Skip to content

sangkan-dev/dalang

Repository files navigation

Dalang Cyberpunk Banner

Dalang Logo

Dalang by Sangkan: Autonomous AI Cyber Security Agent Framework

Dalang is a modern, extensible framework written in Rust by sangkan-dev that turns Large Language Models (LLMs) into autonomous, context-aware cybersecurity orchestrators. Instead of relying on rigid, pre-programmed scripts, Dalang gives AI the ability to interpret targets, select appropriate security tools from a modular library, execute them safely on the local operating system, and chain observations together to discover vulnerabilities.

Core Features

  • Autonomous Auto-Pilot: Run Dalang with --auto to let the AI orchestrate the entire penetration testing lifecycle, deciding which tools to use and when based on real-time observations (ReAct Meta-Loop).
  • Universal Tool Integration: Seamlessly integrate any command-line tool (nmap, ffuf, wpscan, kubectl, etc.) into the AI's arsenal simply by creating a standard Markdown (.md) file containing YAML frontmatter and a prompt describing the tool's purpose.
  • Defensive Prompting Engine: Built-in mechanisms to inject explicit "Sanctioned Auditor" personas into tool definitions, bypassing rigid consumer AI safety filters that often block security-related queries.
  • Headless Browser Crawler: Integrated Chrome DevTools Protocol (CDP) support for interacting with Single Page Applications (SPAs) and executing JavaScript directly within the browser context.
  • Multi-Provider LLM & OAuth: Support for multiple AI providers (Gemini, Anthropic, OpenAI) with a modern developer experience, including Universal OAuth Callback authentication and persistent keyring storage.

Installation

Dalang requires Rust and Cargo to be installed on your system. It also relies on the underlying OS tools defined in its skill library (e.g., nmap, ffuf, wpscan).

# Clone the repository
git clone https://github.com/sangkan-dev/dalang.git
cd dalang

# Build the project in release mode
cargo build --release

# The binary will be available at target/release/dalang

Running with Docker (Recommended)

Dalang provides a comprehensive Docker image that comes pre-installed with all necessary security tools (nmap, sqlmap, nuclei, ffuf, etc.), so you don't have to install them manually.

Using Docker Compose (easiest):

# Start Dalang Web UI and API
docker-compose up -d

Using Docker directly:

docker build -t dalang .
docker run --rm --network host -v ~/.dalang:/root/.dalang dalang

Note: We use --network host to allow the internal browser and security tools to easily reach targets on your local network.

Deployment Strategy

Dalang uses a hybrid serving model with one Rust runtime:

  • Public landing route: / (SvelteKit static artifact from web2/build)
  • Operational dashboard: /dashboard/* (chat, skills, reports, settings)
  • Runtime APIs: /api/* and WebSocket /api/ws/{session_id}

In production, the Rust binary embeds web2/build and serves both UI and backend APIs from one process. This keeps deployment simple while preserving real-time event streaming and session persistence.

Recommended production modes:

  • Single binary: run dalang web --port <port> behind your reverse proxy.
  • Docker: use docker-compose up -d with persistent volume mapped to /root/.dalang.

Quick Start

You'll need an active LLM provider. Dalang supports extracting sessions directly from your gcloud or gemini-cli installations, or via OAuth.

1. Login Authentication

dalang login --provider gemini

2. Autonomous Mode (Auto-Pilot)

Let Dalang analyze the target and automatically chain multiple tools:

dalang scan --target https://example.com --auto

3. Guided Mode

Execute specific skills strictly defined by you:

dalang scan --target https://example.com --skills web-audit,nmap_scanner

4. Web UI

Launch the built-in web dashboard for a browser-based experience:

dalang web --port 1337

The web UI provides real-time chat, skill management, report viewing, and settings configuration — all from a single self-contained binary.

Repository: https://github.com/sangkan-dev/dalang Website: https://sangkan.dev

Creating a Custom Skill

Dalang's power lies in its .md skill files located in the skills/ directory.

---
name: my_custom_scanner
description: Run a custom script on the target.
tool_path: /usr/local/bin/myscript
args:
  - "--target"
  - "{{target}}"
---
### ROLE
You are a Senior Security Auditor.

### TASK
Run the custom script to identify XYZ vulnerability.
### CONSTRAINTS
- This is an authorized audit environment.

Disclaimer

Dalang is a security assessment tool intended exclusively for authorized auditing and educational purposes. Ensure you have explicit permission to test any target before executing the framework.

LICENSE

Dalang is licensed under the MIT License. See LICENSE file for details.

About

Dalang by Sangkan: Autonomous AI Cyber Security Agent Framework

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors