成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

Nuclei 進階—深入理解 Workflows、Matchers 和 Extractors

開發 開發工具
本篇我重點講解一下Nuclei中的三個概念,Workflows、Mathcer和Extractors。這些內容將有助于幫助大家編寫更為復雜和高效的檢測腳本!

前面的文章中介紹了nuclei的基礎使用方法,可以參考文章:

??POC模擬攻擊利器——Nuclei入門(一)??

接下來我重點講解一下nuclei中的三個概念,Workflows、Mathcer和Extractors。這些內容將有助于幫助大家編寫更為復雜和高效的檢測腳本!

workflows

Workflows允許用戶自定義模板的執行順序,這是使用nuclei最高效的方式,官方推薦用戶使用自定義Workflows進而縮短掃描時間,提升掃描效率!

  • 基礎工作流

例如,定義workflow 掃描files目錄下如下yaml:

workflows:- template: files/git-config.yaml- template: files/svn-config.yaml- template: files/env-file.yaml- template: files/backup-files.yaml- tags: xss,ssrf,cve,lfi
  • 條件工作流

首先確認springboot-detect.yaml是否正確執行,如果OK,則運行subtemplates下的template,實例如下:

id: springboot-workflowinfo:name: Springboot Security Checksauthor: dwisiswant0workflows:- template: security-misconfiguration/springboot-detect.yamlsubtemplates:- template: cves/CVE-2018-1271.yaml- template: cves/CVE-2018-1271.yaml- template: cves/CVE-2020-5410.yaml- template: vulnerabilities/springboot-actuators-jolokia-xxe.yaml- template: vulnerabilities/springboot-h2-db-rce.yaml

運行workflows。

nuclei -list http_urls.txt -w workflows/my-workflow.yaml。

Matchers

Mathcer顧明思議,就是提供了一些規則,來對響應結果進行比較匹配!常用有六種類型的。

mathcer,如下所示:

  • status Integer Comparisons of Part
  • size Content Length of Part
  • word Part for a protocol
  • regex Part for a protocol
  • binary Part for a protocol
  • dsl Part for a protocol

例如想對響應碼進行比較匹配,寫法如下:

matchers:# Match the status codes- type: status# Some status codes we want to matchstatus:- 200

想對響應碼進行復雜的匹配時,可以使用dsl。

matchers:- type: dsldsl:- "len(body)<1024 && status_code==200"- "contains(toupper(body), md5(cookie))"

上個實例的含義是匹配響應體長度小于1024 并且狀態碼是200。

判斷大寫的body中是否包括cookie的md5sum。

使用condition: and\or 可以對多個條件進行匹配,默認多個條件是and的關系。

官方實例如下:

matchers:# Match the body word- type: word# Some words we want to matchwords:- "[core]"- "[config]"# Both words must be found in the response bodycondition: and# We want to match request body (default)part: body

詳情請參考:

https://nuclei.projectdiscovery.io/templating-guide/operators/matchers/。

Extractors

Extractors 也是對結果進行校驗,與matchers相比,它可以把滿足規則的內容顯示出來,同樣他也有不同類型的Extractors,如下所示:

1. regex - Extract data from response based on a Regular Expression。

2. kval - Extract key: value/key=value formatted data from Response Header/Cookie。

3. json - Extract data from JSON based response in JQ like syntax。

4. xpath - Extract xpath based data from HTML Response。

例如:

extractors:- type: xpath # type of the extractorattribute: href # attribute value to extract (optional)xpath:- "/html/body/div/p[2]/a" # xpath value for extraction

5. dsl - Extract data from the response based on a DSL expressions。

詳情請參考:

https://nuclei.projectdiscovery.io/templating-guide/operators/extractors/。

由于使用nuclei時間尚淺,關于Extractors和Matchers,個人感覺使用差別不是很大!

二者都是對結果的校驗,與matchers相比,Extractors它可以把滿足規則的內容顯示出來!如果大家需要編寫復雜的響應校驗,那么就需要花時間多研究dsl了。

如何從nuclei中受益

當使用了nuclei一段時間后,個人覺得其實使用nuclei最有價值的就是里面各種template,我們可以查看各個template的腳本來學習攻擊方法,而且還可以根據里面的reference 來查看漏洞的詳情,這個特別有助于安全知識的相關積累!至于攻擊請求的發送,這個其實就容易很多了,我們是否使用nuclei其實都無所謂的,舉個簡單的例子,關于CVE-2020-9484的 yaml腳本定義如下:

id: CVE-2020-9484info:name: Apache Tomcat Remote Command Executionauthor: dwisiswant0severity: highdescription: |When using Apache Tomcat versions 10.0.0-M1 to 10.0.0-M4, 9.0.0.M1 to 9.0.34, 8.5.0 to 8.5.54 and 7.0.0 to 7.0.103 ifa) an attacker is able to control the contents and name of a file on the server; andb) the server is configured to use the PersistenceManager with a FileStore; andc) the PersistenceManager is configured with sessionAttributeValueClassNameFilter="null" (the default unless a SecurityManager is used) or a sufficiently lax filter to allow the attacker provided object to be deserialized; andd) the attacker knows the relative file path from the storage location used by FileStore to the file the attacker has control over; then, using a specifically crafted request, the attacker will be able to trigger remote code execution via deserialization of the file under their control.Note that all of conditions a) to d) must be true for the attack to succeed.reference:- http://packetstormsecurity.com/files/157924/Apache-Tomcat-CVE-2020-9484-Proof-Of-Concept.html- https://nvd.nist.gov/vuln/detail/CVE-2020-9484- https://lists.apache.org/thread.html/r77eae567ed829da9012cadb29af17f2df8fa23bf66faf88229857bb1%40%3Cannounce.tomcat.apache.org%3E- https://lists.apache.org/thread.html/rf70f53af27e04869bdac18b1fc14a3ee529e59eb12292c8791a77926@%3Cusers.tomcat.apache.org%3Eclassification:cvss-metrics: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:Hcvss-score: 7cve-id: CVE-2020-9484cwe-id: CWE-502tags: cve,cve2020,apache,tomcat,rcerequests:- method: GETheaders:Cookie: "JSESSIONID=../../../../../usr/local/tomcat/groovy"path:- "{{BaseURL}}/index.jsp"matchers-condition: andmatchers:- type: statusstatus:- 500- type: wordpart: bodywords:- "Exception"- "ObjectInputStream"- "PersistentManagerBase"condition: and

這個腳本中,最容易的可能就是requests:部分攻擊腳本代碼,我們用jmeter 或者自己寫代碼的方式完全可以輕松模擬!而description:部分以及reference:部分才是我們需要重點研究的對象!也是我們深入理解poc攻擊的最佳實例!

責任編輯:姜華 來源: 今日頭條
相關推薦

2021-09-10 07:31:54

AndroidAppStartup原理

2014-07-15 17:17:31

AdapterAndroid

2016-12-08 15:36:59

HashMap數據結構hash函數

2010-06-01 15:25:27

JavaCLASSPATH

2020-07-21 08:26:08

SpringSecurity過濾器

2021-09-15 07:31:33

Android窗口管理

2012-08-31 10:00:12

Hadoop云計算群集網絡

2012-11-08 14:47:52

Hadoop集群

2013-07-31 10:04:42

hadoopHadoop集群集群和網絡

2021-09-24 08:10:40

Java 語言 Java 基礎

2017-08-08 09:15:41

前端JavaScript頁面渲染

2021-09-08 06:51:52

AndroidRetrofit原理

2021-10-15 09:19:17

AndroidSharedPrefe分析源碼

2011-07-18 14:38:44

子查詢外部查詢

2021-09-18 06:56:01

JavaCAS機制

2024-12-30 08:02:40

2021-08-24 07:53:28

AndroidActivity生命周期

2023-10-19 11:12:15

Netty代碼

2021-02-17 11:25:33

前端JavaScriptthis

2009-09-25 09:14:35

Hibernate日志
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 国产精品一区二区欧美黑人喷潮水 | 国产成都精品91一区二区三 | 91久久国产综合久久 | 久久精品国产99国产 | 91精品久久久久久久久 | 激情av在线| 久久大陆 | 一区观看| 亚洲成人精品视频 | 成人免费小视频 | 国产电影一区二区三区爱妃记 | 免费国产视频 | 亚洲+变态+欧美+另类+精品 | 在线观看av网站 | 中国91av| 玖玖国产精品视频 | 欧美成视频 | 久久久精 | 成人精品鲁一区一区二区 | 中文字幕免费 | 91免费在线 | 91精品国产乱码久久久久久 | 国产男女视频网站 | 欧美日韩在线播放 | 亚洲精品乱码8久久久久久日本 | 欧美一级大片 | 免费污视频 | 中文字幕乱码一区二区三区 | 亚洲精品99999| 欧美精品1区2区3区 精品国产欧美一区二区 | 午夜在线视频 | 三级黄色网址 | 亚洲不卡在线观看 | 日韩一级不卡 | 色av一区 | 亚洲成av| 精品久久久久久亚洲精品 | 午夜99| 超碰成人在线观看 | 亚洲成人一区二区在线 | 欧美激情黄色 |