Skip to content

Installing APHIDS CLI

Now that Docker is installed, let's install the APHIDS CLI tool.

Installation Methods

APHIDS CLI can be installed using pip directly from the GitHub repository.

This method installs the latest stable version: RECOMMENDED

pipx install git+https://github.com/darksidesecurity/aphids.git
or

pip3 install git+https://github.com/darksidesecurity/aphids.git

Method 2: Install Specific Version

To install a specific version:

# Install a specific tag/version
pip3 install git+https://github.com/darksidesecurity/aphids.git@v1.2.0
or

pipx install git+https://github.com/darksidesecurity/aphids.git@v1.2.0

Method 3: Install in Development Mode

For contributors or those who want to modify the CLI:

# Clone the repository
git clone https://github.com/darksidesecurity/aphids.git
cd aphids

# Install in editable mode
pip3 install -e .

Verify Installation

After installation, verify APHIDS CLI is installed correctly:

aphids-cli --help

Expected output:

 __________________________________________
|                                          |
|               Aphids CLI                 |
|__________________________________________|

                version 1.2.0


usage: aphids.py [-h] [-o options.yaml] [-c [config.yaml]] ...

OPTIONS:
  -h, --help            show this help message and exit
  -o options.yaml, --options options.yaml
                        Options file path (See Sample options.yaml)
  ...

Check Version

aphids-cli --version

Expected output:

APHIDS CLI version 1.2.0

Installation Locations

APHIDS CLI is installed in your Python environment:

Find Installation Path

which aphids-cli

Common locations: - Linux: /usr/local/bin/aphids-cli or ~/.local/bin/aphids-cli - macOS: /usr/local/bin/aphids-cli or /opt/homebrew/bin/aphids-cli - Windows (WSL2): /home/username/.local/bin/aphids-cli

Python Package Location

pip3 show aphids-cli

Configuration Files

APHIDS CLI requires configuration files for operation. Let's set up the sample files.

Create Working Directory

# Create a directory for APHIDS work
mkdir -p ~/aphids-work
cd ~/aphids-work

Download Sample Files

Option A: From Repository

# Clone the repository to get samples
git clone https://github.com/darksidesecurity/aphids.git
cd aphids

# Copy sample files
cp Samples/options.yaml ~/aphids-work/
cp Samples/config.yaml ~/aphids-work/

Option B: Create Manually

Create options.yaml:

# options.yaml - APHIDS Configuration
version: "1.0"

# Scan configuration
scan:
  name: "My First Scan"
  description: "Basic security scan"

# Modules to run
modules:
  - name: "nmap"
    enabled: true
    args:
      ports: "1-1000"
      scan_type: "syn"

  - name: "whatweb"
    enabled: true
    args:
      aggression: 3

Create config.yaml:

# config.yaml - Hive Platform Configuration
hive:
  api_url: "https://api.hive.darksidesecurity.io"
  ws_url: "wss://api.hive.darksidesecurity.io"
  api_key: "YOUR_API_KEY_HERE"

# Optional: Engagement configuration
engagement:
  id: "YOUR_ENGAGEMENT_ID"

Environment Setup

Add to PATH (if needed)

If aphids-cli is not found, add it to your PATH:

# Add to ~/.bashrc or ~/.zshrc
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

# Reload shell configuration
source ~/.bashrc

Set Up Aliases (Optional)

Create convenient aliases:

# Add to ~/.bashrc or ~/.zshrc
echo 'alias aphids="aphids-cli"' >> ~/.bashrc
echo 'alias aphids-offline="aphids-cli -o options.yaml -c config.yaml"' >> ~/.bashrc

# Reload
source ~/.bashrc

Upgrading APHIDS CLI

Check for Updates

# Check current version
aphids-cli --version

# Check latest version on GitHub
curl -s https://api.github.com/repos/darksidesecurity/aphids/releases/latest | grep tag_name

Upgrade to Latest Version

# Upgrade via pip
pip3 install --upgrade git+https://github.com/darksidesecurity/aphids.git
pipx upgrade aphids-cli

Upgrade to Specific Version

pip3 install --upgrade git+https://github.com/darksidesecurity/aphids.git@v1.2.0

Uninstalling APHIDS CLI

If you need to uninstall:

# Uninstall via pip
pip3 uninstall aphids-cli

# Uninstall via pipx
pipx uninstall aphids-cli

# Confirm uninstallation
aphids-cli --version  # Should show "command not found"

Troubleshooting Installation

Command Not Found

# Check if installed
pip3 list | grep aphids

# If installed but not found, check PATH
echo $PATH

# Add to PATH
export PATH="$HOME/.local/bin:$PATH"

Permission Denied

# Install for current user only (no sudo needed)
pip3 install --user git+https://github.com/darksidesecurity/aphids.git

SSL Certificate Errors

# If you encounter SSL errors
pip3 install --trusted-host github.com --trusted-host pypi.org \
    git+https://github.com/darksidesecurity/aphids.git

Dependency Conflicts

# Create a virtual environment
python3 -m venv ~/aphids-venv
source ~/aphids-venv/bin/activate

# Install in virtual environment
pip3 install git+https://github.com/darksidesecurity/aphids.git

Python Version Issues

# Check Python version
python3 --version

# If too old, install newer Python
# Ubuntu/Debian
sudo apt install python3.10

# Use specific Python version
python3.10 -m pip install git+https://github.com/darksidesecurity/aphids.git

Using a virtual environment isolates APHIDS CLI from system Python:

Create Virtual Environment

# Create virtual environment
python3 -m venv ~/aphids-venv

# Activate virtual environment
source ~/aphids-venv/bin/activate

# Install APHIDS CLI
pip3 install git+https://github.com/darksidesecurity/aphids.git

# Verify installation
aphids-cli --version

Activate Virtual Environment

# Activate when needed
source ~/aphids-venv/bin/activate

# Deactivate when done
deactivate

Auto-Activate (Optional)

Add to ~/.bashrc or ~/.zshrc:

# Auto-activate APHIDS virtual environment
if [ -d "$HOME/aphids-venv" ]; then
    source ~/aphids-venv/bin/activate
fi

IDE Integration

VS Code

  1. Install Python extension
  2. Select Python interpreter:
  3. Press Ctrl+Shift+P (or Cmd+Shift+P on macOS)
  4. Type "Python: Select Interpreter"
  5. Choose your virtual environment

PyCharm

  1. Go to Settings → Project → Python Interpreter
  2. Click gear icon → Add
  3. Select "Existing environment"
  4. Browse to ~/aphids-venv/bin/python

Shell Completion (Advanced)

Enable tab completion for APHIDS CLI:

Bash Completion

# Generate completion script
aphids-cli --completion bash > ~/.aphids-completion.bash

# Add to ~/.bashrc
echo 'source ~/.aphids-completion.bash' >> ~/.bashrc

# Reload
source ~/.bashrc

Zsh Completion

# Generate completion script
aphids-cli --completion zsh > ~/.aphids-completion.zsh

# Add to ~/.zshrc
echo 'source ~/.aphids-completion.zsh' >> ~/.zshrc

# Reload
source ~/.zshrc

Next Steps

APHIDS CLI is now installed! Next, you need to:

  1. Pull the APHIDS Container - Download the Docker container
  2. Verify Installation - Test your complete setup
  3. Configure APHIDS - Set up configuration files

CLI installed successfully?

Pull the APHIDS Container →