Port Scanning

4 min read690 words

Port Scanning Tools

Port scanning is a technique used in network security to identify open ports, discover accessible services, and understand the network exposure of a target system. Ethical hackers and penetration testers use port scanning to assess systems within an authorized scope.

What You'll Learn

  • Understand TCP and UDP ports.
  • Learn the difference between open, closed, and filtered ports.
  • Discover listening services on authorized systems.
  • Perform TCP and UDP port scans.
  • Identify service versions and potential security risks.
  • Interpret scan results and document findings.

Tools Covered

ToolDescription
NmapDiscover hosts, scan ports, identify services, and perform supported OS detection.
MasscanPerform high-speed port scanning across large address ranges when appropriately configured.
RustScanQuickly discover open ports and integrate with Nmap for further analysis.
UnicornscanPerform asynchronous TCP and UDP network scanning.
NetcatTest connectivity to specific TCP or UDP ports.
NaabuPerform fast port discovery using configurable scanning methods.
ZMapScan large network address spaces for specific ports or services under controlled conditions.

Types of Port Scanning

1. TCP Connect Scan

Establishes a full TCP connection to determine whether a port is accessible.

2. SYN Scan

Sends TCP SYN packets to examine port states without completing a full TCP connection in the usual case.

3. UDP Scan

Checks UDP ports. Results can be ambiguous because many UDP services do not respond to unexpected probes.

4. Service and Version Detection

Attempts to identify the service and its version running on an accessible port.

5. Operating System Detection

Uses network response characteristics to estimate the target operating system. Results are not always definitive.

Learning Path

  1. Port Fundamentals — Understand TCP, UDP, and common service ports.
  2. Basic Scanning — Start with Nmap on a local lab.
  3. Scan Types — Explore TCP connect, SYN, and UDP scanning.
  4. Service Detection — Learn to identify services and versions.
  5. Fast Port Discovery — Understand tools such as RustScan and Naabu.
  6. Result Analysis — Document exposed services and investigate security implications.

Basic Examples

Use these examples only on systems you own or have explicit permission to test.

Scan a Local Lab Host

nmap 192.168.1.10

Scan Specific Ports

nmap -p 22,80,443 192.168.1.10

Scan All TCP Ports

nmap -p- 192.168.1.10

Detect Services and Versions

nmap -sV 192.168.1.10

Perform a TCP Connect Scan

nmap -sT 192.168.1.10

Check a Specific Port with Netcat

nc -vz 192.168.1.10 80

Replace 192.168.1.10 with your own lab machine's IP address. Scan duration and results depend on network conditions, firewall rules, and the target's configuration.

Understanding Port States

StateMeaning
OpenAn application is accepting connections or responding as an active service.
ClosedThe host is reachable, but no service is listening on that port.
FilteredA firewall or network obstacle prevents Nmap from determining whether the port is open.
`OpenFiltered`
`ClosedFiltered`

Prerequisites

  • Basic networking knowledge.
  • Understanding of TCP, UDP, IP addresses, and common ports.
  • Familiarity with Linux terminal commands.
  • A local virtual machine or authorized practice lab.

Practice and Safety

Port scanning can generate network traffic and trigger security alerts. Scan only authorized systems and stay within the agreed scope. Avoid scanning public IP ranges or third-party infrastructure without explicit permission.

Next Steps

After learning port scanning, continue to:

  • Web Enumeration — Discover web directories, endpoints, and application resources.
  • Web Testing — Assess web applications for security vulnerabilities.
  • Exploitation — Study how validated vulnerabilities may affect systems in controlled labs.

Ugenz Academy — Learn • Build • Protect • Grow.

Keep learning. Keep building. Keep growing.

© 2026 Ugenz Academy