githubEdit

Port Scan

Port Scanning is a port mapping on the network. It is often executing when reconnaissance.

Nmap

Nmap is still the most commonly used tool when scanning ports of the target system. But in recent years, some other tools, such as masscan or rustscan, are also becoming popular because the tools scan faster than nmap.

It's recommened to do as stealth scan (SYN scan) by adding the option -sS. Also it's prefered to add -T2 flag for being polite.

# -sS: SYN Scan
# -sV: Service/Version detection
# -sC: Default NSE (script)
# -T2: Timing template.
# -p-: Scan all ports
sudo nmap -sSVC -p- <target-ip> -T2
sudo nmap -sSVC -p 1-65535 <target-ip>
# -p 1000-1500: Scan ports from 1000 to 1500
sudo nmap -sSVC -p 1000-1500 <target-ip>

# If port scanning on CTF not real organization, use `--min-rate` for increase scan speed.
# --min-rate: Send packets no slower than <number> per second
sudo nmap -sSVC -p- <target-ip> --min-rate 1000

# -A: All detection
sudo nmap -sS -A <target-ip>

UDP Scan

Sometimes you need the UDP scan.

Skip Host Discovery

Specified Ports

Network Ranges

Scan Techniques

Firewall Bypass

Nmap Scripting Engine (NSE)

Using Proxychains

First start Tor service.

To execute the nmap with proxychains, add the proxychains command before the nmap command.

Port Knocking

Port knocking is a method of establishing a connection to a networked computer that has no open ports.

After that, check if ports opened.

Massscan

Masscanarrow-up-right is a TCP port scanner. It is faster than nmap.

RustScan

RustScanarrow-up-right is the modern port scanner. It is faster than nmap.

We can also use the Nmap arguments as below.

Naabu

References

Last updated