Skill v1.0.0
currentAutomated scan100/100name: tsecbench-hosted-challenge-loop description: Completes a TSecBench Hosted Evaluation Run through the process-isolated Hosted Challenge Client. metadata: version: "1.0.0"
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_URLandBENCHMARK_TOKENitself. 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:
- Read Scope and the Working Snapshot again.
- Refresh current platform state with
pentest-tsecbench-client list. - Keep one open Attempt for each active Benchmark Challenge.
- Record accepted flag indexes and reusable solving evidence as Solutions or Evidence.
- 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:
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_budgettrue, 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
listagain 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:
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.
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:
printf '%s' "$flag" | pentest-tsecbench-client submit "$code"
Inspect correct, awarded, cumulative_score, correct_flag_count, total_flag_count, and matched_flag_index.
- If
correctis false, keep the Attempt open. Recheck how the candidate was derived. Do not close the challenge. - If
correctis true butcorrect_flag_countis belowtotal_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.
duplicatemeans the candidate was already accepted. Refresh the list instead of submitting it again.
Close a completed challenge
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.
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_foundwith HTTP 404 means the credential is unavailable or invalid. Report the non-secret error. Do not inspect the credential.challenge_not_foundwith HTTP 404 means the code is not in this evaluation. Refresh the list.duplicatewith HTTP 409 means the flag was already accepted. Refresh progress.invalid_statewith HTTP 409 can mean an active limit, a completed challenge, or the end of the evaluation. Inspectmessage. 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.