[Tutorial] Detect Who Attempted Login Your Rcon 2 Times
#1

Detect Who Attempted Login Your Rcon 2 Times
Hey, This is a little tutorial to show you how to detect if someone attempted to login with your rcon with deception him, give him a wrong password, if he write it he will get banned.

Part: #1

So we start put this under public OnRconLoginAttempt(ip[], password[], success) add this: if the player write a random wrong password, he will recive this MSG: you forget the password? the password is: (for example: change)

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
    {
     if(!success)
      {
         printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
         GameTextForPlayer(i,"~y~Welcome administrator ~n~~g~REMINDER: ~y~Our rcon password is change", 4000,5);
         SendClientMessage(i, 0xFFFFFFFF, "you forget the password?  the password is: change");
      }
Part: #2
Sure he will try with the password required (change)
So if he write it he will get banned


pawn Код:
if(!strcmp(password, "change", true)) //if he tried with the password "change"
      {
           GameTextForPlayer(i,"~r~noob! ~n~~w~you attempt rcon password ~n~~r~bye", 4000,5);
           SendClientMessage(i, 0xFFFFFFFF, "Idiot!");
           Ban(i); //or Kick(i)
      }
All Script
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
     for(new i=0; i<MAX_PLAYERS; i++)
    {
     if(!success)
      {
         printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
         GameTextForPlayer(i,"~y~Welcome administrator ~n~~g~REMINDER: ~y~Our rcon password is change", 4000,5);
         SendClientMessage(i, 0xFFFFFFFF, "you forget the password?  the password is: change");
      }
      if(!strcmp(password, "change", true))
      {
           GameTextForPlayer(i,"~r~noob! ~n~~w~you attempt rcon password ~n~~r~bye", 4000,5);
           SendClientMessage(i, 0xFFFFFFFF, "noob!");
           Ban(i);
      }
    }
     return 1;
}
Reply
#2

Not the best explained but i still like it and it's useful
Reply
#3

It's ok I only used the first bit as the other bit is misleading making the player think he has it then banning them it's like giving your keys to a burglar and then arresting him when he uses them to rob your house.
Reply
#4

Like that you are going to make the gametext for every online player!
Reply
#5

This doesnt detect who tried to login. It will just send the messages to all players, and if someone types the faked password it will kick or ban everyone. You should compare the IP with the IPs of the players to detect who it was.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)