People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
rootfs name (such as /tmp/mysandbox) to the file inside the sandbox (/tmp/mysandbox/my_file.txt. The application does path normalization to make directory traversal not trivially possible. However, they did not consider that directory traversal could be done within a symbolic link. Hence, the file to access is concatenated with the path from the symbolic link, giving us access to the host file system. openat is similar to open except it has the additional parameter dirfd with it. According to the man page: "If pathname is absolute, then dirfd is ignored." Since the sandbox will pass in the FD and the path, the sandbox can be trivially escaped using an absolute path in the openat syscall. openat call, how do we get code execution? To do this, the authors decided to modify the running sandbox process via /proc/mem, which is a virtual file for the processes memory. To do this, they alter LibC with a large NOP sled and some executable code to spawn a shell. With this, there is code execution in the context of the sandbox! The flag is rwctf{s0-many-vu1n_but-only-few-exploitable}, which makes sense from the bug described above. openat syscall and the lack of validation done on the symbolic link handling. Great write up for a very interesting bug!