PDF p.364
In progress
Injection Attacks
Summary
PDF p.364Injection attacks exploit vulnerabilities in the way applications process requests and queries, allowing unauthorized actions. These attacks can target both client-side and server-side applications.
Detailed explanation
PDF p.364-
Client-Side vs. Server-Side Attacks
- Client-Side Attacks: Execute arbitrary code on the browser (e.g., session replay, CSRF, XSS).
- Server-Side Attacks: Cause the server to process unauthorized scripts or queries.
-
Injection Attacks
- Mechanism: Exploits insecure processing of requests and queries.
- Example: An application allowing a user to view their profile might be manipulated to return or modify records for all users.
-
Types of Injection Attacks
- Persistent XSS: Injects malicious scripts into web pages viewed by other users.
- SQL Injection: Manipulates SQL queries to access or modify database information.
-
Extensible Markup Language (XML) Injection
- Usage: XML is used for authentication, authorization, and data exchange.
- Vulnerability: Data submitted via XML without encryption or input validation.
- Example: XML External Entity (XXE) attack embeds a request for a local resource.
-
Code Example
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE foo [<!ELEMENT foo ANY >
- <!ENTITY bar SYSTEM "file:///etc/config"> ]>
- <bar>&bar;</bar>
- Effect: Returns the contents of /etc/config as part of the response.
-
Lightweight Directory Access Protocol (LDAP) Injection
- Usage: LDAP is used to read and write network directory databases.
- Vulnerability: Unauthenticated access or client app vulnerabilities.
- Mechanism: Submitting arbitrary LDAP queries to create/delete accounts or change authorizations.
-
Example
- Valid Query: (&(username=Bob)(password=Pa$w0rd))
- Injection: bob)(&)) bypasses the password check.
- Resulting Query: (&(username=Bob)(&))
Important terms
taken from the text above- Client-Side Attacks
- Execute arbitrary code on the browser (e.g., session replay, CSRF, XSS).
- Server-Side Attacks
- Cause the server to process unauthorized scripts or queries.
- Persistent XSS
- Injects malicious scripts into web pages viewed by other users.
- SQL Injection
- Manipulates SQL queries to access or modify database information.
- Effect
- Returns the contents of /etc/config as part of the response.
- Valid Query
- (&(username=Bob)(password=Pa$w0rd))
- Injection
- bob)(&)) bypasses the password check.
- Resulting Query
- (&(username=Bob)(&))
LDAP Lightweight Directory Access Protocol
What I should remember
Key Points PDF p.364-
Client-Side vs. Server-Side
- Client-Side: Browser-based code execution.
- Server-Side: Unauthorized server processing.
-
Injection Attacks
- Mechanism: Insecure request/query processing.
- Example: Manipulating user profile queries.
-
Types
- Persistent XSS: Malicious scripts in web pages.
- SQL Injection: Manipulates SQL queries.
-
XML Injection
- Usage: Authentication, data exchange.
- Vulnerability: Unencrypted, unvalidated data.
- Example: XXE attack.
-
LDAP Injection
- Usage: Network directory databases.
- Vulnerability: Unauthenticated access, client app flaws.
- Example: Bypassing password checks.