

DeepExploit工具(后渗透自动化工框架)调研
source link: https://www.tuicool.com/articles/qQRJfqe
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

DeepExploit工具调研
Deep Exploit是一款可与Metasploit链接使用,且结合机器学习的全自动渗透测试工具。
0x00 安装
安装步骤
根据官方安装手册:https://github.com/13o-bbr-bbq/machine_learning_security/wiki/Installation
-
安装Kali
-
命令执行
git clone https://github.com/13o-bbr-bbq/machine_learning_security.git
-
命令执行 安装python3的pip
apt-get install python3-pip
-
切换到DeepExploit目录下运行
pip3 install -r requirements.txt
-
编辑
config.ini
,修改其中的server_host
为本机IP(ifconfig查看一下~) -
编辑
proxychains.conf
,修改监听IP和端口(要求和DeepExploit目录下config.ini
的proxy_host
、proxy_port
对应) -
初始化Metasploit DB,命令执行
msfdb init
-
启动Metasploit,命令执行
msfconsole
-
启动Metasploit RPC服务,命令执行
msf > load msgrpc ServerHost=172.16.108.139 ServerPort=55553 User=test Pass=test1234 [*] MSGRPC Service: 172.16.108.139:55553 [*] MSGRPC Username: test [*] MSGRPC Password: test1234 [*] Successfully loaded plugin: msgrpc
安装的坑记录
-
安装Scrapy库时报Twisted错误
Python.h: No such file or directory
解决方法:运行命令
sudo apt install python3.6-dev
安装python3.6-dev
-
运行DeepExploit报错
ImportError: numpy.core.multiarray failed to import
解决方法:输入python3进入交互界面->
import numpy
->print(numpy.__path__)
->获得numpy的安装路径退出交互界面,运行sudo rm -r 安装路径
删除numpy,然后运行sudo apt install python3-numpy
-
运行时会报错
/usr/lib/python3/dist-packages/requests/ init .py:80: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (3.0.4) doesn’t match a supported version!
查阅了一下资料说这个提示不会影响使用,所以无需处理。
0x01 使用&工作原理
DeepExploit Train模式
执行命令: python3 DeepExploit.py -t 地址 -m train
训练过程
功能有点像Metasploit之前的db_autopwn。
-
通过Nmap进行端口扫描,将扫描结果进行输出:
[*] nmap -p0-65535 -T5 -Pn -sV -sT --min-rate 1000 -oX nmap_result_172.16.108.140.xml 172.16.108.140
-
从扫描结果中获取已开放的端口信息:
[+] Get port list from nmap_result_172.16.108.140.xml.
-
载入Metasploit的Exploit模块列表:
[+] Get exploit list.
,载入Metaploit的Payload模块列表:[+] Get payload list.
,获取每个模块的选项设置信息。[+] Get exploit list. [*] Loaded exploit list from : /root/machine_learning_security/DeepExploit/data/exploit_list.csv [+] Get payload list. [*] Loaded payload list from : /root/machine_learning_security/DeepExploit/data/payload_list.csv [+] Get exploit tree. [*] Loaded exploit tree from : /root/machine_learning_security/DeepExploit/data/exploit_tree.json
-
获取端口信息,检查WEB端口
[+] Get target info. [+] Check web port.
,针对开放的WEB服务进行站内链接爬虫。 -
针对爬虫爬取的链接进行CMS指纹识别(静态规则针对链接的响应内容进行分析)
载入字典对网站目录进行暴力猜解:
-
分析开放的端口(获取端口对应的服务等信息)选择对应的信息的测试模块(metasploit)
-
载入Metasploit模块进行自动化测试
-
训练结束:
训练结果报告
最终测试结束以后,报告会存储在 /report/train
下:
切换到DeepExploit目录下执行命令: python3 CreateReport.py -m train
[+] Creating training report. [*] Creating training report done.
在 /report/train
目录下会多出一个 DeepExploit_train_report.html
的HTML报告文件,打开查看结果:
DeepExploit Test模式
执行命令 python3 DeepExploit.py -t 172.16.108.140 -m test
流程与DeepExploit Train模式一样,如果Deep Exploit成功利用了目标服务器,它会进一步的对其他内部服务器进行横行攻击。
问题
测试靶机有445端口开放,并且存在漏洞。
DeepExploit在做探测的时候也检测到了端口的开放情况:
但是445端口在匹配Metasploit模块的时候却是0,没有利用模块:
端口匹配模块使用的是Metasploit的search语法:
search_cmd = 'search name:' + service_name + ' type:exploit app:server\n'
调试输出service_name,发现445端口的是unknown,所以无法搜索出利用模块。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK