Skip to content

Commit 225629a

Browse files
author
Brent Cook
committed
Land rapid7#8593, Fix enum_wayback using CDX API
2 parents bd286c4 + ceba4e6 commit 225629a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/auxiliary/scanner/http/enum_wayback.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@ def pull_urls(targetdom)
3737
response = ""
3838
pages = []
3939
header = { 'User-Agent' => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/4.0.221.6 Safari/525.13"}
40-
clnt = Net::HTTP::Proxy(@proxysrv,@proxyport,@proxyuser,@proxypass).new("wayback.archive.org")
41-
resp = clnt.get2("/web/*/http://"+targetdom+"/*",header)
40+
# https://github.com/internetarchive/wayback/tree/master/wayback-cdx-server
41+
clnt = Net::HTTP::Proxy(@proxysrv,@proxyport,@proxyuser,@proxypass).new("web.archive.org")
42+
resp = clnt.get2("/cdx/search/cdx?url="+Rex::Text.uri_encode("#{targetdom}/*")+"&fl=original",header)
4243
response << resp.body
4344
response.each_line do |line|
44-
pages << line.gsub!(/(.+>)(.+)(<\/a>)\n/, '\2')
45+
pages << line.strip
4546
end
4647

4748
pages.delete_if{|x| x==nil}
4849
pages.uniq!
4950
pages.sort!
5051

5152
for i in (0..(pages.count-1))
52-
fix = "http://" + pages[i].to_s
53+
fix = pages[i].to_s.sub(':80', '')
5354
pages[i] = fix
5455
end
5556
return pages

0 commit comments

Comments
 (0)