前言:轮了一圈找批量扫描的框架级别的系统 后面发觉还是回到了pocsuite上
优点:
①速度够快
②方便对接其他的产品如fofa goby
③有人维护
安装教程
windows的一条代码就好了
pip3 install pocsuite3
# 控制源的
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pocsuite3
使用教程
poc编写的位置
pocsuite的pocs目录下
poc使用方法
验证方法
①指定poc对当个进行验证
pocsuite -r tests/poc_example.py -u http://www.example.com/ --attack
对多个进行验证
pocsuite -r test/poc_example.py -f url.txt --verify
多个poc进行验证 即用tests下目录的poc进行验证
pocsuite -r tests/ -u http://www.example.com --verify
批量的方法思路
pocsuite -u http://example.com --plugins poc_from_pocs,html_report # 加载poc目录下所有poc,并将结果保存为html
pocsuite -f batch.txt --plugins poc_from_pocs,html_report # 从文件中加载目标,并使用poc目录下poc批量扫描
攻击的 用--attack就好了
shell交互的
pocsuite -u http://example.com -r example.py -v 2 --shell
使用思路
pocsuite -u http://example.com -r example.py -v 2 # 基础用法 v2开启详细信息
pocsuite -u http://example.com -r example.py -v 2 --shell # shell反连模式,基础用法 v2开启详细信息
pocsuite -r redis.py --dork service:redis --threads 20 # 从zoomeye搜索redis目标批量检测,线程设置为20
pocsuite -u 10.0.0.0/24 -r example.py --plugins target_from_cidr # 加载CIDR目标
pocsuite -u http://example.com -r ecshop_rce.py --attack --command "whoami" # ecshop poc中实现了自定义命令
结合fofa这些
poc模板
get请求的
import re
from collections import OrderedDict
from pocsuite3.api \
import Output, POCBase, POC_CATEGORY, register_poc, requests, VUL_TYPE, get_listener_ip, get_listener_port
from pocsuite3.lib.core.interpreter_option \
import OptString, OptDict, OptIP, OptPort, OptBool, OptInteger, OptFloat, OptItems
from pocsuite3.modules.listener import REVERSE_PAYLOAD
class DemoPOC(POCBase):
vulID = '1571' # ssvid ID 如果是提交漏洞的同时提交 PoC,则写成 0
version = '1' # 默认为1
author = 'goddemon' # PoC作者的大名
vulDate = '2014-10-16' # 漏洞公开的时间,不知道就写今天
createDate = '2014-10-16' # 编写 PoC 的日期
updateDate = '2014-10-16' # PoC 更新的时间,默认和编写时间一样
references = ['https://xxx.xx.com.cn'] # 漏洞地址来源,0day不用写
name = ' PoC' # PoC 名称
appPowerLink = 'https://www.drupal.org/' # 漏洞厂商主页地址
appName = 'Drupal' # 漏洞应用名称
appVersion = '7.x' # 漏洞影响版本
vulType = VUL_TYPE.UNAUTHORIZED_ACCESS # 漏洞类型,类型参考见 漏洞类型规范表
category = POC_CATEGORY.EXPLOITS.WEBAPP
samples = [] # 测试样列,就是用 PoC 测试成功的网站
install_requires = [] # PoC 第三方模块依赖,请尽量不要使用第三方模块,必要时请参考《PoC第三方模块依赖说明》填写
desc = '''
Drupal 在处理 IN 语句时,展开数组时 key 带入 SQL 语句导致 SQL 注入,
可以添加管理员、造成信息泄露。
''' # 漏洞简要描述
pocDesc = '''
poc的用法描述
''' # POC用法描述
def _verify(self):
output = Output(self)
# 验证代码
result = {}
path = "/"
url = self.url + path
# 第一次请求
try:
resq = requests.get(url)
if resq and resq.status_code == 200 and "" in resq.text:
result['VerifyInfo'] = {} # 创建自定义的字典信息
result['VerifyInfo']['URL'] = url
result['VerifyInfo']['Payload'] = payload
except Exception as e:
pass
return self.parse_output(result)
def parse_output(self, result):
'''
检测返回结果数据统一封装到这个方法里进行处理
'''
output = Output(self)
if result:
output.success(result)
else:
output.fail('target is not vulnerable')
return output
# 注册 DemoPOC 类
register_poc(DemoPOC)