Vulnerability Playbook
Vulnerability Playbook
SQL INJECTION
Brief Description of SQL SQL Injection (SQLi) is a common attack technique where
Injection malicious actors manipulate an application’s SQL queries by
injecting malicious SQL code into input fields. This allows
attackers to interfere with the application’s communication with the
database, potentially leading to unauthorized data access, data
modification, or even total database control. SQLi can expose
sensitive data, bypass authentication, or allow remote execution of
arbitrary commands.
Detailed Parameters User Inputs Not Sanitized: When user input (such as
comments, form data, or search queries) is displayed back to the
user in the webpage without sanitization or escaping, attackers
can inject malicious JavaScript.
Dynamic HTML Generation: Websites that dynamically
generate HTML using user inputs without properly sanitizing
them are at high risk. This is common in frameworks or
environments where developers manually build HTML
responses.
Types of XSS:
o Stored (Persistent) XSS: The malicious script is stored on the
server (e.g., in a database) and executed every time the page is
loaded by any user.
o Reflected XSS: The script is reflected off a web server (e.g.,
in a URL parameter or form response) and executed
"The Ultimate Vulnerability Playbook: A Hacker's Worst Nightmare"
Contextual Escaping
Ensure output is properly escaped for the specific context in which it
appears (e.g., HTML, JavaScript, URL). For example, use JSON
encoding for data embedded in <script> tags and URL encoding for
query parameters.
<img
src="https://victim.com/transfer?amount=1000&recipient=attacker_account"
style="display:none;">
Server Misconfigurations:
Servers that are configured to run scripts or commands based on
user input can be susceptible. For example, allowing users to
specify the parameters for shell commands or API calls that interact
with the system can lead to code execution vulnerabilities.
Step-by-Step Step 1: Identify Input Fields That Interact with the System
Exploitation Guide Look for user input fields, URL parameters, or file upload
mechanisms that are likely to interact with the underlying operating
system (e.g., forms to upload images, forms that process
commands, etc.).
Step 2: Test Basic Command Execution
Inject common command-line commands that can be used to test
whether the input is passed directly to the system. For example:
Unix: ; ls, ; whoami
Windows: & dir, & whoami
If the command's output is reflected in the application's response, it
indicates the application is vulnerable.
Step 3: Escalate by Injecting Arbitrary Commands
After confirming that command injection is possible, craft more
complex payloads to manipulate the system. For example:
"The Ultimate Vulnerability Playbook: A Hacker's Worst Nightmare"
Command Injection
Brief Description of Command Injection is a critical vulnerability that occurs when an
Command Injection attacker can inject and execute arbitrary commands on the host
operating system via a vulnerable application. This typically
happens when untrusted user input is passed directly to a system
shell or command interpreter without adequate validation or
sanitization. Command Injection can lead to full system
compromise, allowing attackers to run malicious commands,
exfiltrate data, or even gain control of the entire system.
Concatenation of Commands:
If the application dynamically constructs a command by
concatenating user input into system commands, it’s prone to
"The Ultimate Vulnerability Playbook: A Hacker's Worst Nightmare"
Special Characters:
Command injection typically exploits special shell characters such
as:
; – Allows chaining of multiple commands.
& – Executes commands sequentially.
| – Pipes the output of one command into another.
> – Redirects output to a file.
Step-by-Step Step 1: Identify Vulnerable Input Fields
Exploitation Guide Look for input fields that accept user inputs (e.g., form fields, URL
Guide parameters) that appear to pass data to the underlying system for
execution. Common areas include file upload paths, ping
commands, or search functions.
Step 5: Post-Exploitation
Once you gain control of the system, use privilege escalation
techniques to gain root or administrator access, exfiltrate sensitive
data, or pivot to other parts of the network.
Parameterized Commands:
If you must interact with the command line, ensure that user input
is parameterized properly, and avoid concatenating user input into
system commands. For instance, instead of: