Sheet 5
General Information
All solutions must be Python 3 scripts if not stated otherwise. If you are new to Python 3, have a look online, there are many good resources to get started such as this intro course, this advanced course, this blog post, and this slide deck.
Please keep in mind that you should:
-
read the task description carefully
-
push
all your changes to the GitLab repository (main
branch) before the deadline. Make also sure that the file permissions are set correctly! If you are new to Git check out this site! -
Make sure that your solution (also) runs in the CI environment (and not just your local machine); this also means that you must install all additional packages yourself from within the
solution
script (see our blog post for details how to do that). -
Check the CI-Pipeline status and output for any errors. If the Pipeline is green and the output looks right, your solution should be correct.
-
Make sure that the solution is an executable Python 3 script named
solution
(chmod +x ./solution
) with a working shebang line at the top (i.e.#!/usr/bin/env python3
) so that it can be executed like this:./solution
(do not name your scriptsolution.py
,Solution
,solution.sh
, … – justsolution
) -
The final solution string, and only that, must be written to
stdout
and could be a number, a string, a string with the formatFLAG{some letters and digits here}
, depending on the specific task. -
Describe what you are doing using detailed comments for all your solution scripts! For example, use Docstrings (link) or inline comments:
1 2 3 4 5 6 7 8
def check_input_length(input_string): """ The input string must have a length greater than 42 and must also be even. """ length = len(input_string) # the final check happens here return (length > 42) and (length % 2 == 0)
This helps us to find out if you really understood the task and you are not just brute-forcing some solutions. Please do not leave any commented code (i.e., code that is not needed to solve the task) in your
solution
files! -
Make sure that your
solution
executes within 10 seconds (this is a hard timeout on our server). -
Violating any of the points above might lead to reduced final points for the specific task!
The deadline for this sheet is 2025-06-29 22:00:00 UTC
Task 17 – Simple Heap (8 Points)
This exercise uses a simple implementation for malloc
and free
which you can find in simple_heap.c
.
Exploit the simple_heap
binary to print the flag.
Edit the provided solution
template and explain your approach with meaningful comments!
Your solution should execute like this:
|
|
Task 18 – Fake it till you make it! (8 Points)
Can you leverage the Cheat class to print the content of flag.txt
?
Hints:
- What do you know about vtables?
- Can you leverage your
Nickname
wisely?
Your solution should execute like this:
|
|
Task 19 – An unlinkely secure binary (8 Points, individual Task)
Back to glibc, are you still able to to print the flag?
hint: How do we heap again?
Your solution should execute like this:
|
|
Task 20 – SNAKE? SNAKE!? SNAAAAKE! (8 Points)
Please beat the high score in our snake-clone by any means necessary!
hint:
- What heap technique allows us to write a large value?
Your solution should execute like this:
|
|
Task 21 – Simple Heap (8 Bonus Points)
This exercise uses a simple implementation for malloc
and free
which you can find in simple_heap.c
.
Exploit the simple_heap
binary and print the flag!
Edit the provided solution
template and explain your approach with meaningful comments!
Your solution should execute like this:
|
|