Tags: pwn 

Rating:

Vulnerability: negative index for array => allow arbitrary write to any addresses lower than the array.

Libc provided, PIE on => add offset of magic gadget to GOT of printf

Full exploit: https://gist.github.com/ManhNDd/1623d2a5d730358cc9ea62cfaf685351

Original writeup (https://gist.github.com/ManhNDd/1623d2a5d730358cc9ea62cfaf685351).