mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 20:55:28 +00:00
fix trailing dot (#4295)
* fix trailing dot * remove trailing dot from `domain` * remove trailing dots from answer * remove dots * fix integration test
This commit is contained in:
parent
8371223af1
commit
c79d2f05c4
@ -13,7 +13,7 @@ dns:
|
|||||||
- type: dsl
|
- type: dsl
|
||||||
name: blogid
|
name: blogid
|
||||||
dsl:
|
dsl:
|
||||||
- trim_suffix(cname,'.ghost.io.')
|
- trim_suffix(cname,'.ghost.io')
|
||||||
internal: true
|
internal: true
|
||||||
|
|
||||||
http:
|
http:
|
||||||
|
|||||||
@ -7,7 +7,7 @@ info:
|
|||||||
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
cname_filtered: '{{trim_suffix(dns_cname,".ghost.io.")}}'
|
cname_filtered: '{{trim_suffix(dns_cname,".ghost.io")}}'
|
||||||
|
|
||||||
dns:
|
dns:
|
||||||
- name: "{{FQDN}}" # DNS Request
|
- name: "{{FQDN}}" # DNS Request
|
||||||
|
|||||||
@ -21,6 +21,6 @@ http:
|
|||||||
- type: dsl
|
- type: dsl
|
||||||
dsl:
|
dsl:
|
||||||
- contains(http_body,'ProjectDiscovery.io') # check for http string
|
- contains(http_body,'ProjectDiscovery.io') # check for http string
|
||||||
- trim_suffix(dns_cname,'.ghost.io.') == 'projectdiscovery' # check for cname (extracted information from dns response)
|
- trim_suffix(dns_cname,'.ghost.io') == 'projectdiscovery' # check for cname (extracted information from dns response)
|
||||||
- ssl_subject_cn == 'blog.projectdiscovery.io'
|
- ssl_subject_cn == 'blog.projectdiscovery.io'
|
||||||
condition: and
|
condition: and
|
||||||
@ -159,7 +159,7 @@ func recordsKeyValue(resourceRecords []dns.RR) output.InternalEvent {
|
|||||||
var oe = make(output.InternalEvent)
|
var oe = make(output.InternalEvent)
|
||||||
for _, resourceRecord := range resourceRecords {
|
for _, resourceRecord := range resourceRecords {
|
||||||
key := strings.ToLower(dns.TypeToString[resourceRecord.Header().Rrtype])
|
key := strings.ToLower(dns.TypeToString[resourceRecord.Header().Rrtype])
|
||||||
value := strings.ReplaceAll(resourceRecord.String(), resourceRecord.Header().String(), "")
|
value := strings.TrimSuffix(strings.ReplaceAll(resourceRecord.String(), resourceRecord.Header().String(), ""), ".")
|
||||||
|
|
||||||
// if the key is already present, we need to convert the value to a slice
|
// if the key is already present, we need to convert the value to a slice
|
||||||
// if the key has slice, then append the value to the slice
|
// if the key has slice, then append the value to the slice
|
||||||
|
|||||||
@ -103,6 +103,7 @@ func (request *Request) execute(input *contextargs.Context, domain string, metad
|
|||||||
question = compiledRequest.Question[0].Name
|
question = compiledRequest.Question[0].Name
|
||||||
}
|
}
|
||||||
// remove the last dot
|
// remove the last dot
|
||||||
|
domain = strings.TrimSuffix(domain, ".")
|
||||||
question = strings.TrimSuffix(question, ".")
|
question = strings.TrimSuffix(question, ".")
|
||||||
|
|
||||||
requestString := compiledRequest.String()
|
requestString := compiledRequest.String()
|
||||||
|
|||||||
@ -13,7 +13,7 @@ dns:
|
|||||||
- type: dsl
|
- type: dsl
|
||||||
name: blogid
|
name: blogid
|
||||||
dsl:
|
dsl:
|
||||||
- trim_suffix(cname,'.ghost.io.')
|
- trim_suffix(cname,'.ghost.io')
|
||||||
internal: true
|
internal: true
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,6 @@ http:
|
|||||||
- type: dsl
|
- type: dsl
|
||||||
dsl:
|
dsl:
|
||||||
- contains(http_body,'ProjectDiscovery.io') # check for http string
|
- contains(http_body,'ProjectDiscovery.io') # check for http string
|
||||||
- trim_suffix(dns_cname,'.ghost.io.') == 'projectdiscovery' # check for cname (extracted information from dns response)
|
- trim_suffix(dns_cname,'.ghost.io') == 'projectdiscovery' # check for cname (extracted information from dns response)
|
||||||
- ssl_subject_cn == 'blog.projectdiscovery.io'
|
- ssl_subject_cn == 'blog.projectdiscovery.io'
|
||||||
condition: and
|
condition: and
|
||||||
Loading…
x
Reference in New Issue
Block a user