Fixed nuclei go example + added relevant integration test

dev
Ice3man 2022-04-28 01:02:06 +05:30
parent 55c21a21a1
commit a031ef32b4
3 changed files with 21 additions and 1 deletions

View File

@ -312,7 +312,7 @@ func main() {
protocolstate.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
interactOpts := interactsh.NewDefaultOptions(outputWriter, reportingClient, mockProgress)
@ -334,6 +334,7 @@ func main() {
Interactsh: interactClient,
HostErrorsCache: cache,
Colorizer: aurora.NewAurora(true),
ResumeCfg: types.NewResumeCfg(),
}
engine := core.New(defaultOpts)
engine.SetExecuterOptions(executerOpts)
@ -352,6 +353,7 @@ func main() {
input := &inputs.SimpleInputProvider{Inputs: []string{"docs.hackerone.com"}}
_ = engine.Execute(store.Templates(), input)
engine.WorkPool().Wait() // Wait for the scan to finish
}
```

View 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"

View File

@ -28,6 +28,7 @@ var (
"headless": headlessTestcases,
"whois": whoisTestCases,
"ssl": sslTestcases,
"code": codeTestcases,
"templatesPath": templatesPathTestCases,
"templatesDir": templatesDirTestCases,
}