TFN2K An Analysis
Jason Barlow and Woody Thrower
Abstract
This document is a technical analysis of the Tribe Flood Network 2000 (TFN2K) distributed denial-of-service (DDoS) attack tool, the successor to the original TFN Trojan by Mixter. Additionally, countermeasures for this attack are also covered. This document assumes a basic understanding of DDoS attacks. Analyses of related DDoS attack tools such as Stacheldraht and Trin00 are not presented here. For information about DDoS attacks and TFN2Ks cousins, please refer to the following documents:
http://www2.axent.com/swat/News/ddos-explanation.htm
http://staff.washington.edu/dittrich/misc/trinoo.analysis
http://staff.washington.edu/dittrich/misc/tfn.analysis
http://staff.washington.edu/dittrich/misc/stacheldraht.analysis
http://packetstorm.securify.com/distributed
http://www.cert.org/advisories/CA-2000-01.html
http://www.cert.org/advisories/CA-99-17-denial-of-service-tools.html
http://www.cert.org/advisories/CA-98-13-tcp-denial-of-service.html
http://www.cert.org/incident_notes/IN-99-07.html
http://www.sans.org/y2k/solaris.htm
http://www.fbi.gov/nipc/trinoo.htm
http://www.fbi.gov/pressrm/pressrel/pressrel99/prtrinoo.htm
Terminology
The terminology used in DDoS analyses is often confusing. For clarity, we use the following:
Client an application that can be used to initiate attacks by sending commands to other components (see below).
Daemon a process running on an agent (see below), responsible for receiving and carrying out commands issued by a client.
Master a host running a client
Agent a host running a daemon
Target the victim (a host or network) of a distributed attack
Overview - What is TFN2K?
TFN2K allows masters to exploit the resources of a number of agents in order to coordinate an attack against one or more designated targets. Currently, UNIX, Solaris, and Windows NT platforms that are connected to the Internet, directly or indirectly, are susceptible to this attack. However, the tool could easily be ported to additional platforms.
TFN2K is a two-component system: a command driven client on the master and a daemon process operating on an agent. The master instructs its agents to attack a list of designated targets. The agents respond by flooding the targets with a barrage of packets. Multiple agents, coordinated by the master, can work in tandem during this attack to disrupt access to the target. Master-to-agent communications are encrypted, and may be intermixed with any number of decoy packets. Both master-to-agent communications and the attacks themselves can be sent via randomized TCP, UDP, and ICMP packets. Additionally, the master can falsify its IP address (spoof). These facts significantly complicate development of effective and efficient countermeasures for TFN2K.
TFN2K The Facts
Detecting TFN2K The Signature
All control communications are unidirectional, making TFN2K extremely problematic to detect by active means. Because it uses TCP, UDP, and ICMP packets that are randomized and encrypted, packet filtering and other passive countermeasures become impractical and inefficient. Decoy packets also complicate attempts to track down other agents participating in the denial-of-service network.
Fortunately, there are weaknesses. In what appears to be an oversight (or a bug), the Base 64 encoding (which occurs after encryption) leaves a telltale fingerprint at the end of every TFN2K packet (independent of protocol and encryption algorithm). We suspect it was the intent of the author to create variability in the length of each packet by padding with one to sixteen zeroes. Base 64 encoding of the data translates this sequence of trailing zeros into a sequence of 0x41s (A). The actual count of 0x41s appearing at the end of the packet will vary, but there will always be at least one. The padding algorithm is somewhat obscure (but predictable) and beyond the scope of this document. However, the presence of this fingerprint has been validated both in theory and through empirical data gathered by dumping an assortment of command packets.
A simple scan for the files tfn (the client) and td (the daemon) may also reveal the presence of TFN2K. However, these files are likely to be renamed when appearing in the wild. In addition to this, both client and daemon contain a number of strings that can be found using virus scanning methods. Below is a partial list of some of the strings (or sub-strings) appearing in TFN2K:
NOTE: Scanners should look for pattern combinations unlikely to appear in legitimate software.
TFN2K Client (tfn)
[1;34musage: %s <options>TFN2K Daemon (td)
fork* Unix and Solaris systems only ** Windows NT systems only *** This text is likely to have been changed in many TFN2K installations
TFN2K Daemon and Client (tfn and td)
security_through_obscurity ** This is a function whose definition is generated at compile time. This is a strong (and probably unique) signature. ** This byte pattern is present in both client and daemon, and represents the first eight bytes in the CAST-256 encryption table (assumes little-endian byte ordering). *** A contiguous 128-byte sequence of 0x64 values reveals the presence of the static table used in the Base 64 decoding algorithm.
Defeating TFN2K A Strategy
There is no known way to defend against TFN2K denial-of-service attacks. The most effective countermeasure is to prevent your own network resources from being used as clients or agents.
Prevention
Detection
Response
Once TFN2K has been identified on a host system, it is imperative that the authorities be notified immediately so that the perpetrators can be traced. Because a TFN2K daemon does not acknowledge the commands it receives, it is likely the client will continue to transmit packets to the agent system. Additionally, a hacker observing the absence of flood activity, may attempt to reestablish direct contact with the agent system to determine the nature of the problem. In either case, the communication can be traced.
TFN2K is traceable but requires a timely response on the part of the victim. If you believe you have been the victim of TFN2K or any other DDoS attack, please contact your local FBI office.
http://www.fbi.gov/contact/fo/fo.htm
Summary
TFN2K and other DDoS attack signatures are under continuous investigation by Axent Technologies. As more information becomes available, this document will be updated.
Contact Information
If you have questions or comments regarding this article or other security developments, send e-mail to
securityteam@axent.com.
Copyright © 2000 Axent Technologies All Rights Reserved