People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
ANYNOEOF
is defined as [\001-\377]
. When adding a null byte and a question mark - ?\0
- it will see this as a SPECIAL
and note a literal now. Naturally, this error occurs because it's trying to bind two things in the query. However, adding a comment - code>?#\0
- can easily remediate this problem. So, are we done? Nope! Still some more trickery for this to work.'x'#\0
, where the x is a controllable parameter and the parameterization adds the single quotes around the query because it thinks it's a string. There's another issue now: a null byte cannot be in a comment. The problem can be solved by adding a semicolon between the comment and nullbyte to make it a new line. With the stolen parameter x`;#
and the same column name, this problem is solved.'x
does not exist, though. What now? PDO still thinks that our injection point is in a string! Placing a \
as the first character in the string causes some MAJOR havoc. It will escape the single quote to allow for a context escape. The column name \?#\0
and the stolen parameter with x` FROM...
allows us to create a legitimate query to perform SQL injection. Neat!