Attacks
Due to the anonymity of networks and the Internet, we are seeing an increase in attacks on all types of servers. The reasons for such attacks can be attributed to anything from simple curiosity to malicious intent.
In an effort to prevent your network from becoming part of the growing number of statistics, you need to recognize when an attack is happening and take the proper steps to end it. Learning to identify which types of attacks you might be subject to and how to implement proper security to protect your environment are important functions of your position. Some of the more common attacks are listed in this section.
Denial of Service (DoS) and Distributed Denial of Service (DDoS) Attacks
The purpose of a denial of service (DoS) attack is to disrupt the resources or services that a user would expect to have access to. These types of attacks are executed by manipulating protocols and can happen without the need to be validated by the network.
Many of the tools used to produce this type of attack are readily available on the Internet. Administrators use them to test connectivity and troubleshoot problems on the network, whereas malicious users use them to cause connectivity issues.
Here are some examples of DoS attacks:
Smurf/smurfingThis attack is based on the Internet Control Message Protocol (ICMP) echo reply function. It is more commonly known as ping, which is the command-line tool used to invoke this function. In this attack, the attacker sends ping packets to the broadcast address of the network, replacing the original source address in the ping packets with the source address of the victim, thus causing a flood of traffic to be sent to the unsuspecting network device.
FraggleThis attack is similar to a Smurf attack. The difference is that it uses the User Datagram Protocol (UDP) instead of ICMP. The attacker sends spoofed UDP packets to broadcast addresses as in the Smurf attack. These UDP packets are directed to port 7 (echo) or port 19 (chargen). When connected to port 19, a character generator attack can be run. Table 3.1 lists the most commonly exploited ports.
Ping floodThis attack attempts to block service or reduce activity on a host by sending ping requests directly to the victim. A variation of this type of attack is the ping of death, in which the packet size is too large and the system doesn't know how to handle the packets.
SYN floodThis attack takes advantage of the TCP three-way handshake. The source system sends a flood of synchronization (SYN) requests and never sends the final acknowledgment (ACK), thus creating half-open TCP sessions. Because the TCP stack waits before resetting the port, the attack overflows the destination computer's connection buffer, making it impossible to service connection requests from valid users.
LandThis attack exploits a behavior in the operating systems of several versions of Windows, Unix, Macintosh OS, and Cisco IOS with respect to their TCP/IP stacks. The attacker spoofs a TCP/IP synchronization (SYN) packet to the victim system with the same source and destination IP address and the same source and destination ports. This confuses the system as it tries to respond to the packet.
TeardropThis form of attack targets a known behavior of UDP in the TCP/IP stack of some operating systems. The Teardrop attack sends fragmented UDP packets to the victim with odd offset values in subsequent packets. When the operating system attempts to rebuild the original packets from the fragments, the fragments overwrite each other, causing confusion. Because some operating systems cannot gracefully handle the error, the system will most likely crash or reboot.
BonkThis attack affects mostly Windows machines by sending corrupt UDP packets to DNS port 53. This causes confusion, and the system crashes.
BoinkThis is a Bonk attack that targets multiple ports instead of just port 53.
CAUTION
You should know the difference between the various types of attacks and the ports they are executed on.
Table 3.1 Commonly Exploited Ports
Port |
Service |
7 |
Echo |
11 |
Systat |
15 |
Netstat |
19 |
Chargen |
20 |
FTP-Data |
21 |
FTP |
22 |
SSH |
23 |
Telnet |
25 |
SMTP |
49 |
TACACS |
53 |
DNS |
80 |
HTTP |
110 |
POP3 |
111 |
Portmap |
161/162 |
SNMP |
443 |
HTTPS |
1812 |
RADIUS |
Another form of attack is a simple expansion of a DoS attack, referred to as a Distributed DoS (DDoS) attack. There is already downloadable software that allows DDoS attacks to be generated from inside the network. This will allow disgruntled or malicious users to disrupt services without any outside influence. The attacker distributes zombie software that allows the attacker partial or full control of the infected computer system. Once an attacker has enough systems compromised with the installed zombie software, he can initiate an attack against a victim from a wide variety of hosts. The attacks come in the form of the standard DoS attacks, but the effects are multiplied by the total number of zombie machines under the control of the attacker.
To help protect your network, you can set up filters on external routers to drop packets involved in these types of attacks. You should also set up another filter that denies traffic originating from the Internet that shows an internal network address. When you do this, the loss of ping and some services and utilities for testing network connectivity will be incurred, but this is a small price to pay for network protection. If the operating system allows it, you should reduce the amount of time before the reset of an unfinished TCP connection. This will make it harder to keep resources unavailable for extended periods of time.
TIP
In the case of a DDoS attack, your best weapon is to get in touch quickly with your upstream ISP and see whether it can divert traffic or block the traffic at a higher level.
Subscribing to newsgroups and checking security Web sites daily ensures that you keep up with the latest attacks and exploits. Applying the manufacturer's latest operating system patches or fixes can also help prevent attacks.
Back Door
A back door is a program that allows access to a system without using security checks. Usually programmers put back doors in programs so they can debug and change code during test deployments of software. Because many of these back doors are undocumented, they may get left in, causing security risks.
Some of the better-known software programs that can be used as back doors include the following:
Back OrificeThis is a remote administration tool that allows system administrators to control a computer from a remote location (that is, across the Internet). It is construed as a dangerous back door designed by a group called the Cult of the Dead Cow Communications. Back Orifice consists of two main pieces: a client application and a server application. The client application, running on one machine, can be used to monitor and control a second machine running the server application.
NetBusLike Back Orifice, NetBus allows a remote user to access and control a machine via the Internet. NetBus runs under the Windows NT operating system as well as Windows 95/98. NetBus also has two essential parts: a server (the part that resides on the victim's system) and a client (the application used to find and control the server). Features and functions vary, but the result is much the sameloss of privacy and security on a computer anytime it is connected to the Internet.
Sub7 (or SubSeven)This is a Windows 9X Internet backdoor Trojan similar to Back Orifice and NetBus. When it is running, anyone running the appropriate client software has unlimited access to the system while it is connected to the Internet.
NOTE
The following are legitimate products that may be installed by malicious users to cause harm:
‰ Virtual Network Computing (VNC)This is remote control software by AT&T labs that allows you to view a desktop environment from anywhere on the Internet and from a wide variety of machine architectures.
‰ PCAnywhereThis product is produced by Symantec. It is remote control software with encryption and authentication. It is used by many companies in their help desk departments for resolving user issues.
‰ Terminal ServicesThis application is used by Microsoft operating systems for remote control. It delivers the Windows desktop and applications by means of terminal emulation.
CAUTION
Back Orifice, NetBus, and Sub7 have two essential parts: a server and client. The server is the infected machine and the client is used for remote-controlling the server. These programs are known as illicit servers.
As with most utilities, the software in the preceding list can be used with good intent or maliciousness. The best ways to prevent backdoor attacks are user education and software monitoring. Users should be instructed to only download software off the Internet that has been approved by network or security administration and from approved sites. Installation and use of software such as antivirus packages can catch many of these backdoor applications, including Back Orifice, NetBus, and Sub7. Be sure your antivirus software is scheduled to download the latest virus definitions at least weekly.
Another type of back door comes in the form of a privileged user account. An existing user who already has privileges often creates the backdoor account. This account is set up to look like a normal user's account and given a high-level privilege. This allows the user or an attacker to come in under an alias. To prevent this situation, you need to set proper access so users will not have the right or privilege to alter operating system filesknow who has administrative rights. Auditing, covered in the last section of this chapter, can help detect the creation and use of backdoor accounts by tracking the creation of these accounts and their frequency of use.
Spoofing
Spoofing is making data appear to come from somewhere other than where it really originated. This is accomplished by modifying the source address of traffic or source of information. Spoofing seeks to bypass IP address filters by setting up a connection from a client and sourcing the packets with an IP address that is allowed through the filter.
Services such as email, Hypertext Transfer Protocol (HTTP), and File Transfer Protocol (FTP) can also be spoofed. Web spoofing happens when an attacker creates a convincing but false copy of an entire World Wide Web. The false Web looks just like the real one: It has all the same pages and links. However, the attacker controls the false Web so that all network traffic between the victim's browser and the Web goes through the attacker. In email spoofing, a spammer or a computer virus can forge the email packet information in an email so that it appears the email is coming from a trusted host, from one of your friends, or even from your own email address. If you leave your email address at some Internet site or exchange email with other people, a spoofer may be able to use your email address as the sender address to send spam. These forms of attacks are often used to get additional information from network users in order to complete a more aggressive attack.
As mentioned earlier, you should set up a filter that denies traffic originating from the Internet that shows an internal network address. Using the signing capabilities of certificates on servers and clients allows Web and email services to be more secure. The use of IPSec can secure transmissions between critical servers and clients. This will help prevent these types of attacks from taking place.
Man in the Middle
The man-in-the-middle attack takes place when an attacker intercepts traffic and then tricks the parties at both ends into believing that they are communicating with each other. The attacker can also choose to alter the data or merely eavesdrop and pass it along. This attack is common in Telnet and wireless technologies. It is also generally difficult to implement because of physical routing issues, TCP sequence numbers, and speed. Because the hacker has to be able to sniff both sides of the connection simultaneously, programs such as Juggernaut, T-Sight, and Hunt have been developed to help make the process easier.
If the attack is attempted on an internal network, physical access to the network will be required. Be sure that access to wiring closets and switches is restrictedif possible, the area should be locked. After you have secured the physical aspect, the services and resources that allow a system to be inserted into a session should be protected. DNS can be compromised and used to redirect the initial request for service, providing an opportunity to execute a man-in-the-middle attack. DNS access to should be restricted to read-only for everyone except the administrator. The best way to prevent these types of attacks is to use encryption and secure protocols.
CAUTION
A man-in-the-middle attack takes place when a computer intercepts traffic and either eavesdrops on the traffic or alters it.
Replay
In a replay attack, packets are captured by using sniffers. After the pertinent information is extracted, the packets are placed back on the network. This type of attack can be used to replay bank transactions or other similar types of data transfer in the hopes of replicating or changing activities, such as deposits or transfers.
Protecting yourself against replay attacks involves some type of timestamp associated with the packets or time-valued, nonrepeating serial numbers. Secure protocols such as IPSec prevent replays of data traffic in addition to providing authentication and data encryption.
TCP/IP Hijacking
Hijacking is the term used when an attack takes control of a session between the server and a client. This starts as a man-in-the-middle attack and then adds a reset request to the client. The result is that the client gets kicked off the session, while the rogue machine still communicates with the server. This commonly happens during Telnet and Web sessions where security is lacking or when session timeouts aren't configured properly.
Forcing a user to reauthenticate before allowing transactions to occur could help prevent this type of attack. Other protection mechanisms include the use of unique initial sequence numbers (ISNs) and Web session cookies.
Weak Keys
Weak keys generally denote a weak choice in the number of combinations during encryption. This is usually found in the block cipher method used in 40-bit and 56-bit encryption, whereby the messages are broken into blocks that are independent of each other.
Mathematical
A mathematical attack on an algorithm uses the mathematical properties of the algorithm to decrypt data using computations that are more efficient than guessing. They can come in the form of ciphertext-only, plaintext, or chosen plaintext attacks. These concepts are explained in greater detail in Chapter 8, "Basics of Cryptography."
The best way to avoid weak key, birthday (discussed later), and mathematical attacks is to use 128-bit encryption. Both 40-bit and 56-bit encryption have already been broken40-bit in less than four hours. Keep in mind that export laws prohibit strong encryption from being exported, resulting in many vulnerable servers.
Password Guessing
Allowing users to choose their own passwords produces an unsecure environment because users typically choose passwords that are easy-to-remember words. On the other end of the spectrum, if the passwords are too difficult to remember, users will write them down and post them on monitors, keyboards, and any number of easy-to-find places. Secure passwords should consist of uppercase and lowercase letters, numbers, and special characters. The two basic types of attacks on passwords are brute-force and dictionary attacks. Passwords can also be guessed by shoulder surfing, which is looking over a person's shoulder and watching as she types.
TIP
When allowing users to choose their own passwords, you might to have them combine the first letters and dates of important events. An example would be "My daughter Diane was born on Jan 1, 1976." The password would be MdDwbJ11976.
Brute Force
Brute force is a term used to describe a way of cracking a cryptographic key or password. It involves systematically trying every conceivable combination until a password is found, or until all possible combinations have been exhausted. The more complex the password is, the longer it takes to crack. Many programs exist that try to guess passwords or decipher password files.
Dictionary
We tend to choose passwords that have special meaning to us or relate to our everyday lives. This makes them easy to crack because they are usually found in the dictionary. A dictionary attack is the first step of a brute-force attack. This type of attack checks through known words in a dictionary data file trying to match the password.
Birthday
Birthday attacks are a type of brute-force technique that uses hash functions. It gets its name from the probability that two or more people in a group of 23 sharing the same birthday is greater than 50%.
Some of the more popular password guessing programs include:
CrackA password-cracking program designed to quickly locate insecurities in Unix (or other) password files by scanning the contents of a password file.
John the RipperA password cracker currently available for Unix, DOS, and Windows NT/95. It has its own modules for different ciphertext formats and architectures.
L0phtCrackA Windows and Unix password-auditing tool that produces user passwords from the cryptographic hashes that are stored by the operating system.
The following are measures you can use to help reduce the use of brute-force password-guessing tools:
Make the password length at least eight characters and require the use of uppercase and lowercase letters, numbers, and special characters.
Lock user accounts out after three to five failed logon attempts. This stops programs from deciphering the passwords on locked accounts.
Monitor the network for the use of questionable tools. If password files can be captured, they can be run though password-guessing programs on another machine.
CAUTION
Passwords should be at least eight characters in length and possess a combination of uppercase and lowercase letters, numbers, and special characters.
Software Exploitation
Software exploitation takes advantage of a program's flawed code. One of the most used flaws is the buffer overflow. When more data is sent to a buffer than it is able to handle, it doesn't know how to react to the extra data. Usually this crashes the system and leaves it in a state where arbitrary code can be executed or an intruder can function as an administrator.
In the case of buffer overflow, good quality assurance and secure programming practices would definitively thwart this type of attack. The most effective way to prevent an attacker from exploiting software bugs is to keep the manufacturer's latest patches and service packs applied as well as monitor the Web for newly discovered vulnerabilities.