<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="-1"><font face="Verdana">Tried it in production: too
        many issues with the default settings... HLSW was appearing
        constatly red :(<br>
        <br>
        Can the cvars like </font></font>sv_queryIgnoreMegs be changed
    on runtime via rcon or server.cfg?<br>
    <br>
    Is there a way to set a whitelist?<br>
    <br>
    We are running some bots that manage the servers and do cleanup
    things when they are left empty... with this patch enabled servers
    we constantly appearing offline (forced restart!) or without users
    (automatic restart, logs cleanup and so on)... this was causing a
    lot of problems...<br>
    <br>
    Il 01/08/2011 22:54, Ryan C. Gordon ha scritto:
    <blockquote cite="mid:4E37129C.8030304@icculus.org" type="cite">
      <br>
      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.
      <br>
      <br>
      I've got a patch for COD4 for this, and I need admins to test it
      before I make an official release.
      <br>
      <br>
      &nbsp;&nbsp;
      <a class="moz-txt-link-freetext" href="http://treefort.icculus.org/cod/cod4-lnxsrv-query-limit-test.tar.bz2">http://treefort.icculus.org/cod/cod4-lnxsrv-query-limit-test.tar.bz2</a>
      <br>
      <br>
      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.
      <br>
      <br>
      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.
      <br>
      <br>
      All this info is in README.linux in that tarball, but I'll post it
      here, too:
      <br>
      <br>
      *******
      <br>
      <br>
      About query limits:
      <br>
      <br>
      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.
      <br>
      <br>
      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.
      <br>
      <br>
      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.
      <br>
      <br>
      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).
      <br>
      <br>
      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.
      <br>
      <br>
      Admins can tune it (and turn it off completely) with cvars.
      <br>
      <br>
      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.
      <br>
      <br>
      Server admins have 4 cvars to control this:
      <br>
      <br>
      sv_queryIgnoreDebug: set to 1 to log information about attacks.
      This will write out a lot of logging. Defaults to 0.
      <br>
      <br>
      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.&nbsp;
      :)&nbsp; Defaults to 1.
      <br>
      <br>
      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).
      <br>
      <br>
      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_).
      <br>
      <br>
      *******
      <br>
      <br>
      <br>
      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.
      <br>
      <br>
      Please give me feedback!
      <br>
      <br>
      Thanks,
      <br>
      --ryan.
      <br>
      <br>
      <br>
      _______________________________________________
      <br>
      cod mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:cod@icculus.org">cod@icculus.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://icculus.org/mailman/listinfo/cod">http://icculus.org/mailman/listinfo/cod</a>
      <br>
    </blockquote>
  </body>
</html>