Skip to content

Commit 1f9a065

Browse files
authored
Merge pull request #3640 from projectdiscovery/dev
nuclei v2.9.3 (bugfix release)
2 parents e3ce33a + 79a1c99 commit 1f9a065

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1312
-522
lines changed

.github/workflows/build-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
go-version: [1.19.x]
16-
os: [ubuntu-latest-16-cores, windows-latest-8-cores, macOS-12]
16+
os: [ubuntu-latest, windows-latest, macOS-13]
1717

1818
runs-on: ${{ matrix.os }}
1919
steps:

.github/workflows/functional-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest-16-cores, windows-latest-8-cores, macOS-12]
16+
os: [ubuntu-latest, windows-latest, macOS-13]
1717
steps:
1818
- name: Set up Go
1919
uses: actions/setup-go@v4

.github/workflows/lint-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
lint:
1212
name: Lint Test
13-
runs-on: ubuntu-latest-16-cores
13+
runs-on: ubuntu-latest
1414
steps:
1515
- name: Set up Go
1616
uses: actions/setup-go@v4

.github/workflows/publish-docs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
docs:
11-
runs-on: ubuntu-latest-16-cores
11+
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
1414
uses: actions/checkout@v3

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ UPDATE:
272272

273273
STATISTICS:
274274
-stats display statistics about the running scan
275-
-sj, -stats-json write statistics data to an output file in JSONL(ines) format
275+
-sj, -stats-json display statistics in JSONL(ines) format
276276
-si, -stats-interval int number of seconds to wait between showing a statistics update (default 5)
277277
-m, -metrics expose nuclei metrics on a port
278278
-mp, -metrics-port int port to expose nuclei metrics on (default 9092)

README_ID.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ UPDATE:
232232

233233
STATISTICS:
234234
-stats display statistics about the running scan
235-
-sj, -stats-json write statistics data to an output file in JSONL(ines) format
235+
-sj, -stats-json dispaly statistics in JSONL(ines) format
236236
-si, -stats-interval int number of seconds to wait between showing a statistics update (default 5)
237237
-m, -metrics expose nuclei metrics on a port
238238
-mp, -metrics-port int port to expose nuclei metrics on (default 9092)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
id: dns-template
2+
3+
info:
4+
name: basic dns template
5+
author: pdteam
6+
severity: info
7+
8+
dns:
9+
- name: "{{FQDN}}"
10+
type: CNAME
11+
12+
matchers:
13+
- type: dsl
14+
dsl:
15+
- "rcode == 0"
16+
17+
extractors:
18+
- type: dsl
19+
dsl:
20+
- rcode
21+
- cname
22+
- a
23+
- aaaa

integration_tests/http/get-sni.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
id: basic-get
1+
id: basic-get-sni
22

33
info:
44
name: Basic GET Request with CLI SNI
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
id: raw-unsafe-with-params
2+
3+
info:
4+
name: Test RAW unsafe with params
5+
author: pdteam
6+
severity: info
7+
# this test is used to check automerge of params in both unsafe & safe requests
8+
# key1=value1 is added from inputURL
9+
10+
requests:
11+
- raw:
12+
- |+
13+
GET /?key2=value2 HTTP/1.1
14+
Host: {{Hostname}}
15+
16+
unsafe: true
17+
matchers:
18+
- type: word
19+
words:
20+
- "Test is test raw-params-matcher text"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
id: raw-with-params
2+
3+
info:
4+
name: Test RAW Params Template
5+
author: pdteam
6+
severity: info
7+
# this test is used to check automerge of params in both unsafe & safe requests
8+
# key1=value1 is added from inputURL
9+
10+
requests:
11+
- raw:
12+
- |
13+
GET /?key2=value2 HTTP/1.1
14+
Host: {{Hostname}}
15+
Origin: {{BaseURL}}
16+
17+
matchers:
18+
- type: word
19+
words:
20+
- "Test is test raw-params-matcher text"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
id: save-extractor-values-to-file
2+
3+
info:
4+
name: save extractor values to file
5+
author: pdteam
6+
severity: info
7+
8+
requests:
9+
- method: GET
10+
path:
11+
- "{{BaseURL}}"
12+
13+
extractors:
14+
- type: regex
15+
part: body
16+
regex:
17+
- '[0-9]+'
18+
to: output.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
id: self-contained-with-params
2+
3+
info:
4+
name: self contained with params
5+
author: pd-team
6+
severity: info
7+
8+
self-contained: true
9+
requests:
10+
- raw:
11+
- |
12+
GET http://127.0.0.1:5431/?something=here&key=value HTTP/1.1
13+
Host: {{Hostname}}
14+
15+
matchers:
16+
- type: word
17+
words:
18+
- This is self-contained response
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
id: self-contained-with-path
2+
3+
info:
4+
name: self-contained-with-path
5+
author: pd-team
6+
severity: info
7+
8+
self-contained: true
9+
requests:
10+
- raw:
11+
- |
12+
GET / HTTP/1.1
13+
Host: 127.0.0.1:5431
14+
15+
matchers:
16+
- type: word
17+
words:
18+
- This is self-contained response
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
id: basic-example
2+
3+
info:
4+
name: Test HTTP Template
5+
author: pdteam
6+
severity: info
7+
8+
variables:
9+
a1: "{{to_lower(rand_base(5))}}"
10+
11+
12+
requests:
13+
- method: GET
14+
path:
15+
- "{{BaseURL}}/?x={{a1}}"
16+
- "{{BaseURL}}/?x={{a1}}"
17+
18+
extractors:
19+
- type: dsl
20+
dsl:
21+
- a1

nuclei-jsonschema.json

+5
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@
232232
"type": "boolean",
233233
"title": "use case insensitive extract",
234234
"description": "use case insensitive extract"
235+
},
236+
"to": {
237+
"type": "string",
238+
"title": "save extracted values to file",
239+
"description": "save extracted values to file"
235240
}
236241
},
237242
"additionalProperties": false,

v2/cmd/functional-test/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# reading os type from arguments
44
CURRENT_OS=$1
55

6-
if [ "${CURRENT_OS}" == "windows-latest-8-cores" ];then
6+
if [ "${CURRENT_OS}" == "windows-latest" ];then
77
extension=.exe
88
fi
99

v2/cmd/integration-test/dns.go

+17-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import (
55
)
66

77
var dnsTestCases = map[string]testutils.TestCase{
8-
"dns/basic.yaml": &dnsBasic{},
9-
"dns/ptr.yaml": &dnsPtr{},
10-
"dns/caa.yaml": &dnsCAA{},
11-
"dns/tlsa.yaml": &dnsTLSA{},
12-
"dns/variables.yaml": &dnsVariables{},
8+
"dns/basic.yaml": &dnsBasic{},
9+
"dns/ptr.yaml": &dnsPtr{},
10+
"dns/caa.yaml": &dnsCAA{},
11+
"dns/tlsa.yaml": &dnsTLSA{},
12+
"dns/variables.yaml": &dnsVariables{},
13+
"dns/dsl-matcher-variable.yaml": &dnsDSLMatcherVariable{},
1314
}
1415

1516
type dnsBasic struct{}
@@ -66,3 +67,14 @@ func (h *dnsVariables) Execute(filePath string) error {
6667
}
6768
return expectResultsCount(results, 1)
6869
}
70+
71+
type dnsDSLMatcherVariable struct{}
72+
73+
// Execute executes a test case and returns an error if occurred
74+
func (h *dnsDSLMatcherVariable) Execute(filePath string) error {
75+
results, err := testutils.RunNucleiTemplateAndGetResults(filePath, "one.one.one.one", debug)
76+
if err != nil {
77+
return err
78+
}
79+
return expectResultsCount(results, 1)
80+
}

0 commit comments

Comments
 (0)