2021-02-27 07:03:27 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-11-04 21:31:41 +00:00
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/testutils"
|
2021-02-27 07:03:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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-10-01 15:23:06 +00:00
|
|
|
results, err := testutils.RunNucleiTemplateAndGetResults(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
|
|
|
|
}
|