mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 23:25: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{
|
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)
|
||||||
|
}
|
||||||
|
|||||||
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user