Merge pull request #1564 from projectdiscovery/issue-1542-caa-query

Adding support for DNS CAA query
This commit is contained in:
Sandeep Singh 2022-02-03 11:23:03 +05:30 committed by GitHub
commit 04f8f84c9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 0 deletions

View 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(.+)"

View File

@ -7,6 +7,7 @@ import (
var dnsTestCases = map[string]testutils.TestCase{ var dnsTestCases = map[string]testutils.TestCase{
"dns/basic.yaml": &dnsBasic{}, "dns/basic.yaml": &dnsBasic{},
"dns/ptr.yaml": &dnsPtr{}, "dns/ptr.yaml": &dnsPtr{},
"dns/caa.yaml": &dnsCAA{},
} }
type dnsBasic struct{} type dnsBasic struct{}
@ -40,3 +41,19 @@ func (h *dnsPtr) Execute(filePath string) error {
} }
return expectResultsCount(results, 1) 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)
}

View File

@ -234,6 +234,8 @@ func questionTypeToInt(questionType string) uint16 {
question = dns.TypeDS question = dns.TypeDS
case "AAAA": case "AAAA":
question = dns.TypeAAAA question = dns.TypeAAAA
case "CAA":
question = dns.TypeCAA
} }
return question return question
} }

View File

@ -31,6 +31,8 @@ const (
TXT TXT
// name:AAAA // name:AAAA
AAAA AAAA
// name:CAA
CAA
limit limit
) )
@ -45,6 +47,7 @@ var DNSRequestTypeMapping = map[DNSRequestType]string{
MX: "MX", MX: "MX",
TXT: "TXT", TXT: "TXT",
AAAA: "AAAA", AAAA: "AAAA",
CAA: "CAA",
} }
// GetSupportedDNSRequestTypes returns list of supported types // GetSupportedDNSRequestTypes returns list of supported types