{
  "Module 35: Ports, Services & Scanning": [
    {
      "question": "1. Which port does SMTP typically use for sending email between mail servers on the Internet?",
      "options": [
        "A. 23",
        "B. 25",
        "C. 53",
        "D. 110"
      ],
      "num_answers": 1,
      "answer": "B. 25",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Port 25/TCP is the traditional SMTP relay port used between mail transfer agents.",
        "A": "❌ 23/TCP is Telnet.",
        "C": "❌ 53 is DNS.",
        "D": "❌ 110 is POP3."
      }
    },
    {
      "question": "2. Which IP protocol numbers are associated with IPSec's ESP and AH respectively?",
      "options": [
        "A. 50 (ESP) and 51 (AH)",
        "B. 51 (ESP) and 50 (AH)",
        "C. 80 (ESP) and 443 (AH)",
        "D. 500 (ESP) and 4500 (AH)"
      ],
      "num_answers": 1,
      "answer": "A. 50 (ESP) and 51 (AH)",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ ESP uses IP protocol 50 and AH uses IP protocol 51 for IPSec traffic.",
        "B": "❌ Reversed.",
        "C": "❌ 80 and 443 are TCP ports (HTTP/HTTPS), not IP protocol numbers.",
        "D": "❌ 500/4500 are UDP ports for IKE/IKEv2 with NAT-T, not ESP/AH."
      }
    },
    {
      "question": "3. Which ports are commonly used by DHCP for client–server communication?",
      "options": [
        "A. UDP 67 and UDP 68",
        "B. TCP 67 and TCP 68",
        "C. UDP 69 and UDP 70",
        "D. TCP 110 and TCP 143"
      ],
      "num_answers": 1,
      "answer": "A. UDP 67 and UDP 68",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ DHCP servers listen on UDP 67, and clients use UDP 68.",
        "B": "❌ DHCP uses UDP, not TCP.",
        "C": "❌ 69/70 are not DHCP.",
        "D": "❌ 110 and 143 are mail protocols (POP3/IMAP)."
      }
    },
    {
      "question": "4. Which port is the default for TFTP?",
      "options": [
        "A. UDP 69",
        "B. TCP 21",
        "C. TCP 22",
        "D. UDP 53"
      ],
      "num_answers": 1,
      "answer": "A. UDP 69",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ TFTP uses UDP port 69 for simple file transfers (no authentication).",
        "B": "❌ 21/TCP is FTP control.",
        "C": "❌ 22/TCP is SSH/SFTP.",
        "D": "❌ 53 is DNS."
      }
    },
    {
      "question": "5. Which statement about HTTP and port 80 is MOST accurate?",
      "options": [
        "A. HTTP can ONLY work on port 80",
        "B. HTTP usually uses port 80 but can run on any TCP port",
        "C. HTTP must run on port 443 by default",
        "D. HTTP traffic does not use ports"
      ],
      "num_answers": 1,
      "answer": "B. HTTP usually uses port 80 but can run on any TCP port",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Port 80 is the default, but web servers can bind HTTP to arbitrary ports (e.g., 8080).",
        "A": "❌ Services are not locked to a single port.",
        "C": "❌ 443 is default for HTTPS, not plain HTTP.",
        "D": "❌ TCP and UDP both use ports for multiplexing."
      }
    },
    {
      "question": "6. Why is it important for a security analyst to know which services are bound to which ports?",
      "options": [
        "A. To increase CPU clock speed",
        "B. To identify encrypted vs clear-text traffic and detect unexpected services",
        "C. To disable all network connectivity",
        "D. To speed up disk performance"
      ],
      "num_answers": 1,
      "answer": "B. To identify encrypted vs clear-text traffic and detect unexpected services",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Mapping ports to services helps detect exposed services, misconfigurations, and unencrypted data.",
        "A": "❌ Ports do not affect CPU frequency.",
        "C": "❌ The goal is to secure, not disable, networking.",
        "D": "❌ Ports are unrelated to disk I/O."
      }
    },
    {
      "question": "7. Which port is the default for SSH and SFTP?",
      "options": [
        "A. TCP 20",
        "B. TCP 21",
        "C. TCP 22",
        "D. TCP 23"
      ],
      "num_answers": 1,
      "answer": "C. TCP 22",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ SSH and SFTP both typically use TCP port 22.",
        "A": "❌ 20/TCP is FTP data.",
        "B": "❌ 21/TCP is FTP control.",
        "D": "❌ 23/TCP is Telnet."
      }
    },
    {
      "question": "8. Which port is the default for HTTPS?",
      "options": [
        "A. TCP 80",
        "B. TCP 443",
        "C. TCP 8080",
        "D. TCP 110"
      ],
      "num_answers": 1,
      "answer": "B. TCP 443",
      "answer_keys": ["B"],
      "explanations": {
          "B": "✅ HTTPS (HTTP over TLS/SSL) uses TCP port 443 by default.",
          "A": "❌ 80 is plain HTTP (unencrypted).",
          "C": "❌ 8080 is often alternate HTTP, not default HTTPS.",
          "D": "❌ 110 is POP3."
      }
    },
    {
      "question": "9. TACACS+ typically uses which port for AAA communications?",
      "options": [
        "A. UDP 1812",
        "B. TCP 49",
        "C. TCP 88",
        "D. UDP 1645"
      ],
      "num_answers": 1,
      "answer": "B. TCP 49",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ TACACS+ uses TCP port 49 and provides AAA with full-packet encryption.",
        "A": "❌ 1812 UDP is RADIUS authentication.",
        "C": "❌ 88 is Kerberos.",
        "D": "❌ 1645 is older RADIUS assignment."
      }
    },
    {
      "question": "10. Which port is used by Kerberos in an Active Directory environment?",
      "options": [
        "A. TCP/UDP 53",
        "B. TCP 88",
        "C. TCP 389",
        "D. TCP 389 and 636"
      ],
      "num_answers": 1,
      "answer": "B. TCP 88",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Kerberos uses port 88 (TCP/UDP) for ticket-based authentication.",
        "A": "❌ 53 is DNS.",
        "C": "❌ 389 is LDAP, not Kerberos.",
        "D": "❌ 389 and 636 are LDAP/LDAPS."
      }
    },
    {
      "question": "11. Which port does POP3 use by default for retrieving email from a mail server?",
      "options": [
        "A. 25",
        "B. 80",
        "C. 110",
        "D. 143"
      ],
      "num_answers": 1,
      "answer": "C. 110",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ POP3 uses TCP 110 for mailbox retrieval.",
        "A": "❌ 25 is SMTP.",
        "B": "❌ 80 is HTTP.",
        "D": "❌ 143 is IMAP."
      }
    },
    {
      "question": "12. Which port is the default for SNMP (agent listening port)?",
      "options": [
        "A. UDP 160",
        "B. UDP 161",
        "C. UDP 162",
        "D. TCP 443"
      ],
      "num_answers": 1,
      "answer": "B. UDP 161",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ SNMP agents listen on UDP 161.",
        "C": "❌ 162 is used for SNMP traps (notifications).",
        "A": "❌ 160 is not SNMP.",
        "D": "❌ 443 is HTTPS."
      }
    },
    {
      "question": "13. SNMP traps are typically sent to which port?",
      "options": [
        "A. UDP 160",
        "B. UDP 161",
        "C. UDP 162",
        "D. UDP 514"
      ],
      "num_answers": 1,
      "answer": "C. UDP 162",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ SNMP managers receive trap messages on UDP 162.",
        "B": "❌ 161 is the agent port.",
        "A": "❌ 160 is not used for SNMP.",
        "D": "❌ 514 is commonly syslog."
      }
    },
    {
      "question": "14. Which port is MOST commonly associated with RDP on Windows systems?",
      "options": [
        "A. TCP 3389",
        "B. TCP 445",
        "C. TCP 135",
        "D. TCP 5900"
      ],
      "num_answers": 1,
      "answer": "A. TCP 3389",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ Remote Desktop Protocol uses TCP 3389 by default.",
        "B": "❌ 445 is SMB.",
        "C": "❌ 135 is RPC endpoint mapper.",
        "D": "❌ 5900 is VNC."
      }
    },
    {
      "question": "15. DNS typically uses which ports?",
      "options": [
        "A. TCP 20/21",
        "B. UDP 53 only",
        "C. UDP 53 and TCP 53",
        "D. TCP 110 and TCP 143"
      ],
      "num_answers": 1,
      "answer": "C. UDP 53 and TCP 53",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ DNS uses UDP 53 for most queries and TCP 53 for zone transfers and large responses.",
        "B": "❌ UDP only is incomplete; TCP is also used.",
        "A": "❌ 20/21 are FTP.",
        "D": "❌ 110/143 are mail protocols."
      }
    },
    {
      "question": "16. Which port is associated with SMB over TCP (direct hosting) on modern Windows systems?",
      "options": [
        "A. TCP 139",
        "B. TCP 445",
        "C. UDP 137",
        "D. UDP 138"
      ],
      "num_answers": 1,
      "answer": "B. TCP 445",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Modern SMB uses TCP 445 for file and printer sharing.",
        "A": "❌ 139 is older NetBIOS session service.",
        "C": "❌ 137 is NetBIOS name service.",
        "D": "❌ 138 is NetBIOS datagram service."
      }
    },
    {
      "question": "17. Which ports are typically used by LDAP and LDAPS?",
      "options": [
        "A. 389 for LDAP, 636 for LDAPS",
        "B. 88 for LDAP, 389 for LDAPS",
        "C. 389 for LDAP, 443 for LDAPS",
        "D. 80 for LDAP, 443 for LDAPS"
      ],
      "num_answers": 1,
      "answer": "A. 389 for LDAP, 636 for LDAPS",
      "answer_keys": ["A"],
      "explanations": {
        "A": "✅ LDAP uses 389 (usually TCP/UDP) and LDAPS uses 636/TCP wrapped in TLS.",
        "B": "❌ 88 is Kerberos.",
        "C": "❌ 443 is HTTPS, not standard LDAPS.",
        "D": "❌ 80 is HTTP."
      }
    },
    {
      "question": "18. Which statement BEST describes ARP and ports?",
      "options": [
        "A. ARP uses TCP port 80",
        "B. ARP uses UDP port 53",
        "C. ARP does not use ports because it operates at Layer 2",
        "D. ARP uses dynamic ports assigned by the OS"
      ],
      "num_answers": 1,
      "answer": "C. ARP does not use ports because it operates at Layer 2",
      "answer_keys": ["C"],
      "explanations": {
        "C": "✅ ARP resolves IP-to-MAC at the data link layer and does not use TCP/UDP ports.",
        "A": "❌ 80 is HTTP and Layer 4.",
        "B": "❌ 53 is DNS.",
        "D": "❌ Ports are a Layer 4 concept, not used by ARP."
      }
    },
    {
      "question": "19. What is the PRIMARY purpose of port scanning in ethical hacking?",
      "options": [
        "A. To change MAC addresses on the network",
        "B. To identify open, closed, and filtered ports and associated services",
        "C. To encrypt all network traffic",
        "D. To disable unused network interfaces"
      ],
      "num_answers": 1,
      "answer": "B. To identify open, closed, and filtered ports and associated services",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Port scanning maps exposed services and potential attack surface.",
        "A": "❌ MAC changes are unrelated to port scanning.",
        "C": "❌ Scanning does not encrypt traffic.",
        "D": "❌ Interface configuration is separate from scanning."
      }
    },
    {
      "question": "20. Which protocol does NOT use a TCP or UDP port number?",
      "options": [
        "A. SSH",
        "B. ICMP",
        "C. DNS",
        "D. SMTP"
      ],
      "num_answers": 1,
      "answer": "B. ICMP",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ ICMP is a network layer protocol identified by IP protocol number 1, not by ports.",
        "A": "❌ SSH uses TCP 22.",
        "C": "❌ DNS uses TCP/UDP 53.",
        "D": "❌ SMTP uses TCP 25/587/465."
      }
    },
    {
      "question": "21. Which of the following is the default port for RDP brute-force attempts commonly seen in attacks?",
      "options": [
        "A. 21",
        "B. 22",
        "C. 80",
        "D. 3389"
      ],
      "num_answers": 1,
      "answer": "D. 3389",
      "answer_keys": ["D"],
      "explanations": {
        "D": "✅ Attackers frequently target RDP on TCP 3389 for credential stuffing and brute force.",
        "A": "❌ 21 is FTP.",
        "B": "❌ 22 is SSH.",
        "C": "❌ 80 is HTTP."
      }
    },
    {
      "question": "22. Which protocol and port combination is MOST commonly used for secure VPN tunneling with OpenVPN?",
      "options": [
        "A. TCP 21",
        "B. UDP 1194",
        "C. TCP 143",
        "D. UDP 500"
      ],
      "num_answers": 1,
      "answer": "B. UDP 1194",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ By default, OpenVPN uses UDP 1194, though it can be configured on other ports.",
        "A": "❌ 21 is FTP.",
        "C": "❌ 143 is IMAP.",
        "D": "❌ UDP 500 is typically IKE/IKEv2 for IPsec, not OpenVPN."
      }
    },
    {
      "question": "23. How can SSH tunneling be abused by an attacker?",
      "options": [
        "A. To block all outbound traffic",
        "B. To tunnel other protocols (e.g., RDP, HTTP) through port 22 and bypass firewalls",
        "C. To change MAC addresses automatically",
        "D. To disable DNS resolution"
      ],
      "num_answers": 1,
      "answer": "B. To tunnel other protocols (e.g., RDP, HTTP) through port 22 and bypass firewalls",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ SSH tunnels can encapsulate other traffic, evading simple port-based firewall rules.",
        "A": "❌ Tunnels don’t inherently block traffic.",
        "C": "❌ MAC spoofing is unrelated.",
        "D": "❌ DNS is not directly controlled by SSH."
      }
    },
    {
      "question": "24. Which statement BEST describes the difference between physical and logical ports?",
      "options": [
        "A. Physical ports are numbered; logical ports have no number",
        "B. Physical ports exist as hardware connectors; logical ports are software endpoints identified by numbers like 80 or 443",
        "C. Logical ports are only used in switches; physical ports are only in routers",
        "D. Physical ports encrypt traffic; logical ports decrypt it"
      ],
      "num_answers": 1,
      "answer": "B. Physical ports exist as hardware connectors; logical ports are software endpoints identified by numbers like 80 or 443",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Physical ports are jacks/sockets; logical ports are TCP/UDP identifiers for processes.",
        "A": "❌ Logical ports are numbered; physical ports are not defined that way.",
        "C": "❌ Both exist on various devices.",
        "D": "❌ Encryption has nothing to do with this distinction."
      }
    },
    {
      "question": "25. Why might an attacker run HTTP or SSH on a non-standard port such as TCP 8081 or 2222?",
      "options": [
        "A. To improve CPU performance",
        "B. To evade basic firewall rules and simple port-based detection",
        "C. To disable DNS servers",
        "D. Because services cannot run on default ports"
      ],
      "num_answers": 1,
      "answer": "B. To evade basic firewall rules and simple port-based detection",
      "answer_keys": ["B"],
      "explanations": {
        "B": "✅ Moving services to non-standard ports can bypass naive security controls that only check defaults.",
        "A": "❌ Port choice does not affect CPU speed.",
        "C": "❌ DNS is unrelated.",
        "D": "❌ They *can* run on default ports; non-standard ports are a choice."
      }
    }
  ]
}
