### Build and Start RedAmon Services with Docker Compose
Source: https://github.com/samugit83/redamon/blob/master/README.md
Instructions for building RedAmon Docker images and starting the services. It provides options for a lighter setup without GVM and a complete setup including GVM, noting the initial GVM feed synchronization time.
```bash
# Without GVM (lighter, faster startup):
docker compose --profile tools build # Build all images
docker compose up -d postgres neo4j recon-orchestrator kali-sandbox agent webapp # Start core services only
# Complete, With GVM:
docker compose --profile tools build # Build all images (recon + vuln-scanner + services)
docker compose up -d # Start all services (first GVM run takes ~30 min for feed sync)
```
--------------------------------
### Bash: Install and Start Docker
Source: https://github.com/samugit83/redamon/blob/master/recon/readmes/README.RESOURCE_ENUM.md
These bash commands provide instructions for installing the Docker engine on Debian-based systems and starting the Docker daemon, addressing the 'Docker not found' troubleshooting issue.
```bash
# Install Docker
sudo apt install docker.io
# Start Docker daemon
sudo systemctl start docker
```
--------------------------------
### Troubleshooting: Install Docker
Source: https://github.com/samugit83/redamon/blob/master/recon/readmes/README.VULN_SCAN.md
Provides commands for installing Docker on Debian/Ubuntu and Arch Linux systems, along with instructions to start the Docker daemon and optionally add the user to the docker group.
```bash
# Install Docker
sudo apt install docker.io # Debian/Ubuntu
# or
sudo pacman -S docker # Arch
# Start Docker daemon
sudo systemctl start docker
sudo systemctl enable docker
# Add user to docker group (optional, avoids sudo)
sudo usermod -aG docker $USER
# Log out and back in for group change to take effect
```
--------------------------------
### Start Agentic API with Docker Compose or Uvicorn
Source: https://github.com/samugit83/redamon/blob/master/agentic/readmes/README.PENTEST_AGENT.md
This section provides instructions for starting the Agentic API. You can use Docker Compose for a standard setup or Uvicorn for development, specifying the port for hot-reloading.
```bash
cd agentic/
docker-compose up -d
```
```bash
uvicorn api:app --reload --port 8080
```
--------------------------------
### Bash: Install Docker on Ubuntu
Source: https://github.com/samugit83/redamon/blob/master/recon/readmes/README.HTTP_PROBE.md
This bash command sequence installs the Docker engine on Ubuntu systems. It first updates the package list, then installs `docker.io`, and finally starts the Docker daemon service.
```bash
# Install Docker
sudo apt install docker.io
# Start Docker daemon
sudo systemctl start docker
```
--------------------------------
### Install and Run Redamon Scan (Bash)
Source: https://github.com/samugit83/redamon/blob/master/recon/readmes/README.RESOURCE_ENUM.md
This snippet shows how to start the Docker daemon and execute the Redamon scan using its Python script. It assumes Docker is installed and previous pipeline steps have been completed.
```bash
# Make sure Docker is running
sudo systemctl start docker
# Run the scan - image will be pulled automatically
python3 recon/main.py
```
--------------------------------
### Build and Start Docker Container
Source: https://github.com/samugit83/redamon/blob/master/mcp/README.MCP.md
Commands to build and start the Docker container for the KALI CONTAINER environment. The first command builds and starts, while the second assumes the image is already built and only starts the services.
```bash
cd mcp
docker-compose up -d --build
```
```bash
docker-compose up -d
```
--------------------------------
### Example OPENAI_COMPAT_BASE_URL for Local LLM Providers
Source: https://github.com/samugit83/redamon/blob/master/README.md
Provides example OPENAI_COMPAT_BASE_URL configurations for various self-hosted LLM providers. These examples assume the LLM server is running on the same machine as RedAmon and accessible via Docker's host resolution.
```env
# Ollama
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:11434/v1
# vLLM
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:8000/v1
# LM Studio
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:1234/v1
# LocalAI
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:8080/v1
# Jan
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:1337/v1
# llama.cpp server
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:8080/v1
# OpenLLM
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:3000/v1
# text-generation-webui
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:5000/v1
```
--------------------------------
### Start Webapp in Development Mode
Source: https://github.com/samugit83/redamon/wiki/13.-Troubleshooting
Start the Next.js webapp in development mode using a separate compose file to enable hot-reloading for faster iteration.
```bash
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
```
--------------------------------
### Bash: Install and Verify Docker for Naabu
Source: https://github.com/samugit83/redamon/blob/master/recon/readmes/README.PORT_SCAN.md
Provides bash commands to install and verify Docker, a prerequisite for running the Naabu port scanner. It includes commands to start the Docker service and optionally pre-pull the Naabu Docker image.
```bash
# Make sure Docker is running
sudo systemctl start docker
# Check Docker is running
docker info
# Optionally pre-pull the image
docker pull projectdiscovery/naabu:latest
```
--------------------------------
### Troubleshooting: Start Docker Daemon
Source: https://github.com/samugit83/redamon/blob/master/recon/readmes/README.VULN_SCAN.md
Commands to start the Docker service and check its status, useful when encountering issues with the Docker daemon not running.
```bash
# Start Docker
sudo systemctl start docker
# Check status
sudo systemctl status docker
```
--------------------------------
### Docker Setup and Execution
Source: https://github.com/samugit83/redamon/blob/master/recon/README.RECON.md
Instructions for setting up and running Redamon using Docker. This involves building the Docker image and then running the main Python script within a container. It requires Docker and Docker Compose to be installed.
```bash
# Verify Docker is running
docker info
# Build and run
cd recon/
docker-compose build --network=host
docker-compose run --rm recon python /app/recon/main.py
```
--------------------------------
### Install Docker (Bash)
Source: https://github.com/samugit83/redamon/blob/master/recon/readmes/README.PORT_SCAN.md
These bash commands provide instructions for installing Docker on Debian/Ubuntu-based systems and starting/enabling the Docker daemon, which is often a prerequisite for running containerized tools like Naabu.
```bash
# Install Docker
sudo apt install docker.io # Debian/Ubuntu
# Start Docker daemon
sudo systemctl start docker
sudo systemctl enable docker
```
--------------------------------
### Verify Docker Installation
Source: https://github.com/samugit83/redamon/blob/master/recon/readmes/README.HTTP_PROBE.md
These commands verify that Docker is installed and running on your system. The `docker info` command provides details about the Docker installation, and `docker pull` can be used to pre-download the httpx image.
```bash
# Check Docker is running
docker info
# Optionally pre-pull the image
docker pull projectdiscovery/httpx:latest
```
--------------------------------
### Run All Servers in SSE Mode
Source: https://github.com/samugit83/redamon/blob/master/mcp/README.MCP.md
Starts all servers using Server-Sent Events (SSE) mode. This command also installs project dependencies from the requirements file before running the servers. It assumes you are in the parent directory of 'mcp/servers'.
```bash
cd mcp/servers
pip install -r ../requirements.txt
python run_servers.py
```
--------------------------------
### Local Development: Installing Dependencies and Running API (Bash)
Source: https://github.com/samugit83/redamon/blob/master/recon_orchestrator/README.md
Commands for setting up the development environment. First, it installs Python dependencies using `pip`. Then, it runs the FastAPI application using `uvicorn` with hot-reloading enabled for efficient development.
```bash
# Install dependencies
pip install -r requirements.txt
# Run with hot reload
uvicorn api:app --host 0.0.0.0 --port 8010 --reload
```
--------------------------------
### Python Function Example with Type Hints and Docstrings
Source: https://github.com/samugit83/redamon/blob/master/CONTRIBUTING.md
An example of a Python asynchronous function demonstrating PEP 8 compliance, type hints, Google-style docstrings, and f-string usage.
```python
async def get_scan_results(project_id: str, include_vulns: bool = True) -> ScanResults:
"""Fetch scan results for a project from the graph database.
Args:
project_id: The unique project identifier.
include_vulns: Whether to include vulnerability data.
Returns:
Aggregated scan results for the project.
"""
...
```
--------------------------------
### Start RedAmon Services via Docker Compose
Source: https://github.com/samugit83/redamon/blob/master/recon/README.RECON.md
This command sequence initializes and starts the necessary Docker services for RedAmon, including the PostgreSQL database, Neo4j graph database, and the recon orchestrator. It then starts the web application in development mode. Access the web UI at http://localhost:3000/graph.
```bash
cd postgres_db && docker-compose up -d
cd ../graph_db && docker-compose up -d
cd ../recon_orchestrator && docker-compose up -d
cd ../webapp && npm run dev
```
--------------------------------
### Conventional Commits Examples
Source: https://github.com/samugit83/redamon/blob/master/CONTRIBUTING.md
Illustrates the format and provides examples of commit messages adhering to the Conventional Commits specification used in the project.
```git
feat: add Shodan integration to recon pipeline
fix: handle WebSocket reconnection on network timeout
refactor: extract tool execution logic into separate module
docs: add API endpoint documentation for recon orchestrator
```
--------------------------------
### Build and Start Recon Orchestrator (Bash)
Source: https://github.com/samugit83/redamon/blob/master/recon_orchestrator/README.md
This snippet demonstrates how to build and start the Recon Orchestrator service using Docker Compose. It first ensures a Docker network named 'redamon-network' exists, then builds the necessary Docker images and starts the service in detached mode. Finally, it shows how to verify the service's health.
```bash
# 1. Ensure Docker network exists
docker network create redamon-network
# 2. Build and start
cd recon_orchestrator
docker-compose build
docker-compose up -d
# 3. Verify health
curl http://localhost:8010/health
```
--------------------------------
### Start GVM Infrastructure with Docker Compose
Source: https://github.com/samugit83/redamon/blob/master/gvm_scan/README.GVM.md
Starts the Greenbone Vulnerability Management (GVM) infrastructure services in detached mode using Docker Compose. It also provides a command to follow the logs of the gvmd service, essential for monitoring VT synchronization.
```bash
cd gvm_scan
docker compose up -d
docker compose logs -f gvmd # Wait for VT sync ("Updating VTs in database ... done")
```
--------------------------------
### Redamon API Get Recon Scan Status
Source: https://github.com/samugit83/redamon/blob/master/webapp/README.WEBAPP.md
Example response for the GET /api/recon/[projectId]/status endpoint, providing the current state of a reconnaissance scan. It includes project ID, status, current phase, phase number, total phases, and start time.
```json
{
"project_id": "project-123",
"status": "running",
"current_phase": "Port Scanning",
"phase_number": 2,
"total_phases": 7,
"started_at": "2024-01-15T10:30:00Z"
}
```
--------------------------------
### Start and Verify PostgreSQL Database Connection
Source: https://github.com/samugit83/redamon/blob/master/postgres_db/README.md
This snippet provides commands to start the PostgreSQL database using Docker Compose and verify its connection. It assumes you are in the 'postgres_db' directory and have the necessary Docker setup.
```bash
# 1. Start PostgreSQL
cd postgres_db
docker-compose up -d
# 2. Verify connection
docker exec redamon-postgres pg_isready -U redamon -d redamon
```
--------------------------------
### Redamon API Start Recon Scan Response
Source: https://github.com/samugit83/redamon/blob/master/webapp/README.WEBAPP.md
Example response for the POST /api/recon/[projectId]/start endpoint, confirming the scan initiation. It provides the project ID, the current status, the ID of the launched container, and the timestamp when the scan was started.
```json
{
"project_id": "project-123",
"status": "starting",
"container_id": "abc123...",
"started_at": "2024-01-15T10:30:00Z"
}
```
--------------------------------
### Rebuild and Start Redamon Services
Source: https://github.com/samugit83/redamon/wiki/13.-Troubleshooting
After stopping and potentially removing services, these commands rebuild the Docker images for the 'tools' profile and then start all services in detached mode. This ensures that the project is running with the latest configurations and code.
```bash
docker compose --profile tools build
docker compose up -d
```
--------------------------------
### Provider Setup using Environment Variables (.env)
Source: https://github.com/samugit83/redamon/blob/master/README.md
This snippet shows how to configure environment variables for different AI providers. It includes keys and base URLs for OpenAI, Anthropic, OpenAI-compatible services (like Ollama), OpenRouter, and AWS Bedrock. Ensure you replace placeholder values with your actual credentials.
```env
# .env — add the keys for the providers you want to use
# Direct providers (lowest latency, direct API connection)
OPENAI_API_KEY=sk-proj-... # OpenAI — platform.openai.com/api-keys
ANTHROPIC_API_KEY=sk-ant-... # Anthropic — console.anthropic.com
# OpenAI-compatible providers (self-hosted or third-party)
OPENAI_COMPAT_BASE_URL=http://host.docker.internal:11434/v1 # Ollama on same machine (use IP for remote, e.g. http://192.168.1.50:11434/v1)
OPENAI_COMPAT_API_KEY= # Optional; fallback token "ollama" is used if empty
# Gateway providers (access many models through one key)
OPENROUTER_API_KEY=sk-or-... # OpenRouter — openrouter.ai/settings/keys
# AWS Bedrock (uses standard AWS credential chain)
AWS_ACCESS_KEY_ID=AKIA... # IAM user with bedrock:InvokeModel permission
AWS_SECRET_ACCESS_KEY=... # IAM secret key
AWS_DEFAULT_REGION=us-east-1 # Recommended: us-east-1 (N. Virginia) has the widest model availability
```
--------------------------------
### Git Branching Strategy Example
Source: https://github.com/samugit83/redamon/blob/master/CONTRIBUTING.md
Demonstrates the command to create a new feature branch from the main branch, following the project's branching conventions.
```bash
git checkout main
git pull origin main
git checkout -b feature/your-feature-name
```
--------------------------------
### Start Neo4j Graph Database with Docker Compose
Source: https://github.com/samugit83/redamon/blob/master/graph_db/readmes/README.GRAPH_DB.md
This command starts the Neo4j graph database service using Docker Compose. It assumes you are in the 'graph_db' directory. The '-d' flag runs the containers in detached mode.
```bash
cd graph_db
docker compose up -d
```
--------------------------------
### Redamon API Health Check Endpoint
Source: https://github.com/samugit83/redamon/blob/master/webapp/README.WEBAPP.md
Example of the GET /api/health endpoint response, indicating the service's operational status and connectivity to its dependencies, such as Neo4j.
```json
{
"status": "healthy",
"timestamp": "2025-01-02T12:00:00.000Z",
"services": {
"neo4j": "connected"
}
}
```
--------------------------------
### Redamon API Start Recon Scan
Source: https://github.com/samugit83/redamon/blob/master/webapp/README.WEBAPP.md
Example of a POST request to the /api/recon/[projectId]/start endpoint to initiate a reconnaissance scan. It specifies the project ID and the user initiating the scan, detailing the expected response format including project ID, status, container ID, and start time.
```json
{
"userId": "user-123"
}
```
--------------------------------
### Project Settings Configuration Reference
Source: https://github.com/samugit83/redamon/blob/master/agentic/readmes/README.PENTEST_AGENT.md
Details the configuration settings for the project, which can be database-driven via PostgreSQL and a webapp API when environment variables are set, or fall back to default values. Includes key parameters for LLM models, iteration limits, tool output handling, approval requirements, and tool-specific settings.
```mermaid
flowchart LR
DB[(PostgreSQL)] --> API[Webapp API
/api/projects/:id]
API --> PS[project_settings.py
get_setting]
PS --> ORCH[Orchestrator]
PS --> PROMPTS[Prompts]
PS --> TOOLS[Tools]
DEFAULTS[DEFAULT_AGENT_SETTINGS] -.->|fallback| PS
```
--------------------------------
### Run Metasploit Server in stdio Mode
Source: https://github.com/samugit83/redamon/blob/master/mcp/README.MCP.md
Starts the network_recon server in stdio mode. This is typically used for single-server development setups. It requires navigating to the server directory first.
```bash
cd mcp/servers
python run_servers.py --server network_recon --stdio
```
--------------------------------
### Check Docker Container Status and Logs
Source: https://github.com/samugit83/redamon/wiki/13.-Troubleshooting
Verify the status of running Docker containers and inspect their logs to diagnose issues. This is useful for services that are not starting or are in a restarting state.
```bash
docker compose ps
docker compose logs
```
--------------------------------
### CSS Module Styling Example
Source: https://github.com/samugit83/redamon/blob/master/CONTRIBUTING.md
Demonstrates the use of CSS Modules with semantic design tokens for padding, background, border, and border-radius. Follows project-defined spacing and typography scales.
```css
.container {
padding: var(--space-4);
background: var(--color-bg-primary);
border: 1px solid var(--color-border-primary);
border-radius: var(--radius-md);
}
```
--------------------------------
### Run RedAmon Without GVM Stack
Source: https://github.com/samugit83/redamon/wiki/13.-Troubleshooting
Start RedAmon with a reduced set of services, excluding the GVM stack, to lower resource requirements. This is an option when facing memory limitations.
```bash
docker compose up -d postgres neo4j recon-orchestrator kali-sandbox agent webapp
```
--------------------------------
### Connect to vulnerable service with pwntools
Source: https://github.com/samugit83/redamon/wiki/8.-AI-Agent-Guide
This Python script demonstrates connecting to a remote service using the 'pwntools' library. It establishes a connection, waits for a prompt, sends a payload, and then prints the received data with a timeout. This is common in binary exploitation scenarios.
```python
from pwn import *
r = remote('10.0.0.5', 1337)
r.recvuntil(b'> ')
r.sendline(b'payload')
print(r.recvall(timeout=5).decode())
```
--------------------------------
### Enumerate SMB shares with Impacket
Source: https://github.com/samugit83/redamon/wiki/8.-AI-Agent-Guide
This Python script utilizes the 'Impacket' library to connect to an SMB share and enumerate available shares. It logs in with guest credentials and prints the names of all accessible shares, useful for Windows/AD exploitation.
```python
from impacket.smbconnection import SMBConnection
conn = SMBConnection('10.0.0.5', '10.0.0.5')
conn.login('guest', '')
for share in conn.listShares():
name = share['shi1_netname'][:-1]
print(f"Share: {name}")
```