Required security updates
#8

Nope, that bug was patched like 1-2 releases ago, these are fake players. I've seen this attack multiple times.

I tried to make some code to combat this, but I never tested it as the attacks stopped. I added this code before any login code was attempted:

pawn Код:
stock IsStringAlphaNumeric(string[]) {
    new
        i;

    static const
        szAppropriateCharacters[] = { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" };

    for(new c = 0; c < strlen(string); c++) {
        for(new f = 0; f < sizeof(szAppropriateCharacters); f++) {
            if(string[c] == szAppropriateCharacters[f])
                i++;
        }
    }

    if(i < strlen(string)) return 0;

    return 1;
}

public OnPlayerConnect(playerid) {
    new
        szPlayerName[MAX_PLAYER_NAME],
        szPlayerIP[16],
        szPlayerIPs[16],
        szPlayerNames[MAX_PLAYER_NAME];

    GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
    GetPlayerIp(playerid, szPlayerIP, sizeof(szPlayerIP));

    foreach(Player, x) {
        GetPlayerName(x, szPlayerNames, MAX_PLAYER_NAME);
        GetPlayerIp(playerid, szPlayerIPs, sizeof(szPlayerIPs));
        if(strfind(szPlayerName, szPlayerNames, true) != -1 && !strcmp(szPlayerIPs, szPlayerIP, true) && IsStringAlphaNumeric(szPlayerNames) == 0)
            return BanEx(playerid, "Client spam attack attempt");
    }

    // The rest of your login code...
}
Not sure if it will work, as I said before, I haven't tested it. Nor have I tested the IsStringAlphaNumeric function, but I'm sure you get the gist of what I'm trying to do, consider it as pseudo-code, if it doesn't work.
Reply


Messages In This Thread
Required security updates - by Amit_B - 06.03.2012, 14:54
Re: Required security updates - by Vince - 06.03.2012, 16:20
Re: Required security updates - by Amit_B - 06.03.2012, 16:28
Re: Required security updates - by Scott - 06.03.2012, 16:32
Re: Required security updates - by Amit_B - 06.03.2012, 18:10
Respuesta: Re: Required security updates - by Kurama - 07.03.2012, 00:34
Re: Respuesta: Re: Required security updates - by T0pAz - 07.03.2012, 07:37
Re: Required security updates - by Calgon - 07.03.2012, 10:19
Re: Required security updates - by Amit_B - 07.03.2012, 14:09
Re: Required security updates - by Gerira Gaijin - 07.03.2012, 16:08
Re: Required security updates - by Amit_B - 07.03.2012, 18:08
Re: Required security updates - by robintjeh - 07.03.2012, 21:44
Re: Required security updates - by -Prodigy- - 07.03.2012, 22:52
Re: Required security updates - by lolumadd_ - 08.03.2012, 01:32
Re: Required security updates - by Calgon - 08.03.2012, 07:39
Re: Required security updates - by Amit_B - 08.03.2012, 16:08

Forum Jump:


Users browsing this thread: 1 Guest(s)