Skip to content

Commit f88ec5c

Browse files
Add normalize_uri to modules that may have
been missed by PULL 1045. Please ensure PULL 1045 is in place prior to looking at this (as it implements normalize_uri) ref --> rapid7#1045
1 parent 3df9dfc commit f88ec5c

File tree

178 files changed

+413
-425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+413
-425
lines changed

modules/auxiliary/admin/cisco/cisco_secure_acs_bypass.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ def run_host(ip)
7979
print_status("Issuing password change request for: " + datastore['USERNAME'])
8080

8181
begin
82+
uri = normalize_uri(datastore['TARGETURI'])
8283
res = send_request_cgi({
83-
'uri' => target_uri.path,
84+
'uri' => uri,
8485
'method' => 'POST',
8586
'data' => data,
8687
'headers' =>

modules/auxiliary/admin/http/contentkeeper_fileaccess.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def run_host(ip)
4848
res = send_request_raw(
4949
{
5050
'method' => 'POST',
51-
'uri' => datastore['URL'] + '?-o+' + '/home/httpd/html/' + tmpfile + '+' + datastore['FILE'],
51+
'uri' => normalize_uri(datastore['URL']) + '?-o+' + '/home/httpd/html/' + tmpfile + '+' + datastore['FILE'],
5252
}, 25)
5353

5454
if (res and res.code == 500)

modules/auxiliary/admin/http/iis_auth_bypass.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def initialize(info = {})
4343

4444

4545
def has_auth
46-
uri = target_uri.path
46+
uri = normalize_uri(target_uri.path)
4747
uri << '/' if uri[-1, 1] != '/'
4848

4949
res = send_request_cgi({
@@ -56,7 +56,7 @@ def has_auth
5656
end
5757

5858
def try_auth
59-
uri = target_uri.path
59+
uri = normalize_uri(target_uri.path)
6060
uri << '/' if uri[-1, 1] != '/'
6161
uri << Rex::Text.rand_text_alpha(rand(10)+5) + ".#{Rex::Text.rand_text_alpha(3)}"
6262

modules/auxiliary/admin/http/intersil_pass_reset.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def run
7373
@peer = "#{rhost}:#{rport}"
7474
return if check != Exploit::CheckCode::Vulnerable
7575

76-
uri = target_uri.path
76+
uri = normalize_uri(target_uri.path)
7777
uri << '/' if uri[-1,1] != '/'
7878

7979
res = send_request_cgi({

modules/auxiliary/admin/http/jboss_seam_exec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def initialize(info = {})
4242
end
4343

4444
def run
45-
jbr = datastore['JBOSS_ROOT']
45+
jbr = normalize_uri(datastore['JBOSS_ROOT'])
4646
cmd_enc = ""
4747
cmd_enc << Rex::Text.uri_encode(datastore["CMD"])
4848

modules/auxiliary/admin/http/scrutinizer_add_user.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ def initialize(info = {})
4545
end
4646

4747
def run
48+
uri = normalize_uri(target_uri.path)
4849
res = send_request_cgi({
4950
'method' => 'POST',
50-
'uri' => target_uri.path,
51+
'uri' => uri,
5152
'vars_post' => {
5253
'tool' => 'userprefs',
5354
'newUser' => datastore['USERNAME'],

modules/auxiliary/admin/http/typo3_sa_2009_001.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def run
6868
# Null byte fixed in PHP 5.3.4
6969
#
7070

71+
uri = normalize_uri(datastore['URI'])
7172
case datastore['RFILE']
7273
when nil
7374
# Nothing
@@ -100,8 +101,7 @@ def run
100101
juhash = Digest::MD5.hexdigest(juarray)
101102
juhash = juhash[0..9] # shortMD5 value for use as juhash
102103

103-
file_uri = "#{datastore['URI']}/index.php?jumpurl=#{jumpurl}&juSecure=1&locationData=#{locationData}&juHash=#{juhash}"
104-
file_uri = file_uri.sub("//", "/") # Prevent double // from appearing in uri
104+
file_uri = "#{uri}/index.php?jumpurl=#{jumpurl}&juSecure=1&locationData=#{locationData}&juHash=#{juhash}"
105105
vprint_status("Checking Encryption Key [#{i}/1000]: #{final}")
106106

107107
begin

modules/auxiliary/admin/tikiwiki/tikidblib.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def initialize(info = {})
5252
def run
5353
print_status("Establishing a connection to the target...")
5454

55-
rpath = datastore['URI'] + "/tiki-lastchanges.php?days=1&offset=0&sort_mode="
55+
uri = normalize_uri(datastore['URI'])
56+
rpath = uri + "/tiki-lastchanges.php?days=1&offset=0&sort_mode="
5657

5758
res = send_request_raw({
5859
'uri' => rpath,

modules/auxiliary/admin/webmin/file_disclosure.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def initialize(info = {})
7070
def run
7171
print_status("Attempting to retrieve #{datastore['RPATH']}...")
7272

73-
uri = Rex::Text.uri_encode(datastore['DIR']) + "/..%01" * 40 + Rex::Text.uri_encode(datastore['RPATH'])
73+
dir = normalize_uri(datastore['DIR'])
74+
uri = Rex::Text.uri_encode(dir) + "/..%01" * 40 + Rex::Text.uri_encode(datastore['RPATH'])
7475

7576
res = send_request_raw({
7677
'uri' => uri,

modules/auxiliary/dos/http/apache_range_dos.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def initialize(info = {})
5050
end
5151

5252
def run
53-
uri = datastore['URI']
53+
uri = normalize_uri(datastore['URI'])
5454
ranges = ''
5555
for i in (0..1299) do
5656
ranges += ",5-" + i.to_s

0 commit comments

Comments
 (0)