Skip to content

Commit 36adf86

Browse files
committed
Various and sundry fixes for normalize_uri
1 parent 6a94459 commit 36adf86

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

modules/auxiliary/scanner/http/axis_local_file_include.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def run_host(ip)
6262
get_credentials(new_uri)
6363

6464
else
65-
print_status("#{uri} - Apache Axis - The remote page not accessible")
65+
print_status("#{target_url} - Apache Axis - The remote page not accessible")
6666
return
6767

6868
end
@@ -82,7 +82,7 @@ def get_credentials(uri)
8282
'uri' => "#{uri}" + lfi_payload,
8383
}, 25)
8484

85-
print_status("#{uri} - Apache Axis - Dumping administrative credentials")
85+
print_status("#{target_url} - Apache Axis - Dumping administrative credentials")
8686

8787
if (res and res.code == 200)
8888
if res.body.to_s.match(/axisconfig/)

modules/exploits/multi/http/sit_file_upload.rb

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ def initialize(info = {})
6565
def check
6666

6767
uri = normalize_uri(datastore['URI'])
68-
uri << '/' if uri[-1,1] != '/'
68+
if uri[-1,1] != '/'
69+
uri = uri + "index.php"
70+
else
71+
uri = uri + "/index.php"
72+
end
6973

7074
res = send_request_raw({
7175
'uri' => uri
@@ -88,7 +92,11 @@ def check
8892
def retrieve_session(user, pass)
8993

9094
uri = normalize_uri(datastore['URI'])
91-
uri << '/' if uri[-1,1] != '/'
95+
if uri[-1,1] == "/"
96+
uri = uri + "login.php"
97+
else
98+
uri = uri + "/login.php"
99+
end
92100

93101
res = send_request_cgi({
94102
'uri' => uri,
@@ -114,7 +122,11 @@ def retrieve_session(user, pass)
114122
def upload_page(session, newpage, contents)
115123

116124
uri = normalize_uri(datastore['URI'])
117-
uri << '/' if uri[-1,1] != '/'
125+
if uri[-1,1] == "/"
126+
uri = uri + "ftp_upload_file.php"
127+
else
128+
uri = uri + "/ftp_upload_file.php"
129+
end
118130

119131
boundary = rand_text_alphanumeric(6)
120132

@@ -176,7 +188,11 @@ def cmd_shell(cmdpath)
176188
print_status("Calling payload: #{cmdpath}")
177189

178190
uri = normalize_uri(datastore['URI'])
179-
uri << '/' if uri[-1,1] != '/'
191+
if uri[-1,1] == "/"
192+
uri = uri + cmdpath
193+
else
194+
uri = uri + "/#{cmdpath}"
195+
end
180196

181197
send_request_raw({
182198
'uri' => uri

modules/exploits/multi/http/struts_code_exec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def initialize(info = {})
6666
end
6767

6868
def execute_command(cmd, opts = {})
69-
uri =normalize_uri(datastore['URI'])
70-
uri = Rex::Text::uri_encode(uri)
69+
uri = normalize_uri(datastore['URI'])
70+
uri = Rex::Text::uri_encode(uri)
7171
var_a = rand_text_alpha_lower(4)
7272
var_b = rand_text_alpha_lower(2)
7373
var_c = rand_text_alpha_lower(4)

0 commit comments

Comments
 (0)