0 || stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) { $content = "application/xhtml+xml"; $charset = "utf-8"; } else { $content = "text/html"; $charset = "utf-8"; } header("Content-Type: ".$content."; charset=".$charset); function docommand($dir,$command) { echo "user@loki ".$dir." $ ".$command."\n"; } function file_type( $file ) { // TYPES: 0 = file, 1 = compressed, 2 = executable, 3 = link, 4 = dir, 5 = image $stat = lstat($file); if (is_link($file)) return 3; elseif (is_dir($file)) return 4; elseif ($stat["mode"] & 0x0040 == 0x0040 || $stat["mode"] & 0x0008 == 0x0008 || $stat["mode"] & 0x0001 == 0x0001) return 2; else { $ext = substr($file,-3); switch($ext) { case "zip": case "rar": case "ace": case "tar": case "tgz": case "bz2": case ".gz": case "lzo": case ".ar": case "arj": case "ear": case "jar": case "war": case ".7z": return 1; break; case "jpg": case "jpe": case "png": case "bmp": case "tga": case "xcf": case "gif": case "svg": return 5; break; case "txt": case "pdf": case "tch": /* .patch */ case "tex": return 6; break; default: return 0; break; } } } function file_perms( $perms ) { if (($perms & 0xC000) == 0xC000) { // Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { // FIFO pipe $info = 'p'; } else { // Unknown $info = 'u'; } // Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); // Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); // World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function size_hum_read( $size ){ $i=0; $iec = array("", "K", "M", "G", "T", "P", "E", "Z", "Y"); while (($size/1024)>1) { $size=$size/1024; $i++; } if (substr($size,1,1) == ".") $size = substr($size,0,3).$iec[$i]; elseif(strlen($size) == 1 && $i > 0) $size = $size.".0".$iec[$i]; else $size = round($size).$iec[$i]; return str_repeat(" ",( ( 5 - strlen($size) >= 0 ? ( 5 - strlen($size) ) : 0 ) )).$size; } $visitors = rtrim(file_get_contents("visitor_count")); if ($file = @fopen("visitor_count","w+")) { if ( $visitors == "" ) $visitors = 0; fwrite($file,++$visitors); fclose($file); } echo "\n"; ?> Terminal - ssh user@toribash.reversers.org
login: user
password: 

     .vir.
  .d$$$$$$b. Welcome to loki.slainvet.net
  $$$$( )$$$b
  Q$$$$$$$$$$B Please do not mess with this machine too much—
    "$$$$$$$P It is a balance of broken software and duct tape.
   d$$$$$$P"
  $$$$$$$P This server is running gentoo linux.
  `Q$$P"

  Any malicious and/or unauthorized activity is strictly forbidden.
  All activity is logged for an inappropriate amount of time.

".$file."";
  elseif ($type == 3)
  {
    $linkto = readlink($file);
    if (!file_exists($linkto))
      $output="".$file." -> ";
    else
      $output="".$file." -> ";
    switch (file_type($linkto))
    {
      case 1:
        $filelist[$i]["output"] = $output."".$linkto."";
        break;
      case 2:
        $filelist[$i]["output"] = $output."".$linkto."";
        break;
      case 3:
        $filelist[$i]["output"] = $output."".$linkto."";
        break;
      case 4:
        $filelist[$i]["output"] = $output."".$linkto."";
        break;
      case 5:
        $filelist[$i]["output"] = $output."".$linkto."";
        break;
      case 6:
        $filelist[$i]["output"] = $output."".$linkto."";
        break;
      case 0:
      default:
        $filelist[$i]["output"] = $output."".$linkto."";
        break;
    }
  }
  elseif ($type == 2)
    $filelist[$i]["output"]="".$file."";
  elseif ($type == 1)
    $filelist[$i]["output"]="".$file."";
  elseif ($type == 5)
    $filelist[$i]["output"]="".$file."";
  elseif ($type == 6)
    $filelist[$i]["output"]="".$file."";
  elseif ($type == 0)
    $filelist[$i]["output"]="".$file."";
}
unset($files);

for ($i = 0; $i < count($filelist); $i++)
{
 echo $filelist[$i]["perms"]." ".$filelist[$i]["links"]." user users ".$filelist[$i]["size"]." ";
 echo $filelist[$i]["time"]." ".$filelist[$i]["output"]."\n";
}

docommand("~/toribash.reversers.org","cat copyright");
echo "© SlainVeteran (Anthony Cox) ".date("Y")."\n";
docommand("~/toribash.reversers.org","");
?>