[Ajuda] Bloquear Ataque de bots com inicial de IP igual
#1

Bom, sou novato em pawno...

-Primeiro, tem varias connexoes seguidas com msm inicial de IP
Isso й ataque?

se for me passe um script q bloquearб esse tipo de ataque

no meu server ja tem a proteзгo que bloqueia mais de 5 com ip igual


PS: Quando aconteceu essas conexхes estranhas deu um lag tenso no server
Reply
#2

Vocк pode bloquear jogadores com a mesma faixa de ip.

Basta:

pawn Код:
new StringIP[16];
GetPlayerIp(playerid, StringIP, 16);
strdel(StringIP, 7, 16);

if (strfind("192.168.1.254", StringIP) != -1){
    SendClientMessage(playerid, -1, #);
    Kick(playerid);
}
No caso, uma pequena demonstraзгo!
Reply
#3

Achei esse na net, ultilizo ele em meu servidor!
Й sу vc alterar o valor de
pawn Код:
MAX_CONNECTIONS_FROM_IP
Para o numero de pessoas que podem ultilizar o mesmo ip..
No caso, eu aconselho tu colocar no minimo 4 pois tem amigos que jogam em lanhouse e vгo ficar impedidos de jogar


pawn Код:
// maxips FS limits the number of players connecting from a
// single IP address.

#include <a_samp>
#include <string>

#define MAX_STRING 255

#define MAX_CONNECTIONS_FROM_IP     10
#define RED 0xE60000FF

//---------------------------------------------

public OnFilterScriptInit()
{
    printf("\n*** Limite de Players FS (maximo de Ips) Carregado. Maximo de Conexoes com 1 IP = %d\n",MAX_CONNECTIONS_FROM_IP);
}

//---------------------------------------------
// GetNumberOfPlayersOnThisIP
// Returns the number of players connecting from the
// provided IP address

stock GetNumberOfPlayersOnThisIP(test_ip[])
{
    new against_ip[32+1];
    new x = 0;
    new ip_count = 0;
    for(x=0; x<MAX_PLAYERS; x++) {
        if(IsPlayerConnected(x)) {
            GetPlayerIp(x,against_ip,32);
            if(!strcmp(against_ip,test_ip)) ip_count++;
        }
    }
    return ip_count;
}

//---------------------------------------------

public OnPlayerConnect(playerid)
{
    new connecting_ip[32+1];
    GetPlayerIp(playerid,connecting_ip,32);
    new num_players_on_ip = GetNumberOfPlayersOnThisIP(connecting_ip);

    if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) {
        printf("BrasilSampRPG: Player(%d) excedeu o numero de conecзхes %d com o ip de %s.", playerid, MAX_CONNECTIONS_FROM_IP, connecting_ip);
        SendClientMessage(playerid, RED, "[BrasilSampRPG]Tentou ultilizar BOT para me derrubar? tomou ban!!");
        Ban(playerid);
        return 1;
    }

    return 0;
}

//---------------------------------------------
Reply
#4

Quote:
Originally Posted by Noobster157
Посмотреть сообщение
no meu server ja tem a proteзгo que bloqueia mais de 5 com ip igual
Quote:
Originally Posted by Ichigo_Kurosaki
Посмотреть сообщение
Achei esse na net, ultilizo ele em meu servidor!
Й sу vc alterar o valor de
pawn Код:
MAX_CONNECTIONS_FROM_IP
Para o numero de pessoas que podem ultilizar o mesmo ip..
No caso, eu aconselho tu colocar no minimo 4 pois tem amigos que jogam em lanhouse e vгo ficar impedidos de jogar


pawn Код:
// maxips FS limits the number of players connecting from a
// single IP address.

#include <a_samp>
#include <string>

#define MAX_STRING 255

#define MAX_CONNECTIONS_FROM_IP     10
#define RED 0xE60000FF

//---------------------------------------------

public OnFilterScriptInit()
{
    printf("\n*** Limite de Players FS (maximo de Ips) Carregado. Maximo de Conexoes com 1 IP = %d\n",MAX_CONNECTIONS_FROM_IP);
}

//---------------------------------------------
// GetNumberOfPlayersOnThisIP
// Returns the number of players connecting from the
// provided IP address

stock GetNumberOfPlayersOnThisIP(test_ip[])
{
    new against_ip[32+1];
    new x = 0;
    new ip_count = 0;
    for(x=0; x<MAX_PLAYERS; x++) {
        if(IsPlayerConnected(x)) {
            GetPlayerIp(x,against_ip,32);
            if(!strcmp(against_ip,test_ip)) ip_count++;
        }
    }
    return ip_count;
}

//---------------------------------------------

public OnPlayerConnect(playerid)
{
    new connecting_ip[32+1];
    GetPlayerIp(playerid,connecting_ip,32);
    new num_players_on_ip = GetNumberOfPlayersOnThisIP(connecting_ip);

    if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) {
        printf("BrasilSampRPG: Player(%d) excedeu o numero de conecзхes %d com o ip de %s.", playerid, MAX_CONNECTIONS_FROM_IP, connecting_ip);
        SendClientMessage(playerid, RED, "[BrasilSampRPG]Tentou ultilizar BOT para me derrubar? tomou ban!!");
        Ban(playerid);
        return 1;
    }

    return 0;
}

//---------------------------------------------
Seu cуdigo impossibilita que mais de 5 pessoas, por exemplo consigam logar no servidor com o mesmo IP.

No caso o autor do tуpico pediu para bloquear faixas de IPs iguais. Exemplo:

192.168.1.254
192.168.1.255
192.168.1.256
Reply
#5

Se tiver como bloquear so na entrada seguida, tipo

[21:03:02] Incoming connection: 187.63.256.165
[21:03:03] Incoming connection: 187.63.583.96
[21:03:04] Incoming connection: 187.63.223.97

й possivel bloquear nesse caso?
Reply
#6

Quote:
Originally Posted by Noobster157
Посмотреть сообщение
Se tiver como bloquear so na entrada seguida, tipo

[21:03:02] Incoming connection: 187.63.256.165
[21:03:03] Incoming connection: 187.63.583.96
[21:03:04] Incoming connection: 187.63.223.97

й possivel bloquear nesse caso?
https://sampforum.blast.hk/showthread.php?tid=361931
Reply
#7

Os IPs muda em segundos, so a inicial fica igual, nesse anti ddos ele bloqueia se o IP for todo igual '-' certo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)