Apsauga nuo HLDS Fake players Flood

Čia galite paskelbti apie naudingus pluginus, kuriuos radote internete ar kur kitur ir manote, kad jie bus naudingi kitiems. Savo kurtus pluginus prašome skelbti "Naujai pateikti pluginai" forume.
Forum rules
1. Pluginai turi turėti išsamius aprašymus.
2. Aprašymai turi būti lietuvių kalba.
User avatar
NZT
Flooderis arba specialistas
Posts: 836
Joined: 2011 Aug 18 17:44

Apsauga nuo HLDS Fake players Flood

Post by NZT »

Aprašymas: duotas pluginas leidžia apsisaugoti nuo exploit`o "HLDS Fake players Flood 1.0 By: I-T-N-I".

Kaip dirba pluginas?
Pluginas tikrina console, ieško ir gaudo tuos, kurie per daug prisijunginėja, ir atsijunginėja, ir tuomet užblokuoja juos (tikri žaidėjai nuo to visai nenukentės).

noflood_.zip - 402.5 Kb

Code: Select all

#include <amxmodx>#include <orpheu>#define PLUGIN "Anti flood"#define VERSION "1.0"#define AUTHOR "kanagava" new time_last_connnew ip_old[256]new ip_warn[256]new Msg[256]new OrpheuHook:handlePrintfnew warnnew old_timenew registeredpublic plugin_init(){    register_plugin(PLUGIN, VERSION, AUTHOR)    set_task(5.0, "regfunctions") } public regfunctions(){    server_cmd("mp_logecho 1")    server_cmd("log on")    OrpheuRegisterHook(OrpheuGetFunction("SV_ConnectClient"),"OnSV_ConnectClientPre", OrpheuHookPre)    OrpheuRegisterHook(OrpheuGetFunction("SV_ConnectClient"),"OnSV_ConnectClientPost", OrpheuHookPost)} public OrpheuHookReturn:OnSV_ConnectClientPre(){    registered=0    if(get_systime()-old_time <= 2)    {        handlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" , OrpheuHookPre);        registered=1    }    old_time=get_systime()    return OrpheuIgnored;}  public OrpheuHookReturn:OnSV_ConnectClientPost(){    if(registered)    {        OrpheuUnregisterHook(handlePrintf)    }    return OrpheuIgnored;}   public OrpheuHookReturn:Con_Printf(const a[], const message[] ){    registered=1    if (containi(message,"^" connected, address ^"")!=-1)    {        new len=255        new temp_right[256],temp_left[256],conn_ip[256]        formatex( Msg,charsmax( Msg ),"%s", message );        split(Msg, temp_left, len, temp_right, len, "^" connected, address ^"")        strtok(temp_right, conn_ip, len, temp_right, len, ':')        if (equal(conn_ip,ip_old) && !equal(conn_ip,"") && ((get_systime()-time_last_conn)<2))        {            warn=warn+1            if(warn>1 && equal(conn_ip,ip_warn))            {                log_amx("[NOFLOOD] Connection flood detected from ip %s",ip_old)                server_cmd("addip 120.0 %s",ip_old)            }            ip_warn=conn_ip        }        else        {            warn=0        }        ip_old=conn_ip        time_last_conn=get_systime()    }    return OrpheuIgnored;}
Last edited by NZT on 2012 Jul 03 16:02, edited 1 time in total.

User avatar
Almantsas
Naujokas apylinkėse
Posts: 3
Joined: 2011 Feb 17 09:57
Skype: almantsas

Re: Apsauga nuo HLDS Fake players Flood

Post by Almantsas »

Šiandien testavau, puikiai apsaugo, nes dproto su šituo nesusitvarko.
Image

TETYYS
Gana aktyvus vartotojas
Posts: 457
Joined: 2011 Dec 26 21:49

Re: Apsauga nuo HLDS Fake players Flood

Post by TETYYS »

Gal galit exploitą duot?

Vartotojas galo įspėjimą.

Labai gaila, kad galau įspėjimą, o tik serverius pagadint norėjau. :(

pofke112
O taip. Jis jau surinko 50 žinučių!
Posts: 99
Joined: 2010 Dec 10 23:48

Re: Apsauga nuo HLDS Fake players Flood

Post by pofke112 »

Šis pluginas pribindina žaidėjams nustatymų ir jungia į kažkokį rusišką servą.

User avatar
xDede
Jau po truputį tampa savu
Posts: 113
Joined: 2011 Jun 01 19:30
Skype: cicinas2
Location: Telsiai
Contact:

Re: Apsauga nuo HLDS Fake players Flood

Post by xDede »

Kaip padaryti kad nemestu i rusiska serveri?

TETYYS
Gana aktyvus vartotojas
Posts: 457
Joined: 2011 Dec 26 21:49

Re: Apsauga nuo HLDS Fake players Flood

Post by TETYYS »

Susicompilink pluginą iš čia...

User avatar
nuodas159
Flooderis arba specialistas
Posts: 522
Joined: 2010 Sep 03 15:30
Skype: nuodas159
Location: SunCity

Re: Apsauga nuo HLDS Fake players Flood

Post by nuodas159 »

O po kiek žaidėjų nusiuntimą, užblokuoja?
Image

User avatar
xDede
Jau po truputį tampa savu
Posts: 113
Joined: 2011 Jun 01 19:30
Skype: cicinas2
Location: Telsiai
Contact:

Re: Apsauga nuo HLDS Fake players Flood

Post by xDede »

Truksta failu norint compilinti...

InvIs
Gana aktyvus vartotojas
Posts: 421
Joined: 2011 Aug 13 11:12
Skype: pksoldierlt
Location: ATOSTOGOSE

Re: Apsauga nuo HLDS Fake players Flood

Post by InvIs »

ISVYKES

User avatar
Aivaras
Ar galit patikėti? Jis jau parašė 20 žinučių
Posts: 20
Joined: 2012 Sep 04 17:46
Skype: Creative2461

Re: Apsauga nuo HLDS Fake players Flood

Post by Aivaras »

New version v1.1

Code: Select all

#include <amxmodx>#include <orpheu>#define PLUGIN "Anti flood"#define VERSION "1.1"#define AUTHOR "kanagava"//native halflife_time ( )// небольшие настройки для плагинаnew MAX_WARN=1 //Число предупреждений после которого IP будет забанен рекомендуется [1-2]new CONN_TIME=2 //Минимальное время между соединениями с сервером для включения првоерок// (если между подключениями меньше CONN_TIME секунд включаются проверки) рекомендуется [1-3]new CONN_TIME_IP=3 //Минимальное время между соединениями с одного IP для выдачи предупреждения рекомендуется [1-5]new RST_WARN_TIME_IP=10 //Максимальное время между соединениями с одного IP для сброса предупреждений// НЕОБХОДИМО [RST_WARN_TIME_IP>CONN_TIME_IP]  new Msg[256]new OrpheuHook:handlePrintfnew ip_list[5][16]new time_list[5]new warn_list[5]new old_timenew registeredpublic plugin_init(){    register_plugin(PLUGIN, VERSION, AUTHOR)    set_task(5.0, "regfunctions")      register_srvcmd("floodlist","floodlist")  }  public regfunctions(){    //log_amx("try to reg_func")    OrpheuRegisterHook(OrpheuGetFunction("SV_ConnectClient"),"OnSV_ConnectClientPre", OrpheuHookPre)    OrpheuRegisterHook(OrpheuGetFunction("SV_ConnectClient"),"OnSV_ConnectClientPost", OrpheuHookPost)    server_cmd("mp_logecho 1")    server_cmd("log on")} public OrpheuHookReturn:OnSV_ConnectClientPre(){    registered=0    if(get_systime()-old_time <= CONN_TIME)    {        //log_amx("Reg %d %d ",halflife_time ( ), get_systime())        handlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" , OrpheuHookPre);        registered=1        //log_amx("Reg %d %d ",halflife_time ( ), get_systime())    }    old_time=get_systime()    return OrpheuIgnored;}  public OrpheuHookReturn:OnSV_ConnectClientPost(){    if(registered)    {        OrpheuUnregisterHook(handlePrintf)        //log_amx("Unreg %d %d ",halflife_time ( ), get_systime())    }    return OrpheuIgnored;} public OrpheuHookReturn:Con_Printf(const a[], const message[] ){    registered=1    if (containi(message,"^" connected, address ^"")!=-1)    {        new msg[256]        copy(msg,255,message)        checkip(msg)    }    return OrpheuIgnored;}  public floodlist(){    new h_time[32]    console_print(0,"Floodding IP list by Dan'ka :D")    for (new i=0;i<5;i++)        {    if(time_list[i]!=0)    {        format_time ( h_time,31, "%d.%m %H:%M:%S",time_list[i])         console_print(0,"[%d] [IP %s] [TIME %s]   [WARN's %d]",i,ip_list[i],h_time,warn_list[i])    }}} public checkip(message[]){    new len=255    new temp_right[256],temp_left[256],conn_ip[256]    formatex( Msg,charsmax( Msg ),"%s", message );    split(Msg, temp_left, len, temp_right, len, "^" connected, address ^"")    strtok(temp_right, conn_ip, len, temp_right, len, ':')    new mintime    new replace_index    mintime=get_systime()    for (new i=0;i<5;i++)    {        if (time_list[i]<mintime )        {            mintime=time_list[i]            replace_index=i        }            }    new ipwarn    ipwarn=false    for (new i=0;i<5;i++)    {            if (equal(conn_ip,ip_list[i]) && !equal(conn_ip,""))        {            if ((get_systime()-time_list[i])<CONN_TIME_IP)            {                warn_list[i]=warn_list[i]+1                if(warn_list[i]>MAX_WARN)                {                    //log_amx("Ban %d %d ",halflife_time ( ), get_systime())                    log_amx("[NOFLOOD] Connection flood detected from ip %s",conn_ip)                    server_cmd("addip 120.0 %s",conn_ip)                }            }            else            {                if ((get_systime()-time_list[i])>RST_WARN_TIME_IP)                     warn_list[i]=0            }                            time_list[i]=get_systime()            ipwarn=true            break        }    }            if (!ipwarn)    {        warn_list[replace_index]=0        time_list[replace_index]=get_systime()        copy(ip_list[replace_index],15,conn_ip)    }} 

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests