Generating Shellcode
Worth 75 points
Description
Create shellcode that prints your username.
If you went through the lab by copying and pasting without understanding this will likely be difficult. If you followed the lab closely you will have a much easier time.
git clone https://github.com/cs354/CS-354.git
bash code/CS-354/student_environment.bash
cd /mnt/projects
Replace the shellcode in name.h with shellcode that will print your NetID. Your code should compile and run in the student container and should print your own NetID regardless of what user runs it (i.e. not the same behavior as whoami).
Example:
$ ./name
abc123
Tools to use
- gcc
- gdb
- objdump
Tips
- Don't forget to remove all null characters.
- Make sure a newline is also printed.
- Shellcode should be short, and the grading system will not allow extremely long strings.
- There is no single "right" approach to the problem.