Page 1 of 1
[DONE] Repeated spam protection
Posted: Wed Nov 16, 2016 9:46 pm
by Gottem
Sometimes people may try to be funny and spam users with notices, so I wrote this lil' mod for lels. =] Just load it and you're basically good to go, but you may wanna tweak some settings fam.
EDIT: I made some major changes, so be sure to review the following:
Gottem wrote: Thu Nov 24, 2016 8:49 pm
Kk we good. =]
- Sending TO ulines is now also exempted
- Added the ability to choose between the actions: kill, block, gzline
- Also added the option to show the message when action == block
- Added another trigger for OPER, which checks for repeated "OPER <nick>" messages (it discards the password part)
- Exemption blocks
- Renamed some directives
Example conf:
Code: Select all
repeatprot {
triggers {
// These are all available triggers:
privmsg;
ctcp;
invite;
notice;
oper;
};
exemptions {
*!ham@*;
};
// All of these are the default values
banmsg "Nice spam m8"; // Rejection message
action gline; // Other actions are: block, kill, gzline
showblocked 0; // Show a "your message was blocked" thingy to the user (only applicable if action == block obv)
tkltime 60; // How long to ban for (if action == g(z)line), can be a "time string" like 60, 1h5m, etc (no unit = seconds)
threshold 3; // Max 3 of the same messages/commands/invites/etc
timespan 0; // Can also be a time string like tkltime (0 means indefinitely)
};
The module will keep track of people's last and first to last messages, so it will still catch people who alternate their spam.
Check our git for the source
Re: [DONE] /notice <user> spam protection
Posted: Wed Nov 23, 2016 8:43 pm
by Gottem
Gottem wrote:I will probably, at some point, change this to one noticeprot { } block. ;3 I also may add CTCP stuff too.
Consider that done. :> Also I've renamed it to m_repeatprot (
clicky) since it has multiple triggers now. New block:
Code: Select all
repeatprot {
triggers {
notice;
privmsg;
}
banmsg "Nice spam m8";
zlinetime 60;
threshold 3;
};
You need at least one trigger or the module will throw a critical error. Apparently CTCP is magically wrapped in PRIVMSG so I'll leave that be for now. =]
Re: [DONE] /notice <user> spam protection
Posted: Thu Nov 24, 2016 2:02 pm
by alhoceima
hey there ,
ive tested a bit with it
looks nice and working only make sure to exempt ulined servers and make sure to exempt users sending messages to ulined server incase they need to multi identify for some reason or have another reason why their message doesnt get throu and send multi times to chanserv or to nickserv or whatever ulined services
other than that it looks to be working nice and yeah perhaps the: kill/block/zline option should be added cause zline seems limited
and make sure to add more comments as to how to use and what the parameters are to choose from and perhaps add exemptions block as well
thnx
nice work
Re: [DONE] /notice <user> spam protection
Posted: Thu Nov 24, 2016 2:56 pm
by Gottem
Thanks for the suggestions. =]
Exempt ulines: That's actually already in there, thought I mentioned it but seems I didn't:
Code: Select all
if(IsServer(sptr) || IsULine(sptr) || !acptr || IsOper(sptr) || acptr == sptr)
So opers, servers and ulines are always exempt, as well as sending messages to yourself (like, if you wanna spam yourself, be my guest).
I always disable the last 2 conditions while testing, I forgot to re-enable them before you tested it.
The part about sending TO ulines is not in there, I'll add it to my todo list. ;3 As for specifying the tkl action and tkltime as well as exemptions blocks, vill do that too. Solid ideas. =]
As for the "block" action: do you want the spammer to see a notification or should it be silent? I personally prefer it to be silent, but if you want it configurable I could do that too.
Re: [DONE] /notice <user> spam protection
Posted: Thu Nov 24, 2016 8:49 pm
by Gottem
Kk we good. =]
- Sending TO ulines is now also exempted
- Added the ability to choose between the actions: kill, block, gzline
- Also added the option to show the message when action == block
- Added another trigger for OPER, which checks for repeated "OPER <nick>" messages (it discards the password part)
- Exemption blocks
- Renamed some directives
Example conf:
Code: Select all
repeatprot {
triggers {
// These are all available triggers:
privmsg;
ctcp;
invite;
notice;
oper;
};
exemptions {
*!ham@*;
};
// All of these are the default values
banmsg "Nice spam m8"; // Rejection message
action gline; // Other actions are: block, kill, gzline
showblocked 0; // Show a "your message was blocked" thingy to the user (only applicable if action == block obv)
tkltime 60; // How long to ban for (if action == g(z)line), can be a "time string" like 60, 1h5m, etc (no unit = seconds)
threshold 3; // Max 3 of the same messages/commands/invites/etc
timespan 0; // Can also be a time string like tkltime (0 means indefinitely)
};
Grab the module
here.
Re: [DONE] /notice <user> spam protection
Posted: Thu Nov 24, 2016 9:15 pm
by alhoceima
tested a bit with it seems to work well
good work there Gottem
Re: [DONE] /notice <user> spam protection
Posted: Fri Nov 25, 2016 4:39 pm
by Gottem
Cool, thanks for testing and glad you like it. =]
Re: [DONE] /notice <user> spam protection
Posted: Sat Nov 26, 2016 2:30 pm
by Gottem
Thanks to another tip from alhoceima, the checks are now colour/markup agnostic. That is, bold/underline/etc and colours will be stripped before matching. =]
Re: [DONE] /notice <user> spam protection
Posted: Sat Nov 26, 2016 4:51 pm
by alhoceima
did some testing with it
seems to be working good so far
i also had something come in mind wich is to use the block option (instead of the kick/kickban only) in the +f message text flood as well (per user) example: +f [5t#block]:2
Re: [DONE] /notice <user> spam protection
Posted: Sat Nov 26, 2016 5:21 pm
by Gottem
Well that would be
this thread. =]