PDA

View Full Version : [Cod2] Ban through command



Polat
14th June 2018, 18:04
Hello everyone,

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


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,

bulent
14th June 2018, 21:35
Install nanny bot this easy banned member or admins

kung foo man
14th June 2018, 23:50
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)

Polat
15th June 2018, 10:19
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 ;)

----------------------------------------------------------------------------------------------------------------------------

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

maxdamage99
15th June 2018, 10:38
CodeCallback_CLSpam(type, ip)
{
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;

}

}

Polat
15th June 2018, 10:56
CodeCallback_CLSpam(type, ip)
{
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