[DONE] Repeated spam protection

These are old archives. They are kept for historic purposes only.

Moderators: Gottem, Supporters

Post Reply
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

[DONE] Repeated spam protection

Post 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
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: [DONE] /notice <user> spam protection

Post 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. =]
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
alhoceima
Posts: 32
Joined: Mon Jul 18, 2016 10:35 pm

Re: [DONE] /notice <user> spam protection

Post 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
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: [DONE] /notice <user> spam protection

Post 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. :D

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.
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: [DONE] /notice <user> spam protection

Post 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.
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
alhoceima
Posts: 32
Joined: Mon Jul 18, 2016 10:35 pm

Re: [DONE] /notice <user> spam protection

Post by alhoceima »

tested a bit with it seems to work well

good work there Gottem
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: [DONE] /notice <user> spam protection

Post by Gottem »

Cool, thanks for testing and glad you like it. =]
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: [DONE] /notice <user> spam protection

Post 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. =]
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
alhoceima
Posts: 32
Joined: Mon Jul 18, 2016 10:35 pm

Re: [DONE] /notice <user> spam protection

Post 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
Gottem
UnrealIRCd coder
Posts: 192
Joined: Fri Aug 19, 2016 5:26 pm
Location: NL

Re: [DONE] /notice <user> spam protection

Post by Gottem »

Well that would be this thread. =]
If you like my modules, pls consider donating (credit card or iDEAL, use the custom job fee option in my shop) ;];]
Post Reply