Raised This Month: $51 Target: $400
 12% 

[EXTENSION] Query Cache (AS2_INFO DoS protection)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 01-07-2010 , 16:19   [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #1

Description

If a server is sent a large number of AS2_INFO packets, a degradation or denial of service condition will occur.

This extension replaces the server's existing AS2_INFO response system with a high performance cached responder.


Requirements
  • Windows
  • SourceMod 1.2.1+
  • EP2/OB engine
I don't plan on supporting any other build configurations at this time.


Install
  • Download the attached zip file and extract to modfolder/addons/sourcemod/extensions
  • From RCON
    • sm exts load query_cache

Configuration
(convars (you do not need to set these for some mods))
  • qcache_gameversion - Sets the version reported in AS2_INFO query responses (you can find the correct version by looking in HLSW or running the version command at the server console)
  • qcache_gamedesc - Sets the game description reported in AS2_INFO query responses (sometimes you will need to change this if your server runs special game type (e.g. terror town on gmod)

Source Code


The source code is available from SVN (https://svn.microbits.info:444/sm-extensions/trunk/query_cache). The public ro username and password is anonsvn.


Known Issues (these will be fixed in a later release)
  • Hidden slots are ignored
  • Protocol version is set by a cvar (qcache_gameversion). If someone can provide the HL2SDK call to get the version, I'll be happy to include it.

Changelog

  • 1.0.0.2
    • Initial public release
  • 1.0.0.4
    • Fixed issue with EmpiresMod servers not reporting the correct description
  • 1.4.0.0
    • Added the following cvars
      • qcache_gameversion - Sets the version reported in AS2_INFO query responses (you can find the correct version by looking in HLSW or running the version command at the server console)
      • qcache_gamedesc - Sets the game description reported in AS2_INFO query responses (sometimes you will need to change this if your server runs special game type (e.g. terror town on gmod)
  • Next item

Credits

Attached Files
File Type: zip query_cache.zip (50.6 KB, 2398 views)
__________________

Last edited by recon0; 01-31-2010 at 19:58.
recon0 is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-07-2010 , 16:35   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #2

Aw, I just finished the VSP version of it too
CrimsonGT is offline
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 01-07-2010 , 16:39   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #3

Quote:
Originally Posted by CrimsonGT View Post
Aw, I just finished the VSP version of it too
Ah well...
__________________
recon0 is offline
Inflikted
SourceMod Donor
Join Date: Jan 2009
Old 01-07-2010 , 17:08   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #4

cool glad to see this finally made into an extension
Inflikted is offline
jockersoft
Member
Join Date: Aug 2008
Old 01-07-2010 , 17:19   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #5

looks good, much cleaner than the tool i put together
jockersoft is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 01-07-2010 , 17:25   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #6

Windows only
pheadxdll is offline
DontWannaName
Veteran Member
Join Date: Jun 2007
Location: VALVe Land, WA
Old 01-07-2010 , 18:10   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #7

So replace this http://forums.alliedmods.net/showthread.php?t=95312 with your plugin? I like keeping things simple.
__________________

DontWannaName is offline
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 01-07-2010 , 18:52   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #8

Quote:
Originally Posted by DontWannaName View Post
So replace this http://forums.alliedmods.net/showthread.php?t=95312 with your plugin? I like keeping things simple.
I'm not sure exactly what that plugin is supposed to do. I recommend running DAF, KAC and Query Cache.

Quote:
Originally Posted by pheadxdll View Post
Windows only
It's probably not hard to add Linux support. I'll have to take another look at the Linux socket library (which seems to be almost exactly the same as Winsock) and install Cygwin.
__________________

Last edited by recon0; 01-07-2010 at 18:54.
recon0 is offline
BAILOPAN
Join Date: Jan 2004
Old 01-08-2010 , 02:20   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #9

Nice work. Kudos on going open-source with this!

-dvander
__________________
egg
BAILOPAN is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-08-2010 , 02:45   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #10

Quote:
Originally Posted by recon0 View Post
Ah well...
Ive been working on the VSP all day/night and I think this is causing an issue. When running it in debug mode its spamming the console with NET_RecievePacket: UNKNOWN ERROR everytime the server is queried. Im going to look into it a little bit more tommorow and make sure its not causing any serious side effects. In the meantime its a great fix for anyone being attacked. I think the errors just happening due to the server waiting to get an incoming packet that never shows up.

If I can get my current code working we can switch it away from winsock and it will work for linux and windows, but im waiting to hear back from DS on wether or not he will reverse engineer the struct I need
CrimsonGT is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:55.


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