AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [EXTENSION] Query Cache 1.7 (Updated!) (https://forums.alliedmods.net/showthread.php?t=134373)

Afronanny 08-03-2010 22:18

[EXTENSION] Query Cache 1.7 (Updated!)
 
This is merely an updated version of recon0's Query Cache. The convars have been removed, and after installation, the only time you will need to update or maintain this extension is if the protocol changes, or if the extension is updated.

Purpose: Protect the server from A2S_INFO DoS attacks. Every 5 seconds, the data in the A2S_INFO is refreshed to reflect the current values.

Changes from recon0's extension:
  • Added a Linux binary
  • Now allows players to connect to the server (the "null entity packet" protection recon0's extension provided prevented any user from connecting to the server)
  • Extra data flag is now reported
Todo:
  • Report the actual tags. Currently the tags reported is "Tags, tags, MORE TAGS"
  • Fix the password bug on Windows
Credits:
  • recon0 - Wrote extension code
  • Afronanny (me) - updating and maintaining it
  • asherkin - Provided the code to get the gameserver's steamid
Download available here: http://code.google.com/p/querycache/downloads/list
Source Code available here: http://code.google.com/p/querycache/source/browse/

Note: If you want to compile this extension yourself, have Open Steamworks available.

If you encounter any problems please post them here.

thetwistedpanda 08-03-2010 22:53

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Thanks for fixing the issues!

*Edit: Still locks CS:S servers when loaded*

Afronanny 08-03-2010 23:44

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by thetwistedpanda (Post 1261117)
Thanks for fixing the issues!

*Edit: Still locks CS:S servers when loaded*

What OS?

thetwistedpanda 08-03-2010 23:47

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Uhh Windows, server edition 03 iirc, although possibly 08.

KawMAN 08-04-2010 07:23

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
1)
Code:

[01] <FAILED> file "querycache.ext.so": /home/wsciekle/server_css1/orangebox/cstrike/addons/sourcemod/extensions/querycache.ext.so: cannot open shared object file: No such file or directory
seams like linux version file name should be querycache.ext.so not query_cache.ext.so
2) extension don't respect sv_visiblemaxplayers and shows all slots
3) Game Description is static, pls make it work with SDKHooks GameDescription hook

Afronanny 08-04-2010 07:46

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by KawMAN (Post 1261339)
1)
Code:

[01] <FAILED> file "querycache.ext.so": /home/wsciekle/server_css1/orangebox/cstrike/addons/sourcemod/extensions/querycache.ext.so: cannot open shared object file: No such file or directory
seams like linux version file name should be querycache.ext.so not query_cache.ext.so
2) extension don't respect sv_visiblemaxplayers and shows all slots
3) Game Description is static, pls make it work with SDKHooks GameDescription hook


1. Oh blah. Smack me for doing this late at night. fixed now
2. Will do
3. I'll add something that works with SDKHooks.

asherkin 08-05-2010 14:24

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
This may have issues on some windows servers, due to the Steam library doing batshit-insane load-order stuff.

Afronanny, grab me on IRC one day and I'll give you what you need to make sure it can't fail.
Also, as your using OSW already, there may be a better way to hook the packets, I can talk to you about that at the same time :).

Anyway, Nice job continuing work on this.

Afronanny 08-05-2010 17:40

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by asherkin (Post 1262460)
This may have issues on some windows servers, due to the Steam library doing batshit-insane load-order stuff.

Afronanny, grab me on IRC one day and I'll give you what you need to make sure it can't fail.
Also, as your using OSW already, there may be a better way to hook the packets, I can talk to you about that at the same time :).

Anyway, Nice job continuing work on this.


I assume you're talking about this when talking about fixing Windows loading issues, no?

asherkin 08-05-2010 17:52

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by Afronanny (Post 1262620)
I assume you're talking about this when talking about fixing Windows loading issues, no?

That's the stuff, but a reentrant function can do a much cleaner job of it.

Afronanny 08-05-2010 18:09

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by asherkin (Post 1262626)
That's the stuff, but a reentrant function can do a much cleaner job of it.

Which way does it better, yours or Wazz's?

Quote:

Originally Posted by asherkin (Post 1262460)
Anyway, Nice job continuing work on this.

Thanks, but valve is going to hate my guts for doing it. You know why.

asherkin 08-05-2010 18:34

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by Afronanny (Post 1262644)
Which way does it better, yours or Wazz's?

If your talking about the stuff in the code labeled Wazz Method, you have to go through each stage until it works, the last one is just called "Wazz Method" because it's the only way that would work on his machine.

EDIT: Here is VoiDeD's code that he uses: http://voided.pastebin.com/eCmw0kA1

jldrake 08-06-2010 03:20

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Hello, we have been getting attacked for the past 2 days.

Do you know of any kind of fix for the following:

They all appear to be spoofed ips, They are causing a massive amount of lag.

Packet: Looks like Source Query
ffffffff54536f7572636520456e67696e65205175657 27900

If you know a fix let me know! Thank you!

jldrake 08-06-2010 03:22

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
This seems to be another packet they are using to attack us with: I dont know what this on is.
ffffffff71303030303030303030303030303000

AzuiSleet 08-06-2010 03:32

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by jldrake (Post 1263053)
Hello, we have been getting attacked for the past 2 days.

Do you know of any kind of fix for the following:

They all appear to be spoofed ips, They are causing a massive amount of lag.

Packet: Looks like Source Query
ffffffff54536f7572636520456e67696e65205175657 27900

If you know a fix let me know! Thank you!

There are two problems you have to deal with when it comes to this specific attack, the first is the denial of service caused by sending over 60 OOB packets per second. When that point is reached the engine will stop sending ANY OOB packets (including connect challenges) during that window. That's the first DoS which this plugin prevents.

The second problem is compounded by the fix for the first problem, which is that it replies to every A2S_INFO query. This floods the network and causes an increase in CPU usage and takes up network bandwidth (backscatter).

The solution would be a rather simple QoS system, giving game packets priority over OOB packets. This would give the least amount of impact to the players in game, and since OOB packets don't need to be recieved right away they can take a much lower priority.

jldrake 08-06-2010 05:19

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
60 pps is low. I have blocked 99% of the attack all the way down to 325 pps. Its barely touches my bandwidth at all yet it lags the entire server so bad I cant connect. The plugin doesn't appear to help at all shows it as running in meta list and everything.... I just dont notice any difference. We are still unable to connect to the server.

I dont know what you mean by QoS System, OOB packets.... Or how I would set this up.

Thanks for the help, I appreciate it.

By the way I'm using Windows.
- version appears on server browser as locked but its not locked. Users can still join as well.\
You can connect through console but if you connect off the browser it asks for a password.

AzuiSleet 08-06-2010 16:01

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by jldrake (Post 1263081)
60 pps is low. I have blocked 99% of the attack all the way down to 325 pps. Its barely touches my bandwidth at all yet it lags the entire server so bad I cant connect. The plugin doesn't appear to help at all shows it as running in meta list and everything.... I just dont notice any difference. We are still unable to connect to the server.

Any OOB packet will count against the window limit, this particular plugin only covers A2S_INFO, it looks like you're being spammed with connect challenges as well.

Quote:

Originally Posted by jldrake (Post 1263081)
I dont know what you mean by QoS System, OOB packets.... Or how I would set this up.

You don't, it's up to someone with effort to implement it.

Afronanny 08-07-2010 00:13

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
1 Attachment(s)
Quote:

Originally Posted by jldrake (Post 1263055)
This seems to be another packet they are using to attack us with: I dont know what this on is.
ffffffff71303030303030303030303030303000


Try this. It now has a timer to block these if there are more than 5 in 5 seconds. Source code is available here

thetwistedpanda 08-07-2010 00:56

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Any luck on fixing the dirty hidden password for Windows?

jldrake 08-07-2010 13:53

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
If we could just get the password removed on the browser so users dont have to connect through console we would be set.

I have also been able to patch mine by my secureport firewall. Limiting that packet per second.

Afronanny 08-07-2010 17:54

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by jldrake (Post 1264319)
If we could just get the password removed on the browser so users dont have to connect through console we would be set.

I have also been able to patch mine by my secureport firewall. Limiting that packet per second.

I honestly don't know why a password is being reported. Perhaps valve changed CBaseServer::GetPassword to report an empty string rather than just NULL. I'll test it out and see.

jldrake 08-08-2010 01:47

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
ff ff ff ff 71 30 30 30 30 30 30 30 30 30 30 30 30 30 30 00

Still seems to lag us to death even with the plugin you made. Any other ideas/thoughts? All spoofed ips.

zeroibis 08-15-2010 17:01

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
[03] <FAILED> file "querycache.ext.dll": The specified module could not be found.

zeroibis 08-16-2010 12:16

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Got it to load but had the same password glitch others have had.

Also something causes it to eat up all the sql connections and flood my remote server. I now got to run mysqladmin flush-hosts to hopefully fix it.

thetwistedpanda 08-16-2010 12:23

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Your machine is Linux right zero? That would make it confirmed on both Windows & Linux :-o.

Afronanny 08-16-2010 16:56

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by thetwistedpanda (Post 1272637)
Your machine is Linux right zero? That would make it confirmed on both Windows & Linux :-o.


I did in face test this on Linux, it's fine on Linux.

I'm thinking CBaseServer::GetPassword no longer returns null when there's no password on windows. should be a trivial fix.
I'm on vacation in New Jersey right now :crab: :crab:
I'll look at it when I get back, since I have literally nothing to work with (apparently my ip changed yesterday, so I can't ssh into my machine to do any development because I don't know the new IP. time to write some daemon that will send it to me via text message if i email it?)

zeroibis 08-16-2010 18:37

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
No this was on windows, even if the password issue was fixed it still flooded the remote sql server locking the connection out so that it would no longer work, thus killing ZR.

Afronanny 08-16-2010 19:14

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by zeroibis (Post 1272893)
No this was on windows, even if the password issue was fixed it still flooded the remote sql server locking the connection out so that it would no longer work, thus killing ZR.


Not sure I understand. This extension is flooding your SQL server locking it up?

Taner 11-08-2010 10:02

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
I tried to install this after that sm_hide_slots 1 had a bug and i cant make slots hidden.

KyleS 11-11-2010 04:33

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
I can't seem to compile this for the life of me. I've moved most of it to the latest MM:S branch, fixed the paths, etc. However, I get this when compiling with gcc 4.2.4 (Debian 4.2.4-6) on my Arch Linux Machine (gcc4.3+ renders the same kind of error): PasteBin.

The line that it points to is #include <iostream>, which makes absolutely no sense. The same thing happens when I try compiling with llmv.

pheadxdll 11-11-2010 10:54

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Try 4.1

Samantha 11-15-2010 19:06

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Can someone attempt to fix the password issue, i would try but i have no idea how to compile an extension. Thank you.

KyleS 12-02-2010 23:15

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Any chance at getting this fixed so it compiles properly?

Master53 12-03-2010 23:34

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by samantharp (Post 1350278)
Can someone attempt to fix the password issue, i would try but i have no idea how to compile an extension. Thank you.

yea i have the same issue with "http://forums.alliedmods.net/showthread.php?t=114787" but with the newer version i get this error when i type "sm exts list" and the extension doesnt load.
Code:

sm exts list
[SM] Displaying 12 extensions:
[01] Automatic Updater (1.3.6): Updates SourceMod gamedata files
[02] Webternet (1.3.6): Extension for interacting with URLs
[03] <FAILED> file "querycache.ext.dll": The specified module could not be found
.

[04] Server Secure - Files Only (1.0.0): The finest defence
[05] Zombie Fix (1.0.0): Stops HL2:DM servers crashing upon spawning zombies.
[06] Top Menus (1.3.6): Creates sorted nested menus
[07] GeoIP (1.3.6): Geographical IP information
[08] SDK Tools (1.3.6): Source SDK Tools
[09] BinTools (1.3.6): Low-level C/C++ Calling API
[10] Client Preferences (1.3.6): Saves client preference settings
[11] SQLite (1.3.6): SQLite Driver
[12] SDK Hooks (1.3.0): Source SDK Hooks


Samantha 12-09-2010 16:05

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
1 Attachment(s)
Here is a fixed version of this plugin. Source not changed but it worked for me upon recompiling. Can anyone test and make sure that it works? If not i think i have a fix that will work.

nightrider 12-10-2010 04:45

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by samantharp (Post 1367143)
Here is a fixed version of this plugin. Source not changed but it worked for me upon recompiling. Can anyone test and make sure that it works? If not i think i have a fix that will work.

Unsure if it works, but I do have it installed and running on two of my dust2 CS:S server.

Thanks ... :)

Code:

[SM] Displaying 14 extensions:
        [01] Automatic Updater (1.3.6): Updates SourceMod gamedata files
        [02] Webternet (1.3.6): Extension for interacting with URLs
        [03] CS:S Tools (1.3.6): CS:S extended functionality
        [04] BinTools (1.3.6): Low-level C/C++ Calling API
        [05] Top Menus (1.3.6): Creates sorted nested menus
        [06] SDK Tools (1.3.6): Source SDK Tools
        [07] Client Preferences (1.3.6): Saves client preference settings
        [08] SQLite (1.3.6): SQLite Driver
        [09] GeoIP (1.3.6): Geographical IP information
        [10] Regex (1.3.6): Provides regex natives for plugins
        [11] SDK Hooks (1.3.0): Source SDK Hooks
        [12] Socket (3.0.1alpha): Socket extension for SourceMod
        [13] MySQL-DBI (1.3.6): MySQL driver implementation for DBI
        [14] Server Query Cache (1.7.2): Responds to A2S_INFO queries


Samantha 12-10-2010 07:01

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
It should defiantly block all AS2_INFO spam. This should fix the password bug, which shows that there is a password when there isn't. If your servers aren't showing that when u try to connect then it works fine :)

Afronanny 12-10-2010 12:01

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Quote:

Originally Posted by samantharp (Post 1367606)
It should defiantly block all AS2_INFO spam. This should fix the password bug, which shows that there is a password when there isn't. If your servers aren't showing that when u try to connect then it works fine :)

What did you change to make it work?

Samantha 12-10-2010 14:36

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
I didn't change anything, i just recompiled it. Could be something was outdated? because i'm using the latest version of everything to compile it.

Afronanny 12-10-2010 15:45

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
Afronanny derps again. I updated the source but never compiled it.

Samantha 12-10-2010 17:14

Re: [EXTENSION] Query Cache 1.7 (Updated!)
 
lol, at least it works now and thank you for making such a useful extension.


All times are GMT -4. The time now is 16:34.

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