Skip to content

computer-101: Add new challenge for passing parameters in GDB - #174

Open
m1urah wants to merge 9 commits into
pwncollege:mainfrom
m1urah:main
Open

computer-101: Add new challenge for passing parameters in GDB#174
m1urah wants to merge 9 commits into
pwncollege:mainfrom
m1urah:main

Conversation

@m1urah

@m1urah m1urah commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

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:

  • A fix to the "Reverse the Password" challenge description
  • A new challenge that teaches how to set arguments in gdb
  • A minor change to the "Conditionals Without Conditionals" challenge to link to this new one, so this "confusion" doesn't happen again for anyone else

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:

image

Copilot AI review requested due to automatic review settings April 27, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-args challenge (runtime-built /challenge/debug-me, .gdb config, 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.

Comment thread challenges/computing-101/control-flow/cmp-reverse/DESCRIPTION.md Outdated
Comment thread challenges/computing-101/control-flow/switch/DESCRIPTION.md Outdated
Comment thread challenges/computing-101/introspecting/gdb-args/tests_public/test_solve.sh Outdated
Comment thread challenges/computing-101/introspecting/gdb-args/tests_public/test_solve.sh Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread challenges/computing-101/introspecting/gdb-args/challenge/.init Outdated
@m1urah
m1urah marked this pull request as draft April 28, 2026 06:03
@m1urah
m1urah marked this pull request as ready for review April 28, 2026 07:37
@m1urah
m1urah requested a review from Copilot April 28, 2026 07:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread challenges/computing-101/introspecting/gdb-args/challenge/.init

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-args introspecting challenge that requires using set args in GDB to recover a secret from rdi.
  • 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.

Comment thread challenges/computing-101/introspecting/gdb-args/challenge/.read-secret Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-args challenge in the Software Introspection module.
  • Add the new gdb-args challenge 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.

Comment thread challenges/computing-101/introspecting/gdb-args/tests_public/test_solve.sh Outdated
Comment thread challenges/computing-101/introspecting/gdb-args/challenge/.read-secret Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-args challenge (“Passing Parameters to Programs”) in the introspecting module.
  • Add the new gdb-args challenge 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.

@zardus

zardus commented Jun 2, 2026

Copy link
Copy Markdown
Member

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 set args instead of just run arg1 arg2. The latter seems simpler, so I went ahead and made a quick level for it as part of #177. Would you mind tweaking your current one to go after gdb-run-args as a gdb-set-args?

I also think the implementation can be simplified to avoid secret numbers and such. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants