Company
Date Published
Author
Carlos Polop
Word count
1710
Language
English
Hacker News points
None

Summary

The challenge involves exploiting a vulnerability in the initramfs system of an unfamiliar environment, where the goal is to retrieve the flag out of the root user's home directory without using common utilities or scripts. The exploit starts by analyzing the initramfs image and its contents, including the init program and a compiled kernel with its respective .diff file. A key discovery is made about a new syscall called `fun_setuid()` that allows a process to change its uid to another one as long as it is greater than the current one or the process has the CAP_SETUID capability. The exploit uses this syscall to escalate privileges and obtain root access, leveraging a bug in the kernel's credential handling. Additionally, a tool called memexec is introduced, which enables running any program filelessly on PHP, allowing for arbitrary native code execution. The final step involves using memexec to execute a malicious binary that retrieves the flag from the root user's home directory.