[FilterScript] Anti-DDos Bot
#1

Anti DDOS Bots


Agora sim !! Estб funcionando e foi testado.

Quote:

[17:38:04] Incoming connection: 127.0.0.1:58125
[17:38:04] Incoming connection: 127.0.0.1:58126
[17:38:04] Incoming connection: 127.0.0.1:58127
[17:38:04] Incoming connection: 127.0.0.1:58128
[17:38:04] Incoming connection: 127.0.0.1:58129
[17:38:04] Incoming connection: 127.0.0.1:58130
[17:38:05] Incoming connection: 127.0.0.1:58131
[17:38:05] Incoming connection: 127.0.0.1:58132
[17:38:05] Incoming connection: 127.0.0.1:58133
[17:38:05] Incoming connection: 127.0.0.1:58134
[17:38:07] [join] bRUNO_(QlP4 has joined the server (100:127.0.0.1)
[17:38:07] [join] bRUNO_NQw)Y has joined the server (101:127.0.0.1)
[17:38:07] 101 Entrou em menos de 2 segundos
[17:38:07] [join] bRUNO_yq8OD has joined the server (102:127.0.0.1)
[17:38:07] 102 Entrou em menos de 2 segundos
[17:38:07] BOT: ID -> 102 IP -> 127.0.0.
[17:38:08] [part] bRUNO_yq8OD has left the server (102:2)
Quote:
Originally Posted by Victor'
Посмотреть сообщение
Agora funcionou

PHP код:
[17:42:35] [joinDtvugjacniUnwk has joined the server (2:127.0.0.1)
[
17:42:35] [joinTN2oDpmjCzIKfu has joined the server (2:127.0.0.1)
[
17:42:352 Entrou em menos de 2 segundos
[17:42:35] [joinCmkIKzeN71xKUx has joined the server (2:127.0.0.1)
[
17:42:352 Entrou em menos de 2 segundos
[17:42:35BOTID -> 2 IP -> 127.0.0



Cуdigo:
PHP код:

#include a_samp
#if !defined varGet
#define varGet(%0)      getproperty(0,%0)
#endif
// https://sampforum.blast.hk/showthread.ph...3.51888256
#if !defined varSet
#define varSet(%0,%1) setproperty(0, %0, %1)
#endif
stock botGetIP[24];
#define IsPlayerBot(%0)\
            
GetPlayerPing(%0) == 65535 && (gettime() - varGet((GetPlayerIp(%0botGetIPsizeof botGetIP), botGetIP)) > 5)
public 
OnPlayerConnect(playerid) {
    if(
IsPlayerNPC(playerid)) return false;
    static
        
playerip[24]
    ;
    
GetPlayerIp(playeridplayerip24);
    if(
gettime() - varGet(playerip) < 2) {
        
        
strcat(playerip"di_S");
        if(
gettime() - varGet(playerip) < 3) {
            return 
false;
        }
        
        
printf("%d Entrou em menos de 2 segundos"playerid);
        
GetPlayerIp(playeridplayerip20);
        
varSet(playeripgettime());
        
strcat(playerip"x");
        static 
timers ;
        
timers varGet(playerip);
        
varSet(playerip1timers);
        if(
timers 2) {
            
playerip[strlen(playerip) - 2] = 0;
            
printf("BOT: ID -> %d IP -> %s"playeridplayerip);
            
BanEx(playerid"Bot Connect");
        }
    }
    return 
varSet(playeripgettime());
}
public 
OnPlayerDisconnect(playeridreason) {
    if(
reason == 2) {
        static
            
playerip[20]
        ;
        
GetPlayerIp(playeridplayerip20);
        
strcat(playerip"di_S");
        
varSet(playeripgettime());
    }
    return 
false;

Ele detecta apуs o cara fazer 2 a 5 conexхes. Й via IP, ela registra usando varSet e varGet (uma biblioteca minha) e apуs uma nova conexгo checa o tempo desses dois caras.

----

Tambйm й aconselhбvel que vocк coloca o seguinte no topo de cada callback que use playerid:
pawn Код:
if(IsPlayerBOT(playerid)) return false;
Assim evita outros possнveis bots
Reply


Messages In This Thread
Anti-DDos Bot - by ipsBruno - 22.07.2012, 20:09
Re: Anti-DDos Bot - by Victor' - 22.07.2012, 20:26
Re: Anti-DDos Bot - by DrTHE - 22.07.2012, 20:26
Re : Anti-DDos Bot - by ipsBruno - 22.07.2012, 20:27
Re: Anti-DDos Bot - by Victor' - 22.07.2012, 20:31
Re : Anti-DDos Bot - by ipsBruno - 22.07.2012, 20:38
Re: Anti-DDos Bot - by WaGnerLiima - 22.07.2012, 21:08
Re : Anti-DDos Bot - by paulor - 22.07.2012, 21:55
Re : Anti-DDos Bot - by ipsBruno - 22.07.2012, 21:58
Re: Anti-DDos Bot - by Kuddy - 22.07.2012, 22:18
Re: Anti-DDos Bot - by Nigel - 22.07.2012, 22:47
Re: Anti-DDos Bot - by Juninho_Oakley - 22.07.2012, 23:14
Re: Anti-DDos Bot - by Mercurio - 23.07.2012, 02:04
Respuesta: Anti-DDos Bot - by ipsBruno - 23.07.2012, 02:49
Re: Anti-DDos Bot - by Mercurio - 23.07.2012, 02:57
Re: Anti-DDos Bot - by Mercurio - 23.07.2012, 03:11
Respuesta: Anti-DDos Bot - by ipsBruno - 23.07.2012, 03:11
Re: Respuesta: Anti-DDos Bot - by Mercurio - 23.07.2012, 03:16
Respuesta: Anti-DDos Bot - by ipsBruno - 23.07.2012, 03:30
Re: Respuesta: Anti-DDos Bot - by Mercurio - 23.07.2012, 03:35
Re: Anti-DDos Bot - by Skream - 23.07.2012, 05:47
Re: Anti-DDos Bot - by Mercurio - 23.07.2012, 06:40
Respuesta: Anti-DDos Bot - by ipsBruno - 23.07.2012, 06:54
Re : Anti-DDos Bot - by paulor - 23.07.2012, 15:23
Respuesta: Anti-DDos Bot - by ipsBruno - 23.07.2012, 21:51
Re: Respuesta: Anti-DDos Bot - by paulor - 23.07.2012, 22:23
Re: Anti-DDos Bot - by Math3us - 24.07.2012, 19:25
Respuesta: Anti-DDos Bot - by ipsBruno - 24.07.2012, 20:00
Re: Respuesta: Anti-DDos Bot - by Math3us - 24.07.2012, 20:31
Re: Anti-DDos Bot - by R3S1D3NT1 - 21.08.2012, 01:57
Re: Anti-DDos Bot - by Sampizito - 23.08.2012, 23:27
AW: Anti-DDos Bot - by Maklister - 23.08.2012, 23:58
Re: Anti-DDos Bot - by Spectro_BR - 24.08.2012, 04:05
AW: Anti-DDos Bot - by Mellnik - 24.08.2012, 04:06
Respuesta: AW: Anti-DDos Bot - by ipsBruno - 24.08.2012, 15:51
Re: AW: Anti-DDos Bot - by Delay - 24.08.2012, 17:28
Re: Respuesta: AW: Anti-DDos Bot - by dudaefj - 10.09.2012, 14:05
Re: Anti-DDos Bot - by ipsBruno - 10.09.2012, 22:44
Re: Anti-DDos Bot - by R3S1D3NT1 - 10.09.2012, 23:16

Forum Jump:


Users browsing this thread: 2 Guest(s)