AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   orpheu to rehlds DdoS / Query Flood (https://forums.alliedmods.net/showthread.php?t=299980)

indraraj striker 08-01-2017 03:44

orpheu to rehlds DdoS / Query Flood
 
can someone re-write this script for rehlds
Thanks
PHP Code:

#include <amxmodx>
#include <orpheu>

new OrpheuFunction:HandleFuncNETQueuePacket;
new 
OrpheuFunction:HandleFuncConPrintf;

new 
OrpheuHook:HandleHookConPrintf;

public 
plugin_init()
{
    
register_plugin"Ban NET Packet Spammer""1.0.1""Arkshine" );
    
    
HandleFuncNETQueuePacket OrpheuGetFunction"NET_QueuePacket" );
    
HandleFuncConPrintf      OrpheuGetFunction"Con_Printf" );
    
    
OrpheuRegisterHookHandleFuncNETQueuePacket"NET_QueuePacket_Pre"OrpheuHookPre );
    
OrpheuRegisterHookHandleFuncNETQueuePacket"NET_QueuePacket_Post"OrpheuHookPost );
}   

public 
NET_QueuePacket_Pre()
{
    
HandleHookConPrintf OrpheuRegisterHookHandleFuncConPrintf"Con_Printf" );
}

public 
Con_Printf( const fmt[], const arg[] )
{
    static const 
message[] = "Oversize packet from ";
    
    if( 
containfmtmessage ) >= )
    {
        new 
ip16 ], ic;
        
        while( 
charsmaxip ) && ( fmtcharsmaxmessage ) ] ) && != ':' 
        { 
            
ipi++ ] = c
        }   
        
        
ip] = EOS;

        
log_to_file"NET_Packet_Spammer.log""Blocking %s"ip );
        
        
server_cmd"addip 0 ^"%s^""ip );
        
server_exec();
    }
}

public 
NET_QueuePacket_Post()
{
    
OrpheuUnregisterHookHandleHookConPrintf );



Arkshine 08-01-2017 04:13

Re: orpheu to rehlds DdoS / Query Flood
 
Is such plugin really needed and especially with ReHLDS?

Also, I remember you have cvars like max_queries_sec, max_queries_sec_global and max_queries_window to control the rate. (http://txdv.github.io/cstrike-cvarlist/).

leonardo121 08-01-2017 07:25

Re: orpheu to rehlds DdoS / Query Flood
 
Quote:

Originally Posted by indraraj striker (Post 2539016)
can someone re-write this script for rehlds
Thanks
PHP Code:

#include <amxmodx>
#include <orpheu>

new OrpheuFunction:HandleFuncNETQueuePacket;
new 
OrpheuFunction:HandleFuncConPrintf;

new 
OrpheuHook:HandleHookConPrintf;

public 
plugin_init()
{
    
register_plugin"Ban NET Packet Spammer""1.0.1""Arkshine" );
    
    
HandleFuncNETQueuePacket OrpheuGetFunction"NET_QueuePacket" );
    
HandleFuncConPrintf      OrpheuGetFunction"Con_Printf" );
    
    
OrpheuRegisterHookHandleFuncNETQueuePacket"NET_QueuePacket_Pre"OrpheuHookPre );
    
OrpheuRegisterHookHandleFuncNETQueuePacket"NET_QueuePacket_Post"OrpheuHookPost );
}   

public 
NET_QueuePacket_Pre()
{
    
HandleHookConPrintf OrpheuRegisterHookHandleFuncConPrintf"Con_Printf" );
}

public 
Con_Printf( const fmt[], const arg[] )
{
    static const 
message[] = "Oversize packet from ";
    
    if( 
containfmtmessage ) >= )
    {
        new 
ip16 ], ic;
        
        while( 
charsmaxip ) && ( fmtcharsmaxmessage ) ] ) && != ':' 
        { 
            
ipi++ ] = c
        }   
        
        
ip] = EOS;

        
log_to_file"NET_Packet_Spammer.log""Blocking %s"ip );
        
        
server_cmd"addip 0 ^"%s^""ip );
        
server_exec();
    }
}

public 
NET_QueuePacket_Post()
{
    
OrpheuUnregisterHookHandleHookConPrintf );



btw, this script is working ?

indraraj striker 08-01-2017 09:07

Re: orpheu to rehlds DdoS / Query Flood
 
Quote:

Originally Posted by Arkshine (Post 2539018)
Is such plugin really needed and especially with ReHLDS?

Also, I remember you have cvars like max_queries_sec, max_queries_sec_global and max_queries_window to control the rate. (http://txdv.github.io/cstrike-cvarlist/).

yes if you can
This is already requested by some other guy in github of rehlds
Link : https://github.com/dreamstalker/rehlds/issues/427

indraraj striker 08-01-2017 09:08

Re: orpheu to rehlds DdoS / Query Flood
 
Quote:

Originally Posted by leonardo121 (Post 2539041)
btw, this script is working ?

yes it work


All times are GMT -4. The time now is 22:49.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.