From cb6c17a691203813fa9fa8cbe9321296513f7d2c Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 24 Dec 2013 11:49:23 -0600 Subject: [PATCH] Tired of this --- scripts/perl/f-off-friendly-scanner.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/perl/f-off-friendly-scanner.pl diff --git a/scripts/perl/f-off-friendly-scanner.pl b/scripts/perl/f-off-friendly-scanner.pl new file mode 100644 index 0000000000..48c0b75083 --- /dev/null +++ b/scripts/perl/f-off-friendly-scanner.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl +# Fsck Friendly Scanner +# +use Data::Dumper; +require ESL; +$| = 1; +my $c = new ESL::ESLconnection("localhost", "8021", "ClueCon"); +$c->events("plain", "CUSTOM sofia::register"); + +while ($c->connected()) { + my $event = $c->recvEvent(); + + my $user_agent = $event->getHeader('user-agent'); + my $network_ip = $event->getHeader('network-ip'); + + if ($user_agent =~ m/friendly-scanner/) { + system("/sbin/iptables -I INPUT -s $network_ip -j DROP"); + } +}