tutorial 3
We will be looking at Shellcodes the lab.
Please reference the AMD64 ABI Linux Syscall Table
Setup
Make sure you have all tooling installed.
Demo
In lab 3, your tutor will work through this challenge with you.
Prac
The prac challenge will utilise the same runner binary as above.
Challenge 1
Get the binary to print “HELLO WORLD!!!” using shellcode.
Challenge 2
Print a user entered string (from stdin) to stdout.
Challenge 3
- Open a file called flag.txt
- Copy the first 20 bytes of the file onto a buffer on the stack
- Print the contents of the file to stdout
- Close the file
- Exit cleanly (call exit())
Challenge 4
Transcribe the below code into assembly
int counter = 0
while(1):
if (counter >= 10){
printf("You win!\n");
break;
} else {
printf("%d\n",counter);
counter += 1;
}
}
With the expected output being:
0
1
2
3
4
5
6
7
8
9
You win!