PDA

View Full Version : ban



Denizoo123
10th January 2023, 14:40
Hello guys finally i made it here xd, so wanna ask you something about banning throw putty i'm not good enough that's why i'm here you guys always help me :) and i appreciate :o

so 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 admins to use this command somehow without using Putty?
i have the script already but i don't know where i should add it /rcon iptables -A INPUT -s iphere -j DROP or something like that
maybe in tdm.gsc idk :/



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;

}

}