Skip to main content

KOPPA — Advanced Pentesting Domain-Specific Language

Project description

KOPPA Language

APhysical Penetration Operation Language & Logic Optimizer

A domain-specific programming language designed for security professionals and penetration testers.

Overview

APOLLO combines the best features from multiple languages to create a powerful pentesting DSL:

Feature Inspired By Purpose
Readable syntax Python Easy to write and audit
Pipeline operator Bash/PowerShell Chain security operations
Pattern matching Rust Clean control flow
Object pipeline PowerShell Everything is an object
System integration Bash Execute any tool
Type safety Rust Optional type annotations
Async/await JavaScript Concurrent scanning
Embeddability Lua Lightweight runtime

Quick Start

# Run with optimized VM (Python)
python src/apollo.py run examples/port_scanner.apo

# Run with maximum performance (Deno)
python src/apollo.py deno examples/port_scanner.apo

# Start REPL
python src/apollo.py repl

Hello World

#!/usr/bin/apollo

import scan, log

fn main() {
    let target = "scanme.nmap.org"
    let ports = [22, 80, 443]

    log.info("Scanning {target}")

    for port in ports {
        if scan.tcp(target, port) {
            log.info("[+] Port {port} is open - {scan.service(port)}")
        }
    }

    target
        |> scan.tcp(ports)
        |> filter(open_ports)
        |> save("results.json")
}

Key Features

Pipeline Operator

Chain security operations fluently:

target
    |> recon.dns()
    |> scan.tcp(ports)
    |> enum.services()
    |> exploit.match()
    |> report.save()

Security Primitives

Built-in modules for common pentesting operations:

import recon, scan, enum, exploit, crypto, report

# Reconnaissance
recon.whois(domain)
recon.dns_enumerate(domain)

# Scanning
scan.tcp(host, ports)
scan.version(host, ports)

# Enumeration
enum.smb_shares(host)
enum.ldap_users(dc)
enum.http_directories(url, wordlist)

# Cryptography
crypto.hash.md5(data)
crypto.hash.ntlm(password)
crypto.encode.base64(data)

Pattern Matching

Clean control flow with Rust-style match:

match service {
    "http" => http.scan(target),
    "https" => tls.scan(target),
    "ssh" => ssh.brute(target, wordlist),
    "smb" => smb.enum_shares(target),
    _ => log.info("Unknown service")
}

Async/Parallel Execution

Run multiple operations concurrently:

async fn mass_scan(targets) -> Stream {
    parallel {
        for target in targets {
            emit scan_port(target)
        }
    }
}

Error Handling

Rust-style Result types:

fn crack_hash(hash) -> Result {
    let result = crypto.crack(hash, wordlist)

    if result.cracked {
        Ok(result.plaintext)
    } else {
        Err("Hash not cracked")
    }
}

# Usage
match crack_hash(hash) {
    Ok(password) => log.info("Found: {password}"),
    Err(e) => log.error("Failed: {e}")
}

Architecture

APOLLO/
├── src/
│   ├── lexer.py       # Tokenizer
│   ├── parser.py      # AST builder
│   ├── interpreter.py # Runtime executor
│   └── apollo.py      # CLI runner
├── stdlib/
│   ├── recon.apo   # Reconnaissance module
│   ├── scan.apo    # Scanning module
│   ├── vuln.apo    # Vulnerability scanning (XSS, SQLi, LFI)
│   ├── crypto.apo  # Cryptography module
│   └── ...
├── examples/
│   ├── port_scanner.apo
│   ├── web_scanner.apo
│   ├── ad_enum.apo
│   └── password_cracker.apo
└── docs/
    ├── LANGUAGE_SPEC.md
    └── GETTING_STARTED.md

Example Scripts

Port Scanner

#!/usr/bin/apollo
import scan, log

let COMMON_PORTS = [21, 22, 23, 80, 443, 445, 3389]

fn main(args) {
    let target = args[0] | default("127.0.0.1")

    for port in COMMON_PORTS {
        if scan.tcp(target, port) {
            log.info("[+] {port}: {scan.service(port)}")
        }
    }
}

Web Vulnerability Scanner

#!/usr/bin/apollo
import http, enum, report, log

let XSS_PAYLOADS = ["<script>alert('XSS')</script>", "<img src=x onerror=alert(1)>"]

async fn check_xss(url, param) -> Stream {
    for payload in XSS_PAYLOADS {
        let response = http.get("{url}?{param}={payload}")
        if response.body.contains(payload) {
            emit report.finding("XSS", "high", "Reflected: {payload}")
        }
    }
}

fn main(args) {
    let target = args[0]
    let params = ["search", "q", "query"]

    parallel {
        for param in params {
            check_xss(target, param)
        }
    } |> report.save("xss_report.html")
}

AD Enumeration

#!/usr/bin/apollo
import enum, recon, log

fn enumerate_ad(domain, dc) {
    let data = {
        users: enum.ldap_users(dc),
        shares: enum.smb_shares(dc),
        kerberoastable: enum.kerberoastable(dc),
    }

    for user in data.kerberoastable {
        log.warn("Kerberoastable: {user.spn}")
    }

    return data
}

fn main(args) {
    let domain = args.domain | default("LOCAL")
    enumerate_ad(domain) |> save("ad_enum.json")
}

Documentation

Running Scripts

# Run a script
python src/apollo.py run examples/port_scanner.apo

# Tokenize and show tokens
python src/apollo.py lex script.apo

# Parse and show AST
python src/apollo.py parse script.apo

# Start REPL
python src/apollo.py repl

Design Goals

  1. Security-First: Built-in primitives for pentesting operations
  2. Cross-Platform: Works on Windows, Linux, and macOS
  3. Readable: Clean syntax that's easy to audit
  4. Composable: Pipeline operator for chaining operations
  5. Safe by Default: Dangerous operations require explicit opt-in
  6. Extensible: FFI to call Python, system tools, and external libraries

Roadmap

  • Native compiler (via Deno transpilation)
  • JIT compilation for performance (via V8/Deno)
  • More stdlib modules (exploit, post, lateral)
  • Package manager for community modules
  • LSP support for IDE integration
  • Debugger with breakpoints and stepping

License

MIT License - See LICENSE file for details


APOLLO - Built for security professionals, by security professionals.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

koppa_lang-2.0.1.tar.gz (41.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

koppa_lang-2.0.1-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

Details for the file koppa_lang-2.0.1.tar.gz.

File metadata

  • Download URL: koppa_lang-2.0.1.tar.gz
  • Upload date:
  • Size: 41.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for koppa_lang-2.0.1.tar.gz
Algorithm Hash digest
SHA256 6fef2b4ad94ef458e640822710f135abb3c784b42e5dc350a92d8fd18af2d36d
MD5 58fa436df02d0a52bbf15335f2a85d5d
BLAKE2b-256 1a0eee174b3cc2f0b68891af03f0d116ec579719910536a1c660058934d2ec87

See more details on using hashes here.

File details

Details for the file koppa_lang-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: koppa_lang-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 41.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for koppa_lang-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c0dadd25476f99e14a49a085ec764d519b6dafc68a8cc5c249829c6a2f26644d
MD5 c5fdd1f177770b941ebdd6950e8ab370
BLAKE2b-256 621ce5305c6537d68752986b1af8c0dc5217c48338cb673ef684dcd46e762488

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page