Ethical Hacking Web Application Security 1 — Questions and Answers
Question 1: Which OWASP Top 10 vulnerability occurs when untrusted data is sent to an interpreter as part of a command?
- Broken Authentication
- Injection (Correct answer)
- Security Misconfiguration
- Insecure Deserialization
Correct answer: Injection
Injection vulnerabilities (SQL, OS, LDAP) occur when untrusted input is sent to an interpreter, potentially allowing attackers to execute unintended commands.
Question 2: What does XSS stand for in web application security?
- Cross-Site Scripting (Correct answer)
- Cross-Server Scanning
- Extensible Security Schema
- Cross-Site Session
Correct answer: Cross-Site Scripting
Cross-Site Scripting (XSS) is a vulnerability where attackers inject malicious scripts into web pages viewed by other users, stealing sessions or redirecting victims.
Question 3: Which Burp Suite feature is used to intercept and modify HTTP requests between a browser and web server?
- Scanner
- Intruder
- Proxy (Correct answer)
- Repeater
Correct answer: Proxy
Burp Suite's Proxy module intercepts HTTP/HTTPS traffic between the browser and the server, allowing testers to inspect and modify requests in real time.
Question 4: What is a CSRF attack?
- Injecting scripts into a web page
- Forging requests from an authenticated user's browser (Correct answer)
- Stealing session cookies via XSS
- Bypassing login with SQL injection
Correct answer: Forging requests from an authenticated user's browser
Cross-Site Request Forgery (CSRF) tricks an authenticated user's browser into sending unauthorized requests to a trusted site, performing actions without the user's knowledge.
Question 5: Which HTTP response header helps prevent XSS attacks by restricting which content can be loaded on a page?
- X-Frame-Options
- Strict-Transport-Security
- Content-Security-Policy (Correct answer)
- X-Content-Type-Options
Correct answer: Content-Security-Policy
Content-Security-Policy (CSP) headers restrict the sources from which scripts, styles, and other resources can be loaded, significantly reducing XSS attack surface.
Question 6: What is directory traversal in web application hacking?
- Brute forcing directory names
- Accessing files outside the web root by manipulating path variables (Correct answer)
- Enumerating hidden directories with tools
- Injecting code into file upload fields
Correct answer: Accessing files outside the web root by manipulating path variables
Directory traversal (path traversal) exploits insufficient input validation to access files outside the intended directory, often using sequences like '../' to navigate up the file system.
Which OWASP Top 10 vulnerability occurs when untrusted data is sent to an interpreter as part of a command?