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 11
11
12
12
require 'rubygems' # install rubygems
13
13
require 'hpricot' # gem install hpricot
14
- require 'open-uri'
15
14
require 'timeout'
16
15
17
16
def usage
Original file line number Diff line number Diff line change 11
11
12
12
require 'rubygems' # install rubygems
13
13
require 'hpricot' # gem install hpricot
14
- require 'open- uri'
14
+ require 'uri'
15
15
require 'timeout'
16
16
17
17
def usage
@@ -26,17 +26,17 @@ def usage
26
26
site . strip!
27
27
next if site . length == 0
28
28
next if site =~ /^#/
29
-
29
+
30
30
out = File . join ( output , site + ".txt" )
31
31
File . unlink ( out ) if File . exists? ( out )
32
-
32
+
33
33
fd = File . open ( out , "a" )
34
-
34
+
35
35
36
36
[ "" , "www." ] . each do |prefix |
37
37
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 )
40
40
doc . search ( "//form" ) . each do |form |
41
41
42
42
# Extract the form
@@ -78,9 +78,9 @@ def usage
78
78
$stderr. puts "#{ prefix } #{ site } #{ e . class } #{ e } "
79
79
end
80
80
end
81
-
81
+
82
82
fd . close
83
-
83
+
84
84
File . unlink ( out ) if ( File . size ( out ) == 0 )
85
85
86
86
end
Original file line number Diff line number Diff line change 4
4
##
5
5
6
6
require 'msf/core'
7
- require 'open- uri'
7
+ require 'uri'
8
8
9
9
class Metasploit3 < Msf ::Auxiliary
10
10
@@ -732,7 +732,7 @@ def all_script_urls(pages)
732
732
results = [ ]
733
733
print_status "Fetching URL #{ url } ..."
734
734
# fetch and parse the HTML document
735
- doc = Nokogiri ::HTML ( open ( url ) )
735
+ doc = Nokogiri ::HTML ( URI . parse ( url ) . open )
736
736
# recursively add scripts from iframes
737
737
doc . css ( 'iframe' ) . each do |iframe |
738
738
print_status "Checking iframe..."
@@ -771,7 +771,7 @@ def find_cached_scripts
771
771
if url . to_s . starts_with? '//'
772
772
url = "#{ page_uri . scheme } :#{ url } "
773
773
end
774
- io = open ( url )
774
+ io = URI . parse ( url ) . open
775
775
rescue URI ::InvalidURIError , OpenURI ::HTTPError
776
776
next
777
777
end
Original file line number Diff line number Diff line change 4
4
##
5
5
6
6
require 'msf/core'
7
- require 'open-uri'
8
7
require 'uri'
9
8
10
9
class Metasploit3 < Msf ::Auxiliary
@@ -66,7 +65,7 @@ def run
66
65
67
66
def check
68
67
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
70
69
if io . read . start_with? test_string
71
70
Msf ::Exploit ::CheckCode ::Vulnerable
72
71
else
You can’t perform that action at this time.
0 commit comments