fuckchroot

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
kindle
帖子: 10
注册时间: 2009-05-15 14:16

fuckchroot

#1

帖子 kindle » 2009-05-16 10:56

一段非常猥琐的代码,干什么用的我就是不说, :em04

#!/usr/bin/perl
#chrootfucker v1.0 -- 囗囗囗囗 'chroot' Command Kits !
#Command interpreter:
# chrootfucker.pl -chmod <permit> file1 fil2 ... ---change the permission of a given target list
# chrootfucker.pl -checkfilz ---see what the admin leaves us @_@
# chrootfucker.pl -listdir ---list the content of a certain dir
# chrootfucker.pl -guessBySSH <Opensshbanner> ---Guess Distributions using ssh banner
# chrootfucker.pl -guessByApache <Apache banner> ---Guess Distributions by Apache banner
# chrootfucker.pl -showJmpCodz ---Display C code to evadz chroot control

use warnings;
use strict;
#use File::stat;

my @toolkits = ("/bin/sh","/bin/bash","/bin/ls","/bin/tar","/bin/ps",
"/bin/ln","/bin/chmod","/bin/id","/bin/uname","/bin/netstat",
"/bin/pwd","/bin/which","/bin/cat","/bin/touch",
"/usr/bin/find","/usr/bin/wget","/usr/bin/wget","/usr/bin/top",
"/etc/passwd","/etc/shadow","/etc/group","/etc/fstab","/etc/issue");

my %sshBanner = ("OpenSSH_4.6" => 'Red Hat Enterprise Linux AS release 4:Kernle 2.6.9-5.'
,"OpenSSH_4.7" => 'Fedora Core 8: Kernel Version 2.6.23.1'
);
my %apacheBanner =("Apache/2.2.6" => 'Fedora Core 8: Kernel Version 2.6.23.1'
);


print <<EOF;
chrootfucker v1.0 -- 囗囗囗囗 'chroot' Command Kits !
Usage:
$0 -chmod <permit> file1 fil2 ...
$0 -checkfilz
$0 -listdir <dirname>
$0 -guessBySSH <Opensshbanner>
$0 -guessByApache <Apache banner>
$0 -showJmpCodz

EOF


if($#ARGV>=0){

if($ARGV[0] eq "-chmod"){
print "Changing filez permissions\n";
chmod oct($ARGV[1]),@ARGV[2..$#ARGV];

}elsif($ARGV[0] eq "-checkfilz" ){
print "Let's see what we have...\n";
foreach my $file(@toolkits) {
if(-f $file){
print $file."\n";
}

}

}elsif($ARGV[0] eq "-listdir") {

print "Here comes the dir list...\n";
opendir DH,$ARGV[1] || die "Can't open dir!\n";
my @direntry = readdir(DH);
print "FileName Mode UID GID SIZE\n";
foreach my $file(@direntry){
my $mode;
my $uid;
my $gid;
my $size;
my @stat_ret = stat $ARGV[1]."/".$file;
($mode,$uid,$gid,$size) = @stat_ret[2,4,5,7];
printf "%s\t%04o\t%d\t%d\t%d\n",$file,$mode&07777,$uid,$gid,$size;

}

closedir DH;

}elsif($ARGV[0] eq "-guessBySSH") {

if($ARGV[1] =~/(OpenSSH_.*)/){

if(defined($sshBanner{$1})){
print "Find Target! : \n".$sshBanner{$1}."\n";
}else {
print "Target Not Found!\n";

}

}
}
}
头像
tenzu
论坛版主
帖子: 36924
注册时间: 2008-11-21 20:26

Re: fuckchroot

#2

帖子 tenzu » 2009-05-16 10:59

太邪恶了,虽然我没看懂
头像
peachcolor
帖子: 898
注册时间: 2006-05-20 14:03

Re: fuckchroot

#3

帖子 peachcolor » 2009-05-16 11:02

我怎么没看出来能怎么邪恶
nyliubing
帖子: 7
注册时间: 2006-02-25 19:21
来自: 河南郑州

Re: fuckchroot

#4

帖子 nyliubing » 2009-05-21 19:02

代码没贴全吧,-showJmpCodz的处理代码没有
头像
nuanhuai
帖子: 7813
注册时间: 2009-03-10 13:04

Re: fuckchroot

#5

帖子 nuanhuai » 2009-05-21 19:04

tenzu 写了:太邪恶了,虽然我没看懂
头像
AngelMAX
帖子: 2228
注册时间: 2009-02-25 18:18

Re: fuckchroot

#6

帖子 AngelMAX » 2009-05-21 19:48

nuanhuai 写了:
tenzu 写了:太邪恶了,虽然我没看懂
在中国搞IT的谁不知道Ctrl+C,Ctrl+V啊~
回复