Masscan
Learn Masscan (Ultra-Fast Port Scanner)
Understand how to scan networks at extremely high speed.
Link -> https://github.com/robertdavidgraham/masscan
Tool: Masscan
Description: Masscan is one of the fastest port scanners available. It is designed to scan massive networks (even the entire internet) at incredible speed.
Key features:
- Extremely high-speed scanning
- Scans millions of packets per second
- Lightweight and efficient
It helps you:
- Discover open ports quickly
- Scan large IP ranges
- Identify active services
Used in:
- Large-scale reconnaissance
- Network auditing
- Fast port discovery before deeper scans
Installation / Check
Check if installed:
which masscan
Install Masscan:
sudo apt install masscan
Basic Syntax
masscan <target> -p<ports>
Common Commands
Scan Web Ports
Command:
masscan 192.168.1.0/24 -p80,443
- What it does: Scans for common web ports (80, 443).
- When to use: To find active web servers in a network.
Full Port Scan
Command:
masscan 10.0.0.0/8 -p0-65535 --rate 10000
- What it does: Scans all ports across a large network range.
- When to use: For complete and deep enumeration.
Top Ports Scan
Command:
masscan 192.168.1.0/24 --top-ports 100
- What it does: Scans the top 100 most common ports.
- When to use: To quickly identify common services.
Save Scan Results
Command:
masscan 192.168.1.0/24 -p22,3389 -oL output.txt
- What it does: Saves scan results to a file.
- When to use: For documentation and later analysis.
Step-by-Step Guide
- Define target (IP or range)
- Choose ports to scan
- Set scan rate carefully:
--rate 1000
- Run scan:
masscan <target> -p<ports>
- Save output for later analysis
Understanding Output
Masscan displays:
Discovered open port <port>/tcp on <IP>
Example:
Discovered open port 80/tcp on 192.168.1.1
Meaning:
- Port is open and accessible
- Service likely running on that port
⚠️ Important Warnings
- Generates extremely high network traffic
- Can crash routers/firewalls if misused
- Always use low rate in real environments
- Requires root/sudo privileges
- Easily detected by security systems
🚨 Legal Notice
⚠️ Use Kali Linux tools only on systems you own or have permission to test. Unauthorized high-speed scanning can lead to serious legal consequences.
👉 Comparison:
- Nmap → Accurate but slower
- Masscan → Super fast but less detailed
👉 Real hackers use:
- Masscan ⚡ (fast discovery)
- Nmap 🎯 (detailed analysis)
💡 Pro Combo:
masscan 192.168.1.0/24 -p80,443 --rate 1000 -oL ports.txt
nmap -iL ports.txt -sV
👉 Fast scan + Deep scan = 🔥 Perfect combo