PDF p.366
In progress
Directory Traversal and Command Injection Attacks
Summary
PDF p.366Directory traversal and command injection attacks exploit vulnerabilities in web servers to access unauthorized files or execute OS commands. These attacks can bypass input validation and security measures if not properly configured.
Detailed explanation
PDF p.366-
Directory Traversal
- Mechanism: Submits a request to access files outside the web server's root directory using paths like ../.
- Canonicalization Attack: Disguises malicious input by encoding characters.
-
Example
- Direct Path: http://victim.foo/?show=../../../../etc/config
- Encoded Path: http://victim.foo/?show=%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e %2fetc/config
- Vulnerability: Insufficient input filtering and improper access permissions.
-
Command Injection
- Mechanism: Causes the server to run OS shell commands and return the output to the browser.
- Security Measures: Web server should prevent commands from operating outside the server's directory root and restrict privileges to the "guest" user.
- Vulnerability: Circumventing security measures or exploiting misconfigured web servers.
Important terms
taken from the text above- Canonicalization Attack
- Disguises malicious input by encoding characters.
- Direct Path
- http://victim.foo/?show=../../../../etc/config
- Encoded Path
- http://victim.foo/?show=%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e %2fetc/config
- Security Measures
- Web server should prevent commands from operating outside the server's directory root and restrict privileges to the "guest" user.
What I should remember
Key Points PDF p.366-
Directory Traversal
- Mechanism: Access files outside root directory.
- Canonicalization: Encodes characters to bypass validation.
- Example: Direct and encoded paths.
- Vulnerability: Input filtering, access permissions.
-
Command Injection
- Mechanism: Run OS shell commands.
- Security Measures: Prevent commands outside root, restrict privileges.
- Vulnerability: Circumventing security, misconfiguration.