MDPDF2 TryHackMe

 


1) Scanning using nmap

As usual, we will use nmap command to see if there is any open services. 

And we find the http service is open.


As we search, The MD2PDF service takes any markdown you write and renders it into a PDF.

So, Markdown supports raw HTML, such as:

<iframe src="SOME_URL"></iframe>

So when you put that into the input editor, the PDF generator will try to render the iframe.

In example below, I try to put "test" to see if there is any interesting outcome, but unfrotunately no. 



2) Scanning using gobuster

Here we use gobuster tool to discover any hidden directory.

And here, we can see a very interesting directory named "admin"


But as we go into the path, we can see error below.

it means the /admin page is only accessible from inside the server (localhost), and not from external users which is us.



3) SSRF technique

Here we are using iframe, which is the SSRF payload, to see if there is any interesting output coming out. 

Markdown (.md) supports HTML.

What is markdown (.md)? as the clue given for this challenge?

A Markdown file is a simple text file that uses an easy-to-read, easy-to-write markup language called Markdown.

Markdown is a lightweight markup language used to create the like of:

- documentation

- README files

- notes

- blog posts

- formatted text for websites

This means anything you write inside the editor may be rendered as HTML inside the PDF.

Most PDF rendering libraries (like wkhtmltopdf, Puppeteer, headless Chrome) load HTML the same way a web browser does.

That means:

- They load iframe URLs

- They load image URLs

- They load CSS <link> URLs

- They load <object> URLs


So we can try any of these to search for the flag, but in this tutorial we are using iframe. 

The simplest HTML elements that make HTTP requests are:

<img src="...">

<iframe src="...">

<object data="...">

<video src="...">

<script src="..."> (unless blocked)

So you test what the PDF generator supports.


And we got the flag. 


















Comments

Popular posts from this blog

Data Exfiltrtation Detection (DNS, FTP, HTTP, ICMP)

Firewall, WAF, and VPN manual log Analysis using command line.

Reversing ELF TryHackMe