xpoc漏洞使用與編寫 淺嘗

下載地址 https://github.com/chaitin/xpoc/releases
目前最新版本是 0.0.4
可能是我還是不太習慣yaml這種結構的,感覺就很反人類,所以我以前一般都還是pocsuite用的比較多,結果pocsuite最后也支持yaml了 orz ,如下
#!yaml
name: test poc
description: This is a test POC script written in YAML format.
author: binjie09
date: 2023-06-12
references:
? ?- https://www.example.com/vuln
options:
? ?target:
? ? ? ?type: string
? ? ? ?required: true
? ? ? ?description: Target URL
? ?timeout:
? ? ? ?type: integer
? ? ? ?default: 10
? ? ? ?description: Timeout in seconds
poc:
? ?- name: Test vulnerability
? ? ?request:
? ? ? ? ?method: GET
? ? ? ? ?url: '{{target}}/vulnerability'
? ? ? ? ?headers:
? ? ? ? ? ? ?User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
? ? ? ? ? ? ?Accept-Language: en-US,en;q=0.8
? ? ? ? ?timeout: {{timeout}}
? ? ?response:
? ? ? ? ?- match: 'Vulnerable'
? ? ? ? ? ?keyword: true
? ? ? ? ? ?description: The target is vulnerable.
? ? ?error:
? ? ? ? ?- match: '403 Forbidden'
? ? ? ? ? ?description: Access denied.
運行xpoc
xpoc -h

編寫yaml
你想真正把這玩意用起來就得自己寫poc,本來想用在線版 為了安全性 算了
下載本地規(guī)則工具 https://github.com/zeoxisca/gamma-gui/releases
最新版本為 1.1
打開之后是這樣

比如我想寫一個未授權訪問的POC
剛開始寫POC的時候用這種圖形化界面的生成就行 等后面用的比較多了,同時POC的復雜度上升了之后一般還是需要自己手動進行編寫

最后生成的poc yaml為(當然我這里有些地方?jīng)]有填寫
name: poc-yaml-test
transport: http
rules:
?r0:
? ?request:
? ? ?method: POST
? ? ?path: /aaa
? ? ?follow_redirects: false
? ? ?headers:
? ? ? ?User-Agent: >-
? ? ? ? ?Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101
? ? ? ? ?Firefox/101.0
? ? ? ?Content-Type: application/x-www-form-urlencoded
? ? ? ?Accept-Encoding: gzip, deflate
? ? ?body: order=get
? ?expression: response.status == 200 && "SUCCESS".matches(response.body_string)
expression: r0()
detail:
?author: Cl0udG0d
?links: []
在臨時發(fā)射場我們可以驗證這里的POC的正確性

使用poc
復制出來之后使用xray調用
xpoc -r test.yaml -t http://www.baidu.com

這里當然是失敗的 因為我隨便亂寫的POC :)
總結
我以前還寫過xray破解的教程 orz,相對xray來說 我更喜歡xpoc,可以讓我定制化的程度更高,也有可能是我不會用xray hhh
END
建了一個微信的安全交流群,歡迎添加我微信備注進群
,一起來聊天吹水哇,以及一個會發(fā)布安全相關內容的公眾號,歡迎關注 :)

? ?
