mirror of https://github.com/daffainfo/nuclei.git
adding more query types test
parent
2ed33e4723
commit
0807113e6c
|
@ -5,7 +5,8 @@ import (
|
|||
)
|
||||
|
||||
var dnsTestCases = []TestCaseInfo{
|
||||
{Path: "protocols/dns/basic.yaml", TestCase: &dnsBasic{}},
|
||||
{Path: "protocols/dns/a.yaml", TestCase: &dnsA{}},
|
||||
{Path: "protocols/dns/aaaa.yaml", TestCase: &dnsAAAA{}},
|
||||
{Path: "protocols/dns/ptr.yaml", TestCase: &dnsPtr{}},
|
||||
{Path: "protocols/dns/caa.yaml", TestCase: &dnsCAA{}},
|
||||
{Path: "protocols/dns/tlsa.yaml", TestCase: &dnsTLSA{}},
|
||||
|
@ -14,10 +15,21 @@ var dnsTestCases = []TestCaseInfo{
|
|||
{Path: "protocols/dns/dsl-matcher-variable.yaml", TestCase: &dnsDSLMatcherVariable{}},
|
||||
}
|
||||
|
||||
type dnsBasic struct{}
|
||||
type dnsA struct{}
|
||||
|
||||
// Execute executes a test case and returns an error if occurred
|
||||
func (h *dnsBasic) Execute(filePath string) error {
|
||||
func (h *dnsA) Execute(filePath string) error {
|
||||
results, err := testutils.RunNucleiTemplateAndGetResults(filePath, "one.one.one.one", debug)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return expectResultsCount(results, 1)
|
||||
}
|
||||
|
||||
type dnsAAAA struct{}
|
||||
|
||||
// Execute executes a test case and returns an error if occurred
|
||||
func (h *dnsAAAA) Execute(filePath string) error {
|
||||
results, err := testutils.RunNucleiTemplateAndGetResults(filePath, "one.one.one.one", debug)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
id: basic-dns-example
|
||||
id: basic-dns-a-example
|
||||
|
||||
info:
|
||||
name: Test DNS Template
|
||||
name: Test DNS A Query Template
|
||||
author: pdteam
|
||||
severity: info
|
||||
|
||||
|
@ -14,4 +14,4 @@ dns:
|
|||
matchers:
|
||||
- type: word
|
||||
words:
|
||||
- "1.1.1.1"
|
||||
- "1.1.1.1"
|
|
@ -0,0 +1,17 @@
|
|||
id: basic-dns-aaaa-example
|
||||
|
||||
info:
|
||||
name: Test DNS AAAA Query Template
|
||||
author: pdteam
|
||||
severity: info
|
||||
|
||||
dns:
|
||||
- name: "{{FQDN}}"
|
||||
type: AAAA
|
||||
class: inet
|
||||
recursion: true
|
||||
retries: 3
|
||||
matchers:
|
||||
- type: word
|
||||
words:
|
||||
- "2606:4700:4700::1001"
|
Loading…
Reference in New Issue