From 8c40f7eae5c662c6a3de019cccf4ef83cd339cc6 Mon Sep 17 00:00:00 2001 From: heuzef Date: Thu, 8 Feb 2018 19:07:07 +0100 Subject: [PATCH] setup whitelist (ignore) --- conf/keywords.cfg | 1 - defacement_check.pl | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/conf/keywords.cfg b/conf/keywords.cfg index 472a015..a97e352 100644 --- a/conf/keywords.cfg +++ b/conf/keywords.cfg @@ -5,7 +5,6 @@ anonymous attacked base64_decode base64decode -eval fuck greetz gzinflate diff --git a/defacement_check.pl b/defacement_check.pl index 2d1e508..4e0d928 100644 --- a/defacement_check.pl +++ b/defacement_check.pl @@ -40,11 +40,23 @@ print "FOUND \t\t=> URLs\n"; # Import config Website (LOAD domain in ARG : perl defacement_check.pl example.com) my @search; my $site = $ARGV[0]; +my @ignore; # Slurp Site system("rm urls/*.urls"); 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 my $keywords = 'conf/keywords.cfg'; if (open(my $f, '<:encoding(UTF-8)', $keywords)) { @@ -84,7 +96,11 @@ foreach $file (@files) foreach my $s (@search) { foreach (grep(/$s/i, split(/\n/, $site))) { - push @found, $_; + if($_ =~ m/prolibre/i) { + print "\033[35mIGNORE "; + } else { + push @found, $_; + } } }