read | find our buffer
It is in the stack
need to find the virtual argument to printf
brute force it!
possibly need to add [1-3] padding bytes to align on 4 bytes
Slide 8
Slide 8 text
read | our target
Slide 9
Slide 9 text
read | find our buffer
for offset in `seq 0 20`; do echo "offset=$offset"; ./strfmt "AAAA%$offset\$x";
echo; done | grep 4141 -B1
Slide 10
Slide 10 text
write | specific address
Put it in our buffer
Use %n to write intead of %x to read
Check the system endianness
write | specific address
What to overwrite?
interesting variable
GOT
.dtor
.fini_array
checksec to validate writable zones
Slide 14
Slide 14 text
write | specific address
Slide 15
Slide 15 text
write | specific address
How to write
Endianness again ;)
Not possible to write 0xffffdee8 (shellcode address in environment) in one pass
Split in two
0xdee8
0xffff - 0xdee8
Use %hn to write only a word and not rewrite first part