说了msfpayload,自然就到了msfencode,不管别的,很多生成后门的命令就要用这两条。。。
root@bt:/opt/metasploit/msf3# msfencode -h
Usage: /opt/metasploit/msf3/msfencode <options>
OPTIONS:
-a <opt> The architecture to encode as //指定CPU 的类型
-b <opt> The list of characters to avoid: '\x00\xff' //去掉一些空代码或者是错误代码。比如-b \x00\xff
-c <opt> The number of times to encode the data //编码次数
-d <opt> Specify the directory in which to look for EXE templates //指定exe模板的路径
-e <opt> The encoder to use //选择使用哪种编码器
-h Help banner
-i <opt> Encode the contents of the supplied file path //把payload附加到一个可执行文件。如果你已经生成一个payload,那么你可以使用-i参数把你的payload移植到一个正常的程序。比如:msfencode -i shell.exe –x qq.exe 这个命令就是说我把一个叫做shell.exe的后门添加到了一个叫做qq.exe的软件里面
-k Keep template working; run payload in new thread (use with -x) //如果你使用了-x和-k参数。当你的payload运行后,它会从原始的主文件中分离出来,单独创建一个进程,并且运行
-l List available encoders //列出所有可用的编码器
-m <opt> Specifies an additional module search path //指定一个附加模块的路径
-n Dump encoder information //输出编码器信息
-o <opt> The output file //输出文件
-p <opt> The platform to encode for //指定编码平台
-s <opt> The maximum size of the encoded data //指定编码后的最大字节数
-t <opt> The output format: raw,ruby,rb,perl,pl,bash,sh,c,js_be,js_le,java,dll,exe,exe-small,elf,macho,vba,vba-exe,vbs,loop-vbs,asp,aspx,war //输出文件的格式
-v Increase verbosity //增加代码的冗长,用在免杀
-x <opt> Specify an alternate executable template //指定一个备用的可执行文件模版