










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











11.1 Understand session hijacking and session hijacking techniques Exam Focus: Understand session hijacking and session hijacking techniques. Objective includes:
Session hijacking Session hijacking refers to the exploitation of a valid computer session to gain unauthorized access to information or services in a computer system. In particular, it is used to refer to the theft of a magic cookie used to authenticate a user to a remote server. It has particular relevance to Web developers, as the HTTP cookies used to maintain a session on many Web sites can be easily stolen by an attacker using an intermediary computer or with access to the saved cookies on the victim's computer.
TCP session hijacking occurs when a hacker takes over a TCP session between two machines. Since authentication only occurs at the start of a TCP session, it allows the hacker to gain access to a machine. A popular method is using source-routed IP packets. This allows a hacker at point A on the network to participate in a conversation between B and C by encouraging the IP packets to pass through its machine. If source-routing is turned off, the hacker can use "blind" hijacking, whereby it guesses the responses of the two machines. Thus, the hacker can send a command, but can never see the response. However, a common command would be to set a password allowing access from somewhere else on the net.
A hacker can also be "inline" between B and C using a sniffing program to watch the conversation. This is known as a "man-in-the-middle attack". A common component of such an attack is to execute a denial-of-service (DoS) attack against one end-point to stop it from responding. This attack can be either against the machine to force it to crash, or against the network connection to force heavy packet loss.
Session hijacking is successful due to the following reasons:
Types of session hijacking The following are the types of session hijacking:
Dangers posed by hijacking The following dangers are posed by hijacking:
Key session hijacking techniques The following are key session hijacking techniques:
Methods to perform session hijacking There are four main methods used to perpetrate a session hijack:
11.2 Understand session hijacking process and session hijacking in the OSI Model Exam Focus: Understand session hijacking process and session hijacking in the OSI Model. Objective includes:
Exam Focus: Understand the brute forcing attack and HTTP referrer attack. Objective includes:
Brute force attack In a brute force attack, the attacker uses software that tries a large number of key combinations in order to get a password. In order to prevent such attacks, passwords that are more difficult to guess should be created. For example, create passwords using a minimum of six characters, alphanumeric combinations, lower-upper case combinations, etc.
Http referrer attack HTTP referrer is a phishing attack. The attacker sends a user to a Web page from which HTTP request originated. From this web page, the attacker sends the user to a Web page where the attacker can perform various malicious activities. The following steps describe how such information can be used for a phishing attack:
Countermeasure of the HTTP referrer attack The only countermeasure of the HTTP referrer attack is not passing referrer to visited sites. Firefox and Opera have built-in plugins for it. For Chrome and Safari, the user has to use the external extensions. IE does not provide any easy way to do it.
Difference between session hijacking and IP spoofing In IP spoofing, the attacker artificially identifies the packets' source address. The packets' source address is often fetched from sniffed network traffic.
However, session hijacking is an attack in which the attacker takes over the session by making
the user offline and uses his session.
11.4 Understand application level session hijacking, and discuss session sniffing Exam Focus: Understand application level session hijacking, and discuss session sniffing. Objective includes:
Application level session hijacking In application level session hijacking, an attacker obtains session IDs to gain control of the HTTP user session. During this attack, the session hijacker can also try to create new sessions using stolen data. Application level session hijacking is all about obtaining the session ID, since web applications key off this value to determine identity. Some common methods for these types of attacks are obtaining Session IDs, observation (sniffing), and brute forcing. There are different ways to compromise a session token. The following are the most common ways:
Application level attacks The following are various application level attacks:
Man-in-the-middle attacks Man-in-the-middle attacks occur when an attacker successfully inserts the intermediary software or program between two communicating hosts. Attackers can use the intermediary software or program to listen to and modify the communication packets that pass between the two hosts. The software intercepts the communication packets and then sends the information to the receiving host. The receiving host presumes it to be the legitimate client and responds to the software. The tools used for the man-in-the-middle attack are as follows:
Countermeasures of the man-in-the-middle attack A user can follow various methods to mitigate the man-in-the-middle attack. To overcome these attacks, use authentication techniques that are based on the following:
Man-in-the-browser (MitB) attack Man-in-the-browser (MitB) is a Trojan that is used to infect a web browser. It is able to modify pages, modify transaction content or insert additional transactions. This attack will be successful irrespective of whether security mechanisms, such as SSL/PKI and/or Two or Three Factor Authentication solutions are in place. The only way to counter this attack is by utilizing transaction verification.
Performing man-in-the-browser attack The following steps are taken to perform man-in-the-browser attack:
Client-side attack A client-side attack uses the inexperience of the end-user for creating a foothold in the user's machine, and therefore, the network. Client-side attacks are everywhere and hidden in plain sight. Common hiding places are malicious Web sites and spam. A simple click of a link will permit an attacker to enter.
Cross-site scripting (XSS) is a type of an injection attack. In this attack, the malicious scripts are injected into the web sites. A malicious script can be embedded in a web page. It does not produce any warning when the page is seen in any browser. In Trojan horse, the malicious code is included inside apparently harmless programming or data in such a manner that it can get control and cause damage.
Cross-site script attack Cross-site script attack is focused on a specific victim website and the users who visit it. In this attack, an attacker can send malicious code or programs to the client-side programs to compromise the session token.
Suppose an attacker sends a crafted link to the victim with the malicious JavaScript. The JavaScript will run and complete the instructions made by the attacker when the victim clicks on the link. In this way, the attacker can use the XSS attack to steal the session token.
A specific JavaScript code such as **** can be created to send the cookie to the attacker by using the XSS attack. In this way, the attacker can use the XSS attack to show the cookie value of the current session.
Things have to happen for cross site request forgery to succeed The following are the things have to happen for cross site request forgery to succeed:
Network-level hijacking Network-level hijacking is the interception of packets during transmission between a client and the server in a TCP/UDP session. By attacking on network level sessions, an attacker can get critical information to attack application level sessions. The following are included in network- level hijacking:
IP spoofing attack An IP spoofing attack can be performed to hide the identity in the network. In computer networking, the term IP address spoofing or IP spoofing refers to the creation of Internet Protocol (IP) packets with a forged source IP address, called spoofing, with the purpose of concealing the identity of the sender or impersonating another computing system. The basic protocol for sending data over the Internet and many other computer networks is the Internet Protocol ("IP"). The header of each IP packet contains, among other things, the numerical source and destination address of the packet. The source address is normally the address that the packet was sent from. By forging the header so that it contains a different address, the attacker can make it appear that the packet was sent by a different machine. The machine that receives spoofed packets will send a response back to the forged source address, which means that this technique is mainly used when the attacker does not care about the response or the attacker has some way of guessing the response.
Nonblind spoofing Nonblind spoofing is a type of spoofing that occurs when a user can see the traffic being sent between the host and the target. It is the easiest type of session hijacking, but it requires that a user captures packets as they are passing between the two machines.
Blind spoofing In blind spoofing, a user cannot see the traffic being sent between the host and the target. It is the most difficult session hijacking because it is very difficult to guess the TCP sequence number correctly.
RST hijacking In RST hijacking, an authentic-looking reset (RST) packet is injected using a spoofed source address and the acknowledgement number is predicted. The victim resets the connection as it believes that the reset packet is actually sent by the source. RST hijacking can be performed using a packet crafting toll such as Colasoft's Packet Builder and TCP/IP analysis tool such as tcpdump. The ACK flag should be turned on to sniff the packets.
Blind hijacking In blind hijacking, even if the source routing is disabled, the attacker can introduce the malicious data or commands into the intercepted communications in the TCP session. Although the attacker can send the data or comments, he has no access to see the response.
UDP hijacking UDP hijacking works at the network level. As UDP does not use packet sequencing and synchronizing, the attacker forges a server reply to the client UDP request before the server can respond.
Man-in-the-middle attack using packet sniffer The man-in-the-middle attack involves the use of the packet sniffer as an interface between the client and the server. The following techniques are used to route the packets between the client and the server through the hijacker's host:
Session hijacking tools
The following are session hijacking tools:
Hunt Hunt is a tool that is used for exploiting well known weaknesses in the TCP/IP protocol. It is primarily used to hijack connections but has many other features. It is a program that can be used for intruding into a connection, watching it, and resetting it. Hunt operates on Ethernet; however, it can do something even for hosts on another segment or switched ports. It can also be used to perform hacking techniques: sniffing and session hijacking.
Paros Paros is a man-in-the -middle proxy and application vulnerability scanner. It permits the attacker to intercept, modify, and debug HTTP and HTTPS data on-the-fly between a web server and a client browser. It is also useful in spidering, proxy-chaining, filtering, and application vulnerability scanning.
Burp suite Attackers use burp suite to inspect and modify traffic between the browser and the target application. The burp suite tool is used to analyze all kinds of content. It automatically colorizes the request and response syntax.
Firesheep Firesheep is an extension for the Firefox web browser. The Firefox browser permits attackers to steal a valid session ID in order to get into the system and snoop the data.
Countermeasures of session hijacking The following are countermeasures of session hijacking:
Measures taken to protect against session hijacking The following measures are taken to protect against session hijacking:
Methods to prevent session hijacking Web developers should use the following methods to prevent session hijacking:
Web users should use the following methods to prevent session hijacking:
Defending against session hijack attacks The following actions should be taken against session hijack attacks:
The following is the IPSec architecture:
IPSec authentication and confidentiality The following security services are used by IPSec for authentication and confidentiality:
Components of IPSec The following are the components of IPSec:
Session hijacking pen testing The following actions should be taken during session hijacking pen testing:
Chapter Summary In this chapter, we learned about session hijacking, key session hijacking techniques, session hijacking process, types of session hijacking, and session sniffing. This chapter focused on man- in-the-middle, man-in-the-browser, client-side, cross-site script attacks, and countermeasures of session hijacking. Glossary
Brute force attack In a brute force attack, the attacker uses software that tries a large number of key combinations in order to get a password.
Client-side attack A client-side attack uses the inexperience of the end-user for creating a foothold in the user's machine, and therefore, the network.
Man-in-the-browser Man-in-the-browser (MitB) is a Trojan that is used to infect a web browser.
Man-in-the-middle attacks Man-in-the-middle attacks occur when an attacker successfully inserts the intermediary software or program between two communicating hosts.
Network-level hijacking Network-level hijacking is the interception of packets during transmission between a client and the server in a TCP/UDP session.
Session fixation Session fixation is a type of attack technique that forces a user's session ID to an explicit value.
Session hijacking Session hijacking is the exploitation of a valid computer session sometimes also called a session key to gain unauthorized access to information or services in a computer system. In particular, it is used to refer to the theft of a magic cookie used to authenticate a user to a remote server.
Source routed packets The source routed packets technique is used to gain unauthorized access to the computer with the assistance of the trusted host's IP address.
TCP/IP hijacking