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!
snprintf directly without any length checks! This creates a very large buffer overflow for all strings that are bigger than one page. /sys/class/iscsi_transport/$TRANSPORT_NAME/handle. When read, the function leaks the handle, which is simply a pointer to a kernel address.iscsi_transport structure within the ib_iser module. This structure contains several function pointers with parameters that we control, making it an ideal target. seq_buf_to_user and seq_buf_putmem in order to obtain a simple read/write primitive. There are some caveats to this, as the pointers are not exactly what we expect though. run_cmd in the kernel SE Linux context. The function takes a parameter from the iscsi_transport struct that points to a shell script in userland. Because the attack never dereferences or executes memory from userland in the kernel, the exploit bypasses SMEP, SMAP and KPTI. Connection: Upgrade variant, where the HTTP2-Settings of the Connection header is omitted. Because this is not an expected issue by the proxies, this could be used to smuggle a protocol upgrade request to the backend. HTTP/1.1 Upgrade header can also be used for cleartext communication, even when TLS has already been established. The author had to create a custom client in order to test this. /flag route would return a 403 error. snprintf to occur in a stack buffer. Hash#clear function. This, combined with the error reporting led to the sharing of data across requests. kgsl driver because it is directly accessible from userland. Very few drivers can be reached directly from the apps itself, which is what made this a juicy target. The vulnerability itself lies in the IOCTL_KGSL_GPUOBJ_IMPORT and IOCTL_KGSL_MAP_USER_MEM iotcl, which these calls are used by apps to create shared memory between itself and the kgsl driver. sg_table object, any call to DMA_BUF_IOCTL_SYNC will trigger a UAF. This object is quite diverse in its usage, depending on the function called and the values of the table. The functionality of this iotcl is to synchronize the CPU view of the DMA buffer used by the GPU.
scatterlist field in the sg_table. Using a CodeQL query got them some candidate objects but not anything that would work. To find a proper object to fill this gap, another technique had to be used. scatterlist. This was done via some trickery on threads but freed values that should not be freed; these are not bugs in the code but the first UAF made this an issue. file_operation to run arbitrary functions of our choice. With the kernel though, code execution does not mean game over; these is still another step to take. __bpf_prog_run32 Berkley Packet Filter bytecode can be used for an arbitrary read/write/execute primitive in the kernel. There was some mitigations in place that make privilege escalation harder but they are bypassable (just not done in this post). co_code. Additionally, the Python disassembler had been removed. Finally, all of the opcodes had been completely remapped!base element is used. This is because base will change the default location to send requests to.