User
Pass
2FA
 
 

Protection HLDS Fake players Flood / Anti flood (UPDATE!!!)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash
Author Message25700
WaSaAa

[Mentally Stable]



Status: Offline
(since 12-06-2013 09:11)
Joined: 20 Jan 2012
Posts: 27, Topics: 5
Location: Spain

Reputation: 53.9
Votes: 2

Post Posted: 28-05-2012, 11:24:46 | Translate post to: ... (Click for more languages)

Original text by me, warranty WaSaAa

Features: block fake players. ban 120 min.

Files required (functions: SV_ConnectClient and Con_Printf) http://www66.zippyshare.com/v/18088339/file.html


1º Install module orpheu (orpheu_base: http://forums.alliedmods.net/showthread.php?t=116393)

2º Order amxmodx/configs/modules.ini
Code:
;mysql
;sqlite

orpheu
fun
engine
fakemeta
geoip
sockets
regex
nvault
cstrike
csx
hamsandwich


3º Add commands to Server.cfg
Code:

mp_logfile "1"
mp_logecho "1"
log on


4º Write noflood.amxx in plugins.ini


Clean code noflood.sma
Code:

#include <amxmodx>
#include <orpheu>
#define PLUGIN "Anti flood"
#define VERSION "1.1"
#define AUTHOR "kanagava"
//native halflife_time ( )
// Ajustes menores al plug-in
new MAX_WARN=1 // El número de advertencias después de que la IP se prohibió recomendado [1-2]
new CONN_TIME=2 // Tiempo mínimo entre conexiones al servidor para permitir
// (Si las conexiones entre segundo conn_time más pequeños de la prueba) se recomienda [1-3]
new CONN_TIME_IP=3 // El tiempo mínimo entre las conexiones de una IP a emitir advertencias recomendadas [1-5]
new RST_WARN_TIME_IP=10 // Tiempo máximo entre las conexiones de una IP a restablecer advertencias
// Necesidad [RST_WARN_TIME_IP>CONN_TIME_IP]

new Msg[256]
new OrpheuHook:handlePrintf
new ip_list[5][16]
new time_list[5]
new warn_list[5]
new old_time
new registered
public 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)
    }




Last edited by WaSaAa on 19-11-2012, 15:03:24; edited 8 times in total
0 0
  
Back to top
View user's profile Send private message
killik

[Whaaaaat?!]



Status: Offline
(since 26-05-2019 09:22)
Joined: 14 Jun 2010
Posts: 7576, Topics: 198
Location: Timisoara

Reputation: 301.5
Votes: 99

       
Post Posted: 28-05-2012, 14:07:47 | Translate post to: ... (Click for more languages)

Daca tot copiezi de pe unde apuci,chinuie-te sa-l traduci macar


0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
WaSaAa

[Mentally Stable]



Status: Offline
(since 12-06-2013 09:11)
Joined: 20 Jan 2012
Posts: 27, Topics: 5
Location: Spain

Reputation: 53.9
Votes: 2

Post Posted: 28-05-2012, 18:41:04 | Translate post to: ... (Click for more languages)

killik wrote:
Daca tot copiezi de pe unde apuci,chinuie-te sa-l traduci macar


Original text by me, by WaSaAa

You have to compile it with "AMX Mod X Studio", download the "AMX Mod X Base" on the server you have installed 1.8.1 or 1.8.2dev and also the module "Orpheu" to compile it locally.


1º Download “AMX Mod X Studio” (http://www.amxmodx.org/downloads.php)

2º Download “AMX Mod X Base 1.8.1” or you have installed on your server. (http://www.amxmodx.org/downloads.php)

3º Download “modulo orpheu” (http://forums.alliedmods.net/showthread.php?t=116393)

4º Compile it locally.


Compile locally with custom includes (http://forums.alliedmods.net/showthread.php?t=130511)

-



Last edited by WaSaAa on 08-08-2012, 17:55:08; edited 1 time in total
0 0
  
Back to top
View user's profile Send private message
banditu

[Mentally Stable]



Status: Offline
(since 29-05-2021 22:54)
Joined: 21 Nov 2006
Posts: 349, Topics: 106
Location: Romania

Reputation: 548.9
Votes: 9

Post Posted: 24-06-2012, 15:28:29 | Translate post to: ... (Click for more languages)

A probat cineva? Cum se prezinta?

EDIT: In legatura cu exploitul nu stiu cum se prezinta, dar partea cea proasta e ca atunci cand dai retry de mai multe ori, gen atunci cand serverul este full iti da ban. Vreo rezolvare?

0 0
  
Back to top
View user's profile Send private message
kEnT10

[Mentally Stable]



Status: Offline
(since 21-03-2018 22:45)
Joined: 07 Aug 2011
Posts: 182, Topics: 12
Location: Romania

Reputation: 93.3
Votes: 5

Post Posted: 04-07-2012, 09:59:39 | Translate post to: ... (Click for more languages)

Buun
0 0
  
Back to top
View user's profile Send private message
trUst*w0rld
[Banned user]


Banned


Status: Offline
(since 11-08-2014 20:42)
Joined: 10 Jun 2012
Posts: 2236, Topics: 93
Location: Nu stiu.

Reputation: -49.2
Votes: 200

 
Post Posted: 11-07-2012, 19:41:22 | Translate post to: ... (Click for more languages)

Copy paste sigur -


0 0
  
Back to top
View user's profile Send private message
Z3ddy

[Mentally Stable]



Status: Offline
(since 15-01-2014 20:51)
Joined: 13 Feb 2009
Posts: 87, Topics: 29
Location: Bucuresti

Reputation: 379.7
Votes: 5

 
Post Posted: 28-07-2012, 21:55:24 | Translate post to: ... (Click for more languages)

ne ajuta cineva cu o compilare la sma? ca eu nu reusesc sa-l fac... sunt prea n00b -

http://www29.zippyshare.com/v/49631863/file.html

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
claudiualex

[Mentally Stable]



Status: Offline
(since 10-08-2012 11:22)
Joined: 08 Aug 2012
Posts: 3, Topics: 1
Location: Romania

Reputation: 46.1
Votes: 2

Post Posted: 08-08-2012, 15:04:41 | Translate post to: ... (Click for more languages)

Varianta cea mai buna este sa renuntati la protocolul 47, are 8 ani vechime.
0 0
  
Back to top
View user's profile Send private message
mohsen9010

[Mentally Stable]



Status: Offline
(since 28-11-2022 19:37)
Joined: 08 Sep 2011
Posts: 2, Topics: 1
Location: Iran, Islamic Republic of

Reputation: 108.1
Votes: 3

Post Posted: 12-08-2012, 19:47:09 | Translate post to: ... (Click for more languages)

iptables :
Code:

iptables -A INPUT -p udp -m udp -m string --hex-string "|17c74a30a2fb752396b63532b1bf79b0|" --algo kmp -j DROP
iptables -A INPUT -p udp -m udp -m string --hex-string "|17951a20e2ab6d63d6ac7d62f1f721e057cd4270e2f1357396f66522f1ed61f0|" --algo kmp -j DROP
iptables -A INPUT -p udp -m udp -m string --hex-string "|178f5230e2e17d73d6bc6562f1ed29e0|" --algo kmp -j DROP
iptables -A INPUT -p udp -m udp -m string --hex-string "|d50000806e000000|" --algo kmp -j DROP
iptables -A INPUT -p udp -m udp -m string --hex-string "|ffffffff6765746368616c6c656e6765000000000000|" --algo kmp -j DROP

0 0
  
Back to top
View user's profile Send private message
audy

[Mentally Stable]



Status: Offline
(since 13-09-2013 09:48)
Joined: 25 Jul 2009
Posts: 6, Topics: 2
Location: Romania

Reputation: 102
Votes: 4

Post Posted: 06-09-2012, 23:58:02 | Translate post to: ... (Click for more languages)

Am incercat sa introduc regulile in iptables dar primesc o eroare: iptables: No chain/target/match by that name.

Stie cineva ce as putea face ? Folosesc Centos.

0 0
  
Back to top
View user's profile Send private message
WaSaAa

[Mentally Stable]



Status: Offline
(since 12-06-2013 09:11)
Joined: 20 Jan 2012
Posts: 27, Topics: 5
Location: Spain

Reputation: 53.9
Votes: 2

Post Posted: 13-09-2012, 17:53:24 | Translate post to: ... (Click for more languages)

banditu wrote:
A probat cineva? Cum se prezinta?

EDIT: In legatura cu exploitul nu stiu cum se prezinta, dar partea cea proasta e ca atunci cand dai retry de mai multe ori, gen atunci cand serverul este full iti da ban. Vreo rezolvare?


amx_reservation 0
amx_hideslots 0

and/or

redirect_auto 0

Do not use spaces reserved to avoid the problem.

0 0
  
Back to top
View user's profile Send private message
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash  


The time now is 28-03-2024, 12:35:35
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x