Skip to content

Installation

This guide covers all installation methods for CloakProbe.

The recommended way to install CloakProbe on a Linux server:

Terminal window
curl -fsSL https://raw.githubusercontent.com/drmckay/cloakprobe/main/install.sh | sudo bash

The script automatically:

  • Detects your architecture (x86_64 or aarch64)
  • Downloads the latest release
  • Creates /opt/cloakprobe directory structure
  • Creates a cloakprobe system user
  • Installs the systemd service
  • Sets correct permissions

After installation, download the databases:

Terminal window
# IP-to-ASN database (required)
sudo /opt/cloakprobe/scripts/update_asn_db.sh
# RIPE organization database (optional, for company names)
sudo /opt/cloakprobe/scripts/update_ripe_db.sh
  1. Install Rust

    Terminal window
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source $HOME/.cargo/env
  2. Clone the repository

    Terminal window
    git clone https://github.com/drmckay/cloakprobe.git
    cd cloakprobe
  3. Build the release binary

    Terminal window
    cargo build --release

    The binary will be at target/release/cloakprobe.

  4. Build database tools

    Terminal window
    cargo build --release --bin asn_builder
    cargo build --release --bin ripe_builder

If you prefer to install manually without the script:

  1. Create directory structure

    Terminal window
    sudo mkdir -p /opt/cloakprobe/{data,scripts,systemd}
  2. Copy binaries

    Terminal window
    sudo cp target/release/cloakprobe /opt/cloakprobe/
    sudo cp target/release/asn_builder /opt/cloakprobe/
    sudo cp target/release/ripe_builder /opt/cloakprobe/
    sudo chmod +x /opt/cloakprobe/*
  3. Create system user

    Terminal window
    sudo useradd -r -s /bin/false -d /opt/cloakprobe cloakprobe
  4. Copy scripts

    Terminal window
    sudo cp scripts/update_asn_db.sh /opt/cloakprobe/scripts/
    sudo cp scripts/update_ripe_db.sh /opt/cloakprobe/scripts/
    sudo chmod +x /opt/cloakprobe/scripts/*.sh
  5. Set ownership

    Terminal window
    sudo chown -R cloakprobe:cloakprobe /opt/cloakprobe
  6. Install systemd service

    Terminal window
    sudo cp systemd/cloakprobe.service /etc/systemd/system/
    sudo systemctl daemon-reload
    sudo systemctl enable cloakprobe

After installation, the directory structure looks like:

/opt/cloakprobe/
├── cloakprobe # Main binary
├── asn_builder # ASN database builder
├── ripe_builder # RIPE database builder
├── data/
│ ├── asn_db.bin # IP-to-ASN database
│ └── ripe_db.bin # RIPE organization database
├── scripts/
│ ├── update_asn_db.sh
│ └── update_ripe_db.sh
└── systemd/
└── cloakprobe.service

CloakProbe uses two local databases:

  • Source: iptoasn.com (Public Domain)
  • Contains: IP ranges → ASN mappings for IPv4 and IPv6
  • Update script: update_asn_db.sh
  • Output: data/asn_db.bin
  • Source: RIPE NCC database dumps
  • Contains: ASN → Organization name mappings
  • Update script: update_ripe_db.sh
  • Output: data/ripe_db.bin

To update to a newer version:

Terminal window
# Stop the service
sudo systemctl stop cloakprobe
# Run the installer again
curl -fsSL https://raw.githubusercontent.com/drmckay/cloakprobe/main/install.sh | sudo bash
# Start the service
sudo systemctl start cloakprobe
Terminal window
# Stop and disable service
sudo systemctl stop cloakprobe
sudo systemctl disable cloakprobe
# Remove service file
sudo rm /etc/systemd/system/cloakprobe.service
sudo systemctl daemon-reload
# Remove installation
sudo rm -rf /opt/cloakprobe
# Remove user (optional)
sudo userdel cloakprobe

Check the logs:

Terminal window
sudo journalctl -u cloakprobe -n 50

Common issues:

  • ASN database missing: Run update_asn_db.sh
  • Permission issues: Check ownership is cloakprobe:cloakprobe
  • Port in use: Change PORT in environment
Terminal window
ls -la /opt/cloakprobe/cloakprobe
sudo chmod +x /opt/cloakprobe/cloakprobe

Check connectivity:

Terminal window
curl -I https://iptoasn.com/data/ip2asn-combined.tsv.gz
curl -I ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz