In our support boards we aim to provide support for the B3 core in its current state. Older releases of B3 are NOT supported. Check our front page for the latest version. You may post feature requests in our General Discussion board. Modifications and Hacks of the core B3 code are NOT supported.
Before you ask for support: [ Read the Support Instructions ] - More info: [ Full Support Disclaimer ]

Pages: [1]   Go Down
  Print  
Author Topic: Important Patch for Cod4 Servers  (Read 1757 times) Bookmark and Share
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: BF3,Cod2,Cod4,Cod5,Cod6,Cod7
Posts: 257
Offline Offline
WWW
« on: August 01, 2011, 04:57:29 PM »

From Ryan C. Gordon


So we're getting reports of DDoS attacks, where botnets will send infostring queries to COD4 dedicated servers as fast as possible with spoofed addresses. They send a small UDP packet, and the server replies with a larger packet to the faked address. Multiply this by however fast you can stuff UDP packets into the server's incoming packet buffer per frame, times 7500+ public COD4 servers, and you can really bring a victim to its knees with a serious flood of unwanted packets.

I've got a patch for COD4 for this, and I need admins to test it before I make an official release.

    http://treefort.icculus.org/cod/cod4-lnxsrv-query-limit-test.tar.bz2

You'll need a server updated to 1.7 before applying this, because this is only a replacement cod4_lnxded file. The defaults for the new cvars are probably fine, but you can tweak them as you like.

If you want to see it in action, find your patched server in the in-game server browser, click "Server Info" and keep hitting refresh. If you're doing it faster than the limit, you'll see you don't get a response right away.

All this info is in README.linux
« Last Edit: August 02, 2011, 05:31:42 AM by Platanos » Logged


Moderator
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: 2x CoD4, 1x BF3
Posts: 2615
Offline Offline
Owner of Host4B3.com - Over 70 bots hosted!
WWW
« Reply #1 on: August 02, 2011, 04:27:16 AM »

Chances are, if I am renting my server from a GSP I won't be able to test this? Correct?
Logged

Need B3 Bot hosting? Check out Host4B3.com
Check Twitter.com/Host4B3 for updates if the site it down.

Help will be given to those with a b3.log

System: Python 2.7.1 - B3 Source Code - Locally hosted MySQL & Apache - Win 2k3
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: BF3,Cod2,Cod4,Cod5,Cod6,Cod7
Posts: 257
Offline Offline
WWW
« Reply #2 on: August 02, 2011, 05:31:24 AM »

I think yes but when the Patch are final GSP are updating this automaticly


About query limits:

There is a class of DDoS attack that can utilize COD4 servers to flood a third party, by spoofing UDP packets so that the game server sends its reply for information to an unsuspecting party, over and over, as fast as it can. Unlike most packets sent by the server, this reply packet does not require a player with a legitimate connection before sending.

This patch sets up some reasonable defaults to limit the rate at which the server will send these reply packets to a given IP address. It does not throttle legitimate connections in the process.

The gist is this: If someone sends a query packet, we note their IP address and ignore any further queries for X seconds. If they send a port-unreachable packet (person being spoofed isn't playing the game), we ignore their IP address for Y seconds. This will let normal people play, it prevents people that don't have a legitimate player connection from flooding the server with queries, and it'll stop DDoS attacks against third parties.

If millions of computers try to wail on a single server, this patch should handle it gracefully (we don't allocate memory when adding IP addresses to the ignore list, we use a hashtable so we don't have to check millions of IP addresses for every query, and we clean out old addresses a little each frame).

People that are connected to the server don't have their packets ignored; this only limits server responses to packets that don't need a valid player connection (like the infostring, etc). LAN addresses are never limited.

Admins can tune it (and turn it off completely) with cvars.

Note that a single IP address using different ports all get lumped into the same ignore list entry. This is to make life difficult for attackers and keep things efficient on the server. If 16 players are all behind the same NAT, they might notice it takes longer for the server to respond to each of them individually at the start. They should run a LAN server anyhow, but gameplay will still perform normally here.

Server admins have 4 cvars to control this:

sv_queryIgnoreDebug: set to 1 to log information about attacks. This will write out a lot of logging. Defaults to 0.

sv_queryIgnoreMegs: Number of megabytes we should use to store the ignore list. Set to 0 to turn off the ignore list (basically disables this patch). 1 megabyte handles about 65000 IP addresses, each megabyte after the first adds about 87000 more. 1 is probably fine unless you're under serious attack, but maybe a server wants to spare 12 megs to block a million IP addresses simultaneously.  Smiley  Defaults to 1.

sv_queryIgnoreTime: Number of milliseconds to ignore an IP address's info requests after responding to one of them. Set to 0 to not ignore at all. Defaults to 2000 (2 seconds).

sv_queryBounceIgnoreTime: Number of milliseconds to ignore an IP address's info requests after a server packet bounced with an ICMP Port Unreachable notice. Set to 0 to not ignore at all. Defaults to 12000 (2 _minutes_).

*******


Please note that I haven't touched this code since 2008, so even though the changes are relatively localized, don't blast this out to all your servers until you feel it's stable.

Please give me feedback!

Thanks,
--ryan.
Logged

Jr. Member
**
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 12
Offline Offline
« Reply #3 on: November 22, 2011, 05:06:10 AM »

Anyone has collected som experience with that ?
It seems like I really need that as I get constantly attacked last days with this method.
High outbound traffic and high serverload on the affected gameserver.

Much more complicated is it's use for me that I have made own modifications on my cod4_lnxded file.
Logged
Sr. Member
****
OS: Linux
Type: Owner dedicated server(s)
Gameservers: COD2, COD4, COD5WaW, Homefront
Posts: 173
Offline Offline
« Reply #4 on: December 22, 2011, 10:06:01 AM »

just for my interest: which modifications have you made?
Logged
Jr. Member
**
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 12
Offline Offline
« Reply #5 on: January 19, 2012, 03:26:18 AM »

just for my interest: which modifications have you made?
I think to remember it was the following functionallity:
1. Filedownload-Filtering (allows only .ff and .iwd files and no traversing)
2. Removed the loading protection for .gsc-files packed into .iwd files while not running any mod. So serverside modifications of the basegame became possible.
3. The possibility to load a file which contains a list of allowed GUIDs of players who can join the server without providing a valid cd-key.
4. Removed the mod-flag in info-query-requests, so that the modded servers got listed althought the player used thr default-setting: Mods : No

That was all what I remember so far. The implementation of 3. was the one which took most effort.

Anyway I have got most of this features back to the new version or have replaced them with other ones and added more. Far easier with loading a dl-file instead doing a lot crazy assembler modifications inside the file self.
Logged
Jr. Member
**
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CODBO, BF3
Posts: 19
Offline Offline
WWW
« Reply #6 on: February 05, 2012, 04:12:33 AM »

Hi mates,

I restarted my server with patch 1.7.1
This is my console.log !!
Is it normal ? These lines are showing DDoS attack ?

Code:
.....Resolving cod4master.activision.com
cod4master.activision.com resolved to 63.146.124.21:20810
QUERY LIMIT: (300) Allowing query from 178.238.134.3
QUERY LIMIT: (300) Allowing query from 209.237.40.164
QUERY LIMIT: (300) Allowing query from 63.141.132.112
QUERY LIMIT: (300) Allowing query from 209.237.40.163
QUERY LIMIT: (300) Allowing query from 80.67.13.23
QUERY LIMIT: (300) Blocking query from 80.67.13.23
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Blocking query from 178.238.134.3
QUERY LIMIT: (300) Blocking query from 209.237.40.164
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Blocking query from 80.67.13.23
QUERY LIMIT: (300) Allowing query from 178.63.65.183
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Allowing query from 62.16.217.149
QUERY LIMIT: (300) Blocking query from 80.67.13.23
QUERY LIMIT: (300) Blocking query from 178.63.65.183
QUERY LIMIT: (300) Blocking query from 178.63.65.183
QUERY LIMIT: (300) Blocking query from 209.237.40.164
QUERY LIMIT: (300) Blocking query from 80.67.13.23
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Blocking query from 209.237.40.163
etc etc ....
X4, paintball and SW mods work with the patch.
Logged

Jr. Member
**
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD4
Posts: 12
Offline Offline
« Reply #7 on: February 06, 2012, 01:17:08 AM »

Hi mates,

I restarted my server with patch 1.7.1
This is my console.log !!
Is it normal ? These lines are showing DDoS attack ?

Code:
.....Resolving cod4master.activision.com
cod4master.activision.com resolved to 63.146.124.21:20810
QUERY LIMIT: (300) Allowing query from 178.238.134.3
QUERY LIMIT: (300) Allowing query from 209.237.40.164
QUERY LIMIT: (300) Allowing query from 63.141.132.112
QUERY LIMIT: (300) Allowing query from 209.237.40.163
QUERY LIMIT: (300) Allowing query from 80.67.13.23
QUERY LIMIT: (300) Blocking query from 80.67.13.23
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Blocking query from 178.238.134.3
QUERY LIMIT: (300) Blocking query from 209.237.40.164
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Blocking query from 80.67.13.23
QUERY LIMIT: (300) Allowing query from 178.63.65.183
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Allowing query from 62.16.217.149
QUERY LIMIT: (300) Blocking query from 80.67.13.23
QUERY LIMIT: (300) Blocking query from 178.63.65.183
QUERY LIMIT: (300) Blocking query from 178.63.65.183
QUERY LIMIT: (300) Blocking query from 209.237.40.164
QUERY LIMIT: (300) Blocking query from 80.67.13.23
QUERY LIMIT: (300) Blocking query from 63.141.132.112
QUERY LIMIT: (300) Blocking query from 209.237.40.163
etc etc ....
X4, paintball and SW mods work with the patch.

Seems like debugging is on. Usually you don't get this messages. There where some cvars and one turns debbuging on as far as I remember. I use the default settings.
Logged
Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal