Skip to main content
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.
sudo apt update
sudo apt install -y libpcap-dev libpcap0.8-dev
For Docker Ubuntu containers:
apt update && apt install -yy libpcap0.8-dev

Installation Methods

Download pre-compiled binaries from GitHub Releases - fastest and easiest method.
1

Download the binary

Visit the releases page and download the appropriate binary for your platform:
Linux
# 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
macOS
# 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/
2

Verify installation

scan4all -version
You should see the version information printed.

Method 2: Using Go Install

Install directly using Go (requires Go 1.21.4+):
go install github.com/GhostTroops/[email protected]
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:
scan4all -h

Method 3: Build from Source

For the latest features or custom modifications:
1

Install dependencies

Install Go and build tools:
Ubuntu/Debian
sudo apt install -y golang git build-essential libpcap-dev
CentOS/RHEL
sudo yum install -y golang git gcc libpcap-devel
macOS
brew install go git libpcap
2

Clone the repository

git clone https://github.com/GhostTroops/scan4all.git
cd scan4all
3

Build the binary

go build -o scan4all
For optimized production builds:
CGO_ENABLED=1 go build -ldflags="-s -w" -trimpath -o scan4all
4

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:
sudo apt install -y nmap
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:
Dockerfile
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

Platform-Specific Notes

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:
  1. Check the GitHub Issues
  2. Visit Discussions for Q&A
  3. 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

Build docs developers (and LLMs) love