**tl;dr:** leak `index.php` through `index.php~` backup file, find sql injection, ???, profit.
The actual exploit is just a SQL injection with some forbidden characters. But the key is to use `;\0` to terminate the query even if it is followed by additional data.
The original writeup investigates why the semicolon is required here, as the standard explanation that mysql ignores everything following a `\0` byte would not explain that.