Remove open-uri usage in msf.

bug/bundler_fix
joev 2015-03-05 23:45:28 -06:00
parent 141e2e732f
commit d7295959ca
4 changed files with 12 additions and 14 deletions

View File

@ -11,7 +11,6 @@
require 'rubygems' # install rubygems
require 'hpricot' # gem install hpricot
require 'open-uri'
require 'timeout'
def usage

View File

@ -11,7 +11,7 @@
require 'rubygems' # install rubygems
require 'hpricot' # gem install hpricot
require 'open-uri'
require 'uri'
require 'timeout'
def usage
@ -36,7 +36,7 @@ File.readlines(sitelist).each do |site|
["", "www."].each do |prefix|
begin
Timeout.timeout(10) do
doc = Hpricot(open("http://#{prefix}#{site}/"))
doc = Hpricot(URI.parse("http://#{prefix}#{site}/").open)
doc.search("//form").each do |form|
# Extract the form

View File

@ -4,7 +4,7 @@
##
require 'msf/core'
require 'open-uri'
require 'uri'
class Metasploit3 < Msf::Auxiliary
@ -732,7 +732,7 @@ class Metasploit3 < Msf::Auxiliary
results = []
print_status "Fetching URL #{url}..."
# fetch and parse the HTML document
doc = Nokogiri::HTML(open(url))
doc = Nokogiri::HTML(URI.parse(url).open)
# recursively add scripts from iframes
doc.css('iframe').each do |iframe|
print_status "Checking iframe..."
@ -771,7 +771,7 @@ class Metasploit3 < Msf::Auxiliary
if url.to_s.starts_with? '//'
url = "#{page_uri.scheme}:#{url}"
end
io = open(url)
io = URI.parse(url).open
rescue URI::InvalidURIError, OpenURI::HTTPError
next
end

View File

@ -4,7 +4,6 @@
##
require 'msf/core'
require 'open-uri'
require 'uri'
class Metasploit3 < Msf::Auxiliary
@ -66,7 +65,7 @@ class Metasploit3 < Msf::Auxiliary
def check
test_string = Rex::Text.rand_text_alphanumeric(encoded_swf.length)
io = open(exploit_url(test_string))
io = URI.parse(exploit_url(test_string)).open
if io.read.start_with? test_string
Msf::Exploit::CheckCode::Vulnerable
else