-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add support for multiple ports in network template #4401
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example Templateid: openssh-detect
info:
name: OpenSSH Service - Detect
author: r3dg33k,daffainfo,iamthefrogy
severity: info
description: |
OpenSSH service was detected.
reference:
- http://www.openwall.com/lists/oss-security/2016/08/01/2
- http://www.openwall.com/lists/oss-security/2018/08/15/5
- http://seclists.org/fulldisclosure/2016/Jul/51
- https://nvd.nist.gov/vuln/detail/CVE-2016-6210
- https://nvd.nist.gov/vuln/detail/CVE-2018-15473
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
cwe-id: CWE-200
metadata:
max-request: 1
tags: seclists,network,ssh,openssh,detect
tcp:
- host:
- "{{Hostname}}"
port: 22,2222
matchers:
- type: regex
regex:
- '(?i)OpenSSH'
extractors:
- type: regex
regex:
- '(?i)SSH-(.*)-OpenSSH_[^\r]+' $ ./nuclei -l targets.txt -t ./openssh-detect.yaml
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.1.0-dev
projectdiscovery.io
[INF] Current nuclei version: v3.1.0-dev (development)
[INF] Current nuclei-templates version: v9.6.9 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 73
[INF] Templates loaded for current scan: 1
[WRN] Executing 1 unsigned templates. Use with caution.
[INF] Targets loaded for current scan: 4
[openssh-detect] [tcp] [info] xx.xx.xx.xx:2222 [SSH-2.0-OpenSSH_9.3 FreeBSD-openssh-portable-9.3.p2_1,1]
[openssh-detect] [tcp] [info] scanme.sh:22 [SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.9]
[openssh-detect] [tcp] [info] xx.xx.xx.xx:2222 [SSH-2.0-OpenSSH_7.9 FreeBSD-openssh-portable-7.9.p1_1,1]
[openssh-detect] [tcp] [info] xx.xx.xx.xx:2222 [SSH-2.0-OpenSSH_8.9 FreeBSD-openssh-portable-8.9.p1_3,1] |
I got the following err with the ports $ go run . -u scanme.sh -t ./test.yaml
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.1.0-dev
projectdiscovery.io
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1a62db0]
goroutine 1 [running]:
github.com/projectdiscovery/nuclei/v3/pkg/protocols/network.(*Request).Compile(0x4000c8eb40, 0x4000cace00)
/workspaces/nuclei/pkg/protocols/network/network.go:189 +0x470
github.com/projectdiscovery/nuclei/v3/pkg/tmplexec.(*TemplateExecuter).Compile(0x40009c0200)
/workspaces/nuclei/pkg/tmplexec/exec.go:69 +0x88
github.com/projectdiscovery/nuclei/v3/pkg/templates.parseTemplate({_, _, _}, {{0x0, 0x0}, {0x40004da600, 0x27}, {{0x0, 0x0}, {{0x0, ...}}, ...}, ...})
/workspaces/nuclei/pkg/templates/compile.go:371 +0x598
github.com/projectdiscovery/nuclei/v3/pkg/templates.ParseTemplateFromReader({_, _}, {_, _}, {{0x0, 0x0}, {0x40004da600, 0x27}, {{0x0, 0x0}, ...}, ...})
/workspaces/nuclei/pkg/templates/compile.go:260 +0x408
github.com/projectdiscovery/nuclei/v3/pkg/templates.Parse({_, _}, {_, _}, {{0x0, 0x0}, {0x0, 0x0}, {{0x0, 0x0}, ...}, ...})
/workspaces/nuclei/pkg/templates/compile.go:78 +0x2f4
github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader.(*Store).LoadTemplatesWithTags(0x40009c4090, {0x4000178670?, 0x0?, 0x0?}, {0x0, 0x0, 0x0})
/workspaces/nuclei/pkg/catalog/loader/loader.go:392 +0x2dc
github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader.(*Store).LoadTemplates(...)
/workspaces/nuclei/pkg/catalog/loader/loader.go:354
github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader.(*Store).Load(0x40009c4090)
/workspaces/nuclei/pkg/catalog/loader/loader.go:250 +0x38
github.com/projectdiscovery/nuclei/v3/internal/runner.(*Runner).RunEnumeration(0x40012dcdc0)
/workspaces/nuclei/internal/runner/runner.go:440 +0xa70
main.main()
/workspaces/nuclei/cmd/nuclei/main.go:149 +0x4d8
exit status 2 |
dogancanbakir
requested changes
Nov 22, 2023
dogancanbakir
approved these changes
Nov 23, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ehsandeep
approved these changes
Nov 23, 2023
ehsandeep
added
Status: Completed
Nothing further to be done with this issue. Awaiting to be closed.
Type: Enhancement
Most issues will probably ask for additions or changes.
labels
Nov 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Status: Completed
Nothing further to be done with this issue. Awaiting to be closed.
Type: Enhancement
Most issues will probably ask for additions or changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
port
field PR and only extends its support for multiple ports