Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0x4m4 Hexstrike ai CTFChallenge

From Leeroopedia
Knowledge Sources
Domains CTF, Security
Last Updated 2026-10-10 00:00 GMT

Overview

Dataclass that captures CTF challenge metadata: name, category, difficulty, points, files, and hints for workflow generation.

Description

The CTFChallenge dataclass represents a CTF challenge with its category (web, crypto, pwn, forensics, rev, misc, osint), difficulty level, point value, description, attached files, and hints. It is passed to CTFWorkflowManager to generate solving workflows and to CTFChallengeAutomator for automated solving attempts.

Usage

Create a CTFChallenge to initiate the CTF solving pipeline:

  • Web challenges: Set category="web" with the challenge URL
  • Crypto challenges: Set category="crypto" with cipher/hash details in description
  • Binary challenges: Set category="pwn" or "rev" with file paths

Code Reference

Source Location

  • Repository: HexStrike AI
  • File: hexstrike_server.py
  • Lines: L2784-2793

Signature

@dataclass
class CTFChallenge:
    """CTF challenge information"""
    name: str
    category: str  # web, crypto, pwn, forensics, rev, misc, osint
    description: str
    points: int = 0
    difficulty: str = "unknown"  # easy, medium, hard, insane
    files: List[str] = field(default_factory=list)
    url: str = ""
    hints: List[str] = field(default_factory=list)

Import

from hexstrike_server import CTFChallenge

I/O Contract

Inputs (Constructor)

Name Type Required Description
name str Yes Challenge name
category str Yes One of: web, crypto, pwn, forensics, rev, misc, osint
description str Yes Challenge description text (used for keyword-based tool selection)
points int No Point value (default 0)
difficulty str No easy/medium/hard/insane/unknown (default "unknown")
files List[str] No Attached file paths
url str No Challenge URL
hints List[str] No Provided hints

Outputs

Name Type Description
instance CTFChallenge Dataclass passed to CTFWorkflowManager and CTFChallengeAutomator

Usage Examples

Creating a Web CTF Challenge

from hexstrike_server import CTFChallenge

challenge = CTFChallenge(
    name="SQL Injection Challenge",
    category="web",
    description="Find the admin flag by exploiting a SQL injection vulnerability in the login form.",
    points=200,
    difficulty="medium",
    url="http://challenge.ctf.example.com",
    hints=["Look at the login form parameters"]
)

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment