Skip to content

Commit d55faa1

Browse files
author
jvazquez-r7
committed
Add check function
1 parent 51fd07a commit d55faa1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

modules/exploits/unix/webapp/php_wordpress_total_cache.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,31 @@ def exploit
217217
fail_with(Exploit::Failure::Unknown, "#{peer} - Unexpected redirection, maybe comments are moderated")
218218
end
219219
end
220+
221+
def check
222+
res = send_request_cgi ({
223+
'uri' => normalize_uri(target_uri.path),
224+
'method' => 'POST'
225+
})
226+
227+
if res.nil?
228+
return Exploit::CheckCode::Unknown
229+
end
230+
231+
if res.headers['X-Powered-By'] and res.headers['X-Powered-By'] =~ /W3 Total Cache\/([0-9\.]*)/
232+
version = $1
233+
if version <= "0.9.2.3"
234+
return Exploit::CheckCode::Vulnerable
235+
else
236+
return Exploit::CheckCode::Safe
237+
end
238+
end
239+
240+
if res.body and res.body =~ /Performance optimized by W3 Total Cache/
241+
return Exploit::CheckCode::Detected
242+
end
243+
244+
return Exploit::CheckCode::Unknown
245+
246+
end
220247
end

0 commit comments

Comments
 (0)