Penetration Testing with Kali Linux
PWK - Copyright © 2023 OffSec Services Limited. All rights reserved.
140
Figure 31: Wireshark capture of the Netcat port scan
In this capture (Figure 31), Netcat sent several TCP SYN packets to ports 3390, 3389, and 3388
on packets 1, 3, and 7, respectively. Due to a variety of factors, including timing issues, the
packets may appear out of order in Wireshark. We’ll observe that the server sent a TCP SYN-ACK
packet from port 3389 on packet 4, indicating that the port is open. The other ports did not reply
with a similar SYN-ACK packet, and actively rejected the connection attempt via a
RST-ACK
packet. Finally, on packet 6, Netcat closed this connection by sending a
FIN-ACK
packet.
Now that we have a good understanding of the TCP handshake and have examined how a TCP
scan works behind the scenes, let’s cover UDP scanning. Since UDP is stateless and does not
involve a three-way handshake, the mechanism behind UDP port scanning is different from TCP.
Let’s run a UDP Netcat port scan against ports 120-123 on a different target. We’ll use the only nc
option we have not covered yet, -u, which indicates a UDP scan.
kali@kali:~$
Yüklə
Dostları ilə paylaş: