Results 1 to 6 of 6

Thread: [Cod2] Ban through command

  1. #1
    Private
    Join Date
    Jan 2018
    Location
    Somewhere
    Posts
    43
    Thanks
    10
    Thanked 21 Times in 16 Posts

    Question [Cod2] Ban through command

    Hello everyone,

    Well, when I want to block ( ban ) someone IP from my server, I use this command

    Code:
    iptables -A INPUT -s IPHERE -j DROP
    My question here is, It is possible for my members to use this command somehow without using Putty?

    PB is off at my server because some players don't know how to update it. Sometimes when I'm not home, some hacker comes to my server and my members can't ban him, only kick... so, it is possible to make something that they will be able to use this command? O.o

    Thanks,

  2. #2
    Private
    Join Date
    Jul 2016
    Posts
    38
    Thanks
    0
    Thanked 19 Times in 19 Posts
    Install nanny bot this easy banned member or admins

  3. The Following User Says Thank You to bulent For This Useful Post:

    Polat (15th June 2018)

  4. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    I would either just use player getIP() with a MySQL table or a "screen" running a ban script as root, which does nothing more than checking MySQL of not-yet-banned-ips (for security reasons)
    timescale 0.01

  5. The Following User Says Thank You to kung foo man For This Useful Post:

    Polat (15th June 2018)

  6. #4
    Private
    Join Date
    Jan 2018
    Location
    Somewhere
    Posts
    43
    Thanks
    10
    Thanked 21 Times in 16 Posts
    Quote Originally Posted by bulent View Post
    Install nanny bot this easy banned member or admins
    As I heard, Nany-bot is out-dated and have some bugs/errors. But I'll give a try, thank you

    ----------------------------------------------------------------------------------------------------------------------------
    Quote Originally Posted by kung foo man View Post
    I would either just use player getIP() with a MySQL table or a "screen" running a ban script as root, which does nothing more than checking MySQL of not-yet-banned-ips (for security reasons)
    I'll try to do that and will tell you if it's work or not! Thanks

  7. #5
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    PHP Code:
    CodeCallback_CLSpam(typeip)
    {
    CONST_TimesForBan 40;

    sm strtok(type":");
    svc sm[0];
    type sm[1];

    switch (
    svc)
    {

    case 
    "RCON":
    //
    break;

    case 
    "CHALLENGE":
    //
    break;

    case 
    "INFO":
    //
    break;

    case 
    "STATUS":
    if (
    type == "ADDRESS")
    {
        if (!
    isDefined(level.locked_ip[ip]))
            
    level.locked_ip[ip] = 0;

        
    level.locked_ip[ip]++;
        
        if (
    level.locked_ip[ip] >= CONST_TimesForBan)
        {
            
    //level.locked_ip[ip] = 0;
            
    ip_without_port strtok(ip":")[0];
            
    system("iptables -A INPUT -s "+ip_without_port+" -j DROP");
            
    printf("[CLSpam] IP: "+ip+" banned! Reason: "+type+" [TIMES: "+level.locked_ip[ip]+"]\n");
            
    level.locked_ip[ip] = 0;
    }
    else
        
    printf("SVC_Status: global limit\n");

    break;

    default:
    //
    break;

    }


    Last edited by maxdamage99; 14th January 2019 at 06:07.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  8. The Following 2 Users Say Thank You to maxdamage99 For This Useful Post:

    kung foo man (15th June 2018),Polat (15th June 2018)

  9. #6
    Private
    Join Date
    Jan 2018
    Location
    Somewhere
    Posts
    43
    Thanks
    10
    Thanked 21 Times in 16 Posts
    Quote Originally Posted by maxdamage99 View Post
    PHP Code:
    CodeCallback_CLSpam(typeip)
    {
    CONST_TimesForBan 40;

    sm strtok(type":");
    svc sm[0];
    type sm[1];

    switch (
    svc)
    {

    case 
    "RCON":
    //
    break;

    case 
    "CHALLENGE":
    //
    break;

    case 
    "INFO":
    //
    break;

    case 
    "STATUS":
    if (
    type == "ADRRESS")
    {
        if (!
    isDefined(level.locked_ip[ip]))
            
    level.locked_ip[ip] = 0;

        
    level.locked_ip[ip]++;
        
        if (
    level.locked_ip[ip] >= CONST_TimesForBan)
        {
            
    //level.locked_ip[ip] = 0;
            
    ip_without_port strtok(ip":")[0];
            
    system("iptables -A INPUT -s "+ip_without_port+" -j DROP");
            
    printf("[CLSpam] IP: "+ip+" banned! Reason: "+type+" [TIMES: "+level.locked_ip[ip]+"]\n");
            
    level.locked_ip[ip] = 0;
    }
    else
        
    printf("SVC_Status: global limit\n");

    break;

    default:
    //
    break;

    }


    Thanks very much man, that what I was searching for

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •