This guide covers installation of scan4all on Linux, macOS, and Windows, including all required dependencies.
System Requirements
Operating System : Linux, macOS, or Windows
Go Version : 1.21.4 or higher (if building from source)
Memory : Minimum 2GB RAM recommended
Disk Space : At least 500MB for binaries and POC database
Network : Root/Administrator privileges for SYN scanning
Required Dependencies
libpcap Library
scan4all requires the libpcap library for packet capture functionality. This is a mandatory dependency.
Ubuntu/Debian
CentOS/RHEL
macOS
Windows
sudo apt update
sudo apt install -y libpcap-dev libpcap0.8-dev
For Docker Ubuntu containers: apt update && apt install -yy libpcap0.8-dev
sudo yum install -yy glibc-devel.x86_64
sudo yum install -yy libpcap
On macOS, libpcap is usually pre-installed. If you encounter issues, reinstall it using Homebrew.
Install WinPcap or Npcap:
Download Npcap (recommended)
Run the installer with administrator privileges
Enable “WinPcap API-compatible Mode” during installation
Make sure to check “Install Npcap in WinPcap API-compatible Mode” for scan4all compatibility.
Installation Methods
Method 1: Pre-built Binaries (Recommended)
Download pre-compiled binaries from GitHub Releases - fastest and easiest method.
Download the binary
Visit the releases page and download the appropriate binary for your platform: # Download latest release (example)
wget https://github.com/GhostTroops/scan4all/releases/download/v2.8.9/scan4all_linux_amd64
# Make it executable
chmod +x scan4all_linux_amd64
# Move to system path (optional)
sudo mv scan4all_linux_amd64 /usr/local/bin/scan4all
# Download latest release for macOS
curl -L -o scan4all https://github.com/GhostTroops/scan4all/releases/download/v2.8.9/scan4all_darwin_amd64
# Make executable
chmod +x scan4all
# Move to path
sudo mv scan4all /usr/local/bin/
Verify installation
You should see the version information printed.
Method 2: Using Go Install
Install directly using Go (requires Go 1.21.4+):
The binary will be installed to your $GOPATH/bin directory. Ensure this is in your PATH:
export PATH = $PATH :$( go env GOPATH )/ bin
Verify the installation:
Method 3: Build from Source
For the latest features or custom modifications:
Install dependencies
Install Go and build tools: sudo apt install -y golang git build-essential libpcap-dev
sudo yum install -y golang git gcc libpcap-devel
brew install go git libpcap
Clone the repository
git clone https://github.com/GhostTroops/scan4all.git
cd scan4all
Build the binary
For optimized production builds: CGO_ENABLED = 1 go build -ldflags= "-s -w" -trimpath -o scan4all
Install system-wide (optional)
sudo mv scan4all /usr/local/bin/
Verifying Installation
Run a quick test to ensure everything is working:
scan4all -host 127.0.0.1 -p 80 -v
This scans your localhost on port 80 with verbose output.
Troubleshooting
libpcap Version Conflicts
If you see an error like:
libpcap.so.0.8: cannot open shared object file: No such file or directory
Check installed versions:
ls -la /lib64/libpcap *
# or on some systems
ls -la /usr/lib/x86_64-linux-gnu/libpcap *
Create a symbolic link to the installed version:
# If you have libpcap.so.1.9.1 but need 0.8
sudo ln -s /lib64/libpcap.so.1.9.1 /lib64/libpcap.so.0.8
# On Ubuntu/Debian
sudo ln -s /usr/lib/x86_64-linux-gnu/libpcap.so.1.10.1 /usr/lib/x86_64-linux-gnu/libpcap.so.0.8
Too Many Open Files (Linux)
For large-scale scans, you may need to increase the file descriptor limit:
# Check current limit
ulimit -n
# Check current open files
awk '{print $1}' /proc/sys/fs/file-nr
# Temporarily increase limit for current session
ulimit -n 819200
Permanent fix: Edit /etc/security/limits.conf:
* soft nofile 819200
* hard nofile 819200
Log out and back in for changes to take effect.
Permission Issues
Some scan types (like SYN scans) require elevated privileges:
# Option 1: Run as root
sudo scan4all -host 192.168.1.1
# Option 2: Set capabilities (Linux only)
sudo setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip $( which scan4all )
Setting capabilities allows scan4all to perform privileged operations without sudo, but use this carefully on shared systems.
Optional Components
Nmap Integration
scan4all can optionally use nmap for enhanced port scanning:
Ubuntu/Debian
CentOS/RHEL
macOS
Enable nmap scanning:
export PPSSWWDD = yourRootPassword
priorityNmap = true ./scan4all -host 192.168.1.1
The PPSSWWDD environment variable stores your root password for automated nmap execution. Only use this in secure environments.
Elasticsearch Integration
For centralized result storage and analysis:
# Create directories for Elasticsearch
mkdir -p logs data
# Run Elasticsearch in Docker
docker run --restart=always --ulimit nofile=65536:65536 \
-p 9200:9200 -p 9300:9300 -d --name es \
-v $PWD /logs:/usr/share/elasticsearch/logs \
-v $PWD /config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v $PWD /config/jvm.options:/usr/share/elasticsearch/config/jvm.options \
-v $PWD /data:/usr/share/elasticsearch/data \
hktalent/elasticsearch:7.16.2
# Initialize indices
./config/initEs.sh
Configure scan4all to use Elasticsearch by editing config/config.json.
Log4j-scan Integration
For enhanced Log4j vulnerability scanning:
mkdir -p ~/MyWork/
cd ~/MyWork/
git clone https://github.com/hktalent/log4j-scan
scan4all will automatically detect and use log4j-scan if available.
Docker Installation
Run scan4all in a Docker container:
FROM ubuntu:22.04
RUN apt update && apt install -y \
libpcap0.8-dev \
wget \
ca-certificates
# Download scan4all
RUN wget https://github.com/GhostTroops/scan4all/releases/download/v2.8.9/scan4all_linux_amd64 \
-O /usr/local/bin/scan4all && \
chmod +x /usr/local/bin/scan4all
ENTRYPOINT [ "/usr/local/bin/scan4all" ]
Build and run:
docker build -t scan4all .
docker run --rm scan4all -host scanme.nmap.org -v
Linux
CentOS 7+ : May need to install glibc-devel.x86_64 for compatibility
Alpine Linux : Use apk add libpcap-dev and compile from source with musl support
SELinux : May need to adjust policies for raw socket access
macOS
M1/M2 Chips : Use the ARM64 binary or build from source
Gatekeeper : You may need to allow the binary in System Preferences > Security & Privacy
Network Extensions : May prompt for network monitoring permissions
Windows
Antivirus : Security software may flag scan4all as potentially unwanted. Add an exclusion if needed
Windows Defender : May need to allow through firewall
Administrator Mode : Always run Command Prompt or PowerShell as Administrator
Updating scan4all
To update to the latest version:
# Using go install
go install github.com/GhostTroops/scan4all@latest
# Or use built-in update command
scan4all -update
Uninstallation
To remove scan4all:
# If installed via go install
rm $( which scan4all )
# If installed to /usr/local/bin
sudo rm /usr/local/bin/scan4all
# Remove configuration and cache (optional)
rm -rf ~/.config/scan4all
Next Steps
Quick Start Run your first scan in minutes
Configuration Learn about configuration options
Advanced Usage Explore advanced scanning techniques
Get Help Join the community discussions
Getting Help
If you encounter issues:
Check the GitHub Issues
Visit Discussions for Q&A
Review the troubleshooting guide
For bug reports, include:
Operating system and version
scan4all version (scan4all -version)
libpcap version (ldconfig -p | grep libpcap)
Complete error messages
Steps to reproduce