mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-20 16:15:26 +00:00
Fixed nuclei go example + added relevant integration test
This commit is contained in:
parent
55c21a21a1
commit
a031ef32b4
@ -312,7 +312,7 @@ func main() {
|
|||||||
protocolstate.Init(defaultOpts)
|
protocolstate.Init(defaultOpts)
|
||||||
protocolinit.Init(defaultOpts)
|
protocolinit.Init(defaultOpts)
|
||||||
|
|
||||||
defaultOpts.Templates = goflags.StringSlice{"dns/cname-service-detection.yaml"}
|
defaultOpts.Templates = goflags.FileOriginalNormalizedStringSlice{"dns/cname-service-detection.yaml"}
|
||||||
defaultOpts.ExcludeTags = config.ReadIgnoreFile().Tags
|
defaultOpts.ExcludeTags = config.ReadIgnoreFile().Tags
|
||||||
|
|
||||||
interactOpts := interactsh.NewDefaultOptions(outputWriter, reportingClient, mockProgress)
|
interactOpts := interactsh.NewDefaultOptions(outputWriter, reportingClient, mockProgress)
|
||||||
@ -334,6 +334,7 @@ func main() {
|
|||||||
Interactsh: interactClient,
|
Interactsh: interactClient,
|
||||||
HostErrorsCache: cache,
|
HostErrorsCache: cache,
|
||||||
Colorizer: aurora.NewAurora(true),
|
Colorizer: aurora.NewAurora(true),
|
||||||
|
ResumeCfg: types.NewResumeCfg(),
|
||||||
}
|
}
|
||||||
engine := core.New(defaultOpts)
|
engine := core.New(defaultOpts)
|
||||||
engine.SetExecuterOptions(executerOpts)
|
engine.SetExecuterOptions(executerOpts)
|
||||||
@ -352,6 +353,7 @@ func main() {
|
|||||||
|
|
||||||
input := &inputs.SimpleInputProvider{Inputs: []string{"docs.hackerone.com"}}
|
input := &inputs.SimpleInputProvider{Inputs: []string{"docs.hackerone.com"}}
|
||||||
_ = engine.Execute(store.Templates(), input)
|
_ = engine.Execute(store.Templates(), input)
|
||||||
|
engine.WorkPool().Wait() // Wait for the scan to finish
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
17
integration_tests/code/test.yaml
Normal file
17
integration_tests/code/test.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
id: go-integration-test
|
||||||
|
|
||||||
|
info:
|
||||||
|
name: Basic Go Integration Test
|
||||||
|
author: pdteam
|
||||||
|
severity: info
|
||||||
|
|
||||||
|
requests:
|
||||||
|
- method: GET
|
||||||
|
path:
|
||||||
|
- "{{BaseURL}}"
|
||||||
|
headers:
|
||||||
|
test: nuclei
|
||||||
|
matchers:
|
||||||
|
- type: word
|
||||||
|
words:
|
||||||
|
- "This is test headers matcher text"
|
||||||
@ -28,6 +28,7 @@ var (
|
|||||||
"headless": headlessTestcases,
|
"headless": headlessTestcases,
|
||||||
"whois": whoisTestCases,
|
"whois": whoisTestCases,
|
||||||
"ssl": sslTestcases,
|
"ssl": sslTestcases,
|
||||||
|
"code": codeTestcases,
|
||||||
"templatesPath": templatesPathTestCases,
|
"templatesPath": templatesPathTestCases,
|
||||||
"templatesDir": templatesDirTestCases,
|
"templatesDir": templatesDirTestCases,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user