2023-09-02 09:04:05 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-10-17 12:14:13 +00:00
|
|
|
nuclei "github.com/projectdiscovery/nuclei/v3/lib"
|
2023-09-02 09:04:05 +00:00
|
|
|
"github.com/remeh/sizedwaitgroup"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
// create nuclei engine with options
|
|
|
|
ne, err := nuclei.NewThreadSafeNucleiEngine()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
// setup sizedWaitgroup to handle concurrency
|
|
|
|
sg := sizedwaitgroup.New(10)
|
|
|
|
|
|
|
|
// scan 1 = run dns templates on scanme.sh
|
|
|
|
sg.Add()
|
|
|
|
go func() {
|
|
|
|
defer sg.Done()
|
|
|
|
err = ne.ExecuteNucleiWithOpts([]string{"scanme.sh"},
|
|
|
|
nuclei.WithTemplateFilters(nuclei.TemplateFilters{ProtocolTypes: "dns"}),
|
2024-01-11 17:09:28 +00:00
|
|
|
nuclei.WithHeaders([]string{"X-Bug-Bounty: pdteam"}),
|
2024-01-31 19:31:20 +00:00
|
|
|
nuclei.EnablePassiveMode(),
|
2023-09-02 09:04:05 +00:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
|
|
|
|
// scan 2 = run templates with oast tags on honey.scanme.sh
|
|
|
|
sg.Add()
|
|
|
|
go func() {
|
|
|
|
defer sg.Done()
|
|
|
|
err = ne.ExecuteNucleiWithOpts([]string{"http://honey.scanme.sh"}, nuclei.WithTemplateFilters(nuclei.TemplateFilters{Tags: []string{"oast"}}))
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
|
|
|
|
// wait for all scans to finish
|
|
|
|
sg.Wait()
|
|
|
|
defer ne.Close()
|
|
|
|
|
|
|
|
// Output:
|
|
|
|
// [dns-saas-service-detection] scanme.sh
|
|
|
|
// [nameserver-fingerprint] scanme.sh
|
|
|
|
// [dns-saas-service-detection] honey.scanme.sh
|
|
|
|
}
|