Skip to content

Commit 7b8de95

Browse files
committed
fixed database overwriting issues
1 parent 07f686b commit 7b8de95

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

modules/auxiliary/gather/dns_cache_scraper.rb

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def scrape_dns(domain)
5959
return
6060
end
6161

62+
@is_vulnerable = true
6263
print_good("#{domain} - Found")
6364
report_goods(domain)
6465
end
@@ -78,39 +79,33 @@ def report_goods(domain)
7879
proto = "udp"
7980
end
8081

81-
report_service(
82-
:host => datastore['NS'],
83-
:name => "dns",
84-
:port => 53,
85-
:proto => proto,
86-
:info => "#{domain} cached"
87-
)
88-
8982
report_note(
9083
:host => datastore['NS'],
9184
:name => "dns",
9285
:port => 53,
9386
:proto => proto,
9487
:type => "dns.cache.scrape",
95-
:data => "#{domain} cached"
96-
)
97-
98-
report_host(
99-
:address => datastore['NS'],
100-
:info => "#{domain} cached",
101-
:comments => "DNS Cache Scraper"
88+
:data => "#{domain} cached",
89+
:update => :unique_data
10290
)
10391
end
10492

10593
# main control method
10694
def run
95+
@is_vulnerable = false
96+
10797
print_status("Making queries against #{datastore['NS']}")
10898

10999
if datastore['DOMAIN'].blank?
110100
read_file
111101
else
112102
scrape_dns(datastore['DOMAIN'])
113103
end
104+
105+
report_vuln(
106+
:host => datastore['NS'],
107+
:name => "DNS Cache Snooping",
108+
) if @is_vulnerable
114109
end
115110
end
116111

0 commit comments

Comments
 (0)