The Attack

On Jan. 26, 2015, a little before 3 pm, some of the student workers working on the TE 1.0 system informed us that the system had slowed down to a trickle. A few minutes later, the systems group hosting the TE (1.0) web site informed us that both the HTTP request rate and the associated response times as well as database query times had all greatly increased. For individual users accessing the system, response times had increased so much that, as far as they were concerned, the system had halted.

Although symptoms such as these can have a variety of causes, one likely candidate is a so-called Denial of Service (DoS) attack. In a DoS attack, requests for service arrive at a server at a rate which is higher than the rate at which the requests can be served. In process management language: the arrival rate outstrips the service rate. In any capacity-constrained system (we see the same when the rate of customers arriving at a restaurant outstrips the rate at which these customers are served, or when the rate of cars arriving at a highway on-ramp outstrips the capacity of the highway to absorb these vehicles and move them along) this results in longer wait times or more precisely, queueing times. Since the requests are waiting in the queue to be served, the issuer of the request has the impression that the entire service is halted, just like the driver of a car stopped in a traffic jam on a busy road has the impression that the road is blocked and vehicles ‘requesting’ passage are not at all served. When this principle is abused and lots of requests are purposefully directed at a service in order to overwhelm its service capacity, we call it a Denial of Service (DoS) attack. If these requests are arriving from a large number of different machines, we speak of a Distributed DoS (DDoS).

As our Jan. 26th, 2015 DoS incident illustrates, however, not all DoS instances originate as targeted attacks.

Although our TeachEngineering server served a variety of protocols and hence, a possible DoS could target any of these services, we took a look at its Apache web server log to see if it would contain information about what was going on. The following is a random one-second excerpt from those logs: - - [26/Jan/2015:10:00:40 +0000] 
"GET /announce.php?info_hash= 
1&event=started HTTP/1.0" 302 587 "-" "Bittorrent" - - [26/Jan/2015:10:00:40 +0000] 
"GET /announce.php?info_hash= 
started HTTP/1.0" 302 578 "-" "Bittorrent" - - [26/Jan/2015:10:00:40 +0000] 
"GET /announce.php?info_hash=
1 HTTP/1.0" 302 575 "-" "Bittorrent" - - [26/Jan/2015:10:00:40 +0000] 
"GET /announce.php?info_hash=
1 HTTP/1.0" 302 566 "-" "Bittorrent" - - [26/Jan/2015:10:00:40 +0000] 
"GET /announce?info_hash=
1 HTTP/1.0" 302 572 "-" "Bittorrent" - - [26/Jan/2015:10:00:40 +0000] 
"GET /announce?info_hash=
1 HTTP/1.0" 302 573 "-" "Bittorrent" - - [26/Jan/2015:10:00:40 +0000] 
"GET /announce?info_hash=
1 HTTP/1.0" 302 563 "-" "Bittorrent"

The log entries are easy to parse:

IP-address_of_the_requestor – - [date and time of the request] 
/requested_file?URL_parameters HTTP_version” HTTP_response_code 
number_of_bytes_returned “-“ “User_agent”

Looking at this series of requests, things started to become clear. The machines making the requests were all based in China (you can geographically trace these IP’s at and the requests all came from a software identifying itself as BitTorrent, a well-known file-sharing protocol.

From this we concluded that somehow —most likely by accident but possibly on purpose— our TeachEngineering machine had become registered to be part of the BitTorrent file-sharing network and we were being flooded with BitTorrent requests.

Now what?

Once we concluded that the problem was caused by a flood of BitTorrent requests coming from China, we had to decide on a remedy. The easiest and most obvious course of action would have been to block all BitTorrent requests. This would probably have worked just fine, but since we did not know whether the inclusion of our IP in the BitTorrent network was accidental or purposeful, we erred on the side of caution. We guessed that if the attack was purposeful, blocking the requests might anger (or challenge) the perpetrator(s), as a result of which we might become the target of more vicious attacks. Hence, rather than blocking the requests we decided to ‘deflect’ them. We had TeachEngineering reply to the requests with an empty response; i.e., no content, but a 200 (Success) HTTP response code. Since serving these ‘null’ pages required very little effort from our server and raised the service rate considerably, this approach solved the problem for our users.

An alternative —and in hindsight perhaps preferable— strategy would have been to have the server reply with an HTTP 404 or 410 error. A 404 error signals the requester that the requested file cannot be found whereas a 410 indicates that the requested resource is no longer available.

What most likely happened

We have learned since that our TeachEngineering machine was very likely involved in an incident where Turkish and Chinese DNS servers performed a kind of DNS spoofing, a process which replaces server IP addresses with other, non-related ones. Here is the text from a Jan. 2015 blogpost by Jamie Zawinsky.

“After a bit of logging and searching I found out that some Chinese ISP (probably CERNET according to the results of and some Turkish ISP (probably TTNET) respond to dns queries such as with various IPs that have nothing to do with piratebay or torrents. In other words they seem to do some kind of DNS Cache Poisoning for some bizarre reason.

So hundreds (if not thousands) of bitTorrent clients on those countries make tons of ‘announces’ to my web servers which result pretty much in a DDoS attack filling up all Apache’s connections.

So basically, entire countries’ worth of porn hounds randomly start hammering on my server all at once, even though no BitTorrent traffic has ever passed to or from the network it’s on, because for some unknown reason, the now-long-defunct piratebay tracker sometimes resolves to my IP address. Hooray.”

TE 2.0 and DoS?

Although there is no reason to expect that TE 2.0 is less likely to be targeted by another DoS attack, either deliberately or by mistake, it does seem reasonable to expect that it being hosted in Microsoft’s Azure cloud should provide it with better, more robust protection than the 1.0 version which was hosted at the university. Without suggesting that the protection provided by a university lab or service is inherently insufficient, it stands to reason that large cloud service providers expend a lot of effort on keeping their renters safe from the vagaries of today’s Internet. Hence, it might be a good idea to host services such as TE in an environment which puts a premium on safety.


Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Tale of Two Systems 2E Copyright © 2022 by René Reitsma and Kevin Krueger is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.