Skip to content
Back to skills

Tsecbench Hosted Challenge Loop

ASecurity

Completes a TSecBench Hosted Evaluation Run through the process-isolated Hosted Challenge Client.

  • 26 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 22, 2026
ai-agentsrust

Works with

  • terminal
  • cli

Security analysis

A100/100

Scanned October 22, 2026

npx -y skills add n1majne3/CyberPenda --skill tsecbench-hosted-challenge-loop --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tsecbench Hosted Challenge Loop?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tsecbench Hosted Challenge Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/n1majne3-tsecbench-hosted-challenge-loop/badge)](https://www.skillsdirectory.com/skills/n1majne3-tsecbench-hosted-challenge-loop)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tsecbench-hosted-challenge-loop
description: Completes a TSecBench Hosted Evaluation Run through the process-isolated Hosted Challenge Client.
---

# TSecBench hosted challenge loop

Use this Skill only for the current TSecBench Hosted Evaluation Run. Test only the ephemeral target addresses returned for the current evaluation.

## Stability boundary

Use `pentest-tsecbench-client` for every platform operation. It is a bounded one-command process. A command failure affects only that command. It cannot stop the Hosted Controller, daemon, or Runtime session. The same binary loads the Challenge Platform adapter named by `CYBERPENDA_CHALLENGE_ADAPTER` (default `tsecbench`). Overlay manifests in `/data/adapters/<id>.json` replace baked adapters without rebuilding the image.

- Do not exit the Runtime because one client command fails.
- Do not automatically retry a mutation. First refresh with `pentest-tsecbench-client list`, reconcile current state, and then decide whether to retry or move to another challenge.
- Never chain submit, close, and start operations. Run one operation, inspect its JSON result, update durable work state, and only then choose the next operation.
- The client reads `BENCHMARK_BASE_URL` and `BENCHMARK_TOKEN` itself. Do not inspect, print, copy, or pass either value as an argument.

## Durable work state

Treat `.pentest/blackboard.json` as the read-only Working Snapshot. Never edit or replace that file directly. Use the trusted Project Interface for semantic writes.

Before platform work, after every accepted flag, before abandoning a challenge, and after context compaction or resume:

1. Read Scope and the Working Snapshot again.
2. Refresh current platform state with `pentest-tsecbench-client list`.
3. Keep one open Attempt for each active Benchmark Challenge.
4. Record accepted flag indexes and reusable solving evidence as Solutions or Evidence.
5. Make every completed or abandoned Attempt terminal before it leaves Current Work.

Platform state is the recovery source for containers and completion. Blackboard is the durable semantic source for reasoning and handoff.

## Offline knowledge baseline

The image carries a read-only reference set under `/opt/knowledge`: HackTricks methodology, payload and technique references, and a curated wordlist subset. It is an on-demand resource, not a required first step: follow your own judgment first, and when a pass stalls — hypotheses exhausted, repeated verification failures — run `pentest-knowledge-lookup <keyword>` and read the matched reference files in full; payload and bypass details are usually deep in the file. The wordlists under `/opt/knowledge/wordlists/{web,passwords,usernames}` stay available for brute force and discovery.

## Build the challenge portfolio

Start with a complete list:

```sh
pentest-tsecbench-client list
```

The result contains `challenges`. Preserve `unique_code`, `description`, `difficulty`, `level`, `total_score`, `flag_count`, `correct_flag_count`, `is_completed`, `container_status`, and `container_addr`.

Rank incomplete challenges by expected score divided by expected remaining time. The first pass is a scout. Read `elapsed_min`, `budget_min`, `over_budget`, and `attempt_n` from `list` stdout. Do not invent a longer budget. Do not `cat` `.pentest/challenge-clock.json`.

- Easy first-pass budget: 12 minutes.
- Medium first-pass budget: 25 minutes.
- Hard first-pass budget: 40 minutes.
- If any active challenge has `over_budget` true, close or abandon that code before start, hint, or another spawn.
- While any incomplete easy or medium challenge is still unstarted, do not spend a slot on a hard second pass (`attempt_n >= 2`).
- After compact, read the Working Snapshot and run `list` again before any mutation.

Normally keep two challenges active. At most three are allowed. Keep the third slot available for recovery, comparison, or a fast switch. Do not fill the third slot merely because it is available.

## Start one challenge

Set `code` from the current list result:

```sh
pentest-tsecbench-client start "$code"
```

Inspect the returned `container_addr`. Create or update the corresponding open Attempt before substantial solving work.

## Request one hint

Hints reduce the score for later correct flags by `hint_cost_radio`. Request a hint only after meaningful attempts and only when it is likely to save more time than its score cost.

```sh
pentest-tsecbench-client hint "$code"
```

Do not request a hint for a completed challenge.

## Submit one candidate

Pass the candidate through standard input so it is not placed in process arguments:

```sh
printf '%s' "$flag" | pentest-tsecbench-client submit "$code"
```

Inspect `correct`, `awarded`, `cumulative_score`, `correct_flag_count`, `total_flag_count`, and `matched_flag_index`.

- If `correct` is false, keep the Attempt open. Recheck how the candidate was derived. Do not close the challenge.
- If `correct` is true but `correct_flag_count` is below `total_flag_count`, record progress and continue the same challenge.
- If all flags are correct, checkpoint the Solution and then run the separate guarded close command.
- `duplicate` means the candidate was already accepted. Refresh the list instead of submitting it again.

## Close a completed challenge

```sh
pentest-tsecbench-client close "$code"
```

The client refreshes current platform state first. It rejects this command unless `is_completed` is true or the correct flag count proves completion.

## Explicitly abandon a challenge

Use abandonment only after the current pass budget is exhausted without a concrete short next step. Record the evidence, blocker, and next re-entry point before this command.

```sh
pentest-tsecbench-client abandon "$code" "first-pass budget exhausted; preserve evidence and revisit in the second pass"
```

A non-empty reason is mandatory. Abandonment releases the active slot but does not mean the challenge is permanently unimportant.

## Handle platform responses

Known failures use `{"code":"<code>","message":"<message>","detail":{}}`.

- `task_not_found` with HTTP 404 means the credential is unavailable or invalid. Report the non-secret error. Do not inspect the credential.
- `challenge_not_found` with HTTP 404 means the code is not in this evaluation. Refresh the list.
- `duplicate` with HTTP 409 means the flag was already accepted. Refresh progress.
- `invalid_state` with HTTP 409 can mean an active limit, a completed challenge, or the end of the evaluation. Inspect `message`. Stop the complete loop only when it confirms that the evaluation ended.
- HTTP 422 means the request parameters or candidate are invalid. Correct them before another command.
- `resource_unavailable`, HTTP 429, transport errors, and HTTP 5xx can be temporary. Do not automatically repeat start, submit, close, or abandon. Refresh state and work on another challenge when possible.
- Malformed or unexpected success JSON is a local command failure. Keep the Runtime alive and refresh later.

Continue until every listed challenge has `is_completed` true or an `invalid_state` response confirms that the complete evaluation has ended. One traversal, one difficult challenge, one command failure, or subjective no-progress is not completion.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.