Inactive [ADMN/SEC/CHAT] SpamHammer v1.7b - Punish those spammers [1000]

Discussion in 'Inactive/Unsupported Plugins' started by dumptruckman, Jul 14, 2011.

  1. Offline

    dumptruckman

    SpamHammer - Lay down the law on spammers
    Version: v1.7b

    Detects people sending too many messages in short amounts of time (and optionally repeat messages). Mutes, kicks, and then bans players that spam the same message in that order. Server OPs are unaffected. The default settings that this installs with will only detect VERY fast messages... In other words, it will only really prevent automated spam. If you want to detect slower spam, try something like 5 messages in 3 seconds or something. Experiment!

    Instructions:
    • Download the jar to your plugin folder and start your server.
    • Change the default settings if you want:
      • Message Limit is how many messages within the Message Period (seconds) before action is taken against the player. The default is 3 messages within 1 second.
      • *NEW* Add commands to
        Code:
        commandlist:
              possiblespam:
        that you might consider to be spam. By default /g, /general and /yell are added as examples.
    • Choose whether to use each action type. (Mute/Kick/Ban)
    • Configure the messages as you like them. Mute has a mute time to keep the player muted for. Use %t in the message to replace with the mute time.
    • Set a "cool-off" time for when to reset the action level of a player.
    • Note: all times are in seconds
    • Note: actions will always happen in order unless they are disabled. Mute, kick, then ban.
    • After the config is set to your liking, restart or reload the server.
    • You can now choose to disable all punishments and instead have SpamHammer simple rate limit messages.
    Commands:
    • spamunmute - unmutes a player muted by SpamHammer
    • spamunban - unbans a player banned by SpamHammer
    • spamreset - resets the punishment level of a player.
    SuperPerm nodes:
    • spamhammer.unban - allows access to /spamunban
    • spamhammer.unmute - allows access to /spamunmute
    • spamhammer.reset - allows access to /spamreset
    • spamhammer.ignore - makes player unaffected by SpamHammer
    • spamhammer.* - grants all above permissions
    Download latest version
    Source Code

    Changelog:
    Version 1.7b
    • Now has option to not use permissions and instead use OP only for the commands. This will allow for greater compatability.
    Version 1.7a
    • No longer considers all commands for spam blocking by default. Added spammable command list to config where you should add commands that could be considered spam.
    Version 1.6
    • Added back repeat message block as a default option.
    Version 1.5a
    • Added bukkit permissions support.
    Version 1.4
    • Added config option (default: true) to prevent messages over the limit from appearing. This will allow for non-punishment solutions.
    Version 1.3b
    • Disabling certain punishments no longer breaks the ones still enabled.
    • Because this plugin could break features of BukkitContrib, players with the BC client mod on a server with the BC plugin will not be affected.
    Version 1.3a
    • SpamHammer now additionally picks up command usage to prevent using chat commands as a work-around.
    Version 1.2
    • Modified the way the plugin detects spam... Now works faster and more effectively.
    • Changed the config options.
     
    Mitsugaru and pandapipino like this.
  2. Offline

    40540057

    permissions support? we don't use OPs
     
  3. Offline

    dumptruckman

    Done. 1.5a uses bukkit permissions. Read the OP for the nodes.
     
  4. Offline

    datwerd

    works brilliantly 3 spammers banned by this plugin overnight! excellent work many thanks
     
  5. Offline

    dumptruckman

    Glad it helps, if you need it to have any extra features, please don't hesitate to ask. I don't have anything planned for it right now... Pretty much just adding features that are requested.
     
  6. Offline

    datwerd

    would it be possible to check users last said sentence and check it on their second and third blocking the third message and giving warnings? would be nice for those ppl who constantly spam an admins name for help often alot slower than ppl type
     
  7. Offline

    dumptruckman

    You mean blocking duplicate messages? Hehe, that's how this plugin USE to work... I could certainly bring back that functionality. (And use both types)
     
  8. Offline

    datwerd

    it would be great i have alot of kids that are constantly repeating my name in chat asking for help would be nice to prevent some of it
     
  9. Offline

    dumptruckman

    Sure, I'll let you know when it's done.
     
  10. Offline

    datwerd

    thanking you in advance :)
     
  11. Offline

    RG_PankO

    Any ideas @dumptruckman :

    Code:
    22:07:40 [SEVERE] Could not load 'plugins\SpamHammer.jar' in folder 'plugins':
    while scanning a simple key
     in "<reader>", line 6, column 5:
            period:3
            ^
    could not found expected ':'
     in "<reader>", line 7, column 1:
        ban:
        ^
    
            at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(Scanne
    rImpl.java:400)
            at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.jav
    a:231)
            at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:18
    2)
            at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(Par
    serImpl.java:564)
            at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
            at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
    :228)
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
    :230)
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
            at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:12
    2)
            at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
    
            at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseCons
    tructor.java:124)
            at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
            at org.bukkit.util.config.Configuration.load(Configuration.java:82)
            at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:157)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:175)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:207)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:130)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:128)
            at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:97)
            at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigur
    ationManager.java:51)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:132)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    The config file is the default one. Only changed this part:
    message:
    limit: 3
    preventabovelimit: true
    period:3

    And this aprt:

    punishments:
    ban: false
    kick: true
    mute: false

    So it only kicks people that type 3 msgs for 3 secs
     
  12. Offline

    dumptruckman

    .yml files are very picky. Please post the whole thing on www.pastebin.com

    As far changing it to 3/3... That means that it will detect SLOWER messages. If someone types 3 messages within 3 seconds. That's not that slow though and is probably a decent setting if you're not ONLY shooting for taking care of spam bots.

    1.6 is out, added requested feature. It is an option you can set. It will default to on, however.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
    RG_PankO likes this.
  13. Offline

    RG_PankO

    Here -> http://pastebin.com/WjQJbZ42

    Yes
    I want
    people
    that lik
    to chat
    every
    word on
    diferent
    row
    to be
    kicked
    too
    you know?

    The error that I am showing to you is poped up in the begining -when the server starts. It says that it couldn't load the plugin, so there are no more messages about it - it's just not loaded up.
     
  14. Offline

    dumptruckman

    @RG_Pank0 try adding a space after Period: and before 3
    like
    Period: 3
    instead of
    Period:3
     
  15. Offline

    cloudafloat

    Great plugin been waiting for someone to release something like this,

    Suggestion:

    Make it ignore messages starting with / so people don't get punished for typing commands too fast.
     
  16. Offline

    Raqn

    This blocks toomanyitems from spawning items, as if you click a item multiple times for stacks, it will mute and then ban them lol.

    Could you please make it so it ignores some commands like /give
     
  17. Offline

    dumptruckman

    I'll see what I can do.
     
  18. Offline

    datwerd

    perhaps any message said with / as first letter is ignored
     
  19. Offline

    dumptruckman

    Yeah, I made it block that because of the ability to spam through use of HeroChat's /g and similar. I'm gonna try and work something out. Perhaps permission nodes to block specific commands.
     
  20. Offline

    datwerd

    sounds good keenly awaiting a solution :)
     
  21. Offline

    Raqn

    Why not just have a blacklist of phrases that are not read in the config?

    So /give
    would ignore anything with /give at the beginning.
     
  22. Offline

    datwerd

    thats a long list
     
  23. Offline

    dumptruckman

    @datwerd @Raqn
    1.7a is released. I added a section to the config where you can specify what commands could be considered spam. By default /g, /general and /yell are on the list.
     
  24. Offline

    datwerd

    great work downloading now thanks a bunch
     
  25. Offline

    lipe123

    Just loaded the new version, some problems:

    1. I'm admin with '*' permission and i get "you do not have access to this command" for /spamreset
    2. My players keep getting kicked for entering commands like /cprivate to lock some doors and chests and they did not enter these faster than the limit.
    3. Where in the config is "commandlist->possiblespam:" supposed to go?
    4. No /reload option to read changes to the config?
    Could you please add a option to ignore commands except the ones specified by the "commandlist->possiblespam:"
     
  26. Offline

    dumptruckman

    As far as the permissions, the only thing I can think is that your permissions plugin isn't configured correctly to work with bukkit permissions. Also, the commandlist->possiblespam: is a section in the config that is automatically created. What version does it say you're running when you start up? This wasn't added until 1.7a. And the commands you put in there are the only ones it will consider for possible spam prevention. If you don't put a command in there, they can spam it.
     
  27. Offline

    lipe123

    Using PermissionsEx, had no problems with the older version of spamhammer.

    I loaded 1.7a and my config file did not change to add the commandlist->possiblespam: section and players got banned for doing /home /bal commands even with up to 10 seconds apart.
    Of course this made everyone rather mad and I was forced to downgrade to the previous version of spamhammer.

    I even tried to set the .ignore permission to the group of my regulars (since its just the guests i want to check really) and even with the permission they got kicked.
     
  28. Offline

    dumptruckman

    This is very strange... Could you try deleting your configuration file and letting it remake it? Also the commandlist->possiblespam: really looks like:
    Code:
    commandlist:
        possiblespam:
        - /g
        - /general
        - /yell
     
  29. Offline

    RG_PankO

    This was the problem ;)

    Thx for the time and the great plugin!
    beer for you
     
  30. Offline

    lipe123

    I'll have to wait till the weekend to test again, I'm at work during the day and if everyone gets kicked all the time I'll have no one left when i get home :p
     
  31. Offline

    Monkz

    When it says people are muted, it doesnt actually mute them :l That's the only issue im having. People still get the messages that they are muted, just people can hear them.
     

Share This Page