mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-09 01:06:00 +00:00
Tired of this
This commit is contained in:
parent
f03e9fe8af
commit
cb6c17a691
19
scripts/perl/f-off-friendly-scanner.pl
Normal file
19
scripts/perl/f-off-friendly-scanner.pl
Normal file
@ -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");
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user