A question about RCON .
#1

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    return 0;
}
If the return is 0 , will it stop someone from logging it to the rcon ?
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!IsPlayerConnected(playerid)) return 0;
    return 0;
}
Or would this stop a brute force attack ?
Reply
#2

As the SA-MP Wiki says: This callback does not handle returns.

If the player tries to login as RCON via rcon remote console, the callback won't be called. This callback is called for online players only. However, you can do:
pawn Код:
rcon 0
in server.cfg and disable that feature.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
As the SA-MP Wiki says: This callback does not handle returns.

If the player tries to login as RCON via rcon remote console, the callback won't be called. This callback is called for online players only. However, you can do:
pawn Код:
rcon 0
in server.cfg and disable that feature.
I wanna make it so RCON cant be accessed from the game but from the console only.
I've been rcon attacked for 3 days straight ,.
Reply
#4

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) return 1;
    new playerip[16];
    for(new i = 0; i < MAX_PLAYERS; i++) //Foreach would be the better option.
    {
        if(!IsPlayerConnected(i)) continue; //Remove this if you are using foreach.
        GetPlayerIp(i, playerip, sizeof(playerip)); //Get the player's ip
        if(strcmp(playerip, ip, true)) continue; //This will compare the ip of the attempted RCON accesser and the player's ip
        SendClientMessage(i, -1, "You are not permitted to access RCON.");
        SetTimerEx("KickPlayer", 200, false, "i", i); //Set a timer to kick the player.
    }
    return 1;
}

forward KickPlayer(playerid);
public KickPlayer(playerid) return Kick(playerid);
This is an example of a script that would not allow players to log into RCON in-game. However, you can expect a lot more attacks on RCON externally than internally. Adding 'rcon 0' to your server.cfg will disable the external Remote Console.
Reply
#5

Thanks so if i add this to my script + i set rcon to 0 , nobody will be able to access it ?
Reply
#6

Another question(Its a hot topic for me since im been attacked alot): How can i make it so nobody can access rcon and if they try , they get banned + if they try to login to the rcon and the player isn't connected , kick the ip or block it ?
Reply
#7

By adding 'rcon 0' to your server.cfg, it means they HAVE to be in-game to access RCON.

If you want it to kick them when they ATTEMPT to access RCON, successful or not, just remove this line from OnRconLoginAttempt:
pawn Код:
if(!success) return 1;
Reply
#8

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
new pIP[16];
GetPlayersIp(playerid, pIP);
foreach(Player, i) {
new pIP2[16];
GetPlayersIp(i, pIP2);
if(strcmp(pIP, pIP2, true && !CanLoginToRcon[playerid])) Kick(i); }
return 1;
}
Untested.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)