Assignment 1
- Download: Assignment 1
- Deadline: April 21, 12:30.
- Hand-in: Brightspace
Extra resources
- (YouTube) Writing your first shell script
- Documentation for different printf() types
man man
(how to use the manual command)
Assignment 2
- Download: Assignment 2
- Deadline: May 12, 12:30.
- Hand-in: Brightspace
Extra resources
- C - Data Types
- Pointers
- More on pointers
- Calculating next memory address
- Underestainding memory address in C
- IBM inttypes.h
- One’s and two’s complement calculator
- Binary <-> decimal converter
- One’s complement
- Two’s complement
- Writing out binary numbers
Assignment 3
- Download: Assignment 3
- Deadline: May 19, 12:30.
- Hand-in: Brightspace
Extra resources
Initializing an array with a fixed value
The below code will initialize the whole of array
with the value 0
.
unsigned char array[SIZE] = {0};
Unfortunately, I was mistaken, and this only works for zero! Setting other values will only set that value for the first element and the rest will still be zero.
If you want to set a value on the whole array, try using memset
:
memset(array, 0, SIZE);
Assignment 4
- Download: Assignment 4
- Deadline: May 26, 12:30.
- Hand-in: Brightspace
Extra resources
Thom’s hacking utilities
These scripts can help you do some menial stuff, like printing addresses in little-endian order, as demonstrated in the lecture.
Follow the instructions in the README.md
to install them.
Assignment 5
The last homework assignment will be a bit different from the previous ones. I have spent the last weeks creating a website to host “capture the flag” style hacking challenges, which is where I will run the graded challenges on. I demoed it a little bit in the lecture.
This week we traditionally have the remote buffer overflow challenge, which more or less asks of you to do the same thing as I did in the lecture. You can submit your write-up through the site as well.
Sign up at https://hackme.rded.nl. You will need to fill in your student number and you can only sign up once. Please terminate your running processes after you’re done with them. This weeks homework is completing the two challenges that are posted there.
Extra resources
- ASCII/Hex encoder / Decoder. This encoder doesn’t chocke on null bytes or weird characters. Note that it doesn’t like
0x
in its input. - Classic tutorial on buffer overflows. Note that it is a bit outdated, because it’s from way before AMD64 (1996). Smashing the stack for fun and profit