{
  "Module 06: Nmap Scanning": [
    {
      "question": "1. Which Nmap scan type sends TCP SYN packets and analyzes responses without completing the TCP three-way handshake, making it stealthier than a full connect scan?",
      "options": [
        "A. -sT",
        "B. -sA",
        "C. -sS",
        "D. -sU"
      ],
      "num_answers": 1,
      "answer": "C. -sS",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ -sS is a TCP SYN (half-open/stealth) scan that does not complete the handshake, making it harder to log at the application level.",
        "A": "❌ -sT is a full TCP connect scan that completes the three-way handshake.",
        "B": "❌ -sA is a TCP ACK scan used mainly for firewall rule testing, not port state discovery.",
        "D": "❌ -sU is a UDP scan, not a SYN-based scan."
      }
    },
    {
      "question": "2. Which Nmap option is used to perform a TCP connect() scan, typically when you do not have raw packet privileges?",
      "options": [
        "A. -sS",
        "B. -sT",
        "C. -sA",
        "D. -sF"
      ],
      "num_answers": 1,
      "answer": "B. -sT",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -sT uses the OS connect() call and completes the TCP handshake on each port.",
        "A": "❌ -sS is the half-open SYN scan.",
        "C": "❌ -sA is an ACK scan for firewall mapping.",
        "D": "❌ -sF is a FIN scan, used as a stealth scan type."
      }
    },
    {
      "question": "3. Which Nmap scan type is BEST suited for mapping firewall rules by determining whether ports are filtered or unfiltered without identifying open/closed state?",
      "options": [
        "A. -sS (SYN scan)",
        "B. -sA (ACK scan)",
        "C. -sU (UDP scan)",
        "D. -sN (NULL scan)"
      ],
      "num_answers": 1,
      "answer": "B. -sA (ACK scan)",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ ACK scans (-sA) are primarily used to identify filtered vs. unfiltered ports and infer firewall rules.",
        "A": "❌ SYN scans detect open/closed ports, not just filter behavior.",
        "C": "❌ UDP scans check UDP ports, not firewall state in this way.",
        "D": "❌ NULL scans are stealthy TCP scans, not specifically for firewall mapping."
      }
    },
    {
      "question": "4. Which Nmap scan sends TCP packets with no flags set to attempt to evade some stateless filters and IDS signatures?",
      "options": [
        "A. -sN",
        "B. -sX",
        "C. -sF",
        "D. -sS"
      ],
      "num_answers": 1,
      "answer": "A. -sN",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ -sN is the NULL scan, sending TCP packets with no flags set.",
        "B": "❌ -sX is the Xmas scan (FIN, PSH, URG set).",
        "C": "❌ -sF sends packets with only the FIN flag set.",
        "D": "❌ -sS is a SYN scan."
      }
    },
    {
      "question": "5. Which Nmap scan type sets the FIN, PSH, and URG flags simultaneously in TCP packets?",
      "options": [
        "A. -sN",
        "B. -sX",
        "C. -sA",
        "D. -sU"
      ],
      "num_answers": 1,
      "answer": "B. -sX",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -sX performs an Xmas scan, with FIN, PSH, and URG flags set.",
        "A": "❌ -sN is the NULL scan (no flags).",
        "C": "❌ -sA is an ACK scan.",
        "D": "❌ -sU is a UDP scan, not TCP flags-based."
      }
    },
    {
      "question": "6. Which option tells Nmap to treat all hosts as online and skip the ICMP/ARP host discovery phase?",
      "options": [
        "A. -n",
        "B. -Pn",
        "C. -sn",
        "D. -PR"
      ],
      "num_answers": 1,
      "answer": "B. -Pn",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -Pn disables host discovery and forces Nmap to attempt port scans on all specified hosts.",
        "A": "❌ -n disables reverse DNS resolution.",
        "C": "❌ -sn is 'ping scan' (host discovery only, no port scan).",
        "D": "❌ -PR uses ARP for host discovery on local networks."
      }
    },
    {
      "question": "7. Which Nmap option performs a UDP scan to identify open UDP services?",
      "options": [
        "A. -sT",
        "B. -sS",
        "C. -sU",
        "D. -sA"
      ],
      "num_answers": 1,
      "answer": "C. -sU",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ -sU performs a UDP scan for UDP-based services (e.g., DNS, SNMP).",
        "A": "❌ -sT is a TCP connect scan.",
        "B": "❌ -sS is a TCP SYN scan.",
        "D": "❌ -sA is a TCP ACK scan."
      }
    },
    {
      "question": "8. Which Nmap options combination enables OS detection, version detection, script scanning, and traceroute in a single 'aggressive' scan?",
      "options": [
        "A. -sV -O",
        "B. -A",
        "C. -sC -O",
        "D. -sS -sU"
      ],
      "num_answers": 1,
      "answer": "B. -A",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -A enables OS detection, version detection, default scripts, and traceroute.",
        "A": "❌ -sV -O enables version + OS detection but not scripts/traceroute by default.",
        "C": "❌ -sC -O enables default scripts and OS detection but not traceroute.",
        "D": "❌ -sS -sU performs TCP SYN and UDP scans, not OS/script detection."
      }
    },
    {
      "question": "9. Which option in Nmap is used specifically for service version detection?",
      "options": [
        "A. -sS",
        "B. -sV",
        "C. -O",
        "D. -A"
      ],
      "num_answers": 1,
      "answer": "B. -sV",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -sV probes open ports to identify application/service versions.",
        "A": "❌ -sS is a SYN scan.",
        "C": "❌ -O is OS detection.",
        "D": "❌ -A turns on multiple advanced features, including -sV, but is not 'version-only'."
      }
    },
    {
      "question": "10. Which Nmap switch is used to enable OS fingerprinting to identify the target's operating system?",
      "options": [
        "A. -O",
        "B. -sV",
        "C. -A only",
        "D. -sC"
      ],
      "num_answers": 1,
      "answer": "A. -O",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ -O enables OS detection via TCP/IP stack fingerprinting.",
        "B": "❌ -sV is service version detection.",
        "C": "❌ -A includes OS detection but -O is the specific flag.",
        "D": "❌ -sC runs default NSE scripts."
      }
    },
    {
      "question": "11. Which Nmap option executes the default NSE script set against discovered services?",
      "options": [
        "A. --script=default",
        "B. -sC",
        "C. Both A and B",
        "D. -sV"
      ],
      "num_answers": 1,
      "answer": "C. Both A and B",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ -sC is equivalent to --script=default, running the default script category.",
        "A": "☑️ Correct, but -sC is the shorthand.",
        "B": "☑️ Correct, but it is just shorthand for --script=default.",
        "D": "❌ -sV is version detection, not NSE scripts."
      }
    },
    {
      "question": "12. You want to run only 'safe' NSE scripts against a production server to avoid disruptive actions. Which Nmap option is MOST appropriate?",
      "options": [
        "A. --script=vuln",
        "B. --script=exploit",
        "C. --script=safe",
        "D. --script=intrusive"
      ],
      "num_answers": 1,
      "answer": "C. --script=safe",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ The 'safe' category includes scripts unlikely to cause disruptions.",
        "A": "❌ 'vuln' scripts may be more aggressive and intrusive.",
        "B": "❌ 'exploit' scripts may attempt exploitation.",
        "D": "❌ 'intrusive' is explicitly riskier and not recommended on production without approval."
      }
    },
    {
      "question": "13. Which set of Nmap timing options goes from slowest (most stealthy) to fastest (least stealthy)?",
      "options": [
        "A. -T5, -T4, -T3, -T2, -T1, -T0",
        "B. -T0, -T1, -T2, -T3, -T4, -T5",
        "C. -T1, -T0, -T2, -T3, -T4, -T5",
        "D. -T0, -T2, -T4 only"
      ],
      "num_answers": 1,
      "answer": "B. -T0, -T1, -T2, -T3, -T4, -T5",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Nmap timing templates range from paranoid (-T0) to insane (-T5).",
        "A": "❌ This is reversed (fastest to slowest).",
        "C": "❌ Incorrect order; T0 is the slowest.",
        "D": "❌ Only three values and not in order."
      }
    },
    {
      "question": "14. You want Nmap to scan all 65,535 TCP ports on a host. Which option is correct?",
      "options": [
        "A. -F",
        "B. -p-",
        "C. -p 1-1024",
        "D. -p 80,443"
      ],
      "num_answers": 1,
      "answer": "B. -p-",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -p- instructs Nmap to scan all ports from 1 to 65535.",
        "A": "❌ -F scans only the most common ports.",
        "C": "❌ This limits scanning to the first 1024 ports.",
        "D": "❌ This scans only ports 80 and 443."
      }
    },
    {
      "question": "15. Which option disables reverse DNS resolution for faster scans?",
      "options": [
        "A. -R",
        "B. -n",
        "C. -Pn",
        "D. -sn"
      ],
      "num_answers": 1,
      "answer": "B. -n",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -n skips DNS resolution, speeding up large scans.",
        "A": "❌ -R forces reverse DNS resolution.",
        "C": "❌ -Pn skips host discovery, not DNS.",
        "D": "❌ -sn performs host discovery only."
      }
    },
    {
      "question": "16. Which option is used to enable decoy scanning in Nmap, making it harder for defenders to identify the real source IP?",
      "options": [
        "A. -D",
        "B. -S",
        "C. --data-length",
        "D. -f"
      ],
      "num_answers": 1,
      "answer": "A. -D",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ -D lets you specify decoy IPs to obfuscate the true origin of the scan.",
        "B": "❌ -S spoofs the source IP, but -D is decoy scanning.",
        "C": "❌ --data-length changes payload size for evasion, not decoys.",
        "D": "❌ -f fragments packets for evasion."
      }
    },
    {
      "question": "17. Which Nmap option spoofs the source IP address of the scan?",
      "options": [
        "A. -D",
        "B. -S",
        "C. -e",
        "D. --spoof-mac"
      ],
      "num_answers": 1,
      "answer": "B. -S",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -S allows you to specify a different source IP address.",
        "A": "❌ -D is for decoy scanning, not direct IP spoofing.",
        "C": "❌ -e chooses the network interface.",
        "D": "❌ --spoof-mac spoofs MAC address, not IP."
      }
    },
    {
      "question": "18. Which option tells Nmap to fragment packets, sometimes used to evade simple packet filters and IDS?",
      "options": [
        "A. -f",
        "B. --mtu",
        "C. --data-length",
        "D. -sF"
      ],
      "num_answers": 1,
      "answer": "A. -f",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ -f fragments packets into small IP fragments.",
        "B": "❌ --mtu sets a custom MTU for packet sizes, related but different.",
        "C": "❌ --data-length pads packets with extra data.",
        "D": "❌ -sF is a FIN scan type, not fragmentation."
      }
    },
    {
      "question": "19. Which Nmap option is used to specify a custom source port, sometimes used to bypass poorly configured firewalls (e.g., pretending to be DNS or HTTP)?",
      "options": [
        "A. --source-port",
        "B. --sport",
        "C. -g",
        "D. -p-"
      ],
      "num_answers": 1,
      "answer": "C. -g",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ -g or --source-port sets the source port for outgoing probes.",
        "A": "❌ --source-port is the long form alias, but exam-style often shows -g.",
        "B": "❌ --sport is not the standard Nmap flag.",
        "D": "❌ -p- selects destination ports, not source port."
      }
    },
    {
      "question": "20. You want to run only vulnerability-related NSE scripts against a target. Which category option should you use?",
      "options": [
        "A. --script=vuln",
        "B. --script=default",
        "C. --script=safe",
        "D. --script=exploit"
      ],
      "num_answers": 1,
      "answer": "A. --script=vuln",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ 'vuln' category focuses on vulnerability detection scripts.",
        "B": "❌ 'default' is a general, safe-ish set of scripts.",
        "C": "❌ 'safe' minimizes risk but is broader and less focused on vulns.",
        "D": "❌ 'exploit' runs scripts that may attempt exploitation."
      }
    },
    {
      "question": "21. Which Nmap output option saves results in all major formats (normal, XML, and grepable) using a given basename?",
      "options": [
        "A. -oN",
        "B. -oX",
        "C. -oG",
        "D. -oA"
      ],
      "num_answers": 1,
      "answer": "D. -oA",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ -oA saves output in three formats at once using a common filename prefix.",
        "A": "❌ -oN is normal output only.",
        "B": "❌ -oX is XML output only.",
        "C": "❌ -oG is grepable output only."
      }
    },
    {
      "question": "22. You want Nmap to perform host discovery only (ping scan) without port scanning. Which option is correct?",
      "options": [
        "A. -Pn",
        "B. -sn",
        "C. -n",
        "D. -F"
      ],
      "num_answers": 1,
      "answer": "B. -sn",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ -sn (formerly -sP) performs host discovery only.",
        "A": "❌ -Pn disables host discovery and treats hosts as online.",
        "C": "❌ -n disables DNS resolution.",
        "D": "❌ -F scans a smaller set of common ports."
      }
    },
    {
      "question": "23. Which Nmap flag allows scanning over IPv6 networks?",
      "options": [
        "A. -6",
        "B. -v6",
        "C. --ipv6",
        "D. -I6"
      ],
      "num_answers": 1,
      "answer": "A. -6",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ -6 tells Nmap to use IPv6 for scanning.",
        "B": "❌ -v6 is not a valid Nmap option.",
        "C": "❌ --ipv6 is not the official flag; -6 is used instead.",
        "D": "❌ -I6 is invalid."
      }
    },
    {
      "question": "24. Which command is MOST appropriate to quickly scan the top 1000 TCP ports, enable service version detection, and avoid DNS lookups, against a single host 10.0.0.5?",
      "options": [
        "A. nmap -sS -sV -n 10.0.0.5",
        "B. nmap -sU -n 10.0.0.5",
        "C. nmap -A -n -p- 10.0.0.5",
        "D. nmap -sn 10.0.0.5"
      ],
      "num_answers": 1,
      "answer": "A. nmap -sS -sV -n 10.0.0.5",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ SYN scan + version detection + no DNS is a common advanced scan approach.",
        "B": "❌ -sU does UDP only and may be slower.",
        "C": "❌ -A with -p- is very heavy; not 'quick'.",
        "D": "❌ -sn is host discovery only, no port or version scan."
      }
    },
    {
      "question": "25. During a CEH engagement, you want to minimize the chance of triggering IDS/IPS while still performing a SYN scan on a sensitive subnet. Which approach is MOST appropriate?",
      "options": [
        "A. nmap -sS -T0 --scan-delay 1s <target-subnet>",
        "B. nmap -sS -T5 <target-subnet>",
        "C. nmap -sS -A -T4 <target-subnet>",
        "D. nmap -sU -T5 <target-subnet>"
      ],
      "num_answers": 1,
      "answer": "A. nmap -sS -T0 --scan-delay 1s <target-subnet>",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ Very slow timing (-T0) and scan delay reduce traffic rate, improving stealth.",
        "B": "❌ -T5 is very aggressive and likely to trigger IDS/IPS.",
        "C": "❌ -A is noisy (OS, scripts, traceroute) combined with fast timing.",
        "D": "❌ Fast UDP scanning is also noisy and slow to interpret."
      }
    }
  ]
}
