Reconnaissance and Enumeration
A Python script must send an HTTP GET to each in-scope web host and read the Server response header. Which call does this?
Show the answer
Correct answerD. requests.get(url).headers["Server"]
AWhy not this: Ping sends ICMP echo requests, which carry no HTTP headers.
BWhy not this: json.loads parses a JSON string, not a URL, and makes no network request.
CWhy not this: It only resolves a hostname to an IP address and sends no HTTP request, so no headers are returned.
DWhy this is right: requests.get sends the HTTP GET and .headers holds the response headers, including Server.
The requests library sends the HTTP GET and exposes response headers as a dictionary, so the Server header is read directly. gethostbyname only resolves a name to an IP address and sends no HTTP request.