[ADMN] IPNotify v1.3 - Advanced IP logger [1060]

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

  1. Offline

    Hretsam

    IPNotify - Advanced IP logger
    Version: v1.3.1

    This project is based on IPGet by Yoharnu.

    IPNotify works with CraftBukkit 1000 & 1060. But should also work on older CraftBukkits!

    This plugin logs the ip's that the players use. If the player later gets on an other computer with a different IP address, it will be added to the list.
    This plugin allows mods/admins to see all associated usernames with every ip and also every ip associated with a username

    Special thanks to: KiloWhiskey for the support & suggestions.

    Commands:
    /ip [username]
    This will print out the IP of the user itself (if no argument), else the IP of the given player​
    /iplist <username>
    This will list ip's the player used to connect. The lenght of this list can be adjusted in the config file.​
    Works with players that are not online.​
    /ipusers <username|ip address>
    This will list a users that used the given ip address, or the ip address of the given user.​
    Works with players that are not online.​
    /ipcheck
    This will list users that are indirecly banned, but not added to the banlist.​
    A player will be listed here when:​
    - The IP he has used, or is using, is banned​
    - The IP he has used, or is using, is also used by a player who's name is banned​
    /aipban <playername|ip> [banrelated]
    This will ban the given IP (or the given player's IP), and list all names that used the same IP.​
    If the last variable is set (doesn't matter what it is), the listed names will be auto banned.​
    This command does not kick the player! So you need an other plugin to kick him.​

    Download file here. (version v1.3.1)
    Source code (GitHub)

    How to use:
    1. Download jar above.
    2. Put jar in 'plugins' folder.
    3. Start server. (all files will be created on first run)
    Config file, this will will also be created on first run:
    config.yml (open)
    Code:
    ---
    
    
    ## Version of the config file, do not touch
    configversion: 3
    
    ## Permissions node:
    ## These can be used with or without the permissions plugin
    ## set it to 'permissions' to make it use the permissions plugin or bukkitperms
    ## set it to 'none' to disable the node
    ## set it to 'all' to make the node available to all users
    ## set it to 'op' to make the node available to op's
    ## the warning has an extra option 'server' where the warning is only printed to the server
    
    ## This node is to get information about yourself.
    ## Like your own ip, or connected accounts to own ip address
    self node: permissions
    ## This node is to get information about someone else
    other node: permissions
    ## Node to get the warning messages
    warning node: permissions
    ## Node to use the aipban command
    aipban node: permissions
    
    ## This is the maximum size of the iplist (for command /iplist)
    max iplist size: 6
    
    ## Sends a warning about users with an IP that is also used by other players.
    ## This is send to all players with the warning node and the server.
    ## You can set it to 'firstjoin', 'always' or 'off'
    warn double ip: firstjoin
    
    ## Syntax on how the data is printed
    ## See folling website for more info: http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html
    date syntax: dd-MMM-yyyy HH:mm
    
    ## What IPNotify must use to store its data
    ## Supported are "flatfile", "mysql" or "sqllite"
    datasource: flatfile
    
    ## Mysql information
    mysql:
      username: ipnotify
      password: ipnotify
      location: 127.0.0.1
      dbname: ipnotify
    
    ...
    
    Permissions (open)

    ipnotify.all - Gives the player acess to all nodes
    ipnotify.warning - The players with this node get warnings on players joining with double ip's
    ipnotify.self - Allows the player to see details about himself
    ipnotify.other - Allows the player to see details about others
    ipnotify.aipban - Allows the player to use the aipban command

    Changelog:

    Next Version 1.4:
    - Disable the tracking of players

    Update 1.3.1:
    - Fixed DinnerPerm bug

    Version 1.3:
    - Mysql/SqlLite support
    - DinnerPerms support
    - Search for partial IP
    - Warn when multiple users use the same IP
    - Removed support for pre 1.0 versions & IPGet.

    Version 1.2:

    - Fixed permission bug for /aipban

    Old Changelog (open)

    Version 1.1:

    - Added a missing null check

    Version 1.0:

    - Changed name to IPNotify
    - Added aipban (advanced IPBan)
    - Added ipcheck (will check for usernames that are indirectly banned)
    - Changed Command structure, server and player use same code

    Version 0.8:

    - Fix bug where iplist was to long for the chat cutting stuff off
    - Added console commands (/iplist & /ipusers)
    - /ipusers will print different now, like a /players or /who list
    - You can set the max amount of ip's printed
    - Added converter to convert old logs to new (only latest logindate for each ip will be stored)
    - Fixed typo in Date syntax
    - /iplist will sort ip's on last used (so the first is the most recent)

    Version 0.7:

    Changes:
    - Commands /iplist and /ipusers accept offline player
    - Command /ipusers accepts an ip address
    - Fixed permission bug!
    - Added config file
    - When no permissions it will not fall back automatic to OP. (this can be adjusted in config file)
    - Made possible to customize the syntax of the date string
    - Added warning when a new player joins (will say how maby users have the same ip address)
    - Code Cleanup
    - If no config file, the plugin will create one for you.

    Version 0.6:

    - Hretsam forks and edits IPGet
    - Saves players in a .yml file (gets automaticly created)
    - Added command /iplist <player>
    This command will list all the ip's the user has used to login, with the last date he used it
    - Added command /ipusers <player>
    This command will list all the users that use the same IP as the given player.
    (This will accept an IP in a future update)
    - /ip will now give your own ip, or the ip of the given user
    - To see anything related with yourself (so your own playername) you need the node "IPGet.self"
    - To see anything not related with yourself (so of other players) you need the node "IPGet.other"

    Version 0.5 - June 16, 2011

    • Added ability to see a player's last known IP if that player is offline
    Version 0.4 - April 09, 2011

    • Changed Permissions
    • Added log to track players' login times and IPs
    Version 0.3 - April 09, 2011

    • Fixed a problem where servers without Permissions couldn't run the plugin
    Version 0.2 - April 08, 2011

    • Added support for Permissions
    • Add IPGet.* or IPGet.getIP to Permissions to be able to use /ip
    Version 0.1 - April 05, 2011

    • Initial Release
     
  2. Offline

    Plague

    you are missing a category tag in the title
     
  3. Offline

    Hretsam

    Oh i forgot to add that, added
     
  4. Offline

    KiloWhiskey

    Best plugin on my server. Priceless peace of mind plugin.
     
  5. Offline

    Snowy007

    definetely going to use this. I just have 1 question.
    i have my server in 'offline mode' because some of my friends refuse to buy the game. Because of that i have the 'AuthMe' plugin so users will have to register and set up a password.

    Now, if a potentional griefer tries to log in (before he is banned) on another players name. (with the plan of getting the extra permissions the player has) He will fail to do so because he doesn't have his/her password. BUT the griefers IP get registered on his/her name right?

    Now if i would ban the griefer, the other players name will show up in the /ipcheck command right?
    Does that mean that the other player is banned too?

    Or does this only happen if i use the [banrelated] parameter with the /aipban command?
     
  6. Offline

    Hretsam

    Yes,/ipcheck will only display it.
    And if you use /aipban will only give a list of related usernames if you dont use the [banrelated] parameter

    So it will only ban the other player if you use it like this: "/aipban name banrelated",
    and not is you do "/aipban name" <= where it will only ban the IP of the player (if he is online)
     
  7. Offline

    Snowy007

    ah good to know. Thanks.
    Now i'm going to bug you with something else....

    I'm getting this error when i log in:
    Code:
    00:23:03 [INFO] Snowy007 [/192.168.1.1:57204] logged in with entity id 2443 at (
    [world] 149.28125, 28.0, -116.5)
    00:23:03 [SEVERE] Could not pass event PLAYER_JOIN to IPNotify
    java.lang.NullPointerException
            at me.hretsam.ipnotify.FileHandler.isUserAlreadyLogged(FileHandler.java:
    188)
            at me.hretsam.ipnotify.IPPlayerListener.onPlayerJoin(IPPlayerListener.ja
    va:24)
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:244)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:321)
            at net.minecraft.server.ServerConfigurationManager.c(ServerConfiguration
    Manager.java:124)
            at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:97)
            at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:74)
            at net.minecraft.server.Packet1Login.a(SourceFile:43)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:40)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:91)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    IPNotify v1.0
    CB 953
    MC 1.7.2

    players.yml is empty.
     
  8. Offline

    Hretsam

    @Snowy007
    Sorry, missed a null check!

    Fixed it in version 1.1, download it here

    To be honest, i feel a little embarrassed that i missed that..
     
  9. Offline

    Snowy007

    don't be
    I don't even know what a null check is. :D

    Though i do know that its usually the simple things people forget (a ; character in PHP for example) causing software not to work.
    man... how long and how many times have i been searching PHP files for those small missing characters.....
     
  10. Offline

    Phinary

    MySql support :)
     
  11. Offline

    Kozzy68

    Hi,
    What is permission node for /aipban ? I have added 3 nodes listed in config (warn self others) but now its seems that all users can aipban. So one of this 3 nodes is granding also ban perm. (probably not intended). Prehaps I dont understand well what is writtend at start of the config file about perms. There is example for .admin .op But not sure how is it ment.
     
  12. Offline

    Hretsam

    Your right, thank you f0r pointing this out!

    I forgot to add the permission node for that.
    The permission node default is now "IPNotify.aipban".

    To everyone using this plugin, Update to 1.2!
     
  13. Offline

    KiloWhiskey

    Good to see you're going to keep up with updates and code clean-up :D I'm going to take another shot at importing my old logs. What is the format you use for time called? I'm going to start with exporting names and IPs, then try to get dates too. Though I must admit that dates for these old logs mean nothing for my concerns.
     
  14. Offline

    Hretsam

    The converter parses dates in the format "dd-MM-yyyy HH:mm"
     
  15. Offline

    KiloWhiskey

    I mean this format 1310578310026. I have the dates from old logs in 22 May 2011 and I'm wondering how to convert it to your format which I have no idea how to read.
     
  16. Offline

    Hretsam

    Oooh, i save the dates as a value that represents the difference between the date and midnight January first 1970 UTC in milliseconds.
     
  17. Offline

    KiloWhiskey

    lol...sounds random. I'll see what I can find to give me a good time for that then. :)
     
  18. Offline

    feildmaster

  19. Offline

    KiloWhiskey

  20. Offline

    Zixt

    If I was referencing this externally through another java app how would I fetch the the latest user to log in from a certain IP address?
     
  21. Offline

    Hretsam

    If your doing this with an other plugin, you can do it the same way as Permissions is hooked and get the Filehandler. Which contains all the methods for getting information out of the yml file.

    If your not using a plugin, you need to make a new instance of the FileHandler and load it (make sure that you also have the bukkit library (for the configuration class), and you dont use the getMc..... methods.

    Or if you dont want the to IPNotify, load the yml file. The usernames have a list of IP address they used, the value behind the IP is the UNIX time of the last login (this number of miliseconds since midnight January first 1970 UTC.
     
  22. Offline

    Cosmic Break

    how can i make it so it doesnt track certain users? like the server owner.
     
  23. Offline

    Zixt

    I'm more thinking which methods.

    What I want is essentially doing /ipusers [ipaddr] and finding the latest user to connect. Which method would I use to grab the list and the timestamps?
     
  24. Offline

    Hretsam

    It doesn't do that, will add that in the next version.

    Currently you can only grab the list of usernames, or ip's. Will add a method for this in the new version.

    Sorry for the late response, i didn't had very much time for Mysql support. But the next version will have it. Together with SQLLite ( i think)
     
  25. Offline

    SilencShadoW

    Hey Guy
    i realy like ur plugin but can u implement that the /ipusers xxxx check just the first 2 ip packages? like 123.456.789.123 ... it just check 123.456 in the log ... because a reconnect change the last 2 parts ... :()

    regards.
    silencshadow
     
  26. Offline

    wooden_axe

    same for me:)
     
  27. Offline

    Hretsam

    Yes, i'll add it.
     
  28. Offline

    wooden_axe

    any idea when 1.3 is coming?
     
  29. Offline

    Zixt

    Could you also make it so we can AIPBan offline users?


    Also, what wooden_axe said. When can we expect an update? :D
     
  30. Offline

    Hretsam

    Working as hard as i can, and i will try to get it done this weekend.
     

Share This Page