From c12056d242a1af8fc793e8d72486759625910d60 Mon Sep 17 00:00:00 2001 From: William Vu Date: Wed, 21 Jun 2017 12:29:15 -0500 Subject: [PATCH] Fix enum_wayback using CDX API --- modules/auxiliary/scanner/http/enum_wayback.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/auxiliary/scanner/http/enum_wayback.rb b/modules/auxiliary/scanner/http/enum_wayback.rb index 32d222b507..112412862d 100644 --- a/modules/auxiliary/scanner/http/enum_wayback.rb +++ b/modules/auxiliary/scanner/http/enum_wayback.rb @@ -37,11 +37,11 @@ class MetasploitModule < Msf::Auxiliary response = "" pages = [] 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"} - clnt = Net::HTTP::Proxy(@proxysrv,@proxyport,@proxyuser,@proxypass).new("wayback.archive.org") - resp = clnt.get2("/web/*/http://"+targetdom+"/*",header) + clnt = Net::HTTP::Proxy(@proxysrv,@proxyport,@proxyuser,@proxypass).new("web.archive.org") + resp = clnt.get2("/cdx/search/cdx?url="+Rex::Text.uri_encode("#{targetdom}/*")+"&fl=original",header) response << resp.body response.each_line do |line| - pages << line.gsub!(/(.+>)(.+)(<\/a>)\n/, '\2') + pages << line.strip end pages.delete_if{|x| x==nil} @@ -49,7 +49,7 @@ class MetasploitModule < Msf::Auxiliary pages.sort! for i in (0..(pages.count-1)) - fix = "http://" + pages[i].to_s + fix = pages[i].to_s.sub(':80', '') pages[i] = fix end return pages