Skip to content

Basic Commands

Essential APHIDS CLI commands for everyday use.

Help and Version

Show Help

aphids-cli --help

Show Version

aphids-cli --version

Online Mode (Connected to Hive)

Execute Runbook

aphids-cli \
  --api-key YOUR_API_KEY \
  --runbook RUNBOOK_ID \
  --target-url https://example.com \
  --engagement ENGAGEMENT_ID

Execute Attack Tree

aphids-cli \
  --api-key YOUR_API_KEY \
  --attack-tree TREE_ID \
  --target-url https://example.com \
  --engagement ENGAGEMENT_ID

With Verbose Output

aphids-cli \
  --api-key YOUR_API_KEY \
  --runbook RUNBOOK_ID \
  --target-url https://example.com \
  --verbose

Offline Mode (Standalone)

Basic Scan

aphids-cli \
  --options options.yaml \
  --config config.yaml

With Verbose Output

aphids-cli \
  --options options.yaml \
  --config config.yaml \
  --verbose

With Debug Mode

aphids-cli \
  --options options.yaml \
  --config config.yaml \
  --debug

Common Options

Target Specification

# URL target
--target-url https://example.com

# Domain target
--target-domain example.com

# IP target
--target-ip 192.168.1.1

# IP range
--target-ip 192.168.1.0/24

Output Options

# Custom output directory
--output-dir ./results

# Verbose output
--verbose

# Debug mode
--debug

# Keep tool output
--tool-output

Docker Options

# Custom Docker image
--image custom-aphids:latest

# Custom network
--network custom-network

# Static path mapping
--static-path /path/to/code

Examples

Example 1: Quick Web Scan

aphids-cli \
  --api-key $API_KEY \
  --runbook web-quick-scan \
  --target-url https://example.com \
  --engagement pentest-2024

Example 2: Network Discovery

aphids-cli \
  --api-key $API_KEY \
  --runbook network-discovery \
  --target-ip 192.168.1.0/24 \
  --engagement internal-audit

Example 3: Offline Scan

aphids-cli \
  --options scan-config.yaml \
  --config aphids-config.yaml \
  --verbose

Example 4: CI/CD Integration

aphids-cli \
  --api-key $CI_API_KEY \
  --runbook ci-security-scan \
  --target-url https://staging.example.com \
  --engagement ci-cd-scans \
  --verbose

Environment Variables

Set API Key

export HIVE_API_KEY="your-api-key"
aphids-cli --api-key $HIVE_API_KEY ...

Set API URL

export HIVE_API_URL="https://api.hive.darksidesecurity.io"
aphids-cli --api-url $HIVE_API_URL ...

Exit Codes

  • 0: Success
  • 1: General error
  • 2: Invalid arguments
  • 3: Authentication failed
  • 4: Scan failed
  • 5: Network error

Troubleshooting

Command Not Found

# Check installation
which aphids-cli

# Reinstall if needed
pip3 install --upgrade aphids-cli

Permission Denied

# Check Docker permissions
docker ps

# Add user to docker group
sudo usermod -aG docker $USER

Connection Failed

# Check API URL
ping api.hive.darksidesecurity.io

# Verify API key
echo $HIVE_API_KEY

Related: Installation | Configuration | Integration