CTF Web Challenges skill for Codex

Understand the app, then find the intended bug. Codex approaches a scoped web CTF challenge like a puzzle: map every route and parameter, read provided source, match the clues to a likely bug class, then confirm with the smallest probe before building the chain. It keeps a request-by-request log that becomes the write-up, stays inside the challenge boundary, and leans on structured method over a tool dump.

  • Security
  • $ctf-web-challenges
  • 101 lines
  • 2 files
  • ~1,250 tokens
  • MIT
  • Updated

Install

curl -fsSL codexskills.dev/install.sh \  | sh -s -- ctf-web-challenges

Installs to ~/.agents/skills/ctf-web-challenges/ for every project on this machine.

104-line POSIX script. No sudo, no telemetry. Read install.sh

Use it in Codex

Start a prompt with $ctf-web-challenges, or pick it from /skills. You can also just describe the task: Codex reads the description below and loads the playbook when your request matches.

What Codex reads before loading it

Solves web security CTF challenges methodically against the challenge instance you were given - map the app, read the source when provided, form a hypothesis about the intended bug class (IDOR, auth logic, SSTI, SQLi, deserialization, prototype pollution, JWT flaws, request smuggling), and work toward the flag with a repeatable notes trail. Use in a CTF or training lab (pwn.college, PortSwigger Web Security Academy, HTB, picoCTF) when a web challenge is stuck and you want structure, not a tool dump.

Use it when

  • You are solving a web challenge in a CTF or training lab
  • A challenge is stuck and you want a structured next step
  • You want to learn a web bug class by working it end to end

Use something else when

How to check the result

You can reproduce the flag from your notes alone and explain the vulnerability and its fix, not just the payload that happened to work.

The mistake it prevents

Firing scanners at everything instead of reading the provided source, and straying off the scoped challenge host onto the platform or other instances.

~/.agents/skills/ctf-web-challenges/SKILL.md

--- name: ctf-web-challenges description: Solves web security CTF challenges methodically against the challenge instance you were given - map the app, read the source when provided, form a… license: MIT ---

A CTF web challenge is a puzzle with an intended solution. Solve it by understanding the app, not by firing every tool at it. Done well means: you can explain the vulnerability, reproduce the flag from your notes, and you learned the bug class well enough to recognise it next time.

Scope

Only touch the challenge instance you were assigned (the lab’s own hosts, your container, the competition’s scoped targets). CTF authorization ends at the challenge boundary: scanning the platform itself, other teams’ instances, or unrelated internet hosts is out of bounds. If a “challenge” points at a real third-party site, stop.

Method

- [ ] 1. Map the app: every route, parameter, cookie, header, and client-side JS
- [ ] 2. Read the source if given (challenge handout, /src, a .git folder, JS bundles)
- [ ] 3. Identify the trust boundary and the likely intended bug class
- [ ] 4. Form one hypothesis; test the smallest thing that confirms or kills it
- [ ] 5. Build the exploit step by step; keep every request/response in notes
- [ ] 6. Get the flag; write up the chain while it is fresh

1. Map

  • Walk the app as a user. Note auth flows, roles, object IDs, and anything that looks server-rendered from input.
  • Read the JS: fetch/axios calls reveal hidden endpoints and parameter names. Source maps (.js.map) often ship the original code.
  • Check the obvious leaks: /robots.txt, /.git/ (dumpable with git tooling if exposed), /.env, backup files (index.php~, .bak), verbose errors, and comments in HTML.
  • Diff responses: a valid vs invalid username, an admin vs user token, a 200 vs 403.

2. Recognise the bug class

ClueLikely classFirst probe
Numeric or guessable object IDs in URLsIDOR / broken access controlRequest another ID with your session
Your input appears in the rendered pageXSS, or SSTI if a template engine{{7*7}}, ${7*7}, <%= 7*7 %> per engine
Input reaches a SQL-looking query; errors change on 'SQL injectionBoolean/time-based differentials; use the DB’s own syntax
A JWT in a cookie or headerAlg confusion, alg:none, weak secret, kid tricksDecode header/claims; check signature handling
Serialized blob (base64 of pickle/PHP/Java/Node)Insecure deserializationIdentify the format before anything else
__proto__ / constructor accepted in JSONPrototype pollutionPollute a benign key, look for a gadget
Login logic in provided sourceAuth logic flawTrace the comparison and the session issuance
Weird header handling / proxy in frontRequest smuggling, cache poisoning, host-headerCompare front-end vs back-end parsing

PortSwigger’s Web Security Academy has a focused lab for each of these; when a class is unfamiliar, work the matching lab first, then return to the challenge.

3-5. Confirm, then build

  • Change one variable at a time. A confirmation probe should give an unambiguous yes/no (reflected 49, a boolean-differentiated response, an out-of-band callback you control).
  • Keep a running log: request, response, what it proved. This is the write-up and the thing that lets you backtrack when a path dead-ends.
  • Use a proxy (Burp, mitmproxy) to replay and tweak requests; curl with saved cookies for scripting the final chain.
  • Out-of-band confirmation (blind SSRF/SQLi/SSTI) uses a collaborator/interactsh-style listener you control, never a victim’s infrastructure.

Tools, used with intent

  • Recon: browser devtools, ffuf/feroxbuster for content discovery (only on the scoped host), nuclei to catch known patterns fast.
  • Intercept and replay: Burp Suite (Repeater, Intruder) or Caido; mitmproxy for scripting.
  • Decode and inspect: CyberChef for encodings, jwt_tool or manual base64 for tokens.
  • These need network and sometimes installs; in the Codex sandbox, call out when a step needs network or approval. Rate-limit discovery tools so you do not knock the challenge over.

Getting unstuck

  • Re-read the source and the challenge description; CTF titles and flavour text hint at the class.
  • The intended bug is usually one hop, not a five-stage chain. If your plan is elaborate, you probably missed something simpler.
  • Compare with a known-good request to see what you are missing (a header, content type, ordering).
  • Diff the app against the framework’s defaults: what did the author deliberately change?

Write-up template

## <Challenge name> (category: web, points: N)
**Bug class:** SSTI in the Jinja2 profile renderer
**Entry point:** POST /profile, field `nickname`, reflected into the rendered page
**Confirmation:** `{{7*7}}` rendered as `49`
**Exploit chain:**
1. `{{config}}` leaks app config -> SECRET not there
2. `{{''.__class__.__mro__[1].__subclasses__()}}` to reach a RCE gadget (sandboxed)
3. Read the flag file via the gadget
**Flag:** flag{...}
**Lesson:** user input rendered through a template engine without autoescape/sandbox

What the zip contains

SKILL.md plus the interface file below. Nothing runs on install.

agents/openai.yamlgenerated from this page

Gives the Codex app a display name, a one-line description and a starter prompt for this skill.

interface:
  display_name: "CTF Web Challenges"
  short_description: "Understand the app, then find the intended bug"
  default_prompt: "$ctf-web-challenges I'm stuck on this web CTF - here's the source, help me find the bug"

About this skill

Written and maintained by the Codex Skills editors to the same editorial standard as every skill here: a selective description, a real workflow, known pitfalls and a way to verify the work. First published , last updated . MIT licensed. Something wrong or out of date? Tell us.

esc
Just launched

Codex Skills Pro is live

79 premium skills for Codex, each with scripts, references and an evidence report that proves the result.

Bought one by one$882.21
All 79 skills$49
94% off

That's $0.62 a skill, paid once.

Get all 79 for $49Or pick single skills from $4.99 →

Secure checkout by Creem