pocsuite学习

前言:轮了一圈找批量扫描的框架级别的系统 后面发觉还是回到了pocsuite上
优点:
①速度够快
②方便对接其他的产品如fofa goby
③有人维护

安装教程

windows的一条代码就好了

pip3 install pocsuite3
# 控制源的
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pocsuite3

pocsuite安装

使用教程

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)

其他命令的

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

goddemon

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值