# Exploit (computer security)

An exploit is a method or piece of code that takes advantage of vulnerabilities in software, applications, networks, operating systems, or hardware, typically for malicious purposes. The term "exploit" derives from the English verb "to exploit," meaning "to use something to one’s own advantage." Exploits are designed to identify flaws, bypass security measures, gain unauthorized access to systems, take control of systems, install malware, or steal sensitive data. While an exploit by itself may not be a malware, it serves as a vehicle for delivering malicious software by breaching security controls.
Researchers estimate that malicious exploits cost the global economy over US$450 billion annually. In response to this threat, organizations are increasingly utilizing cyber threat intelligence to identify vulnerabilities and prevent hacks before they occur.

## Description

Exploits target vulnerabilities, which are essentially flaws or weaknesses in a system's defenses. Common targets for exploits include operating systems, web browsers, and various applications, where hidden vulnerabilities can compromise the integrity and security of computer systems. Exploits can cause unintended or unanticipated behavior in systems, potentially leading to severe security breaches.
Many exploits are designed to provide superuser-level access to a computer system. Attackers may use multiple exploits in succession to first gain low-level access and then escalate privileges repeatedly until they reach the highest administrative level, often referred to as "root." This technique of chaining several exploits together to perform a single attack is known as an exploit chain.
Exploits that remain unknown to everyone except the individuals who discovered and developed them are referred to as zero-day or "0day" exploits. After an exploit is disclosed to the authors of the affected software, the associated vulnerability is often fixed through a patch, rendering the exploit unusable. This is why some black hat hackers, as well as military or intelligence agency hackers, do not publish their exploits but keep them private. One scheme that offers zero-day exploits is known as exploit as a service.

## Classification

There are several methods of classifying exploits. The most common is by how the exploit communicates to the vulnerable software.
By Method of Communication:
* Remote Exploits: Works over a network and exploits the security vulnerability without any prior access to the vulnerable system.
* Local Exploits: Requires prior access or physical access to the vulnerable system, and usually increases the privileges of the person running the exploit past those granted by the system administrator.
By Targeted Component:
* Server-Side Exploits: Target vulnerabilities in server applications, such as web servers or database servers, often by sending maliciously crafted requests to exploit security flaws.
* Client-Side Exploits: Target vulnerabilities in client applications, such as web browsers (browser exploits) or media players. These exploits often require user interaction, like visiting a malicious website or opening a compromised file. Exploits against client applications may also require some interaction with the user and thus may be used in combination with the social engineering method.
The classification of exploits based on the type of vulnerability they exploit and the result of running the exploit (e.g., Elevation of Privilege (EoP), Denial of Service (DoS), spoofing) is a common practice in cybersecurity. This approach helps in systematically identifying and addressing security threats. For instance, the STRIDE threat model categorizes threats into six types, including Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege. Similarly, the National Vulnerability Database (NVD) categorizes vulnerabilities by types such as Authentication Bypass by Spoofing and Authorization Bypass.
By Type of [[Vulnerability (computer security)|Vulnerability]]:
* Code Execution Exploits: Allow attackers to execute arbitrary code on the target system, potentially leading to full system compromise.
* Denial-of-Service (DoS) Exploits: Aim to disrupt the normal functioning of a system or service, making it unavailable to legitimate users.
* Privilege Escalation Exploits: Enable attackers to gain higher privileges on a system than initially granted, potentially leading to unauthorized actions.
* Information Disclosure Exploits: Lead to unauthorized access to sensitive information due to vulnerabilities in the system.
Another classification is by the action against the vulnerable system; unauthorized data access, arbitrary code execution, and denial of service are examples.

## Exploitation Techniques

Attackers employ various techniques to exploit vulnerabilities and achieve their objectives. Some common methods include:
* Buffer Overflow: Attackers send more data to a buffer than it can handle, causing it to overflow and overwrite adjacent memory, potentially allowing arbitrary code execution.
* SQL Injection: Malicious SQL code is inserted into input fields of web applications, enabling attackers to access or manipulate databases.
* Cross-Site Scripting (XSS): Attackers inject malicious scripts into web pages viewed by other users, potentially leading to session hijacking or data theft.
* Cross-Site Request Forgery (CSRF): Attackers trick users into performing actions they did not intend, such as changing account settings, by exploiting the user's authenticated session.

### Zero-click

A zero-click attack is an exploit that requires no user interaction to operate – that is to say, no key-presses or mouse clicks. These exploits are commonly the most sought after exploits (specifically on the underground exploit market) because the target typically has no way of knowing they have been compromised at the time of exploitation.
FORCEDENTRY, discovered in 2021, is an example of a zero-click attack.
In 2022, NSO Group was reportedly selling zero-click exploits to governments for breaking into individuals' phones.
For mobile devices, the National Security Agency (NSA) points out that timely updating of software and applications, avoiding public network connections, and turning the device Off and On at least once a week can mitigate the threat of zero-click attacks. Experts say that protection practices for traditional endpoints are also applicable to mobile devices. Many exploits exist only in memory, not in files. Theoretically, restarting the device can wipe malware payloads from memory, forcing attackers back to the beginning of the exploit chain.

### Pivoting

Pivoting is a technique employed by both hackers and penetration testers to expand their access within a target network. By compromising a system, attackers can leverage it as a platform to target other systems that are typically shielded from direct external access by firewalls. Internal networks often contain a broader range of accessible machines compared to those exposed to the internet. For example, an attacker might compromise a web server on a corporate network and then utilize it to target other systems within the same network. This approach is often referred to as a multi-layered attack. Pivoting is also known as island hopping.
Pivoting can further be distinguished into proxy pivoting and VPN pivoting:
* Proxy pivoting is the practice of channeling traffic through a compromised target using a proxy payload on the machine and launching attacks from the computer. This type of pivoting is restricted to certain TCP and UDP ports that are supported by the proxy.
* VPN pivoting enables the attacker to create an encrypted layer to tunnel into the compromised machine to route any network traffic through that target machine, for example, to run a vulnerability scan on the internal network through the compromised machine, effectively giving the attacker full network access as if they were behind the firewall.
Typically, the proxy or VPN applications enabling pivoting are executed on the target computer as the payload of an exploit.
Pivoting is usually done by infiltrating a part of a network infrastructure (as an example, a vulnerable printer or thermostat) and using a scanner to find other devices connected to attack them. By attacking a vulnerable piece of networking, an attacker could infect most or all of a network and gain complete control.