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

[EXTENSION] Query Cache (AS2_INFO DoS protection)


Post New Thread Reply   
 
Thread Tools Display Modes
DontWannaName
Veteran Member
Join Date: Jun 2007
Location: VALVe Land, WA
Old 01-08-2010 , 03:03   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #11

Big words Crimson

Yeah, I meant DAF, what does this do that it doesnt?
__________________

DontWannaName is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 01-08-2010 , 13:21   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #12

Looking at the code, you don't really do anything windows-specific (as far as the socket code goes). Porting that to linux would be pretty simple
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Inflikted
SourceMod Donor
Join Date: Jan 2009
Old 01-08-2010 , 13:22   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #13

DAF doesn't protect from query flood on your gameport (i think? least it didnt for me lol). and source server doesn't have any flood protection what so ever so it craps out from the flood. this plugin caches your server info and sends it to the user, rather than letting the server itself deal with it. essentially routing your server queries through this extension rather than letting your source server handle it.
Inflikted is offline
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 01-08-2010 , 15:52   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #14

Quote:
Originally Posted by devicenull View Post
Looking at the code, you don't really do anything windows-specific (as far as the socket code goes). Porting that to linux would be pretty simple
Exactly. I just need to get Cygwin installed here, and I'm a little busy.

Quote:
Originally Posted by CrimsonGT View Post
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
I didn't notice that when I was testing. It certainly makes sense though. When you return SOCKET_ERROR, the server assumes there was a network error, which is why that error appears (I think).

I'm guessing a debug version of the extension might do the same thing.

Good to hear. You'll also need to figure out how to extract the port from sockaddr. I *think* it involves passing a sockaddr_in casted to sockaddr * in to recvfrom with the size of sockaddr.

Quote:
Originally Posted by Inflikted View Post
DAF doesn't protect from query flood on your gameport (i think? least it didnt for me lol). and source server doesn't have any flood protection what so ever so it craps out from the flood. this plugin caches your server info and sends it to the user, rather than letting the server itself deal with it. essentially routing your server queries through this extension rather than letting your source server handle it.
Pretty much. The server has no part in responding to queries when this extension is loaded.
__________________

Last edited by recon0; 01-08-2010 at 16:06.
recon0 is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 01-08-2010 , 17:40   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #15

Quote:
Originally Posted by recon0 View Post
I didn't notice that when I was testing. It certainly makes sense though. When you return SOCKET_ERROR, the server assumes there was a network error, which is why that error appears (I think).

I'm guessing a debug version of the extension might do the same thing.
Try overwriting the beginning of the string with garbage (IE, not \xFF\xFF\xFF\xFF). The server drops any packets that aren't valid, without producing errors.

AFAIK, it's gathering all the info over and over again that causes the lag, not receiving the packets.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 01-08-2010 , 18:15   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #16

Quote:
Originally Posted by devicenull View Post
Try overwriting the beginning of the string with garbage (IE, not \xFF\xFF\xFF\xFF). The server drops any packets that aren't valid, without producing errors.

AFAIK, it's gathering all the info over and over again that causes the lag, not receiving the packets.
That's an interesting idea. The method I'm using now (setting the timeout flag and returning SOCKET_ERROR) doesn't produce any spam (I haven't tested the debug build for spam yet).

True, but if we allow the packet through, it will gather the info to produce a reply.
__________________
recon0 is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 01-08-2010 , 18:22   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #17

Right, but it won't try to respond if the format of the packet is wrong
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 01-08-2010 , 19:31   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #18

Quote:
Originally Posted by devicenull View Post
Right, but it won't try to respond if the format of the packet is wrong
Yes I know. I prefer my method, since it's logical and seems to work correctly.
__________________
recon0 is offline
DontWannaName
Veteran Member
Join Date: Jun 2007
Location: VALVe Land, WA
Old 01-12-2010 , 00:28   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #19

Seems like this is starting to go mainstream.
__________________

DontWannaName is offline
Kigen
BANNED
Join Date: Feb 2008
Old 01-12-2010 , 01:33   Re: [EXTENSION] Query Cache (AS2_INFO DoS protection)
Reply With Quote #20

This would be best as a MM:S plugin so it gets loaded automatically.
Kigen 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 01:38.


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