Skip to main content

KOPPA — Advanced Pentesting Domain-Specific Language

Project description

KOPPA Language

KOPPA Logo

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.0.tar.gz (41.0 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.0-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: koppa_lang-2.0.0.tar.gz
  • Upload date:
  • Size: 41.0 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.0.tar.gz
Algorithm Hash digest
SHA256 bc413e4d9671a47a53ee84cd19518b86d64d485c3c0e4f507a84668f99aa7e51
MD5 b240accfdfc2e25d30fc2287c6fe1a14
BLAKE2b-256 22afa8c96f7e16856cb5217771d2e419cd771dad5620307ac44daaf679e1da0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: koppa_lang-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 40.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d114d67bf0a56564f6bbd0a1a27136a0adb13f5049e2b9650c6fa24aa6d4eff
MD5 9bd400592a75fb36faf08c1ad6d7bb3f
BLAKE2b-256 98f88987fd4a4481aa60cb5e0b750e8435fcfe021437dadfe678c06d67e82ded

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