computer-101: Add new challenge for passing parameters in GDB - #174
computer-101: Add new challenge for passing parameters in GDB#174m1urah wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “GDB args” challenge to the Computing 101 Software Introspection module to teach setting program arguments inside GDB, and updates nearby challenge descriptions to reduce learner confusion around segfaults caused by missing argv.
Changes:
- Add new
gdb-argschallenge (runtime-built/challenge/debug-me,.gdbconfig, and public solve test). - Register the new challenge in
introspecting/module.yml. - Update control-flow challenge descriptions to correct/adjust the module reference and to mention passing argv when debugging.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| challenges/computing-101/introspecting/module.yml | Adds the new gdb-args challenge to the Software Introspection module resource list. |
| challenges/computing-101/introspecting/gdb-args/tests_public/test_solve.sh | Public test that validates behavior with/without args under GDB and submits the recovered number. |
| challenges/computing-101/introspecting/gdb-args/challenge/submit-number.j2 | Reuses the common submit-number helper for checking the recovered value. |
| challenges/computing-101/introspecting/gdb-args/challenge/Dockerfile.j2 | Uses the Computing 101 common Dockerfile template for required tooling (binutils/gdb/etc.). |
| challenges/computing-101/introspecting/gdb-args/challenge/.init | Generates the secret and assembles/links the debug-me binary that traps on int3 when argc is correct. |
| challenges/computing-101/introspecting/gdb-args/challenge/.gdb | Provides a GDB config that prints disassembly on stops while keeping output clean. |
| challenges/computing-101/introspecting/gdb-args/DESCRIPTION.md | Documents set args usage and the intended solving workflow for the new challenge. |
| challenges/computing-101/control-flow/switch/DESCRIPTION.md | Adds a note about needing argv and references the introspection module for passing args in GDB. |
| challenges/computing-101/control-flow/cmp-reverse/DESCRIPTION.md | Fixes the Software Introspection module link reference in the description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e92bef388
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4318e0ceb5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a new “Passing Parameters to Programs” GDB challenge to reduce confusion around argv-dependent levels, and updates related challenge descriptions to point learners to the right introspection material.
Changes:
- Add new
gdb-argsintrospecting challenge that requires usingset argsin GDB to recover a secret fromrdi. - Update control-flow “switch” description to explicitly warn about required argv and suggest ways to pass args in GDB.
- Fix the “Reverse the Password” description link to the correct introspection module route.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| challenges/computing-101/introspecting/module.yml | Registers the new gdb-args challenge in the introspection module flow. |
| challenges/computing-101/introspecting/gdb-args/tests_public/test_solve.sh | Public functional test validating expected behavior with/without GDB args and preventing static leakage. |
| challenges/computing-101/introspecting/gdb-args/challenge/submit-number.j2 | Reuses the standard submit helper for number submission. |
| challenges/computing-101/introspecting/gdb-args/challenge/bin/objdump | Disables objdump to steer learners toward GDB. |
| challenges/computing-101/introspecting/gdb-args/challenge/bin/gdb | Wraps GDB to enforce a simplified invocation for the level. |
| challenges/computing-101/introspecting/gdb-args/challenge/Dockerfile.j2 | Sets SUID bit on .read-secret for runtime secret injection. |
| challenges/computing-101/introspecting/gdb-args/challenge/.read-secret | SUID helper that releases the secret only to the intended GDB tracing scenario. |
| challenges/computing-101/introspecting/gdb-args/challenge/.init | Generates the per-instance secret and builds the debug-me binary that conditionally triggers int3. |
| challenges/computing-101/introspecting/gdb-args/challenge/.gdb | Adds breakpoint automation to load the secret into rdi at int3_loc. |
| challenges/computing-101/introspecting/gdb-args/DESCRIPTION.md | Learner-facing instructions for using set args and recovering the value from rdi. |
| challenges/computing-101/control-flow/switch/DESCRIPTION.md | Adds explicit argv requirement warning and points to prior introspection practice. |
| challenges/computing-101/control-flow/cmp-reverse/DESCRIPTION.md | Fixes the introspection module link path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Adds a new “Passing Parameters to Programs” GDB challenge to reduce confusion around needing argv/argc during debugging, and updates related challenge descriptions/links across computing-101.
Changes:
- Register new
gdb-argschallenge in the Software Introspection module. - Add the new
gdb-argschallenge implementation (init/build, gdb scripting, wrappers, public test). - Update control-flow and reverse-password challenge docs to correct module links and clarify argument passing requirements.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| challenges/computing-101/introspecting/module.yml | Adds the new gdb-args challenge entry to the module resource list. |
| challenges/computing-101/introspecting/gdb-args/tests_public/test_solve.sh | Public solve test that drives gdb in batch mode and verifies the intended solution path. |
| challenges/computing-101/introspecting/gdb-args/challenge/submit-number.j2 | Wires the standard submit-number helper into the level. |
| challenges/computing-101/introspecting/gdb-args/challenge/bin/objdump | Disables objdump inside the level to push learners toward gdb. |
| challenges/computing-101/introspecting/gdb-args/challenge/bin/gdb | Constrains gdb invocation style for the level (single target binary). |
| challenges/computing-101/introspecting/gdb-args/challenge/Dockerfile.j2 | Sets SUID on the .read-secret helper in the image build. |
| challenges/computing-101/introspecting/gdb-args/challenge/.read-secret | SUID helper that releases the secret only when invoked from a qualifying gdb-traced session. |
| challenges/computing-101/introspecting/gdb-args/challenge/.init | Builds /challenge/debug-me and seeds the secret used by submit/validation. |
| challenges/computing-101/introspecting/gdb-args/challenge/.gdb | Adds a breakpoint + command hook to inject the secret into $rdi at the right stop. |
| challenges/computing-101/introspecting/gdb-args/DESCRIPTION.md | Learner-facing writeup explaining set args and the intended workflow. |
| challenges/computing-101/control-flow/switch/DESCRIPTION.md | Clarifies the need to pass argv and points learners back to the introspection module. |
| challenges/computing-101/control-flow/cmp-reverse/DESCRIPTION.md | Fixes the module link path to /computing-101/introspecting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Adds a new Software Introspection challenge to teach setting program arguments from inside GDB, and updates related challenge docs to reduce confusion around missing argv causing crashes.
Changes:
- Register a new
gdb-argschallenge (“Passing Parameters to Programs”) in the introspecting module. - Add the new
gdb-argschallenge implementation (init/build logic, GDB config, wrappers, SUID helper) plus a public solve test. - Update control-flow and cmp-reverse descriptions to point to the correct introspection module and to mention passing arguments.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| challenges/computing-101/introspecting/module.yml | Adds the new gdb-args challenge to the module resource list. |
| challenges/computing-101/introspecting/gdb-args/tests_public/test_solve.sh | Public integration test that verifies solving via GDB argument-setting and prevents trivial leakage. |
| challenges/computing-101/introspecting/gdb-args/challenge/submit-number.j2 | Wires in the standard submit-number helper. |
| challenges/computing-101/introspecting/gdb-args/challenge/bin/objdump | Disables objdump for the level to push learners to GDB. |
| challenges/computing-101/introspecting/gdb-args/challenge/bin/gdb | Adds a constrained GDB launcher wrapper for the level. |
| challenges/computing-101/introspecting/gdb-args/challenge/Dockerfile.j2 | Sets SUID on the helper used to inject the secret into GDB. |
| challenges/computing-101/introspecting/gdb-args/challenge/.read-secret | SUID helper to provide the secret only to the intended traced debug session. |
| challenges/computing-101/introspecting/gdb-args/challenge/.init | Creates per-instance secret and builds the /challenge/debug-me binary. |
| challenges/computing-101/introspecting/gdb-args/challenge/.gdb | GDB configuration and breakpoint commands to load the secret into $rdi. |
| challenges/computing-101/introspecting/gdb-args/DESCRIPTION.md | Learner-facing instructions for using set args and recovering $rdi. |
| challenges/computing-101/control-flow/switch/DESCRIPTION.md | Adds guidance that an argument is required and reminds how to pass args in GDB. |
| challenges/computing-101/control-flow/cmp-reverse/DESCRIPTION.md | Fixes the module link to the correct /computing-101/introspecting route. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ript, and add missing bin wrappers.
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Hi, sorry about the delay in taking a look at this. I think this is really good stuff, but it seems to jump ahead to I also think the implementation can be simplified to avoid secret numbers and such. What do you think? |
As I was doing the control-flow challenges, I got stuck at the "Conditionals Without Conditionals" challenge as I kept getting segmentation faults 🙃
I thought there was something wrong with the challenge, so I wrote a for-loop to brute-force the flag and check whether the issue was my approach or the code itself. Turns out it was the former... I just didn't know I had to provide an argument.
This MR includes three things:
Tests are public under test_public as I don't have access to the module's key
I've run the tests inside the nix challenge shell, and all passed: