Reconnaissance and Enumeration
A scope entry reads 10.10.4.17/22, with host bits set. A Python script must loop over only the usable host addresses of that network. Which call supplies them?
Show the answer
Correct answerA. ipaddress.ip_network(entry, strict=False).hosts()
AWhy this is right: strict=False accepts the host bits and hosts() yields only usable addresses, as required.
BWhy not this: ip_interface returns the single address 10.10.4.17, not every host in the network.
CWhy not this: strict=False avoids the error, but iterating the network directly also yields the network and broadcast addresses.
DWhy not this: With host bits set, ip_network raises ValueError under the default strict=True, so no addresses are produced.
strict=False lets ip_network accept an entry with host bits set, and hosts() yields only usable addresses, excluding network and broadcast. Without strict=False, ip_network raises ValueError on 10.10.4.17/22.