ABSTRACT

Security is big issue in a computing world and more professionals and business and government seeking for further security to safeguard and protect their secret and critical data from falling into evil hands. Now people are security concerned as we have seen lot of cracking of computer, exploiting of program in past decade. Confidentiality, Integrity and Authentication are the top priority in security world. My aim in this thesis is to show how an Intrusion Detection System (IDS) can be handy in detection of network and computer attacks.

Intrusion Detection System detects the attacks, notifies and logs the attack for later review. To stop the attack it is necessary to know what type of attack has been done against us and then stopping it from happening. By analyzing IDS architecture and techniques to know what would be a best option for a particular network. To show how intrusion could be detected I'll use snort as my IDS.

INTRODUCTION

An attack is defined as "an assault on system security that derives from an intelligent threat, i.e., an intelligent act that is a deliberate attempt (especially in the sense of a method or technique) to evade security services and violate the security policy of a system". [65]

When people made the computer they never thought about the security, the threats that could bring your computer perhaps whole network can come down because lack of the security in them. Now security is a big issue in computing world all enterprise wants to protect their critical data from falling in evil hands which could bring enterprise to disaster. We are now facing many threats to network security it could be anything from hijacking the critical data to exposing all the secrets to the enterprise rivals, denial of service and so on. I would be discussing what and how attack could be done against network and computer after reviewing all those attack suggesting prevention from them.

First starting from the TCP/IP because almost every network is built on this technology and without knowing TCP/IP one could not understand how to secure and prevent from those deadly attacks made by so called black hat Hacker and Cracker. TCP is a connection-oriented, end-to-end reliable protocol designed to fit into a layered hierarchy of protocols which support multi-network applications. The TCP provides for reliable inter-process communication between pairs of processes in host computers attached to distinct but interconnected computer communication networks. [2] TCP is responsible for safe transmission of the data from one end to another, it detect the error in the packet like there is no loss of packet and all packet are received if not then it will request to send it again. IP (Internet Protocol) work like a post man its job is to deliver packet from one computer to another, one network to another. The internet protocol provides for transmitting blocks of data called datagrams from sources to destinations, where sources and destinations are hosts identified by fixed length addresses. The internet protocol also provides for fragmentation and reassembly of long datagrams, if necessary, for transmission through "small packet" networks. [7]

After that I would be discussing how one could attack the network or a particular computer on a network. What they need to know before they launch an attack of any kind on the system. Initial study is very necessary to know how victim network is and what vulnerable service he/she running on their system. To make a perfect attack, attacker make sure he/she knows everything about the victim else they could end up with nothing. Through several techniques it can be discoverable how weak is the victim security policies are and I would be talking about what are necessary steps to take and gather all the important information needed before launching an impressive attack.

In my second chapter I'll go through the computer and network attacks to gain the knowledge how different attack works and how they can be disaster for victim. I would be researching on what are the common methods of attack and how hacker and cracker use those methods to be successful in their mission. The idea is to uncover the techniques and tools of the cracker and how hacker exploits the programs in the system.

Third chapter covers about intrusion detection system, what they are, what they used for, what their architectures are and how it can be useful to detect those deadly attack on network or just on a single computer (Server). Basically the idea behind this technology is to detect the attack, what the source is it coming from and taking measurements according to that like refusing the packets, disconnecting the session or sometime may take aggressive steps toward the source (Attacker). According to the definition of Intrusion detection is "A security service that monitors and analyzes system events for the purpose of finding, and providing real-time or near real-time warning of, attempts to access system resources in an unauthorized manner". [65]

Fourth chapter include discussion about snort is one of the intrusion detection system (IDS) and I would be analyzing how snort prevent those malicious attack to happen. By describing what methodologies and pattern it takes to know the type of the attack and then giving appropriate response to it.

Fifth chapter is all about how I implemented snort on my network/computer. The resources I have used to successfully deploy the sensor to detect the attacks.

Sixth chapter is emphasizing on other tool and techniques available to protect the network and computer from malicious code and attack. To strengthen the network or individual computer we definitely need to take some extra measurement like deploying of firewall, packet filters, Intrusion Prevention System (IPS), Honeynet and etc because IDS is not enough to keep the intruder out from the network.

INITIAL STEPS FOR LAUNCHING ATTACK

Computer security is a growing problem this can be known by the real fact provided by Computer Emergency Response Team or CERT that in 1988 only 6 incidents reported and in the last year 2003, 137,529 incidents reported and again starting from 1995, 171 vulnerabilities were reported going further in 2003 to 3,784 which makes total of 319,992 incidents from 1988 to 2003 and 12,946 vulnerabilities from 1995 to 2003 in total. [1] Below Table 1.1 show the number of incident and vulnerabilities since 1988 to 2003.

Vulnerability is "a flaw or weakness in a system's design, implementation, or operation and management that could be exploited to violate the system's security policy". [65]

An incident is "a security event that involves a security violation. In other words, a security-relevant system event in which the system's security policy is disobeyed or otherwise breached". [65]

Years

988

989

990

991

992

993

994

995

996

Incidents

6

32

252

406

773

,334

2,340

2,412

2,573

Vulnerabilities

71

345

Years

997

998

999

2000

2001

2002

2003

Incidents

2,134

3,734

9,859

21,756

52,658

82,094

37,529

Vulnerabilities

311

262

417

,090

2,437

4,129

3,784

Table 1.1 - Number of Incidents and vulnerabilities. [1]

Aiming for a better understanding of the subject it is extremely important to know what TCP/IP is. I start with the overview of the TCP/IP and how these two protocol works.

.1 TCP/IP Overview

The TCP/IP protocol suite allows computers of all sizes, from many different computer vendors, running totally different operating systems, to communicate with each other. Created during a project funded by DoD (Department of Defense) in 1969, Network is now called Defense Advanced Research Projects Agency (DARPA). The transmission Control Protocol (TCP) is intended for use as a highly reliable host to host protocol between hosts in packet-switched computer communication networks, and in interconnected systems of such networks. [2]

Figure 1.1 - Relationship of the Internet Protocol Suite to the OSI Reference Model [3]

.2 Flow of Data

On application level message is generated by the programs like FTP, Telnet etc, message is passed down the stack to transport layer which is TCP, here information added in front of the data is called header, and includes critical information for the layer to get its job done like about where on the destination machine the packet should go. This header is kind of like an envelope for the data, the resulting header and data element is called TCP segment. The TCP segment gets passed to the Network layer, where another header is added. The Network layer will prepend information about the source and destination address in the IP header that is added to the packet. The resulting packet is called an IP datagram. This is sent to the Data Link where ARP (Address Resolution Protocol) is used to translate IP addresses to Ethernet addresses. The translation is done only for outgoing IP packets, because this is when the IP header and the Ethernet header are created. Now we have a frame which can be transmitted across the link. Upon receiving the data, the destination system opens all the headers, layer by layer. [4]

Figure 1.2 - Adding headers (and a trailer) to move data through the communications stack and across the network.

.3 Transmission Control Protocol (TCP)

TCP is a connection-oriented transport protocol that sends data as an unstructured stream of bytes. By using sequence numbers and acknowledgement messages, TCP can provide a sending node with delivery information about packets transmitted to a destination node. Where data has been lost in transmit from source to destination, TCP can retransmit the data until either a timeout condition is reached or until successful delivery has been achieved. TCP can also recognize duplicate messages and will discard them appropriately. If the sending computer is transmitting too fast for the receiving end, TCP can employ flow control mechanisms to slow data transfer. TCP can also communicate delivery information to the upper-layer protocols and applications it supports. [3]

Many applications use TCP for instance FTP, Telnet, HTTP, SMTP, POP and many others. Each of these applications generates packets and passes them to the TCP/IP stack of the local machine. The TCP layer software on the system takes this data and creates TCP packet by placing a TCP header at the front of each packet. The TCP header format is shown in figure below.

Figure 1.3 - The TCP Header [3]

.3.1 Explanation of TCP Header

The header of every TCP packet includes two port numbers: a source port and a destination port. These 16 bit numbers are like little doors on the system where data can be sent out or received. Sequence numbers are used to provide reliability, ordering, protection from duplicates, if retransmission is asked. The acknowledgement number is used in the acknowledgements returned by recipient, to indicate which segment is being acknowledged. Data offset describes where in the TCP packet the header ends and the data starts. It is equal to the length of the TCP header in 32 bit words. Reserved field was reserved for future use. The importance of the TCP control bits becomes obvious when we analyze how sessions are initiated in TCP. All legitimate TCP connections are established using a three-way handshake, a fundamental tool used by TCP to get its job done. Window field is used to control the number of outstanding packets sent between systems. It makes sure every packet is received properly and acknowledge appropriately before new packets are sent. Checksum is used to verify that the TCP packet was not corrupted in its journey across the network. Urgent pointer has a pointer into the data of the packet to indicate where urgent information is located. Option field indicates additional information about the TCP processing capabilities of either side of the connection. For example, if a TCP layer can handle only TCP packets of a given maximum size, the system can indicate this limitation in the TCP Option. Padding filed put enough zero bits to extend the length of the TCP header so that o tens on a 32 bit boundary. [6]

.3.2 Establishing TCP Connection

. Suppose Alice has some data to send to Bob. Alice start the three-way handshake to establish a TCP connection by sending a packet with the SYN code bit set to one and with sequence number set to some initial value, known as initial sequence number.

2. Bob sends back a single packet with both the ACK and SYN code bits set. Bob acknowledge Initial sequence number ISN(A) and ask Alice to Synchronize with ISN(B).

3. Upon receiving Bob's response, Alice will complete the three-way handshake by sending a packet with the ACK code bit set, and an Acknowledgement to ISN(B).

Figure 1.4 - The TCP three-way handshake [11]

.3.3 Closing TCP Connection

As ACK and SYN code bits is used to establish a session, the FIN code bit is used tear down a session. Each side sends a packet with the FIN code bit set to indicate the session should be ended. The RST code bit is used to stop connections and free up the sequence numbers in use. The PSH code bit means that the TCP layer should flush the packet through the stack quickly, doesn't need to queue it up for later delivery.

.4 Internet Protocol (IP)

IP is the primary layer 3 protocol in the Internet suite. In addition to internetworking routing, IP provides error reporting and fragmentation and reassembly of information units called datagrams for transmission over networks with different maximum data unit sizes. [3]

The two major services that the internet protocol layer provides are addressing (to deliver messages from one host to another host) and fragmentation (to move messages through networks that have differing packet sizes). [5] When message is passed from transport layer to network layer another header is added in front of the TCP header which is called IP Header. Below is the diagram of IP header.

Figure 1.5 - IP Header [7].

.4.1 Explanation of IP Header

In the Internet Protocol header, the version field describes which version of the internet protocol is in use. IHL field tells the total length of the IP header. The Type of Service field indicates the quality of service desired during the transmission of this message through the internet system. Priority messages can be given special treatment by network facilities if so indicated via the Type of Service field. In Total Length field, the total length of the IP packet is identified, including the IP header and its data. Identification field is used to distinguish from other packet, its support fragment reassembly. The Flags field indicates whether this message if fragmented and whether this is the last message fragment. The Fragment Offset field is used to rebuild the full message once all the fragments have been collected at the destination host. Time to Live is used to indicate the maximum number of router to router hops the packet should take as it crosses the network. Protocol filed describes the protocol that is being carried by this IP packet. It is often set to value corresponding to TCP or UDP. The Header Checksum is used to make sure the header does not get corrupted. It is recalculated at each router hop. The Source Address and Destination Address fields indicate where the packet is coming from and where the packet is going to respectively. The Options field specifies routing option like it tells what route to take through the network and sometime it records the routing. Padding field is used to fill out the remaining bits in IP header to complete 32 bit packet.

.4.2 IP Addressing

IP addresses identify a particular machine on the network, and are 32 bits on length. Each host in a network must have a unique address assigned to it in order for message to be uniquely sent to a particular host. IP addresses are usually written in dotted-quad notation. Dotted-quad notation lists each of four eight-bit bundles of the IP address as a number between 0 and 255, resulting in an IP address of the form w.x.y.z, such as 10.21.41.3.

Internet addresses are divided into several classes, each of which is illustrated in figure below.

Class A network: binary address start with 0, therefore the decimal number can be anywhere from 1 to 126. The first 8 bits (the first octet) identify the network and the remaining 24 bits indicate the host within the network.

Class B Network: binary addresses start with 10, therefore the decimal number can be anywhere from 128 to 191. The first 16 bits (the first two octets) identify the network and the remaining 16 bits indicate the host within the network.

Class C Network: binary addresses start with 110, therefore the decimal number can be anywhere from 192 to 223. The first 24 bits (the first three octets) identify the network and the remaining 8 bits indicate the host within the network.

Class D Network: binary addresses start with 1110, therefore the decimal number can be anywhere from 224 to 239. Class D networks are used to support multicasting.

Class E network: binary addresses start with 1111, therefore the decimal number can bbe anywhere from 240 to 255. Class E networks are used for experimentation. They are reserved for future used.

Figure 1.6 - Assigned classes of IP Addresses [71]

.4.3 Packet Fragmentation in IP

IP reduces the size of a large datagram by splitting the data field into suitably small parts because every network has an MTU (Maximum Transmission Unit) size. The MTU is the size of the largest packet that network can transmit. The IP header has to be transported with every fragment for them to be routed correctly. The end system's IP layer is responsible for reassembling all fragments before passing the data up to the Transport layer. The identification, offset, length and flags fields are used together to enable segmentation of packets as they travel through the network from source to destination. First, the Fragment Offset field tells a system where the contents of this fragment should be included when the entire packet is reassembled. The Identification field is used to support fragment reassembly. Identification field is set by the fragmenting system to a unique value to help the destination system reassemble the packet. Additionally, the flags in the IP header specify information about fragmentation. The sending system can set these fields to indicate that a packet should not be fragmented as it travels across the network. Also, if a packet is fragmented, these flags indicate whether more fragments of the original packet are still on the way.

.5 Reconnaissance

Before carrying an attack it is necessary for attacker to discover as much about their target as possible. It enables attackers to create a complete profile of an organization's security posture. Information sought would typically include domain names, network blocks, IP addresses, system architecture, access control mechanisms and so on. Techniques available for reconnaissance are general Web searches, whois database, the Domain Name System (DNS), and a variety of other techniques. I will try to explain almost every technique used in reconnaissance yet keeping it short.

.5.1 Search the Fine Web

One of the best areas to search on the Web for useful information about a target organization is the target's own Web site. Web site often include very detailed information about the organization for instance employee's contact information with phone numbers which can be very useful in social engineering and can even be used in a war dialing. Location could also be easily discovered by surfing target's web site and the technologies which they are using like what web server is in use, what is the operating system and others useful things.

Tool: Wget (76) for UNIX and Teleport Pro (77) for Windows with these tools attacker could mirror the whole site to study offline and could discover some very useful information about the organization.

World Wide Web can provide an attacker with enticing tidbits about the target by using the multitude of free search engines, such as Alta Vista, Excite, Hotbot or Google. These search engines provide a handy facility that allows you to search for all sites that have links back to the target organization's domain. Usenet also get helpful as most of the administrator post their problem about setting and configuration of hardware and software. Attackers love this type of questioned as it often reveals sensitive information about the particular vendor products a target organization uses.

.5.2 Internet Footprinting

It is important to identify domain names and associated networks related to a particular organization. Domain names represent the company's presence on the Internet to enumerate these domains and begin to discover the networks attached to them, you must scour the Internet. There are multiple whois databases available which can provide information including the assignment of Internet addresses, domain names and individual contacts. Currently we have three top level domain names ending with .com, .net and .org. The InterNIC is comprehensive Internet information about company's domain which is available at [78], allow user to enter organization's name and domain name. InterNIC whois database will output a record that contains the name of the registrar the organization has used to register its domain name. ARIN database contains all IP addresses assigned to a particular organization. European and Asian IP address can be retrieved from RIPE NCC [79] and APNIC [80] respectively.

Tool: Sam spade (81) and Netscan tools (82) can discover a lot about target organization including whois queries.

.5.3 DNS Interrogation

DNS is a hierarchical database distributed around the world that stores a variety of information, including IP addresses, domain names and mail server information. It is used to map IP addresses to hostnames and vice versa. Misconfigured DNS server can allow DNS zone transfer to untrusted computer. A zone transfer allows a secondary master server to update its zone database from the primary master. Attacker would be able to know all the hostnames and IP of the organization once zone transfer is done. Famous tool for zone transferring is nslookup which is included in windows NT/2000 and UNIX variants. Essentially, in a zone transfer, the nslookup program asks the DNS server to transmit all information it has about all systems associated with the given domain.

.5.4 Network Reconnaissance

Now that we have identified potential networks, we can attempt to determine their network topology as well as potential access paths into the network. Traceroute is a useful tool to accomplish this task in UNIX, in windows NT, it is spelled tracert. Traceroute lets you view the route that an IP packet follows from one host to the next. It uses the time-to-live (TTL) option in the IP packet to elicit an ICMP TIME_EXCEEDED message from each router.

Tools: Traceroute and tracert for UNIX and Windows NT respectively. For the graphically presentation, you can use VisualRoute [83], NeoTrace [84] or Cheops [85].

.6 Scanning

After the reconnaissance phase, the attacker is armed with some vital information about your infrastructure like telephone numbers, domain names, IP addresses and others. Attackers will then use this knowledge to begin scanning your systems looking for openings. Scanning for open ports is like burglar turning door knobs and trying to open windows and doors to find a way into your house.

.6.1 Ping sweeps

"An attack that sends ICMP echo requests ("pings") to a range of IP addresses, with the goal of finding hosts that can be probed for vulnerabilities". [65]

One of the most basic steps in mapping out a network is performing an automated ping sweep on a range of IP addresses and network blocks to determine if individual systems are alive. Ping is an ICMP Echo Request packet, attacker could send this packet to every possible address in your network and wait for ICMP ECHO REPLY message in return. If reply comes back that's mean machine is alive.

Tools: There are number of tools that can used to do a ping sweep, such as fping, gping and Nmap for UNIX systems, and the Pinger software from Rhino9 and Ping Sweep from SolarWinds for Windows systems.

.6.2 Port Scans

"An attack that sends client requests to a range of server port addresses on a host, with the goal of finding an active port and exploiting a known vulnerability of that service".[65]

Port scanning is the process of connecting to TCP and UDP ports on the target system to determine what services are running or in a LISTENING state (Open ports). Active services that are listening may allow an unauthorized user to gain access to systems that are misconfigured or running a version of software known to have security vulnerabilities.

Tools: Nmap is the most powerful tool for this purpose which can be run both on UNIX and Windows. NetScan Tools Pro and SuperScan is also good tool for windows to perform port scanning and revealing open ports on victim machine.

.6.3 Banner Grabbing

Another technique which comes very handy for attacker is banner grabbing. Once attacker know what version of software victim is running than it is easy to write an exploit or look through for known vulnerabilities in that software.

Tools: Netcat is called swiss army knife of network as it has many utilities in one. It can be run on UNIX and Windows.

Summary

Knowing TCP/IP is one of the most important part of the networking, most of the network is build on this two protocol suite. I have tried to give an idea how TCP/IP works and how they flow across network to network or host to host. TCP provides a reliable, connection-oriented, byte stream, transport layer service. TCP packetizes the user data into segments, sets a timeout any time it sends data, acknowledge data received by the other end, reorders out of order data, discards duplicate data, provides end to end flow control, and calculates and verifies a mandatory end to end checksum. Functionality of the IP has been examined with emphasis on the message fragmentation and addressing functions that the Internet Protocol performs. IP, the Network layer protocol used on the Internet, has a header that includes the source and destination IP address of the packet. IP addresses are represented in dotted-quad form, such as 10.21.41.3. IP packets can be broken down into smaller packets called fragments to optimize transmission performance.

Many attacks start with a reconnaissance phase, where an attacker tries to gain as much information about a target as possible without actually attacking it. I have described briefly how to carry a research about the target before launching the attack. By searching the web attacker may extract many useful information on target organization like their names, contact number, technologies they are using etc. Whois database provide information about target's Internet addresses, domain names, and contacts. Unlike DNS servers hold a great deal of information valuable to an attacker, including the mapping of domain names to IP addresses, the mail servers for an organization, and other name servers for the organization.

Attacker use network mapping techniques to develop an inventory of target machines and the overall topology of the network architecture by sweeping the target range which tells host is alive or not. Using traceroute, the attacker can determine how systems, routers, and firewalls are connected together. Port scanners are used to determine which ports have listening services on a target network. By interacting with various ports on the target systems, attacker looks for an open port and tries to exploit with known vulnerabilities in particular service to gain the access.

COMPUTER AND NETWORK ATTACKS

The internet put the rest of the world at the reach of our computers. In the same way it also made our computers reachable by the rest of the world. Good news and bad news! Over the last decade, the internet and critical computers has been subject to widespread security attacks. Besides the classical terms, new ones had to be found in order designate a large collection of threats: Worms, break-ins, hackers, crackers, hijacking, phrackers, spoofing, man-in-the-middle, password-sniffing, denial-of-service, and so on. [11]

You can't defend against an attack unless you are aware of it. Patton once said that to defeat your enemy you must know your enemy. This is true with hackers and how they attack your networks. If the security specialist can identify an attack, then as a minimum they can prevent it from happening again.

Consider the following:

April 26, 2002

The Federal Aviation Administration was hacked and unpublished information on airport passenger screening activities was downloaded. The group known as "The Deceptive Duo" also publicly defaced the FAA site used by the Civil Aviation Security organization. They also used information extracted from the database to post the name of the FAA inspector, screener ID number, number of passengers screened, and any guns, explosives, or chemicals found. The duo stated this warning as their reason for the attack "secure your systems before a foreign attacker hacks you."

November 21, 2001

Playboy.com was hacked and credit card numbers were stolen. The attacker e-mailed all of the customers claiming responsibility for the attack and provided each customer with his/her credit card number as proof.

June 3, 2001

Intruders hacked Amazon.com and download a database of 98,000 accounts including customer records, credit card information, names and addresses.

January 24, 2001

Microsoft's online services were disabled by a supposed Denial of Service attack. Further investigation by a Swedish network administrator reveals that all of Microsoft's DNS servers were behind one single network, therefore the problem was a result of poor network design.
Join now!


September 11, 2000

Western Union Web site was hacked. Hackers made off with 15,700 credit and debit card numbers. [10]

As Figure 2.1 shows, the sophistication of the attacks and attack tools has grown very much in complexity. And these attack tools has also been automated, so the skill needed to use these attack tools and to launch attacks has been reduced. [67]

Figure 2.1 - The evolution of attack sophistication [67]

Attacks on the security of a computer system or network are best characterized by viewing the function of the computer system as ...

This is a preview of the whole essay