312-50 ยท Scanning networks
Network scanning and the TCP three-way handshake
Purpose of scanning, TCP flags and the three-way handshake, ICMP types, and what scanning produces.
Key points
- Scanning probes targets to learn which hosts are alive, which ports are open, which services run and which OS they use.
- TCP connections start with SYN, the server answers SYN/ACK if the port is open (RST if closed), and the client finishes with ACK.
- Most scan types are variations on how far they take this exchange.
Source: https://linux.die.net/man/1/nmap
Practice questions
Which flags does a server set in the second step of the TCP three-way handshake when the port is open?
- SYN and ACK
- ACK only
- FIN and ACK
- RST and ACK
Show answer
Answer: A. SYN and ACK
An open port answers a SYN with SYN/ACK. A bare ACK is the client's last step and RST/ACK signals a closed port.
Which items are typical outputs of a network scan?
- A list of live hosts
- Open, closed and filtered port states
- Names of services listening on ports
- Plaintext user passwords
- The application's source code
Show answer
Answer: A. A list of live hosts, B. Open, closed and filtered port states, C. Names of services listening on ports
Scans reveal live hosts, port states and service names. Passwords and source code are not obtained by probing ports.
A host that does not answer ICMP echo requests must be offline.
Show answer
Answer: False
False. Firewalls often drop ICMP while the host and its TCP services are fine, which is why scanners also try TCP and ARP probes.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
