summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-default/channels.xml2
-rwxr-xr-xmeta.pl4
-rw-r--r--modules/classes.pl8
-rw-r--r--modules/event.pl12
4 files changed, 20 insertions, 6 deletions
diff --git a/config-default/channels.xml b/config-default/channels.xml
index 5bb687e..8b6ec5a 100644
--- a/config-default/channels.xml
+++ b/config-default/channels.xml
@@ -462,7 +462,7 @@
<event id="joinflood" class="floodqueue" reason="join flood (5 joins in 20 seconds)" risk="medium" type="join">5:20</event>
<event id="keylogger" class="re" override="keylogger-medium" reason="using the norton start-key-logger exploit" risk="high" type="public">^startkeylogger$|^stopkeylogger$</event>
<event id="keylogger-medium" class="re" reason="using the norton start-key-logger exploit" risk="medium" type="public">\bstartkeylogger\b|\bstopkeylogger\b</event>
- <event id="last_measure_regex" class="re" reason="posting what appears to be a last measure link" risk="medium" type="public">http://\S+\.on\.nimp\.org</event>
+ <event id="last_measure_regex" class="re" reason="posting what appears to be a last measure link" risk="high" type="public">(?i)(http://\S+\.on\.nimp\.org|http://feenode.net)</event>
<event id="levenflood" class="levenflood" override="flood-5to3" reason="levenshtein flood match" risk="debug" type="public">contentisuseless</event>
<event id="massflood" class="splitflood" reason="distributed flooding" risk="high" type="public,part,caction">4:4</event>
<event id="nickspam" class="nickspam" reason="nickspamming" risk="high" type="public">60:10</event>
diff --git a/meta.pl b/meta.pl
index c9d5446..312b4f4 100755
--- a/meta.pl
+++ b/meta.pl
@@ -20,6 +20,10 @@ $::pass = '';
$::netsplit = 0;
$::debug = 0;
$::cset = '';
+%::debugx = (
+ "dnsbl" => 0,
+ "pingpong" => 0
+);
BEGIN {
my @modules = qw/Util Xml Inspect Event Services Log Command Classes Mysql/;
diff --git a/modules/classes.pl b/modules/classes.pl
index 832951d..6896ce7 100644
--- a/modules/classes.pl
+++ b/modules/classes.pl
@@ -79,6 +79,7 @@ sub dnsbl
# hopefully getting rid of this won't cause shit to assplode
# but I'm getting rid of it so it can detect cgi:irc shit
if (defined $rev) {
+ print "Querying $rev$chk->{content}\n" if $::debugx{dnsbl};
my $iaddr = gethostbyname( "$rev$chk->{content}" );
my @dnsbl = unpack( 'C4', $iaddr ) if defined $iaddr;
my $strip;
@@ -164,7 +165,7 @@ sub splitflood {
$cfc = 0;
process_cf();
}
- if ( $#{@{$cf{$id}{$chan}{$text}}}+1 == int($cut[0]) ) {
+ if ( scalar @{$cf{$id}{$chan}{$text}} == int($cut[0]) ) {
$bs{$id}{$text} = time;
return 1;
}
@@ -195,7 +196,7 @@ sub advsplitflood {
$cfc = 0;
process_cf();
}
- if ( $#{@{$cf{$id}{$chan}{$text}}}+1 == int($cut[0]) ) {
+ if ( scalar @{$cf{$id}{$chan}{$text}} == int($cut[0]) ) {
$bs{$id}{$text} = time;
return 1;
}
@@ -279,7 +280,8 @@ sub flood_add
$sfc = 0;
flood_process();
}
- return $#{ @{$sf{$id}{$chan}{$host}}}+1;
+# return $#{ @{$sf{$id}{$chan}{$host}}}+1;
+ return scalar @{$sf{$id}{$chan}{$host}};
}
sub flood_process
diff --git a/modules/event.pl b/modules/event.pl
index e7e7d55..1e1f7a6 100644
--- a/modules/event.pl
+++ b/modules/event.pl
@@ -57,10 +57,20 @@ sub new
$conn->add_handler('cfinger', \&on_ctcp);
$conn->add_handler('354', \&on_whoxreply);
$conn->add_handler('account', \&on_account);
+ $conn->add_handler('ping', \&on_ping);
bless($self);
return $self;
}
+sub on_ping
+{
+ my ($conn, $event) = @_;
+ $conn->sl("PONG " . $event->{args}->[0]);
+ return unless $::debugx{pingpong};
+ print strftime("%F %T ", gmtime) . "Ping? Pong!\n";
+ print Dumper($event);
+}
+
sub on_account
{
my ($conn, $event) = @_;
@@ -78,7 +88,6 @@ sub on_join {
my $nick = lc $event->{nick};
my $chan = lc $event->{to}->[0];
my $rate;
- print Dumper($event) if $::debug;
if ( lc $conn->{_nick} eq lc $nick) {
$::sc{$chan} = {};
mkdir($::settings->{log}->{dir} . $chan);
@@ -363,7 +372,6 @@ sub on_whoxreply
return unless $event->{args}->[1] eq '314';
my ($tgt, $magic, $chan, $user, $host, $nick, $flags, $account, $gecos) = @{$event->{args}};
my ($voice, $op) = (0, 0);
- print Dumper($event) if $::debug;
$op = 1 if ( $flags =~ /\@/ );
$voice = 1 if ($flags =~ /\+/);
$nick = lc $nick; $chan = lc $chan;