File tree Expand file tree Collapse file tree 4 files changed +12
-14
lines changed
data/exploits/capture/http/forms Expand file tree Collapse file tree 4 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 1111
1212require 'rubygems' # install rubygems
1313require 'hpricot' # gem install hpricot
14- require 'open-uri'
1514require 'timeout'
1615
1716def usage
Original file line number Diff line number Diff line change 1111
1212require 'rubygems' # install rubygems
1313require 'hpricot' # gem install hpricot
14- require 'open- uri'
14+ require 'uri'
1515require 'timeout'
1616
1717def usage
@@ -26,17 +26,17 @@ def usage
2626 site . strip!
2727 next if site . length == 0
2828 next if site =~ /^#/
29-
29+
3030 out = File . join ( output , site + ".txt" )
3131 File . unlink ( out ) if File . exists? ( out )
32-
32+
3333 fd = File . open ( out , "a" )
34-
34+
3535
3636 [ "" , "www." ] . each do |prefix |
3737 begin
38- Timeout . timeout ( 10 ) do
39- doc = Hpricot ( open ( "http://#{ prefix } #{ site } /" ) )
38+ Timeout . timeout ( 10 ) do
39+ doc = Hpricot ( URI . parse ( "http://#{ prefix } #{ site } /" ) . open )
4040 doc . search ( "//form" ) . each do |form |
4141
4242 # Extract the form
@@ -78,9 +78,9 @@ def usage
7878 $stderr. puts "#{ prefix } #{ site } #{ e . class } #{ e } "
7979 end
8080 end
81-
81+
8282 fd . close
83-
83+
8484 File . unlink ( out ) if ( File . size ( out ) == 0 )
8585
8686end
Original file line number Diff line number Diff line change 44##
55
66require 'msf/core'
7- require 'open- uri'
7+ require 'uri'
88
99class Metasploit3 < Msf ::Auxiliary
1010
@@ -732,7 +732,7 @@ def all_script_urls(pages)
732732 results = [ ]
733733 print_status "Fetching URL #{ url } ..."
734734 # fetch and parse the HTML document
735- doc = Nokogiri ::HTML ( open ( url ) )
735+ doc = Nokogiri ::HTML ( URI . parse ( url ) . open )
736736 # recursively add scripts from iframes
737737 doc . css ( 'iframe' ) . each do |iframe |
738738 print_status "Checking iframe..."
@@ -771,7 +771,7 @@ def find_cached_scripts
771771 if url . to_s . starts_with? '//'
772772 url = "#{ page_uri . scheme } :#{ url } "
773773 end
774- io = open ( url )
774+ io = URI . parse ( url ) . open
775775 rescue URI ::InvalidURIError , OpenURI ::HTTPError
776776 next
777777 end
Original file line number Diff line number Diff line change 44##
55
66require 'msf/core'
7- require 'open-uri'
87require 'uri'
98
109class Metasploit3 < Msf ::Auxiliary
@@ -66,7 +65,7 @@ def run
6665
6766 def check
6867 test_string = Rex ::Text . rand_text_alphanumeric ( encoded_swf . length )
69- io = open ( exploit_url ( test_string ) )
68+ io = URI . parse ( exploit_url ( test_string ) ) . open
7069 if io . read . start_with? test_string
7170 Msf ::Exploit ::CheckCode ::Vulnerable
7271 else
You can’t perform that action at this time.
0 commit comments