Raised This Month: $32 Target: $400
 8% 

CIDR Block - Block IP ranges for countries, hackers


Post New Thread Reply   
 
Thread Tools Display Modes
Author
bottiger
AlliedModders Donor
Join Date: Dec 2010
Plugin ID:
3865
Plugin Version:
1.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    3 
    Plugin Description:
    Block IP ranges with CIDR notation.
    Old 08-31-2013 , 03:23   CIDR Block - Block IP ranges for countries, hackers
    Reply With Quote #1

    Instructions

    Have you ever needed to block a hacker that keeps getting a new IP? Have you ever needed to block an entire country? This plugin will do the job.

    You can make ban lists with websites like this.

    https://www.countryipblocks.net/country_selection.php

    The default ban list path is configs/ipblocks.txt

    Code:
    # example ban list
    1.2.3.4/28
    4.5.6.7/18
    # network 2
    5.6.7.8/31
    Here is a quick CIDR tutorial.

    1.2.3.4/32 = blocks 1.2.3.4 - 1.2.3.4
    1.2.3.4/24 = blocks 1.2.3.0 - 1.2.3.255
    1.2.3.4/16 = blocks 1.2.0.0 - 1.2.255.255
    1.2.3.4/8 = blocks 1.0.0.0 - 1.255.255.255

    You can also use the command cidr_add to add blocks in game that will last until a reboot.

    Convars

    CreateConVar("cidr_path", "configs/ipblocks.txt", "Path to block list.");

    Commands

    RegAdminCmd("cidr_reload", Command_Reload, ADMFLAG_BAN, "Clear banlist and reload bans from file.");
    RegAdminCmd("cidr_clear", Command_Clear, ADMFLAG_BAN, "Clear banlist.");
    RegAdminCmd("cidr_add", Command_Add, ADMFLAG_BAN, "Add CIDR to banlist. Does not last between reboots and does not get added to file.");
    Attached Files
    File Type: sp Get Plugin or Get Source (cidr.sp - 1579 views - 4.2 KB)
    __________________
    bottiger is offline
    luki1412
    Veteran Member
    Join Date: Oct 2008
    Location: OnPluginStart()
    Old 10-29-2013 , 20:25   Re: CIDR Block - Block IP ranges for countries, hackers
    Reply With Quote #2

    Isn't banning the STEAMID enough these days?
    __________________
    luki1412 is offline
    ChauffeR
    Junior Member
    Join Date: Dec 2013
    Location: Italy
    Old 03-20-2014 , 15:18   Re: CIDR Block - Block IP ranges for countries, hackers
    Reply With Quote #3

    Thank you! This is useful.
    ChauffeR is offline
    Alex30555
    Member
    Join Date: Sep 2011
    Location: Paris
    Old 08-16-2014 , 12:32   Re: CIDR Block - Block IP ranges for countries, hackers
    Reply With Quote #4

    I think after KickClient, you should add a banip with a ServerCommand
    __________________
    Alex30555 is offline
    IceCucumber
    Member
    Join Date: Dec 2011
    Old 11-10-2014 , 11:19   Re: CIDR Block - Block IP ranges for countries, hackers
    Reply With Quote #5

    I think there's something wrong with the comments detection. With
    Quote:
    # 1.2.3.4/32 = blocks 1.2.3.4 - 1.2.3.4
    # 1.2.3.4/24 = blocks 1.2.3.0 - 1.2.3.255
    # 1.2.3.4/16 = blocks 1.2.0.0 - 1.2.255.255
    # 1.2.3.4/8 = blocks 1.0.0.0 - 1.255.255.255
    123.123.123.123/24
    I trigger the LogError("CIDR prefix 0, clamping to 32. %s", cidr_string) at line 133, whereas just
    Quote:
    123.123.123.123/24
    works fine.
    IceCucumber is offline
    Creampuffyness
    Senior Member
    Join Date: Jun 2009
    Old 10-16-2015 , 18:37   Re: CIDR Block - Block IP ranges for countries, hackers
    Reply With Quote #6

    an option to whitelist a certain steamid would be great
    __________________
    Creampuffyness is offline
    Creampuffyness
    Senior Member
    Join Date: Jun 2009
    Old 12-08-2015 , 15:33   Re: CIDR Block - Block IP ranges for countries, hackers
    Reply With Quote #7

    Also a log of the blocked users SteamIDs and IPs would be fantastic
    __________________
    Creampuffyness is offline
    eliteroyal
    AlliedModders Donor
    Join Date: Dec 2016
    Location: Moldova
    Old 12-14-2016 , 19:09   Re: CIDR Block - Block IP ranges for countries, hackers
    Reply With Quote #8

    is there any plugin that is still supported?
    eliteroyal is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 21:34.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode