Try   HackMD

nuclei poc 框架初步使用

github地址:https://github.com/projectdiscovery/nuclei

template 地址:https://github.com/projectdiscovery/nuclei-templates

template 编写官方文档:https://nuclei.projectdiscovery.io/templating-guide/

基础使用

下载好release可执行文件

例如编写一个检查shiro的template,nuclei也有一个shiro detect的template,下面加上了允许URL跳转,最大跳转三次

id: shiro-detect

info:
  name: shiro detect
  author: Lhaihai
  severity: info

requests:
  - method: GET
    path:
      - "{{BaseURL}}/"
    redirects: true   #允许跳转
    max-redirects: 3  #最大跳转三次
    headers:
        Cookie: rememberMe=123
    matchers:
      - type: word
        words:
          - "rememberMe=deleteMe"
        part: header

执行下列命令:

.\nuclei.exe -l .\url.txt -t .\shiro-dete.yaml -o result.txt

-l 指定url文件
-t 执行使用的template文件
-o 输出结果

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

因为nuclei不支持C段,可以改nuclei,在internal\runner\runner.go的147行附近,这段代码是读取文件的url列表,可以在这里加上处理C段的代码,但感觉以后C段转url列表在很多工具也需要(Kunpeng),于是我简单写了个C段和端口转URL的脚本

https://github.com/Lhaihai/Tools/tree/main/c2ip

默认template模板也有很多,可以搜索

windows 下搜索文件命令 dir /s /b "*shiro*"

linux 下搜索文件命令 find . -name "*shiro*"

Workflows

nuclei 支持workflows,简单来说,例如当检测出存在springboot框架的文件,可以接着调动springboot的漏洞检测,例如

id: springboot-pwner-workflow

info:
  name: Spring Boot Pwner
  author: dwisiswant0

variables:
  springboot: security-misconfiguration/springboot-detect.yaml
  springboot_cve_2018_1271: cves/CVE-2018-1271.yaml
  springboot_cve_2019_3799: cves/CVE-2019-3799.yaml
  springboot_cve_2020_5410: cves/CVE-2020-5410.yaml
  springboot_xxe: vulnerabilities/springboot-actuators-jolokia-xxe.yaml
  springboot_rce: vulnerabilities/springboot-h2-db-rce.yaml

logic:
  |
  if springboot() {
    springboot_cve_2018_1271()
    springboot_cve_2019_3799()
    springboot_cve_2020_5410()
    springboot_xxe()
    springboot_rce()
  }