Analysis of the bug =================== There is a stack-based buffer overflow in child(): `MAX_CMD` bytes are read into a `MAX_ARG`-sized array. Attack plan =========== The idea is to redirect execution to a one\_gadget. No gadget meets its preconditions, but at least one of them can be fixed with a small ROP chain. Attack implementation ===================== Using, e.g., cyclic, we can find the offset betwen the buffer and the saved rip: it is 32 bytes. The server leaks the address of `printf` and its offset in the libc can be obtained with nm -D libc.so.6 | grep '\