Skip to content

aidotse/Project-Violet-2.0

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Project Violet 2.0

An automated cybersecurity research platform that creates a continuous feedback loop between AI-powered attackers and adaptive honeypots. Project Violet uses autonomous red team operations, LLM-enhanced honeypots, and adaptive reconfiguration to generate labeled attack datasets for defensive security research.

Architecture

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚        main_menu.py           β”‚
                         β”‚   Interactive CLI Interface    β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                        β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚                         β”‚                         β”‚
              β–Ό                         β–Ό                         β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚    Sangria       β”‚     β”‚   Blue_Lagoon       β”‚    β”‚   Reconfigurator   β”‚
   β”‚  LLM Attacker    │────▢│  Honeypot Infra     │◀───│  Adaptive Profiles β”‚
   β”‚                  β”‚     β”‚  (Cowrie/Docker)     β”‚    β”‚                    β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚                                                    β–²
            β–Ό                                                    β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                           β”‚
   β”‚     Purple       β”‚β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β”‚   Analysis &     β”‚   Attack pattern analysis triggers
   β”‚   MITRE Labels   β”‚   profile reconfiguration
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core loop: Deploy honeypot β†’ LLM attacks it β†’ Extract & label sessions β†’ Analyze patterns β†’ Generate new profile β†’ Redeploy

Prerequisites

  • Docker & Docker Compose
  • Python 3.11+
  • .env file in the project root:
OPENAI_API_KEY="{your-openai-api-key}"
TOGETHER_AI_SECRET_KEY="{your-togetherai-api-key}"
TOKENIZERS_PARALLELISM=false

Quick Start

pip install -r requirements.txt
python main_menu.py

The interactive menu provides five workflows:

Option Description
Start New Experiment Configure models, reconfiguration method, session count, then run
Demo Mode Showcase honeypot capabilities with scripted SSH sessions
Settings Adjust LLM providers, models, profiles, CHeaT defenses
Prepare Experiment Data Extract structured sessions from raw attack logs
Run Purple Analysis HP comparison, meta analysis, visualizations

Components

Sangria (Attacker)

Autonomous LLM-powered red team agent that conducts SSH-based attacks via a Kali Linux container.

  • Attack loop (sangria.py): LLM decides actions, executes commands via pexpect SSH, tracks state
  • State register (attack_state.py): Tracks discovered hosts, credentials, files, services; deduplicates commands to prevent loops
  • MITRE labeling (llm_tools.py): Each command is labeled with ATT&CK tactics and techniques at execution time
  • Model-specific tuning (attacker_prompt.py): Behavioral overrides per model (Llama, DeepSeek, Qwen, GPT) to handle tool-calling differences

Supported models: GPT-4.1, GPT-4.1-Mini, O4-Mini, Llama 3.3 70B, Qwen 3.5 397B, DeepSeek V3/R1, and local models via Ollama/vLLM/LMStudio.

Blue_Lagoon (Honeypot Infrastructure)

Docker orchestration layer for Cowrie honeypot deployment.

  • Container lifecycle (honeypot_tools.py): Build, start, stop, health-check containers
  • Compose generation (compose_generator.py): Generates multi-hop honeynet docker-compose files with correct network topology
  • Credential chaining (credential_chain.py): Seeds breadcrumb credentials across hops for realistic lateral movement

Cowrie (Modified Honeypot)

Fork of the Beelzebub honeypot with an LLM fallback system. When a command has no built-in handler, the honeypot calls the configured LLM to generate a realistic response, making the honeypot harder to fingerprint.

Reconfigurator (Adaptive Profiles)

Dynamically generates new honeypot configurations based on attack patterns.

  • Profile system: 16 pre-built JSON profiles (WordPress, database, CI/CD, monitoring, etc.) defining filesystem trees, file contents, and services
  • LLM-driven generation (new_config_pipeline.py): Creates new profiles with lure requirements (breadcrumb credentials, lateral movement targets, privilege escalation paths)
  • Novelty measurement (profile_distance.py): Ensures new profiles are sufficiently different from previous ones
  • Lure enrichment (lure_agent.py): Injects deceptive breadcrumbs into bash history, config files, SSH known_hosts
  • Database seeding (db_seed_generator.py): Generates realistic SQL init scripts for MySQL/PostgreSQL

Reconfiguration triggers:

Method Description
NO_RECONFIG Single profile, no adaptation
BASIC Reconfigure every N sessions
ENTROPY Shannon entropy of tactics over sliding window
T_TEST Statistical significance testing on tactic sequences

Purple (Analysis)

Post-attack analysis, MITRE ATT&CK labeling, and visualization.

  • HP Comparison (hp_comparison_cli.py): Compare session lengths across experiments
  • Meta Analysis (meta_analysis_cli.py): MITRE tactic distributions, honeypot deceptiveness metrics
  • Visualizations (run_analysis.py): Session length distributions, entropy over time, technique frequency
  • CHeaT detection (cheat_detector.py): Detects attacker defenses against honeypots (unicode honeytokens, canary URLs, prompt injection, tool traps)
  • Session correlation (session_correlator.py): Correlates multi-hop attack sessions

CHeaT Defenses

Proactive countermeasures against LLM-based attackers:

Defense Description
Unicode honeytokens Credentials with zero-width Unicode characters
Canary URLs Honey links planted in files and history
Prompt traps Payloads in file contents to disrupt attacker LLM
Tool traps Fake CVEs and false-positive tool outputs

Multi-Hop Honeynet

Project Violet supports multi-hop honeynets where the attacker must discover and pivot between hosts:

Kali (attacker)
    ↓ SSH
Hop 1: WordPress Server + MySQL
    ↓ credentials in config files
Hop 2: Database Server + PostgreSQL
    ↓ credentials in CI/CD configs
Hop 3: CI/CD Runner

Each hop runs an independent Cowrie instance on a separate Docker network. Credential breadcrumbs and /etc/hosts entries guide the attacker to the next hop.

Configure in config.py:

honeynet_enabled = True
chain_profiles = [wordpress_server, database_server, cicd_runner]
chain_db_enabled = [True, True, False]

Configuration

All settings are managed through config.py (or interactively via the menu):

# LLM providers: openai | togetherai | ollama | vllm | lmstudio | custom
llm_provider = "togetherai"

# Models for each component
llm_model_sangria = LLMModel.QWEN_3_5_397B
llm_model_honeypot = LLMModel.QWEN_3_5_397B
llm_model_reconfig = LLMModel.LLAMA_3_3_70B

# Reconfiguration strategy
reconfig_method = ReconfigCriteria.ENTROPY

# Session parameters
num_of_sessions = 400
max_session_length = 200

# CHeaT defenses
cheat_enabled = True
cheat_unicode_honeytokens = True
cheat_canary_urls = False
cheat_prompt_traps = False

Output Structure

logs/
β”œβ”€β”€ {EXPERIMENT_NAME}/
β”‚   β”œβ”€β”€ metadata.json
β”‚   β”œβ”€β”€ sessions.json              # Honeypot-visible commands
β”‚   β”œβ”€β”€ omni_sessions.json         # All attacker commands
β”‚   β”œβ”€β”€ meta_analysis/
β”‚   β”‚   β”œβ”€β”€ tactic_distribution.csv
β”‚   β”‚   └── honeypot_deceptiveness.csv
β”‚   β”œβ”€β”€ analysis_plots/
β”‚   β”‚   β”œβ”€β”€ session_length_*.png
β”‚   β”‚   β”œβ”€β”€ mitre_distribution_*.png
β”‚   β”‚   └── entropy_*.png
β”‚   └── hp_config_{N}/
β”‚       β”œβ”€β”€ honeypot_config.json
β”‚       β”œβ”€β”€ sessions.json
β”‚       β”œβ”€β”€ tokens_used.json
β”‚       └── full_logs/
β”‚           └── attack_{N}.json
└── hp_comparison/
    β”œβ”€β”€ session_length_statistics.csv
    └── session_length_comparison_boxplot.png

Lure Secret Management

Honeypot profiles contain realistic-looking secrets (API keys, tokens) that trigger GitHub push protection. These are managed with a sanitize/restore workflow:

# Before committing β€” replace secrets with placeholders
./scripts/restore_lure_secrets.sh --sanitize

# After checkout β€” restore realistic secrets for deployment
./scripts/restore_lure_secrets.sh

Secret mappings are stored in scripts/.lure_secrets (gitignored). See the script for details.

Testing

# Run all tests
pytest

# Run by category
pytest -m unit
pytest -m integration
pytest -m statistical

Project Structure

β”œβ”€β”€ Sangria/              # LLM-powered autonomous attacker
β”œβ”€β”€ Blue_Lagoon/          # Honeypot Docker orchestration
β”œβ”€β”€ Cowrie/               # Modified Beelzebub honeypot with LLM fallback
β”œβ”€β”€ Reconfigurator/       # Adaptive profile generation & lure enrichment
β”‚   └── profiles/         # 16 pre-built honeypot filesystem profiles
β”œβ”€β”€ Purple/               # Analysis, MITRE labeling, CHeaT detection
β”œβ”€β”€ Utils/                # Shared utilities (LLM client, JSON, caching)
β”œβ”€β”€ Tests/                # Unit, integration, and statistical tests
β”œβ”€β”€ scripts/              # Deployment and automation tools
β”œβ”€β”€ docs/                 # Implementation plans and architecture guides
β”‚   β”œβ”€β”€ done/             # Completed plans
β”‚   β”œβ”€β”€ doing/            # In-progress work
β”‚   β”œβ”€β”€ upcoming/         # Planned features
β”‚   └── how-it-works/     # Architecture documentation
β”œβ”€β”€ main_menu.py          # Interactive CLI entry point
β”œβ”€β”€ main.py               # Core orchestration engine
β”œβ”€β”€ demo.py               # Demo mode with scripted attacks
β”œβ”€β”€ config.py             # Centralized configuration
└── docker-compose.yml    # Container definitions

Troubleshooting

Permission errors with Docker

  • Add your user to the docker group: sudo usermod -aG docker $USER
  • Log out and back in for changes to take effect

Lure secrets blocking push

  • Run ./scripts/restore_lure_secrets.sh --sanitize before committing
  • If new secret patterns are added to profiles, add mappings to scripts/.lure_secrets

Cowrie not responding

  • Check container health: docker ps
  • View logs: docker-compose logs cowrie
  • Ensure the profile JSON is valid: python -m Reconfigurator.validate_config <profile.json>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 93.4%
  • Go 3.2%
  • Shell 1.2%
  • Roff 0.9%
  • PowerShell 0.6%
  • Dockerfile 0.4%
  • Other 0.3%