setup whitelist (ignore)

master
heuzef 7 years ago
parent eb7bd1eba3
commit 8c40f7eae5
  1. 1
      conf/keywords.cfg
  2. 16
      defacement_check.pl

@ -5,7 +5,6 @@ anonymous
attacked attacked
base64_decode base64_decode
base64decode base64decode
eval
fuck fuck
greetz greetz
gzinflate gzinflate

@ -40,11 +40,23 @@ print "FOUND \t\t=> URLs\n";
# Import config Website (LOAD domain in ARG : perl defacement_check.pl example.com) # Import config Website (LOAD domain in ARG : perl defacement_check.pl example.com)
my @search; my @search;
my $site = $ARGV[0]; my $site = $ARGV[0];
my @ignore;
# Slurp Site # Slurp Site
system("rm urls/*.urls"); system("rm urls/*.urls");
system("/bin/bash slurp_urls.sh $site"); system("/bin/bash slurp_urls.sh $site");
# Import config Ignore
my $ignore = 'conf/' . $site . '.ignore';
if (open(my $f, '<:encoding(UTF-8)', $ignore)) {
while (my $row = <$f>) {
chomp $row;
push @ignore, $row;
}
} else {
warn "Could not open file '$ignore' $!";
}
# Import config Keywords # Import config Keywords
my $keywords = 'conf/keywords.cfg'; my $keywords = 'conf/keywords.cfg';
if (open(my $f, '<:encoding(UTF-8)', $keywords)) { if (open(my $f, '<:encoding(UTF-8)', $keywords)) {
@ -84,9 +96,13 @@ foreach $file (@files)
foreach my $s (@search) { foreach my $s (@search) {
foreach (grep(/$s/i, split(/\n/, $site))) { foreach (grep(/$s/i, split(/\n/, $site))) {
if($_ =~ m/prolibre/i) {
print "\033[35mIGNORE ";
} else {
push @found, $_; push @found, $_;
} }
} }
}
# Results # Results
foreach (uniq(@found)) { foreach (uniq(@found)) {

Loading…
Cancel
Save