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!
NtQuerySystemInformation because it's the most audited syscall. They just kept coming back to it... There's a funny paradox: places where everyone assumes someone else has carefully looked have less scrutiny because of that assumption. They had pulled out bugs from these places before, so they opened up IDA to look for bugs.SystemProcessInformationExtension. When length is 0 on ProbeForWrite(), it's a NOP, where the body is gated on an if statement of the length. This means that any pointer passed in, including kernel pointers, passes through the write loop without validation. The function stores the buffer pointer into pExtensionOut and increments the value at the address. This creates a direct arbitrary kernel address increment primitive. Classes 5 and 252 have proper bounds checks before writes. _TOKEN structure contains privilege bitmasks. Notably, SeDebugPrivilege is bit 20 of this bitmask. By using the original write primitive, we can set the process flag to contain the debug capabilities. This allows for reading and writing to memory arbitrarily for any process; they chose to write into winlogon.exe because it's always on and has SYSTEM privileges.