Skip to content

Commit 0e45a00

Browse files
authored
feat: added fuzzing time delay analyzer docs to templates (#98)
* feat: added fuzzing time delay analyzer docs to templates * Update fuzzing-overview.mdx
1 parent d4a6746 commit 0e45a00

File tree

2 files changed

+128
-2
lines changed

2 files changed

+128
-2
lines changed

templates/protocols/http/fuzzing-examples.mdx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,61 @@ http:
4343
words:
4444
- "{{result}}"
4545
```
46+
47+
## Blind Time Based SQLi Template
48+
49+
A template to detect blind time based SQLi with a time delay analyzer.
50+
51+
```yaml
52+
id: mysql-blind-time-based-sqli
53+
54+
info:
55+
name: MySQL SQLi - Blind Time based
56+
author: pdteam
57+
severity: critical
58+
reference:
59+
- https://github.com/zaproxy/zap-extensions/blob/main/addOns/ascanrules/src/main/java/org/zaproxy/zap/extension/ascanrules/SqlInjectionMySqlScanRule.java
60+
61+
http:
62+
- payloads:
63+
injections:
64+
low:
65+
- " / sleep([SLEEPTIME]) "
66+
- "' / sleep([SLEEPTIME]) / '"
67+
- "\" / sleep([SLEEPTIME]) / \""
68+
medium:
69+
- " and 0 in (select sleep([SLEEPTIME]) ) -- "
70+
- "' and 0 in (select sleep([SLEEPTIME]) ) -- "
71+
- "\" and 0 in (select sleep([SLEEPTIME]) ) -- "
72+
- " where 0 in (select sleep([SLEEPTIME]) ) -- "
73+
- "' where 0 in (select sleep([SLEEPTIME]) ) -- "
74+
- "\" where 0 in (select sleep([SLEEPTIME]) ) -- "
75+
high:
76+
- "\" where 0 in (select sleep([SLEEPTIME]) ) and \"\"=\""
77+
- " and 0 in (select sleep([SLEEPTIME]) ) "
78+
- "' and 0 in (select sleep([SLEEPTIME]) ) and ''='"
79+
- "\" and 0 in (select sleep([SLEEPTIME]) ) and \"\"=\""
80+
81+
attack: pitchfork
82+
analyzer:
83+
name: time_delay
84+
85+
fuzzing:
86+
- part: request # fuzz all the request parts.
87+
type: postfix
88+
mode: single
89+
fuzz:
90+
- "{{injections}}"
91+
92+
stop-at-first-match: true
93+
matchers-condition: and
94+
matchers:
95+
- type: word
96+
part: analyzer
97+
words:
98+
- "true"
99+
```
100+
46101
## Basic XSS Template
47102
48103
A simple template to discover XSS probe reflection in HTML pages.

templates/protocols/http/fuzzing-overview.mdx

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebarTitle: "Overview"
66

77
Nuclei supports fuzzing of HTTP requests based on rules defined in the `fuzzing` section of the HTTP request. This allows creating templates for generic Web Application vulnerabilities like SQLi, SSRF, CMDi, etc without any information of the target like a classic web fuzzer. We call this concept as **Fuzzing for Unknown Vulnerabilities**.
88

9-
## pre-condition
9+
### pre-condition
1010

1111
More often than not, we want to only attempt fuzzing on those requests where it makes sense. For example,
1212

@@ -75,6 +75,26 @@ fuzzing:
7575
- part: body # fuzz parameters in body
7676
```
7777

78+
#### Special Part
79+
80+
**request** - fuzz the entire request (all parts mentioned above)
81+
82+
```yaml
83+
fuzzing:
84+
- part: request # fuzz entire request
85+
```
86+
87+
#### Multiple selective parts
88+
89+
Multiple parts can be selected for fuzzing by defining a `parts` field which is the plural of above allowing selected multiple parts to be fuzzed.
90+
91+
```yaml
92+
fuzzing:
93+
- parts:
94+
- query
95+
- body
96+
- header
97+
```
7898

7999
### Type
80100

@@ -281,7 +301,58 @@ http:
281301
- "{{reflection}}"
282302
```
283303

284-
## Example **Fuzzing** template
304+
### Analyzer
305+
306+
Analyzers is a new concept introduced in nuclei fuzzing which allow the engine to make additional verification requests based on a certain logic to verify the vulnerability.
307+
308+
#### time_delay
309+
310+
The `time_delay` analyzer verifies that the response time of the request is controllable by the fuzzed payload. It uses a Linear Regression algorithm ported from ZAP with alternating requests to determine the server time is actually controllable rather than just noise. You can configure it like so
311+
312+
```yaml
313+
# Create a new time delay analyzer
314+
analyzer:
315+
name: time_delay
316+
# Optionally, you can define parameters for the
317+
# analyzer like below.
318+
#
319+
# the defaults are good enough for most use cases.
320+
parameters:
321+
sleep_duration: 10 # sleep for 10 seconds (default: 5)
322+
requests_limit: 6 # make 6 verification requests (default: 4)
323+
time_correlation_error_range: 0.30 # error range for time correlation (default: 0.15)
324+
time_slope_error_range: 0.40 # error range for time slope (default: 0.30)
325+
```
326+
327+
The following dynamic placeholders are available in payloads with `time_delay` analyzer.
328+
329+
- `[SLEEPTIME]` - The sleep time in seconds for the time delay analyzer.
330+
- `[INFERENCE]` - The inference condition (%d=%d) for the time delay analyzer.
331+
332+
These values are substituted at runtime with the actual values for the analyzer. The following is how a usual verification process looks.
333+
334+
1. Send the request with the payload to the target with 5 second delay.
335+
2. If the response time is less than 5, do nothing.
336+
3. Send the request to the analyzer which queues ith with 5 seconds delay.
337+
4. Next a 1 second delay
338+
5. Next a 5 second delay
339+
6. Finally, the last 1 second delay.
340+
341+
If the response time is controllable, the analyzer will report the vulnerability.
342+
343+
Matching for the analyzer matches is pretty straightforward as well. Simiar to interactsh, you can use `part: analyzer` to match the analyzer response.
344+
345+
```yaml
346+
matchers:
347+
- type: word
348+
part: analyzer
349+
words:
350+
- "true"
351+
```
352+
353+
Optionally, you can also extract the `analyzer_details` from the analyzer for matches.
354+
355+
### Example **Fuzzing** template
285356

286357
An example sample template for fuzzing XSS vulnerabilities is provided below.
287358

0 commit comments

Comments
 (0)