Further practice needs both readiness and permission. An assigned target is the particular program or service a platform explicitly gives you, under its rules. A binary is a machine-readable program file. Its instruction architecture and operating environment affect how it can run and how tools interpret it.
A debugger inspects a process you may run. pwntools is an optional Python toolkit that can start a local program and communicate with it. A helper does not discover authorization or make an unfamiliar binary safe. The required work here is a written plan, with no exploit, tool installation or mitigation change.
Before you begin
- Recommended first
- Enough C and assembly to follow a compare and a jump, A beginner license check, Where practice is allowed, What NX, ASLR, stack canaries, and PIE stop
- Estimated time
- 18 min reading, 18 min activity. Setup and optional practice may take longer.
- Where you work
- Use the printed memory and source models in a desktop or mobile browser, with paper or a text editor. No compilation, debugger, pwntools installation, mitigation change or executable is needed. The layouts are conceptual, not measured process memory. Optional later tools need a separately checked owned environment and budget.
- Without a lab
- All evidence needed for the activity appears on this page. Copy it into notes if downloads are unavailable. Read the labeled model and predict each result; a paper trace practises the reasoning while tool operation waits for a lab. Reading needs no JavaScript. Answer checking needs JavaScript and a secure context; saving progress also needs usable browser storage.
After this lesson you can:
- Name desk-stack as the only file in the worked grant.
- Name lamp-heap as the only file in the activity grant.
- State a stop that leaves a different host, a login page, and kernel settings outside the grant.
01Example
Fresh bounded-practice model, separate from the lamp-heap assignment card.
Grant: inspect one owned source file in a disposable guest.
Allowed: read the stated file and record its requirements.
Unknown: matched build and runtime evidence.
Stop: a proposed step needs another file, host or setting outside the grant.
Plan does not claim a challenge was opened or solved.02A grant is one sentence
Copy the assignment’s target, permitted actions, time/window, exclusions and stop condition. A login used to access a platform, a status page and other users’ systems remain separate targets unless an explicit grant includes them.
For later binary practice, review Reversing in its recommended reading order, then the bounds and mitigation roles here. Record the named architecture, such as x86-64, a processor instruction family. An ARM host is not assumed to match an x86-64 model, and no supplied diagram is a captured stack layout.
If you later choose pwn.college, read its current rules and Start Here guidance before starting an assigned challenge. Its previously read rules restrict publication of challenge solutions; this course requires no belt or external flag. If access or rules cannot be checked, keep the plan pending rather than claiming participation.
Build a bounded next-practice plan and read an optional local process helper without expanding its target scope.Model. A teaching model drawn by hand. It shows the idea, not real tool output.
Read the full explanation below.
Grant: inspect one owned source file in a disposable guest.
met · One owned source in disposable guest.Allowed: read the stated file and record its requirements.
met · Read and record requirements only.Stop: a proposed step needs another file, host or setting outside the grant.
met · No additional file, host or setting required.Matched build and runtime evidence remain unknown; no challenge was opened.
A next-practice plan stays inside its named assignment; a plan is not an opened or solved challenge.
Matched build and runtime evidence remain unknown; no challenge was opened.
Follow the explanation
- Matched build and runtime evidence remain unknown; no challenge was opened.
- Keep the next-practice plan pending rather than claiming a launched or solved challenge.
Read every state and value
1. Matched build and runtime evidence remain unknown; no challenge was opened.
- Case
- read
- Conditions inspected
- One owned source file · Read and record requirements · Scope stop
- Decision shown
- Yes
2. Keep the next-practice plan pending rather than claiming a launched or solved challenge.
- Case
- outside
- Conditions inspected
- One owned source file · Read and record requirements · Scope stop
- Decision shown
- Yes
Label: practice-plan template. The worked names are fiction. Replace the blanks only when a platform, or your own machine, has assigned the target.
No challenge was opened. No account was created. No flag is printed here.
Worked grant, for the reading:
- Target file: desk-stack
- Machine family: Linux x86-64
- Where: the host that assignment names for that file
- Included: that one file
- Not included: the platform login, other challenges, other users, and the guest's kernel settings
Plan to copy for a real assignment. Leave a blank empty until you have the fact.
Target file: ________
Who assigned it, and the sentence that says so: ________
Machine family the assignment names: ________
Prerequisites you already have: Reversing, including the recommendation to read Compiled and interpreted first; this stage's four lessons; where-practice-is-allowed.
Isolated environment: an owned disposable guest, or the platform's assigned shell. Not your everyday host.
Helper tools: optional. A debugger can inspect a program you are allowed to run. pwntools is an optional library for starting that program. Neither one adds a target.
In scope:
- ________
Out of scope, unless a new sentence adds them:
- Platform login, account recovery, and status pages
- Any other challenge
- Any machine the assignment does not name
- Host mitigation settings and kernel policy
Stop if:
1. The next step is not named in the assignment sentence.
2. The next step changes a mitigation or a kernel policy.
3. You cannot yet read the model this stage uses, or the reversing lessons it assumes.
4. You are about to post a solution, flag, or writeup and the platform asks you not to.
Activity card, different from the worked grant:
- Target file: lamp-heap
- Machine family: Linux x86-64
- Included: lamp-heap only
- The account-recovery page is not named
- One stop already written on the card: stop if the next step names a different host
Check for the activity: the in-scope file is lamp-heap. The account-recovery page stays outside.
03Trace lamp-heap
lamp-heap is a fictional assignment on a named Linux x86-64 host. Complete the four note lines using that sentence only.
Label: activity grant. Fiction. Not an account you hold.
Assignment sentence: You may study the single file lamp-heap on the assigned Linux x86-64 host.
Named in that sentence: lamp-heap, Linux x86-64, the assigned host.
Not named: the account-recovery page, the platform login, any other file, any kernel setting.
Stop condition already on this card: if the next step names a different host, stop.
Write these four lines in your notes. They are not graded by the checker.
1. In-scope file: lamp-heap
2. Machine family: Linux x86-64
3. Prerequisite you are using: the bounds model and the mitigation roles from this stage
4. Stop: a different host, or a page this sentence does not name
- Copy the target lamp-heap and machine family Linux x86-64. Identify the assigned host as a condition, without inventing its address.
- Use the permitted-action sentence to identify the study task. Mark the account-recovery page and other files as excluded.
- Write one stop if a step names a different host, an unnamed page or a host setting change. State which prerequisite or missing matched evidence you would review before proceeding later.
- Stop with the private plan. Do not create an account, connect to a challenge or change the computer’s settings.
04Optional: a process helper, unread
Read the optional source without installing pwntools. from pwn import process imports only its local process helper. process(["./owned-hello"]) would launch that path in the current directory; ./ means here. sendline(b"desk") would send a bytes line, and close() closes the helper connection/process resources. The source does not collect a response, so it is not evidence of seeing the greeting.
owned-hello.c uses an eight-byte array. fgets(line,8,stdin) reads at most seven bytes and adds a null terminator when successful. stdin is standard input. If the read succeeds, puts prints hello-from-owned; if it fails, the program returns status 1. The script may close before a later observation, and no pipe transcript is supplied.
For a separately authorized future run, use an isolated Python environment in an owned disposable guest, pin and record the library/runtime versions, build the benign source yourself under its checked instructions, and keep the path fixed to that owned build. Stop for an unknown executable, missing architecture support or any step that changes a mitigation. No installation/build is part of this reading estimate.
#include <stdio.h>
/* Owned hello. Not compiled. Not run.
Eight positions. fgets is documented to read at most one less than the
size it is given, and to store a terminating null. Then the program
prints a fixed word. The word does not depend on the characters read,
as long as fgets succeeds.
*/
int main(void) {
char line[8];
if (fgets(line, 8, stdin) == NULL) {
return 1;
}
puts("hello-from-owned");
return 0;
}
"""Optional primer. Not installed. Not run. Not an exploit.
The pwntools 4.15.0 introduction shows
`from pwn import *` and says that import brings in a large toolkit.
This file imports only process, which is the one function the lesson discusses.
process() is documented to spawn a process and wrap it for communication.
This script names ./owned-hello and nothing else. It does not change
address randomization. It does not attach to another user's program.
If you later install the library, use an isolated environment you control,
build owned-hello.c yourself, and stop if the path is not that file.
Do not point it at a platform login or at a challenge you were not assigned.
""",
from pwn import process
owned = process(["./owned-hello"])
owned.sendline(b"desk")
owned.close()
Label: reading notes for pwntools-demo.py and owned-hello.c.
Do not install pwntools for this page. Neither file was run. No pipe bytes were captured.
What the documentation supports, from the pages read:
- The stable introduction identifies itself as pwntools 4.15.0 documentation.
- It shows `from pwn import *` and says the library is a large toolkit.
- It says interacting with processes uses pwnlib.tubes.process.
- The process page says process() spawns a new process and wraps it for communication.
- The introduction's examples call sendline and recvline. Those examples are not this course's files.
What this course's files do, as source:
- owned-hello.c reads with fgets into an 8-byte array, then prints hello-from-owned if the read succeeds.
- The Linux fgets(3) page says fgets reads at most one less than the size it is given and stores a terminating null.
- pwntools-demo.py would start ./owned-hello and send the line desk. This note does not include captured pipe bytes. The script closes without receiving a line, so its source does not establish an observed greeting.
- A source trace, not a captured run: if fgets succeeds, the C file prints hello-from-owned.
What the primer does not do:
- It does not grant permission to start a program.
- It does not find a bug, change a mitigation, or finish a challenge.
- It does not include a setting that turns randomization off. The process page documents such a setting. This file does not use it, and this course does not ask you to.
Stop conditions if a later install is allowed on a machine you control:
- Stop if the program is not the owned hello you just built.
- Stop if you are about to change a host mitigation or a kernel policy.
- Stop if the platform forbids publishing what you did, and you were about to post it.
05Stage case
Complete the three-piece stage case in private notes. It combines new capacity numbers, a mitigation role and an explicit target grant. A useful evidence note records each source, calculation or interpretation, and limit.
Label: ungraded stage case. Original fiction. Not a captured crash, scan, or challenge result.
Keep a private evidence note with source, reasoning and limits.
Piece 1. Bounds.
Buffer bin has 3 positions, indexed from 0.
Requested write: 4 bytes, and no extra terminator is requested.
The write needs more positions than bin has. Mark it as a bounds violation.
Piece 2. Mitigation.
Row on this card: the stack's model address differs across two ordinary runs.
Match that row to the role whose job is a layout that varies between runs.
The bounds violation in piece 1 remains. The match does not repair it.
Piece 3. Practice.
Assignment sentence: You may study the single file crate on the assigned Linux x86-64 host.
The status dashboard is not in that sentence.
In-scope file: crate.
Stop condition: stop when the next step is the status dashboard, another file, or a change to a host setting.
Rubric, for your own note. The site does not grade the note.
- Piece 1 says the 4-byte write does not fit in 3 positions.
- Piece 2 names the layout that varies between runs, and still calls the write wrong.
- Piece 3 keeps crate and leaves the status dashboard out.
- The note does not claim a program was run, a mitigation was changed, or a flag was found.
- For bin with three positions and four requested bytes, record that capacity is exceeded without claiming a captured crash.
- For a model whose stack address differs across ordinary runs, name ASLR’s role and state that the bounds error remains.
- For the assignment naming crate, keep that file in scope and the separate status dashboard outside.
- Stop with the written plan and review publication rules before any later sharing. No solution, flag or execution result is produced by this case.
06Optional challenge
For about fifteen optional minutes, annotate each helper line with its role: import, local launch, send bytes, close. List what would still need actual confirmation before a runtime claim: the exact owned executable, supported environment and recorded communication. Keep all of this as source reading.
07Fresh cases for the checks
Use these fictional cases for the checks below. They have different inputs from the worked examples. Read them here or make notes; no installation or external service is needed.
Practice case A: new fictional one-file assignmentOwned fixture. An original file made for this course. Follow the activity's instructions in your own lab.
Assignment: study the single source file reed-stack on the assigned Linux x86-64 host.
Permitted action: read that source and write a private evidence plan.
No executable, binary build or runtime trace is supplied.
The assignment names no other host, login page, file or kernel setting.
Stop if the next step needs any of those additions.
Practice case B: optional unrun helper sourceOwned fixture. An original file made for this course. Follow the activity's instructions in your own lab.
from pwn import process
owned = process(["./owned-card"])
owned.sendline(b"reed")
owned.close()
No receive call or communication transcript is supplied. This is source reading only.
08Explain your evidence
Optional written self-check: explain one decision using the supplied case. No tool run is required.
Check your explanation: name file, host family and permitted action separately; classify added targets and settings; cite source and missing matched runtime evidence; keep the plan private and stop at the grant boundary.
09Common mistakes
If the platform login is treated as part of a binary assignment, compare targets explicitly and return to the named grant.
If a model is treated as an actual architecture-specific memory layout, record the missing matched build/debugger evidence.
If importing a helper seems to solve a bug, trace its actual job: it starts and communicates with the program; it does not establish safety, scope or a bounds proof.
References
- pwn.college homepage, including The Rules
Current rules and assigned-instance guidance should be read before optional later participation.
- pwntools 4.15.0 documentation: Getting Started
Official local process-helper API; the example is source reading only.
- pwntools: pwnlib.tubes.process
Official local process-helper API; the example is source reading only.
- fgets(3): read a line into a sized buffer
fgets reads within its supplied size and stores a terminating null on success.
- Debugging with GDB: Starting your Program
Runtime policy and debugger launch conditions; no setting change is required.