2021-02-27 07:03:27 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/projectdiscovery/nuclei/v2/internal/testutils"
|
|
|
|
)
|
|
|
|
|
|
|
|
var dnsTestCases = map[string]testutils.TestCase{
|
|
|
|
"dns/basic.yaml": &dnsBasic{},
|
|
|
|
}
|
|
|
|
|
|
|
|
type dnsBasic struct{}
|
|
|
|
|
2021-09-03 14:25:50 +00:00
|
|
|
// Execute executes a test case and returns an error if occurred
|
2021-02-27 07:03:27 +00:00
|
|
|
func (h *dnsBasic) Execute(filePath string) error {
|
|
|
|
var routerErr error
|
|
|
|
|
2021-02-27 07:29:26 +00:00
|
|
|
results, err := testutils.RunNucleiAndGetResults(filePath, "one.one.one.one", debug)
|
2021-02-27 07:03:27 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if routerErr != nil {
|
|
|
|
return routerErr
|
|
|
|
}
|
|
|
|
if len(results) != 1 {
|
|
|
|
return errIncorrectResultsCount(results)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|