Author Topic: DDoSing xat.com with Tremulous servers - wtf?  (Read 10702 times)

rotacak

  • Posts: 761
  • Turrets: +39/-64
DDoSing xat.com with Tremulous servers - wtf?
« on: January 11, 2012, 09:06:45 pm »
Today was my VPS server with Tremulous servers 1.1 and 1.2 disconnected from internet by my hosting company. They informed me and forwarded me email, from xat.com:

Quote
Your IP 46.28.108.190 attacked xat.com with udp packets as part of a
co-ordinated DDOS attack.

If you are running a game server this may be useful:
There is a known exploit with the "quake engine" used by various FPS type
games.
Your server may be being used for a Distributed Reflection Denial of
Service attack. eg:
- Attacker spoofs some packets (with our server ip) and asks gameserver to
send all server information (about 2k of data)
- gameserver sends all server information (500k of data)
- Attacker repeats for thousands of gameservers

If you are running a DNS server it may be being used for a reflection
attack. This may be useful:
http://www.shortestpathfirst.net/2009/11/12/hardening-dns-against-reflection-attacks-and-flooding-attacks/
Please contact me to confirm that you have addressed this matter and that
action will be taken against your customer/compromised machine and this
server will be taken down to prevent a repeat of this illegal activity.

With google is possible to find few similar things:
Quote
Your IP 46.182.120.203 attacked wrestlinghub with udp packets as part of a
co-ordinated DDOS attack.

Estimated bandwidth: 426 Mb/s

I need you to contact me to confirm that you have addressed this matter and
that action will be taken against your customer/compromised machine and this
server will be taken down to prevent a repeat of this illegal activity.

I look forward to hearing from you as a matter of urgency.

Richard
xat.com

Quote
Your IP 188.138.116.207 attacked xat.com with udp packets as part of a
co-ordinated DDOS attack.

Estimated bandwidth: 4 Mb/s

We got this from another host and it might prove useful:
"After investigation we found out that the attacker exploited a
vulnerability in the Call of Duty 2 server code, which is , as of now still
not patched by Acitivision. We're looking into filtering this specific type
of traffic outgoing
untill the developers come up with a fix

It is even possible? Attack should be from 1.1 server (Lakitu 5.5), but it is weird that anybody from xat.com will be contacting every attacking server and moreover that he will be "investigating" that problem with results "quake engine and call of duty 2 servers have nonpatched exploits". Sending 500KB of data is weird too.

Any ideas what the hell it is this?

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #1 on: January 11, 2012, 10:54:19 pm »
The best way to mitigate it is to set iptables to rate limit getstatus / getinfo requests.

Something like:
Code: [Select]
iptables -N limit
iptables -A INPUT -p udp --dport 30720 -m string --from 25 --to 32 --string getstatus --algo bm -J limit
iptables -A INPUT -p udp --dport 30720 -m string --from 25 --to 30 --string getinfo --algo bm -J limit
iptables -A limit -m limit --limit 1/s --limit-burst 3 -j RETURN
iptables -A limit -j DROP

The 500KB figure is bullshit. 1-2KB is more realistic per packet.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

kharnov

  • Spam Killer
  • *
  • Posts: 626
  • Turrets: +47/-791
    • Unvanquished
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #2 on: January 11, 2012, 11:07:33 pm »
Quote
DDoSing

Meisseeelliiiiiiiii! >:(

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #3 on: January 12, 2012, 12:40:44 pm »
Code: [Select]
iptables -A INPUT -p udp --dport 30720 -m string --from 25 --to 32 --string getstatus --algo bm -J limit
that won't work if someone adds some amount of whitespace in between the OOB bytes and the getstatus text.
The 500KB figure is bullshit. 1-2KB is more realistic per packet.
a 400-byte reply packet (or 500-byte packet on a non-empty server) is realistic for a 13-byte getstatus request packet. this translates to 63KiB (or 79KiB) of attack sp4m for the said 2KiB worth of requests.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #4 on: January 12, 2012, 06:20:20 pm »
I misread it as them saying one packet was 500k.

Does it work with leading space?  Could change it to limit outbound packets, but I'm not sure if limit can do it on dest address.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #5 on: January 12, 2012, 09:47:01 pm »
Does it work with leading space?
and not only that! here's a shiny test:
Code: [Select]
#!/bin/sh
printf '\377\377\377\377  \t "GEtStATuS' | nc -u 127.0.0.1 30720

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #6 on: January 12, 2012, 10:28:39 pm »
After reading the docs, what we want is probably:
Code: [Select]
iptables -N limit
iptables -A OUTPUT -p udp --sport 30720 -m string --from 25 --to 40 --string getstatusResponse --algo bm -J limit
iptables -A OUTPUT -p udp --sport 30720 -m string --from 25 --to 38 --string getinfoResponse --algo bm -J limit
iptables -A limit -m hashlimit --hashlimit 1/s --hashlimit-burst 5 --hashlimit-mode dstip,srcip,srcport --hashlimit-name trem -j RETURN
iptables -A limit -j DROP
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Little*Butterfly

  • Posts: 19
  • Turrets: +0/-1
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #7 on: January 13, 2012, 06:37:35 am »
Two days ago, I brought up this subject on the MG IRC chat. I'm told there is a patch that will limit the number of getstatus responses sent in n-seconds to a client. I hope this makes it by default in tremulous 1.2 and is available soon for 1.1

RAKninja-Decepticon

  • Posts: 843
  • Turrets: +14/-679
    • Stupid Videos
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #8 on: January 13, 2012, 04:32:10 pm »
Two days ago, I brought up this subject on the MG IRC chat. I'm told there is a patch that will limit the number of getstatus responses sent in n-seconds to a client. I hope this makes it by default in tremulous 1.2 and is available soon for 1.1
but what to do till 1.2?  i mean, we've got another 3-4 years of development to wait out.
Note 4: The best, although not always easiest, way to deal with trolls is thus: do not respond at ALL in the thread.
Main Rules
4.) No spamming or advertising (includes useless multi-posts and bumps.)
6b.) Do NOT harass other members.
  6c.) Do NOT troll!

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #9 on: January 13, 2012, 11:43:21 pm »
but what to do till 1.2?
use recent GPP or GPP-based binaries.

RAKninja-Decepticon

  • Posts: 843
  • Turrets: +14/-679
    • Stupid Videos
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #10 on: January 14, 2012, 01:35:46 am »
but what to do till 1.2?
use recent GPP or GPP-based binaries.
do they have the patch included by default?

*hint, hint*
Note 4: The best, although not always easiest, way to deal with trolls is thus: do not respond at ALL in the thread.
Main Rules
4.) No spamming or advertising (includes useless multi-posts and bumps.)
6b.) Do NOT harass other members.
  6c.) Do NOT troll!

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #11 on: January 14, 2012, 05:17:26 am »
use recent GPP or GPP-based binaries.
do they have the patch included by default?
no, but it is not true that
we've got another 3-4 years of development to wait out.

RAKninja-Decepticon

  • Posts: 843
  • Turrets: +14/-679
    • Stupid Videos
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #12 on: January 14, 2012, 09:33:28 am »
i know, was just making a (played out) joke.

but seriously, we might want to get that patch added and update the binaries asap.
Note 4: The best, although not always easiest, way to deal with trolls is thus: do not respond at ALL in the thread.
Main Rules
4.) No spamming or advertising (includes useless multi-posts and bumps.)
6b.) Do NOT harass other members.
  6c.) Do NOT troll!

Qrntz

  • Posts: 847
  • Turrets: +204/-12
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #13 on: January 14, 2012, 04:52:00 pm »

You make up Qrntz, u always angry, just calmdown. :police:
I am stupid idiot who dares to open mouth and start debating

RAKninja-Decepticon

  • Posts: 843
  • Turrets: +14/-679
    • Stupid Videos
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #14 on: January 14, 2012, 05:48:17 pm »
well, someone.  i would patch and compile them myself, but i dont have any development libraries installed on this machine.

so i'll be cheering for the brave soul who takes this task on.
Note 4: The best, although not always easiest, way to deal with trolls is thus: do not respond at ALL in the thread.
Main Rules
4.) No spamming or advertising (includes useless multi-posts and bumps.)
6b.) Do NOT harass other members.
  6c.) Do NOT troll!

CreatureofHell

  • Posts: 2422
  • Turrets: +430/-126
    • Tremtopia
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #15 on: January 14, 2012, 11:33:25 pm »
I would like to point out that either someone has already solved this problem or never will.
{NoS}StalKer
Quote
<Timbo> posting on the trem forums rarely results in anything good

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Re: DDoSing xat.com with Tremulous servers - wtf?
« Reply #16 on: January 16, 2012, 06:06:13 pm »
ioQuake3/Tremulous already has a packet limiter exactly for the relevant purposes. unfortunately, it is applied only for getstatus requests, but not getinfo requests. here's an example patch to fix that (includes a bit of my limiting preferences):
Code: [Select]
--- a/src/server/sv_main.c
+++ b/src/server/sv_main.c
@@ -566,6 +566,8 @@ static qboolean SVC_RateLimitAddress( netadr_t from, int burst, int period ) {
  return SVC_RateLimit( bucket, burst, period );
 }
 
+static leakyBucket_t outboundLeakyBucket;
+
 /*
 ================
 SVC_Status
@@ -584,10 +586,9 @@ static void SVC_Status( netadr_t from ) {
  int statusLength;
  int playerLength;
  char infostring[MAX_INFO_STRING];
- static leakyBucket_t bucket;
 
  // Prevent using getstatus as an amplifier
- if ( SVC_RateLimitAddress( from, 10, 1000 ) ) {
+ if ( SVC_RateLimitAddress( from, 10, 2000 ) ) {
  Com_DPrintf( "SVC_Status: rate limit from %s exceeded, dropping request\n",
  NET_AdrToString( from ) );
  return;
@@ -595,7 +596,7 @@ static void SVC_Status( netadr_t from ) {
 
  // Allow getstatus to be DoSed relatively easily, but prevent
  // excess outbound bandwidth usage when being flooded inbound
- if ( SVC_RateLimit( &bucket, 10, 100 ) ) {
+ if ( SVC_RateLimit( &outboundLeakyBucket, 20, 100 ) ) {
  Com_DPrintf( "SVC_Status: rate limit exceeded, dropping request\n" );
  return;
  }
@@ -640,6 +641,20 @@ void SVC_Info( netadr_t from ) {
  char *gamedir;
  char infostring[MAX_INFO_STRING];
 
+ // Prevent using getinfo as an amplifier
+ if ( SVC_RateLimitAddress( from, 10, 2000 ) ) {
+ Com_DPrintf( "SVC_Info: rate limit from %s exceeded, dropping request\n",
+ NET_AdrToString( from ) );
+ return;
+ }
+
+ // Allow getinfo to be DoSed relatively easily, but prevent
+ // excess outbound bandwidth usage when being flooded inbound
+ if ( SVC_RateLimit( &outboundLeakyBucket, 20, 100 ) ) {
+ Com_DPrintf( "SVC_Info: rate limit exceeded, dropping request\n" );
+ return;
+ }
+
  /*
  * Check whether Cmd_Argv(1) has a sane length. This was not done in the original Quake3 version which led
  * to the Infostring bug discovered by Luigi Auriemma. See http://aluigi.altervista.org/ for the advisory.
« Last Edit: January 16, 2012, 06:09:49 pm by /dev/humancontroller »