mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 19:15:25 +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
|
||||
name: blogid
|
||||
dsl:
|
||||
- trim_suffix(cname,'.ghost.io.')
|
||||
- trim_suffix(cname,'.ghost.io')
|
||||
internal: true
|
||||
|
||||
http:
|
||||
|
||||
@ -7,7 +7,7 @@ info:
|
||||
|
||||
|
||||
variables:
|
||||
cname_filtered: '{{trim_suffix(dns_cname,".ghost.io.")}}'
|
||||
cname_filtered: '{{trim_suffix(dns_cname,".ghost.io")}}'
|
||||
|
||||
dns:
|
||||
- name: "{{FQDN}}" # DNS Request
|
||||
|
||||
@ -21,6 +21,6 @@ http:
|
||||
- type: dsl
|
||||
dsl:
|
||||
- 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'
|
||||
condition: and
|
||||
@ -159,7 +159,7 @@ func recordsKeyValue(resourceRecords []dns.RR) output.InternalEvent {
|
||||
var oe = make(output.InternalEvent)
|
||||
for _, resourceRecord := range resourceRecords {
|
||||
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 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
|
||||
}
|
||||
// remove the last dot
|
||||
domain = strings.TrimSuffix(domain, ".")
|
||||
question = strings.TrimSuffix(question, ".")
|
||||
|
||||
requestString := compiledRequest.String()
|
||||
|
||||
@ -13,7 +13,7 @@ dns:
|
||||
- type: dsl
|
||||
name: blogid
|
||||
dsl:
|
||||
- trim_suffix(cname,'.ghost.io.')
|
||||
- trim_suffix(cname,'.ghost.io')
|
||||
internal: true
|
||||
|
||||
|
||||
|
||||
@ -21,6 +21,6 @@ http:
|
||||
- type: dsl
|
||||
dsl:
|
||||
- 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'
|
||||
condition: and
|
||||
Loading…
x
Reference in New Issue
Block a user