Ekoparty2022 Windows Challenge
- Find handshake, packet type byte, packet size from reversing
- Find that packet size > 0x0f00 can be used to cause a stack overflow when the buffer gets copied onto the stack
- Find that overflow can turn packet type from T to X which leads to a basic block that jumps exactly behind our payload
- Find that "random" initialization of heap memory is not so random and we can use the iret to transition to 32-bit (we cant use 0x2b and 0x33 since these are bad bytes)
- Use jmp 0x33:0x100000xx to get back to 64-bit (https://stackoverflow.com/questions/39310831/implement-x86-to-x64-assembly-code-switch)
- Restore stack pointer from rcx
- MSF Shellcode
Tested on Win11 21H2