mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 19:35:27 +00:00
Merge pull request #1564 from projectdiscovery/issue-1542-caa-query
Adding support for DNS CAA query
This commit is contained in:
commit
04f8f84c9d
22
integration_tests/dns/caa.yaml
Normal file
22
integration_tests/dns/caa.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
id: caa-fingerprinting
|
||||
|
||||
info:
|
||||
name: CAA Fingerprint
|
||||
author: pdteam
|
||||
severity: info
|
||||
tags: dns,caa
|
||||
|
||||
dns:
|
||||
- name: "{{FQDN}}"
|
||||
type: CAA
|
||||
|
||||
matchers:
|
||||
- type: word
|
||||
words:
|
||||
- "IN\tCAA"
|
||||
|
||||
extractors:
|
||||
- type: regex
|
||||
group: 1
|
||||
regex:
|
||||
- "IN\tCAA\t(.+)"
|
||||
@ -7,6 +7,7 @@ import (
|
||||
var dnsTestCases = map[string]testutils.TestCase{
|
||||
"dns/basic.yaml": &dnsBasic{},
|
||||
"dns/ptr.yaml": &dnsPtr{},
|
||||
"dns/caa.yaml": &dnsCAA{},
|
||||
}
|
||||
|
||||
type dnsBasic struct{}
|
||||
@ -40,3 +41,19 @@ func (h *dnsPtr) Execute(filePath string) error {
|
||||
}
|
||||
return expectResultsCount(results, 1)
|
||||
}
|
||||
|
||||
type dnsCAA struct{}
|
||||
|
||||
// Execute executes a test case and returns an error if occurred
|
||||
func (h *dnsCAA) Execute(filePath string) error {
|
||||
var routerErr error
|
||||
|
||||
results, err := testutils.RunNucleiTemplateAndGetResults(filePath, "google.com", debug)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if routerErr != nil {
|
||||
return routerErr
|
||||
}
|
||||
return expectResultsCount(results, 1)
|
||||
}
|
||||
|
||||
@ -234,6 +234,8 @@ func questionTypeToInt(questionType string) uint16 {
|
||||
question = dns.TypeDS
|
||||
case "AAAA":
|
||||
question = dns.TypeAAAA
|
||||
case "CAA":
|
||||
question = dns.TypeCAA
|
||||
}
|
||||
return question
|
||||
}
|
||||
|
||||
@ -31,6 +31,8 @@ const (
|
||||
TXT
|
||||
// name:AAAA
|
||||
AAAA
|
||||
// name:CAA
|
||||
CAA
|
||||
limit
|
||||
)
|
||||
|
||||
@ -45,6 +47,7 @@ var DNSRequestTypeMapping = map[DNSRequestType]string{
|
||||
MX: "MX",
|
||||
TXT: "TXT",
|
||||
AAAA: "AAAA",
|
||||
CAA: "CAA",
|
||||
}
|
||||
|
||||
// GetSupportedDNSRequestTypes returns list of supported types
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user