mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 11:35:26 +00:00
adding more query types test
This commit is contained in:
parent
2ed33e4723
commit
0807113e6c
@ -5,7 +5,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var dnsTestCases = []TestCaseInfo{
|
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/ptr.yaml", TestCase: &dnsPtr{}},
|
||||||
{Path: "protocols/dns/caa.yaml", TestCase: &dnsCAA{}},
|
{Path: "protocols/dns/caa.yaml", TestCase: &dnsCAA{}},
|
||||||
{Path: "protocols/dns/tlsa.yaml", TestCase: &dnsTLSA{}},
|
{Path: "protocols/dns/tlsa.yaml", TestCase: &dnsTLSA{}},
|
||||||
@ -14,10 +15,21 @@ var dnsTestCases = []TestCaseInfo{
|
|||||||
{Path: "protocols/dns/dsl-matcher-variable.yaml", TestCase: &dnsDSLMatcherVariable{}},
|
{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
|
// 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)
|
results, err := testutils.RunNucleiTemplateAndGetResults(filePath, "one.one.one.one", debug)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
id: basic-dns-example
|
id: basic-dns-a-example
|
||||||
|
|
||||||
info:
|
info:
|
||||||
name: Test DNS Template
|
name: Test DNS A Query Template
|
||||||
author: pdteam
|
author: pdteam
|
||||||
severity: info
|
severity: info
|
||||||
|
|
||||||
@ -14,4 +14,4 @@ dns:
|
|||||||
matchers:
|
matchers:
|
||||||
- type: word
|
- type: word
|
||||||
words:
|
words:
|
||||||
- "1.1.1.1"
|
- "1.1.1.1"
|
||||||
17
integration_tests/protocols/dns/aaaa.yaml
Normal file
17
integration_tests/protocols/dns/aaaa.yaml
Normal file
@ -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…
x
Reference in New Issue
Block a user