Session Fixation Session Hijacking and Captcha Bypass 1704716762
Session Fixation Session Hijacking and Captcha Bypass 1704716762
Karthik B
What is Session?
A session refers to the entire time spent on an activity. In computer systems, a
user session begins when a user logs in or accesses a specific computer, network, or
software service. It concludes when the user logs out or shuts down the computer.
During a session, information related to the user's activities can be temporarily
stored.
A session cookie is employed in web pages to retain information in case the user
leaves the page or closes their Internet browser. For instance, it allows a website to
remember the contents of your shopping cart if you leave and return later.
A session fixation attack enables an attacker to take control of a valid user session.
In this attack, the vulnerability lies in how the web application handles the session
ID, particularly in scenarios where the application fails to assign a new session ID
during user authentication. This oversight allows the exploitation of an existing
session ID. The attack involves acquiring a valid session ID (e.g., by connecting to
the application), prompting a user to authenticate themselves using that session
ID, and subsequently seizing control of the user-validated session through
knowledge of the utilized session ID. The attacker must present a legitimate web
application session ID and attempt to induce the victim's browser to use it.
1. The attacker gains access to the web application's login page and acquires a
session identifier generated by the application. In certain cases, if the web
application allows arbitrary session IDs, this step may not be necessary.
2. Using techniques like CRLF Injection, man-in-the-middle attacks, social
engineering, etc., the attacker persuades the victim to use the provided session
identifier. The success of this step relies on how the web application manages
session IDs. It might involve sending a malicious URL or, in more complex
cases, creating a fake website.
3. The victim visits the web application's login page, enters credentials, and logs
in. Post-authentication, the web application treats anyone using this session
ID as if they were the legitimate user.
4. Leveraging the acquired session identifier, the attacker gains access to the web
application, takes control of the user session, and assumes the identity of the
victim. Subsequent actions depend on the intentions of the attacker and the
functionalities of the web application.
Session hijacking is a malicious act where an attacker takes control of a user's web
session. In web browsing, a session involves a series of interactions between two
endpoints, sharing a unique session token for continuity and security.
In this type of attack, a threat actor steals or manipulates the session token to gain
unauthorized access to information or services. The process begins when the
attacker intercepts this token, similar to a secret handshake between the user and
the website. Once in possession of the token, the attacker can impersonate the
legitimate user, potentially causing harm. Methods of interception vary, from
network eavesdropping to sophisticated phishing attacks.
Given the widespread use of the internet for various activities, including banking
and social interactions, session hijacking poses a significant threat. Attackers can
exploit hijacked sessions for fraud, identity theft, and breaching confidential
communications. Therefore, understanding session hijacking is crucial for
protecting our online presence.
⚫ Brute Force: The attacker attempts multiple session IDs until finding a
successful match.
⚫ Calculate: In many cases, session IDs are generated in a predictable manner
and can be calculated by the attacker.
⚫ Steal: The attacker can acquire the Session ID using various techniques.
In a Brute Force attack, the attacker may try numerous IDs systematically. For
example, they might guess session IDs by iterating through a list of URLs, as
shown below:
• http://www.somesite.com/view/VW30422101518909
• http://www.somesite.com/view/VW30422101520803
• http://www.somesite.com/view/VW30422101522507
In a "referrer" attack, the attacker lures the user to click on a link leading to
another site (e.g., www.hostile.com), and the browser sends the referrer URL,
containing the session ID, to the attacker's site. Session IDs can also be stolen
using script injections, such as Cross-Site Scripting, where a malicious script
redirects the user's information to the attacker.
What are the impacts of Session Hijacking?
Several tools and techniques are specifically crafted to detect session hijacking.
Intrusion detection systems (IDS), for instance, can actively monitor network
traffic, identifying any indications of session token misuse. Moreover, anomaly-
based detection mechanisms are designed to notify administrators of unusual
session activities, serving as alerts for potential session hijacking attempts.
Web developers and organizations need a more technical strategy for prevention.
This involves the widespread implementation of HTTPS, the use of secure
cookies, and the adoption of robust session management practices. Consistent
system updates and the timely application of security patches are essential to
thwart potential session hijacking attacks exploiting known vulnerabilities.
Session fixation and session hijacking are both strategies aimed at compromising a
user's client and web server session. In a session hijacking attack, the assailant
seeks to pilfer the ID of a victim's session post their login. On the other hand, in a
session fixation attack, the attacker already possesses a valid session and endeavors
to compel the victim into utilizing that specific session for their own objectives.
Crucially, the session fixation attack initiates by "fixing" an established session on
the victim's browser even before the user logs in.
What is Captcha Bypassing?
Captcha mechanisms are in place to ensure that human users are making requests
rather than automated bots or tools. Although not foolproof, this security measure
is crucial. Originally designed to enhance OCR software by presenting a known
and an unknown word, captchas have evolved significantly. Bypassing captchas
can lead to severe consequences, such as application brute forcing or even
application-level denial-of-service attacks.
References:
https://www.computerhope.com/jargon/s/session.htm
https://www.acunetix.com/blog/web-security-zone/what-is-session-fixation/
https://vishnushivalalp.medium.com/session-fixation-and-session-hijacking-
6f67400e815c
https://www.imperva.com/learn/application-security/session-hijacking/