Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.5.2 Bugfix release #1038

Merged
merged 78 commits into from
Sep 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
448388a
Added TODOs next to un-used parameters
forgedhallpass Aug 23, 2021
cfbd628
Merge branch 'dev' into code_smells
forgedhallpass Aug 31, 2021
40d88d2
In-lined error checks, reduced scope of error variables, introduced n…
forgedhallpass Aug 31, 2021
f36ed8d
Removed unused parameter
forgedhallpass Aug 31, 2021
f9eb8ba
Changed/removed some documentation/comments
forgedhallpass Sep 1, 2021
8b8c16d
Improve readability of some methods
forgedhallpass Sep 1, 2021
0cabce5
Merge branch 'dev' into code_smells
forgedhallpass Sep 1, 2021
2988e95
Merge remote-tracking branch 'origin/dev' into code_smells
forgedhallpass Sep 2, 2021
0acec5e
Adding correct godoc prefixes
forgedhallpass Sep 3, 2021
0ce3392
Typo fixes.
forgedhallpass Sep 7, 2021
555e609
Merge remote-tracking branch 'origin/dev' into code_smells
forgedhallpass Sep 7, 2021
c762cc8
Merge remote-tracking branch 'origin/dev' into code_smells
forgedhallpass Sep 10, 2021
e07123e
misc
Ice3man543 Sep 10, 2021
7f058db
Merge branch 'dev' of https://github.com/projectdiscovery/nuclei into…
Ice3man543 Sep 10, 2021
dfff092
dev update
ehsandeep Sep 10, 2021
cb39fd9
Use separate nuclei version check infra
Ice3man543 Sep 11, 2021
b69d98b
chore(deps): bump golang from 1.17.0-alpine to 1.17.1-alpine
dependabot[bot] Sep 13, 2021
5bd1d6b
Merge remote-tracking branch 'origin/dev' into code_smells
forgedhallpass Sep 13, 2021
5cda839
Fixed an issue with nuclei version for templates
Ice3man543 Sep 13, 2021
8a1a739
Misc
Ice3man543 Sep 13, 2021
638c763
Misc updates
Ice3man543 Sep 13, 2021
c1e4a61
Misc
Ice3man543 Sep 13, 2021
d7c6d1d
misc
Ice3man543 Sep 13, 2021
be46cb2
Show not found new templates message
Ice3man543 Sep 13, 2021
04a4159
Misc changes to update mechanism
Ice3man543 Sep 13, 2021
0f232bc
Don't show message without -ut
Ice3man543 Sep 13, 2021
474987e
Merge pull request #1014 from projectdiscovery/dependabot/docker/dev/…
ehsandeep Sep 13, 2021
01d0fb4
Fixes 1016 # Implicitly enable the Verbose option if VerboseVerbose i…
forgedhallpass Sep 13, 2021
ad9755d
Misc work on jsonschema validations
Ice3man543 Sep 14, 2021
518ba1a
Merge pull request #1021 from projectdiscovery/misc-jsonschema
Ice3man543 Sep 14, 2021
c73c6a9
Auto Generate Syntax Docs + JSONSchema [Tue Sep 14 13:33:29 UTC 2021]…
actions-user Sep 14, 2021
6667f28
fix: consider missing templates directory in update check
Ice3man543 Sep 14, 2021
744c739
Merge pull request #1017 from projectdiscovery/1016_vv_fix
ehsandeep Sep 14, 2021
4d52fb4
Misc changes to update and ignore handling
Ice3man543 Sep 14, 2021
2521d53
fix: gbk when uppercase isn't decoded properly
Ice3man543 Sep 14, 2021
2b99561
misc update
ehsandeep Sep 15, 2021
14ecfed
fix Makefile indentation for commands to work
parrasajad Sep 15, 2021
259ccb1
fix: interactsh crash when not initialized
Ice3man543 Sep 15, 2021
19e0f39
Merge pull request #1027 from projectdiscovery/fix/make-indentation
ehsandeep Sep 16, 2021
7aa8cc5
Added updated fastdialer for panic fix
Ice3man543 Sep 16, 2021
9bbcb57
Added disclaimer for auto update to comments
Ice3man543 Sep 16, 2021
cefbd37
misc update
ehsandeep Sep 16, 2021
9b45c31
Merge remote-tracking branch 'origin/dev' into code_smells
forgedhallpass Sep 16, 2021
38268d4
misc update
ehsandeep Sep 16, 2021
d40755e
tidying go modules
Mzack9999 Sep 16, 2021
bfb0a99
additional-fields to metadata
ehsandeep Sep 16, 2021
4845b85
Merge pull request #1026 from projectdiscovery/github-rate-limit-fix
ehsandeep Sep 16, 2021
fc950a0
Update templates_doc.go
geeknik Sep 16, 2021
78cfb07
Update templates_doc.go
geeknik Sep 16, 2021
d95f723
Update model.go
geeknik Sep 16, 2021
2aee208
Update network.go
geeknik Sep 16, 2021
115f6d1
Update http.go
geeknik Sep 16, 2021
e79fcb0
Update request.go
geeknik Sep 16, 2021
05d1f8a
Update build_request.go
geeknik Sep 16, 2021
eb56641
Update instance.go
geeknik Sep 16, 2021
20a1a5c
Update elasticsearch.go
geeknik Sep 16, 2021
3b8ec87
Update operators.go
geeknik Sep 16, 2021
c8307b2
Update dsl.go
geeknik Sep 16, 2021
67d3bd6
Update README.md
geeknik Sep 16, 2021
4fdda86
Update SYNTAX-REFERENCE.md
geeknik Sep 16, 2021
0d31e96
Update nuclei-jsonschema.json
geeknik Sep 16, 2021
2baf695
Merge remote-tracking branch 'origin/dev' into code_smells
forgedhallpass Sep 16, 2021
2af11f4
Merge pull request #966 from projectdiscovery/code_smells
forgedhallpass Sep 16, 2021
ba587b1
Auto Generate Syntax Docs + JSONSchema [Thu Sep 16 17:12:26 UTC 2021]…
actions-user Sep 16, 2021
261279d
Merge pull request #1032 from projectdiscovery/metadata-update
forgedhallpass Sep 16, 2021
818838a
Auto Generate Syntax Docs + JSONSchema [Thu Sep 16 17:30:33 UTC 2021]…
actions-user Sep 16, 2021
c5a1753
Merge branch 'dev' into patch-4
forgedhallpass Sep 16, 2021
ef39802
Merge pull request #1034 from geeknik/patch-4
forgedhallpass Sep 16, 2021
13ade32
Auto Generate Syntax Docs + JSONSchema [Thu Sep 16 19:14:52 UTC 2021]…
actions-user Sep 16, 2021
a08d90e
misc
Mzack9999 Sep 17, 2021
e314a06
Merge branch 'dev' into fastdialer-fix
Mzack9999 Sep 17, 2021
dd3f84c
updating fastdialer
Mzack9999 Sep 17, 2021
301c263
dropping glog based dbs
Mzack9999 Sep 17, 2021
383c61c
Merge pull request #1031 from projectdiscovery/fastdialer-fix
ehsandeep Sep 17, 2021
ea8a709
Upgraded go-rod to latest version
Ice3man543 Sep 18, 2021
54214eb
version update
ehsandeep Sep 18, 2021
712e3ae
Update elasticsearch.go
Ice3man543 Sep 18, 2021
8b96c14
misc update
ehsandeep Sep 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.0-alpine as build-env
FROM golang:1.17.1-alpine as build-env
RUN GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei

FROM alpine:3.14
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei

### Nuclei Templates

Nuclei has had built-in support for automatic update/download templates since version [v2.4.0](https://github.com/projectdiscovery/nuclei/releases/tag/v2.4.0). [**Nuclei-Templates**](https://github.com/projectdiscovery/nuclei-templates) project provides a community-contributed list of ready-to-use templates that is constantly updated.
Nuclei has had built-in support for automatic template download/update as default since version [v2.5.2](https://github.com/projectdiscovery/nuclei/releases/tag/v2.5.2). [**Nuclei-Templates**](https://github.com/projectdiscovery/nuclei-templates) project provides a community-contributed list of ready-to-use templates that is constantly updated.

You may still use the `update-templates` flag to update the nuclei templates at any time; automatic updates happen every 24 hours. You can write your own checks for your individual workflow and needs following Nuclei's [templating guide](https://nuclei.projectdiscovery.io/templating-guide/).
You may still use the `update-templates` flag to update the nuclei templates at any time; You can write your own checks for your individual workflow and needs following Nuclei's [templating guide](https://nuclei.projectdiscovery.io/templating-guide/).

The YAML DSL reference syntax is available [here](SYNTAX-REFERENCE.md).

Expand Down Expand Up @@ -128,8 +128,9 @@ CONFIGURATIONS:
-env-vars enable environment variables support

INTERACTSH:
-no-interactsh do not use interactsh server for blind interaction polling
-interactsh-url string self-hosted Interactsh Server URL (default "https://interact.sh")
-no-interactsh disable interactsh server for OOB testing
-interactsh-url string interactsh server url for self-hosted instance (default "https://interact.sh")
-interactsh-token string authentication token for self-hosted interactsh server
-interactions-cache-size int number of requests to keep in the interactions cache (default 5000)
-interactions-eviction int number of seconds to wait before evicting requests from cache (default 60)
-interactions-poll-duration int number of seconds to wait before each interaction poll request (default 5)
Expand Down Expand Up @@ -219,7 +220,7 @@ Nuclei offers great number of features that are helpful for security engineers t
<tr>
<td>

**For bugbounty hunters:**
**For Bug Bounty hunters:**

Nuclei allows you to customise your testing approach with your own suite of checks and easily run across your bug bounty programs. Moreover, Nuclei can be easily integrated into any continuous scanning workflow.

Expand All @@ -237,9 +238,9 @@ Please check our other open-source projects that might fit into your bug bounty
<tr>
<td>

**For pentesters:**
**For Penetration Testers:**

Nuclei immensely improve how you approach security assessment by augmenting the manual repetitve processes. Consultancies are already converting their manual assessment steps with Nuclei, it allows them to run set of their custom assessment approach across thousands of hosts in an automated manner.
Nuclei immensely improve how you approach security assessment by augmenting the manual, repetitive processes. Consultancies are already converting their manual assessment steps with Nuclei, it allows them to run set of their custom assessment approach across thousands of hosts in an automated manner.

Pen-testers get the full power of our public templates and customization capabilities to speed-up their assessment process, and specifically with the regression cycle where you can easily verify the fix.

Expand All @@ -254,7 +255,7 @@ Pen-testers get the full power of our public templates and customization capabil

# For Developers and Organisations

Nuclei is built with simplicity in mind, with the community backed templates by hundreds of security researchers, it allows you to stay updated with latest security threats using continuous Nuclei scanning on the hosts. It is designed to be easily integrated into regression tests cycle, to verify the fixes and eliminate vulnerabilities from occuring in future.
Nuclei is built with simplicity in mind, with the community backed templates by hundreds of security researchers, it allows you to stay updated with the latest security threats using continuous Nuclei scanning on the hosts. It is designed to be easily integrated into regression tests cycle, to verify the fixes and eliminate vulnerabilities from occurring in the future.

- **CI/CD:** Engineers are already utilising Nuclei within their CI/CD pipeline, it allows them to constantly monitor their staging and production environments with customised templates.
- **Continuous Regression Cycle:** With Nuclei, you can create your custom template on every new identified vulnerability and put into Nuclei engine to eliminate in the continuous regression cycle.
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

DO NOT CREATE AN ISSUE to report a security problem. Instead, please send an email to security@projectdiscovery.io and we will acknowledge it within 3 working days.
DO NOT CREATE AN ISSUE to report a security problem. Instead, please send an email to security@projectdiscovery.io, and we will acknowledge it within 3 working days.
44 changes: 23 additions & 21 deletions SYNTAX-REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ Examples:


```yaml
description: Bower is a package manager which stores packages informations in bower.json file
description: Bower is a package manager which stores package information in the bower.json file
```

```yaml
Expand Down Expand Up @@ -415,20 +415,20 @@ Valid values:

<div class="dd">

<code>additional-fields</code> <i>map[string]string</i>
<code>metadata</code> <i>map[string]string</i>

</div>
<div class="dt">

AdditionalFields regarding metadata of the template.
Metadata of the template.



Examples:


```yaml
additional-fields:
metadata:
customField1: customValue1
```

Expand Down Expand Up @@ -679,7 +679,7 @@ Matchers contains the detection mechanism for the request to identify
whether the request was successful by doing pattern matching
on request/responses.

Multiple matchers can be combined together with `matcher-condition` flag
Multiple matchers can be combined with `matcher-condition` flag
which accepts either `and` or `or` as argument.

</div>
Expand Down Expand Up @@ -792,7 +792,7 @@ raw:
</div>
<div class="dt">

ID is the the optional id of the request
ID is the optional id of the request

</div>

Expand Down Expand Up @@ -869,6 +869,8 @@ Valid values:
- <code>TRACE</code>

- <code>PATCH</code>

- <code>PURGE</code>
</div>

<hr />
Expand Down Expand Up @@ -979,7 +981,7 @@ Examples:


```yaml
# Follow upto 5 redirects
# Follow up to 5 redirects
max-redirects: 5
```

Expand Down Expand Up @@ -1125,7 +1127,7 @@ This can be used in conjunction with `max-redirects` to control the HTTP request

Pipeline defines if the attack should be performed with HTTP 1.1 Pipelining

All requests must be indempotent (GET/POST). This can be used for race conditions/billions requests.
All requests must be idempotent (GET/POST). This can be used for race conditions/billions requests.

</div>

Expand Down Expand Up @@ -1666,7 +1668,7 @@ group: 1
description: |
kval contains the key-value pairs present in the HTTP response header.
kval extractor can be used to extract HTTP response header and cookie key-value pairs.
kval extractor inputs are case insensitive, and does not support dash (-) in input which can replaced with underscores (_)
kval extractor inputs are case-insensitive, and does not support dash (-) in input which can replaced with underscores (_)
For example, Content-Type should be replaced with content_type

A list of supported parts is available in docs for request types.
Expand Down Expand Up @@ -1844,7 +1846,7 @@ Matchers contains the detection mechanism for the request to identify
whether the request was successful by doing pattern matching
on request/responses.

Multiple matchers can be combined together with `matcher-condition` flag
Multiple matchers can be combined with `matcher-condition` flag
which accepts either `and` or `or` as argument.

</div>
Expand Down Expand Up @@ -1892,7 +1894,7 @@ Valid values:
</div>
<div class="dt">

ID is the the optional id of the request
ID is the optional id of the request

</div>

Expand Down Expand Up @@ -2059,7 +2061,7 @@ Matchers contains the detection mechanism for the request to identify
whether the request was successful by doing pattern matching
on request/responses.

Multiple matchers can be combined together with `matcher-condition` flag
Multiple matchers can be combined with `matcher-condition` flag
which accepts either `and` or `or` as argument.

</div>
Expand Down Expand Up @@ -2162,7 +2164,7 @@ denylist:
</div>
<div class="dt">

ID is the the optional id of the request
ID is the optional id of the request

</div>

Expand All @@ -2177,7 +2179,7 @@ ID is the the optional id of the request

MaxSize is the maximum size of the file to run request on.

By default, nuclei will process 5MB files and not go more than that.
By default, nuclei will process 5 MB files and not go more than that.
It can be set to much lower or higher depending on use.


Expand Down Expand Up @@ -2242,7 +2244,7 @@ matchers:
</div>
<div class="dt">

ID is the the optional id of the request
ID is the optional id of the request

</div>

Expand Down Expand Up @@ -2366,7 +2368,7 @@ Matchers contains the detection mechanism for the request to identify
whether the request was successful by doing pattern matching
on request/responses.

Multiple matchers can be combined together with `matcher-condition` flag
Multiple matchers can be combined with `matcher-condition` flag
which accepts either `and` or `or` as argument.

</div>
Expand Down Expand Up @@ -2482,7 +2484,7 @@ Valid values:

Read is the number of bytes to read from socket.

This can be used for protcols which expected an immediate response. You can
This can be used for protocols which expect an immediate response. You can
read and write responses one after another and evetually perform matching
on every data captured with `name` attribute.

Expand Down Expand Up @@ -2548,7 +2550,7 @@ Appears in:
</div>
<div class="dt">

ID is the the optional id of the request
ID is the optional id of the request

</div>

Expand Down Expand Up @@ -2578,7 +2580,7 @@ Matchers contains the detection mechanism for the request to identify
whether the request was successful by doing pattern matching
on request/responses.

Multiple matchers can be combined together with `matcher-condition` flag
Multiple matchers can be combined with `matcher-condition` flag
which accepts either `and` or `or` as argument.

</div>
Expand Down Expand Up @@ -2823,7 +2825,7 @@ Matchers perform name based matching to run subtemplates for a workflow.
</div>
<div class="dt">

Subtemplates are ran if the `template` field Template matches.
Subtemplates are run if the `template` field Template matches.

</div>

Expand Down Expand Up @@ -2864,7 +2866,7 @@ Name is the name of the item to match.
</div>
<div class="dt">

Subtemplates are ran if the name of matcher matches.
Subtemplates are run if the name of matcher matches.

</div>

Expand Down
8 changes: 5 additions & 3 deletions nuclei-jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"title": "description of the template",
"description": "In-depth explanation on what the template does",
"examples": [
"Bower is a package manager which stores packages informations in bower.json file"
"Bower is a package manager which stores package information in the bower.json file"
]
},
"reference": {
Expand All @@ -69,7 +69,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/severity.Holder"
},
"additional-fields": {
"metadata": {
"patternProperties": {
".*": {
"type": "string"
Expand Down Expand Up @@ -207,6 +207,7 @@
"size",
"word",
"regex",
"binary",
"dsl"
],
"type": "string",
Expand Down Expand Up @@ -615,7 +616,8 @@
"CONNECT",
"OPTIONS",
"TRACE",
"PATCH"
"PATCH",
"PURGE"
],
"type": "string",
"title": "method is the http request method",
Expand Down
22 changes: 11 additions & 11 deletions v2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ GOGET=$(GOCMD) get

all: build
build:
$(GOBUILD) -v -ldflags="-extldflags=-static" -o "nuclei" cmd/nuclei/main.go
$(GOBUILD) -v -ldflags="-extldflags=-static" -o "nuclei" cmd/nuclei/main.go
docs:
if ! which dstdocgen > /dev/null; then
echo -e "Command not found! Install? (y/n) \c"
go get -v github.com/projectdiscovery/yamldoc-go/cmd/docgen/dstdocgen
fi
$(GOCMD) generate pkg/templates/templates.go
$(GOBUILD) -o "cmd/docgen/docgen" cmd/docgen/docgen.go
./cmd/docgen/docgen docs.md nuclei-jsonschema.json
test:
$(GOTEST) -v ./...
if ! which dstdocgen > /dev/null; then
echo -e "Command not found! Install? (y/n) \c"
go get -v github.com/projectdiscovery/yamldoc-go/cmd/docgen/dstdocgen
fi
$(GOCMD) generate pkg/templates/templates.go
$(GOBUILD) -o "cmd/docgen/docgen" cmd/docgen/docgen.go
./cmd/docgen/docgen docs.md nuclei-jsonschema.json
test:
$(GOTEST) -v ./...
tidy:
$(GOMOD) tidy
$(GOMOD) tidy
5 changes: 4 additions & 1 deletion v2/cmd/cve-annotate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ func getCVEData(client *nvd.Client, filePath, data string) {
}
severityValue := severityMatches[0][1]

// Skip if there's classification data already
if strings.Contains(data, "classification:") {
return
}
cveItem, err := client.FetchCVE(cveName)
if err != nil {
log.Printf("Could not fetch cve %s: %s\n", cveName, err)
Expand Down Expand Up @@ -110,7 +114,6 @@ func getCVEData(client *nvd.Client, filePath, data string) {
newInfoBlock = strings.ReplaceAll(newInfoBlock, severityMatches[0][0], "severity: "+newSeverity)
fmt.Printf("Adjusting severity for %s from %s=>%s (%.2f)\n", filePath, severityValue, newSeverity, cvssScore)
}
// Start with additional-fields as that is the one most likely to break stuff.
if !strings.Contains(infoBlockClean, "classification") && (cvssScore != 0 && cvssMetrics != "") {
changed = true
newInfoBlock = newInfoBlock + fmt.Sprintf("\n classification:\n cvss-metrics: %s\n cvss-score: %.2f\n cve-id: %s", cvssMetrics, cvssScore, cveName)
Expand Down
3 changes: 2 additions & 1 deletion v2/cmd/functional-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/logrusorgru/aurora"
"github.com/pkg/errors"

"github.com/projectdiscovery/nuclei/v2/internal/testutils"
)

Expand Down Expand Up @@ -75,5 +76,5 @@ func runIndividualTestCase(testcase string) error {
if mainOutput == devOutput {
return nil
}
return fmt.Errorf("%s main is not equal to %s dev", mainOutput, devOutput)
return fmt.Errorf("%s main is not equal to %s dev", mainOutput, devOutput)
}
2 changes: 1 addition & 1 deletion v2/cmd/integration-test/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var dnsTestCases = map[string]testutils.TestCase{

type dnsBasic struct{}

// Executes executes a test case and returns an error if occurred
// Execute executes a test case and returns an error if occurred
func (h *dnsBasic) Execute(filePath string) error {
var routerErr error

Expand Down
Loading