{
  "Module 15: Hacking Web Servers": [
    {
      "question": "1. Which of the following best describes a directory traversal vulnerability?",
      "options": [
        "A. A vulnerability that allows an attacker to access unauthorized files by using ../ to traverse up the directory tree.",
        "B. A vulnerability that allows an attacker to execute arbitrary code on a web server.",
        "C. A vulnerability that allows an attacker to intercept and modify network traffic.",
        "D. A vulnerability that allows an attacker to obtain sensitive information by tricking a user into disclosing their credentials."
      ],
      "num_answers": 1,
      "answer": "A. A vulnerability that allows an attacker to access unauthorized files by using ../ to traverse up the directory tree.",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ Directory traversal (path traversal) lets attackers escape the web root using '../' to access restricted system files.",
        "B": "❌ Arbitrary code execution is a different vulnerability type.",
        "C": "❌ This describes a man-in-the-middle attack.",
        "D": "❌ This is social engineering or phishing, not traversal."
      }
    },
    {
      "question": "2. Which of the following is the most effective method to prevent directory traversal attacks?",
      "options": [
        "A. Installing antivirus software on the server.",
        "B. Configuring the server to only accept HTTPS connections.",
        "C. Limiting the number of login attempts to prevent brute force attacks.",
        "D. Preventing input that contains any directory traversal sequences such as ../."
      ],
      "num_answers": 1,
      "answer": "D. Preventing input that contains any directory traversal sequences such as ../.",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ Input validation and sanitization of '../' sequences is key to preventing traversal attacks.",
        "A": "❌ Antivirus doesn’t protect against path traversal.",
        "B": "❌ HTTPS secures transmission, not file path access.",
        "C": "❌ Brute force protection is unrelated."
      }
    },
    {
      "question": "3. Danny noticed that the web server does not block the '../' string. What attack can he perform?",
      "options": [
        "A. Cross-site scripting (XSS)",
        "B. SQL injection",
        "C. Directory traversal",
        "D. Denial of Service (DoS)"
      ],
      "num_answers": 1,
      "answer": "C. Directory traversal",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ '../' traversal enables reading files outside the web root.",
        "A": "❌ XSS involves injecting scripts in pages.",
        "B": "❌ SQL injection manipulates database queries.",
        "D": "❌ DoS overwhelms a service, not access files."
      }
    },
    {
      "question": "4. Which file extension is often used for web pages that contain Server-Side Includes (SSI) code?",
      "options": ["A. .java", "B. .cms", "C. .stm", "D. .php"],
      "num_answers": 1,
      "answer": "C. .stm",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ .stm files can contain SSI directives.",
        "A": "❌ .java is for Java source code.",
        "B": "❌ .cms is not standard.",
        "D": "❌ .php is for PHP scripts, not SSI."
      }
    },
    {
      "question": "5. Which of the following best describes a server-side inclusion (SSI) attack?",
      "options": [
        "A. An attack that injects malicious code into a SQL database.",
        "B. An attack that targets the server's file system by accessing files outside the web root.",
        "C. An attack that allows an attacker to intercept wireless traffic.",
        "D. An attack exploiting server-side script vulnerabilities to include malicious code from external sources."
      ],
      "num_answers": 1,
      "answer": "D. An attack exploiting server-side script vulnerabilities to include malicious code from external sources.",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ SSI injection lets attackers embed unauthorized commands or code via SSI directives.",
        "A": "❌ Describes SQL injection.",
        "B": "❌ Describes directory traversal.",
        "C": "❌ Unrelated to web servers."
      }
    },
    {
      "question": "6. Which of the following best describes a Server-Side Request Forgery (SSRF) attack?",
      "options": [
        "A. A vulnerability that tricks a web server into making requests to attacker-specified servers.",
        "B. A vulnerability allowing modification of HTML or JS in a web page.",
        "C. A vulnerability that injects malicious SQL statements into a database.",
        "D. A vulnerability that intercepts and modifies traffic between client and server."
      ],
      "num_answers": 1,
      "answer": "A. A vulnerability that tricks a web server into making requests to attacker-specified servers.",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ SSRF manipulates server requests to internal/external systems.",
        "B": "❌ Describes XSS.",
        "C": "❌ Describes SQL injection.",
        "D": "❌ Describes a man-in-the-middle attack."
      }
    },
    {
      "question": "7. Danny altered a URL parameter to point to localhost and accessed sensitive data. Which technique was used?",
      "options": [
        "A. Server-side request forgery",
        "B. Cross-site request forgery",
        "C. Man-in-the-middle",
        "D. Server-side include injection"
      ],
      "num_answers": 1,
      "answer": "A. Server-side request forgery",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ SSRF allows attackers to force a server to access internal resources.",
        "B": "❌ CSRF manipulates user actions, not server requests.",
        "C": "❌ MITM intercepts traffic.",
        "D": "❌ SSI is different from SSRF."
      }
    },
    {
      "question": "8. Which action helps protect against web server attacks?",
      "options": [
        "A. Enabling all available ISAPI filters",
        "B. Disabling audit feature",
        "C. Enabling unnecessary ISAPI filters",
        "D. Disabling unnecessary ISAPI filters"
      ],
      "num_answers": 1,
      "answer": "D. Disabling unnecessary ISAPI filters",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ Reducing attack surface by disabling unused ISAPI filters improves security.",
        "A": "❌ Enabling all filters increases exposure.",
        "B": "❌ Disabling audit reduces visibility.",
        "C": "❌ Enables unnecessary attack points."
      }
    },
    {
      "question": "9. Gobuster performs content enumeration on the basis of:",
      "options": ["A. Randomly", "B. Wordlist", "C. Rainbow table", "D. Top vulnerabilities"],
      "num_answers": 1,
      "answer": "B. Wordlist",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Gobuster uses wordlists to brute-force directories/files on web servers.",
        "A": "❌ It’s not random.",
        "C": "❌ Rainbow tables are for password cracking.",
        "D": "❌ Enumeration isn’t based on CVEs."
      }
    },
    {
      "question": "10. Preventing any kind of HTML-based user input helps protect against:",
      "options": [
        "A. Social engineering attack",
        "B. Cross-site scripting attack",
        "C. Man-in-the-middle attack",
        "D. Cross-site request forgery attack"
      ],
      "num_answers": 1,
      "answer": "B. Cross-site scripting attack",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ XSS often exploits unfiltered HTML/JS input.",
        "A": "❌ Social engineering is human manipulation.",
        "C": "❌ MITM is a network-layer attack.",
        "D": "❌ CSRF manipulates authenticated requests."
      }
    },
    {
      "question": "11. Hidden code sends cookies to another site. What happens when a user clicks it?",
      "options": [
        "A. Captures browser details",
        "B. Captures session cookie and ID",
        "C. Redirects to a malicious site",
        "D. Performs no action"
      ],
      "num_answers": 1,
      "answer": "B. Captures session cookie and ID",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ The injected script steals session cookies—classic XSS.",
        "A": "❌ Not the purpose here.",
        "C": "❌ It posts data, not redirects.",
        "D": "❌ It performs active theft."
      }
    },
    {
      "question": "12. In which attack are client-side scripts injected into a web page?",
      "options": [
        "A. Cross-site request forgery",
        "B. Cross-site scripting",
        "C. SQL injection",
        "D. Bluejacking"
      ],
      "num_answers": 1,
      "answer": "B. Cross-site scripting",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ XSS injects malicious JS or HTML into web content.",
        "A": "❌ CSRF sends unauthorized requests.",
        "C": "❌ SQL injection targets databases.",
        "D": "❌ Bluejacking uses Bluetooth."
      }
    },
    {
      "question": "13. Which best describes a cross-site scripting (XSS) attack?",
      "options": [
        "A. Attack on databases",
        "B. Executing malicious code in a user's browser",
        "C. Impersonating users for unauthorized actions",
        "D. Intercepting and modifying data in transit"
      ],
      "num_answers": 1,
      "answer": "B. Executing malicious code in a user's browser",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ XSS executes attacker’s script in victim browsers.",
        "A": "❌ That’s SQL injection.",
        "C": "❌ That’s CSRF or session hijack.",
        "D": "❌ That’s MITM."
      }
    },
    {
      "question": "14. An attack where malicious links cause browsers to send authenticated requests is:",
      "options": [
        "A. Cross-site request forgery",
        "B. Man in the middle",
        "C. Piggybacking",
        "D. Cross-site scripting"
      ],
      "num_answers": 1,
      "answer": "A. Cross-site request forgery",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ CSRF tricks a browser into performing unauthorized actions using stored credentials.",
        "B": "❌ MITM intercepts traffic.",
        "C": "❌ Piggybacking is physical access abuse.",
        "D": "❌ XSS injects scripts, not forced requests."
      }
    },
    {
      "question": "15. A user’s browser unknowingly sends requests exploiting a specific webpage vulnerability. Which type of vulnerability was used?",
      "options": [
        "A. Cross-site request forgery (CSRF)",
        "B. Cross-site scripting (XSS)",
        "C. SQL injection",
        "D. Man in the middle"
      ],
      "num_answers": 1,
      "answer": "A. Cross-site request forgery (CSRF)",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ The attacker forced the browser to issue authenticated requests — CSRF.",
        "B": "❌ XSS injects code into web content.",
        "C": "❌ SQL injection targets databases.",
        "D": "❌ MITM intercepts traffic."
      }
    },
    {
      "question": "16. In simple terms, a CSRF makes:",
      "options": [
        "A. The user’s browser connect to another server without knowledge",
        "B. The user’s server connect to another browser",
        "C. The attacker’s server connect to the user’s browser",
        "D. The user’s server connect to another server"
      ],
      "num_answers": 1,
      "answer": "A. The user’s browser connect to another server without knowledge",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ CSRF forces a browser to send requests to another site without consent.",
        "B": "❌ Wrong direction of connection.",
        "C": "❌ That’s MITM-like behavior.",
        "D": "❌ Server-to-server is SSRF."
      }
    },
    {
      "question": "17. Malware forcing browsers to send authenticated requests to specific servers indicates:",
      "options": [
        "A. Cross-site request forgery",
        "B. Man in the middle",
        "C. Cross-site scripting",
        "D. Server-side request forgery"
      ],
      "num_answers": 1,
      "answer": "A. Cross-site request forgery",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ Browser sends requests using existing session tokens — CSRF behavior.",
        "B": "❌ MITM captures traffic.",
        "C": "❌ XSS injects JS, not requests.",
        "D": "❌ SSRF is server-side."
      }
    },
    {
      "question": "18. Which attack uses HTTP GET or POST to control users into actions without their knowledge?",
      "options": [
        "A. Server-side request forgery",
        "B. Cross-site request scripting",
        "C. SQL injection",
        "D. Cross-site request forgery"
      ],
      "num_answers": 1,
      "answer": "D. Cross-site request forgery",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ CSRF works via GET or POST, exploiting user sessions.",
        "A": "❌ SSRF manipulates server requests.",
        "B": "❌ Term doesn’t exist; confusion with XSS.",
        "C": "❌ SQL injection targets databases."
      }
    },
    {
      "question": "19. A manager clicked a malicious link during online banking; a hidden session transferred funds. What attack occurred?",
      "options": [
        "A. Cross-site request forgery",
        "B. Clickjacking attack",
        "C. Server-side request forgery",
        "D. Cross-site scripting"
      ],
      "num_answers": 1,
      "answer": "A. Cross-site request forgery",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ CSRF forged a legitimate banking request using his session.",
        "B": "❌ Clickjacking hides UI elements, not session reuse.",
        "C": "❌ SSRF is server-driven.",
        "D": "❌ XSS injects scripts, not request replay."
      }
    },
    {
      "question": "20. Modifying values in a banking URL and seeing changes reflected indicates:",
      "options": [
        "A. Web parameter tampering",
        "B. Man in the middle",
        "C. Cross-site scripting",
        "D. Session splicing"
      ],
      "num_answers": 1,
      "answer": "A. Web parameter tampering",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ Web parameter tampering manipulates input fields or URL parameters to alter behavior.",
        "B": "❌ MITM intercepts traffic.",
        "C": "❌ XSS injects code.",
        "D": "❌ Session splicing fragments data streams."
      }
    },
    {
      "question": "21. Which attack involves tricking a user into clicking on something they didn’t intend to click on?",
      "options": ["A. Phishing", "B. DDoS", "C. SQL Injection", "D. Clickjacking"],
      "num_answers": 1,
      "answer": "D. Clickjacking",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ Clickjacking hides malicious elements under visible content.",
        "A": "❌ Phishing uses email deception.",
        "B": "❌ DDoS floods resources.",
        "C": "❌ SQL injection targets databases."
      }
    },
    {
      "question": "22. Which describes a clickjacking attack?",
      "options": [
        "A. Sending fake emails for data theft",
        "B. Flooding a server to deny service",
        "C. Exploiting website code for data access",
        "D. Tricking a user into clicking on a hidden element"
      ],
      "num_answers": 1,
      "answer": "D. Tricking a user into clicking on a hidden element",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ Clickjacking overlays transparent frames to trigger hidden actions.",
        "A": "❌ Phishing is email-based.",
        "B": "❌ DDoS overloads traffic.",
        "C": "❌ That’s code injection."
      }
    },
    {
      "question": "23. A fake 'gift card' site hid a transparent layer that triggered malware download. What attack is this?",
      "options": ["A. Man in the middle", "B. DDoS", "C. SQL Injection", "D. Clickjacking"],
      "num_answers": 1,
      "answer": "D. Clickjacking",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ Transparent overlay tricked user clicks—classic clickjacking.",
        "A": "❌ MITM intercepts, not overlays.",
        "B": "❌ DDoS overwhelms
 }
  }
]