Port scanning techniques (TCP, UDP)

Port scanning is a fundamental technique used in cybersecurity assessments and ethical hacking to identify open ports and services running on target systems. Different types of port scanning techniques are employed to achieve this goal, including TCP and UDP port scans. Here's an overview of each:

TCP Port Scanning Techniques:

TCP Connect Scan: Also known as a full-open scan, this method involves initiating a full TCP connection to each port being scanned. If a connection is successfully established, the port is considered open.
This scan type is reliable but can be easily detected by intrusion detection systems (IDS) or firewall logs.

SYN Scan (Half-open Scan): In a SYN scan, the scanning tool sends SYN packets to the target ports. If a SYN-ACK (synchronization acknowledgment) packet is received in response, it indicates that the port is open.
This scan is stealthier than a TCP connect scan because it does not complete the TCP handshake, but it may still be detected by IDS or firewall logs.

ACK Scan: This scan type involves sending ACK (acknowledgment) packets to target ports. The scanner then analyzes the responses received. If a RST (reset) packet is received, it indicates that the port is unfiltered (i.e., not blocked by a firewall). If no response is received, the port may be filtered or protected by a firewall.

FIN Scan: A FIN scan sends FIN (finish) packets to target ports. If the port is closed, it may respond with a RST packet. However, many systems do not respond to FIN packets, making this scan less reliable.

XMAS Scan: An XMAS scan sets the FIN, URG (urgent), and PSH (push) flags in the TCP header. Similar to the FIN scan, this method aims to elicit responses from closed ports. However, its effectiveness may vary depending on the target system's behavior.

UDP Port Scanning Techniques:

UDP Scan: UDP scanning involves sending UDP packets to target ports and analyzing the responses received. If an ICMP (Internet Control Message Protocol) unreachable message is received, it indicates that the port is closed. If no response is received, the port may be open or filtered.

NULL Scan: In a NULL scan, the scanning tool sends packets with no flags set in the TCP header. This scan relies on the target system's response behavior to determine port status. If no response is received, the port may be open. However, many systems respond differently to NULL packets, making this scan less reliable.

FIN Scan: Similar to TCP FIN scanning, FIN packets can be sent to UDP ports to determine their status. If the port is closed, it may respond with an ICMP port unreachable message.

UDP Reverse Ident Scan: This technique involves sending UDP packets to the target ports and analyzing the responses to identify services running on those ports. It can be useful for identifying UDP services that do not follow standard protocol behavior.

Each port scanning technique has its strengths, weaknesses, and potential for detection. Ethical hackers and security professionals must carefully select the appropriate scanning techniques based on the target environment, goals, and risk tolerance. Additionally, obtaining proper authorization and adhering to legal and ethical guidelines are essential when conducting port scanning activities.

Indian Cyber Securiry



Research Papers


Case Study



Cyber Police


Newsletter