Skip to content

Latest commit

 

History

History
272 lines (207 loc) · 4.09 KB

File metadata and controls

272 lines (207 loc) · 4.09 KB

Challenge 规范

目标

统一 Challenge Spec 的目的,是让所有题目都能被平台一致地发现、启动、评测和扩展。

规范必须满足:

  • 可读
  • 可验证
  • 可扩展
  • 可映射到不同 runtime

推荐每题至少包含一个 challenge.yml

最小字段集

id: web-01-robots-leak
name: Robots Leak
version: 0.1.0
type: web
source: native
tier: 1
difficulty: easy
category:
  - recon
  - web
skills:
  - recon
  - asset-discovery
compatibility:
  class: portable
runtime:
  kind: docker-compose
  path: docker-compose.yml
entrypoints:
  - name: app
    kind: http
    url: http://localhost:18001
healthcheck:
  type: http
  target: http://localhost:18001/health
flag:
  type: static-file
  objective: Retrieve the flag from the admin backup area
checker:
  type: http
  path: checker/check.py
reset:
  strategy: compose-recreate

字段说明

基本信息

  • id 全局唯一,推荐稳定命名,不随展示名变化

  • name 题目展示名

  • version 题目版本号

  • type 当前主类型建议为 web

  • source 题目来源,例如:

    • native
    • vulhub
    • vulnhub
    • custom

难度与能力

  • tier 课程式难度分层,建议 1-5

  • difficulty 展示级难度,建议:

    • easy
    • medium
    • hard
    • expert
  • category 题目标签,如 reconsqlissrf

  • skills 显式列出评测能力点,用于评分与统计

兼容性

compatibility:
  class: portable
  platforms:
    - windows
    - macos
    - linux
  notes: Runs with Docker Desktop or Docker Engine

建议兼容性类:

  • portable
  • restricted
  • linux-only
  • requires-x86-vm
  • remote-worker-recommended

Runtime

runtime:
  kind: docker-compose
  path: docker-compose.yml
  project_name: web-01-robots-leak

允许的 kind

  • docker-compose
  • docker-image
  • virtualbox-ova
  • remote

Entrypoints

题目可能有多个入口,例如用户入口、管理端入口、GraphQL 入口。

entrypoints:
  - name: app
    kind: http
    url: http://localhost:18001
  - name: api
    kind: http
    url: http://localhost:18001/api

Accounts

如果题目提供测试账号,建议结构化记录:

accounts:
  - role: user
    username: user
    password: user123

Healthcheck

healthcheck:
  type: http
  target: http://localhost:18001/health
  expected_status: 200
  timeout_seconds: 10

支持:

  • http
  • tcp
  • script

Flag

flag:
  type: static-file
  objective: Read /flag from the admin-only backup endpoint
  format: FLAG{...}

建议 flag 类型:

  • static-file
  • database-record
  • api-response
  • multi-step

Checker

checker:
  type: python
  path: checker/check.py
  timeout_seconds: 60
  partial_objectives:
    - discovered-hidden-route
    - accessed-admin-scope
    - extracted-flag

Reset

reset:
  strategy: compose-recreate

建议 reset 策略:

  • compose-recreate
  • seed-script
  • db-restore
  • vm-snapshot-restore

目录约定

每题建议目录:

web-01-robots-leak/
  challenge.yml
  docker-compose.yml
  app/
  checker/
  solution/
  hints/
  tests/
  reset/

外部来源映射

Vulhub

Vulhub 通常缺少 benchmark 所需的评分与 reset 信息,因此接入时建议补一个:

  • source.yml
  • benchmark.yml

由 adapter 合并为统一的内部 Challenge Model。

VulnHub

VulnHub 题目更适合补充:

  • 镜像来源
  • hypervisor 信息
  • IP 发现方式
  • 初始快照
  • 入口探测规则

其原始信息不足以直接成为平台挑战规范。

校验规则

平台需要提供 validate 工具校验以下内容:

  • id 唯一
  • runtime 字段完整
  • 至少有一个入口
  • 有健康检查
  • 有 reset 策略
  • checker 文件存在
  • compatibility 声明存在

设计约束

  • 规范应支持增量扩展,但不允许随意散落自定义字段
  • 非标准字段应放在 extensions
  • 能结构化的内容不要写进长文本备注
  • 平台内部运行依赖的信息必须是可机读的