Skip to main content

##My approach:

My approach:

SELECT password FROM users WHERE name = 'root''root';
SELECT password FROM users WHERE name = 0x726f6f740x726f6f74;
SELECT password FROM users WHERE name = UNHEX('726f6f74');

The ** 0x**0x prefix can only be used for data columns such as char, varchar, text, block, binary, etcchar, varchar, text, block, binary, etc.
Also, its use is a little complicated if you are about to insert an empty string. You'll have to entirely replace it with '', or you'll get an error.

UNHEX()UNHEX() works on any column; you do not have to worry about the empty string.

SELECT ... WHERE id = -1 union all select table_name from information_schema.tables

SELECT ... WHERE id = -1 UNION ALL SELECT table_name FROM information_schema.tables;

SELECT ... WHERE id = -1 union all select column_name from information_schema.column where table_name = 0x61727469636c65

SELECT ... WHERE id = -1 UNION ALL SELECT column_name FROM information_schema.column WHERE table_name = __0x61727469636c65__;

But if the coder of an injectable site would hex it, no injection would be possible because the query would look like this: SELECT ... WHERE id = UNHEX('2d312075...3635')

SELECT ... WHERE id = UNHEX('2d312075...3635');

##My approach:

SELECT password FROM users WHERE name = 'root'
SELECT password FROM users WHERE name = 0x726f6f74
SELECT password FROM users WHERE name = UNHEX('726f6f74')

The ** 0x** prefix can only be used for data columns such as char, varchar, text, block, binary, etc.
Also, its use is a little complicated if you are about to insert an empty string. You'll have to entirely replace it with '', or you'll get an error.

UNHEX() works on any column; you do not have to worry about the empty string.

SELECT ... WHERE id = -1 union all select table_name from information_schema.tables

SELECT ... WHERE id = -1 union all select column_name from information_schema.column where table_name = 0x61727469636c65

But if the coder of an injectable site would hex it, no injection would be possible because the query would look like this: SELECT ... WHERE id = UNHEX('2d312075...3635')

My approach:

SELECT password FROM users WHERE name = 'root';
SELECT password FROM users WHERE name = 0x726f6f74;
SELECT password FROM users WHERE name = UNHEX('726f6f74');

The 0x prefix can only be used for data columns such as char, varchar, text, block, binary, etc.
Also, its use is a little complicated if you are about to insert an empty string. You'll have to entirely replace it with '', or you'll get an error.

UNHEX() works on any column; you do not have to worry about the empty string.

SELECT ... WHERE id = -1 UNION ALL SELECT table_name FROM information_schema.tables;
SELECT ... WHERE id = -1 UNION ALL SELECT column_name FROM information_schema.column WHERE table_name = __0x61727469636c65__;

But if the coder of an injectable site would hex it, no injection would be possible because the query would look like this:

SELECT ... WHERE id = UNHEX('2d312075...3635');
Grammar improvement(s)
Source Link
Nae
  • 15.1k
  • 7
  • 58
  • 82

0x The ** 0x** prefix can only be used onfor data columns such as char, varchar, text, block, binary, etc.
Also, its use is a little complicated if you are about to insert an empty string. You'll have to entirely replace it with '', or you'll get an error.

0x prefix can only be used on data columns such as char, varchar, text, block, binary, etc.
Also, its use is a little complicated if you are about to insert an empty string. You'll have to entirely replace it with '', or you'll get an error.

The ** 0x** prefix can only be used for data columns such as char, varchar, text, block, binary, etc.
Also, its use is a little complicated if you are about to insert an empty string. You'll have to entirely replace it with '', or you'll get an error.

Fixed reversed word order.
Source Link
Palec
  • 13.4k
  • 8
  • 74
  • 141

And then just select whatever data ones want. it Isn't it cool?

And then just select whatever data ones want. it Isn't cool?

And then just select whatever data ones want. Isn't it cool?

improved syntax
Source Link
Farzad Karimi
  • 770
  • 1
  • 13
  • 33
Loading
Post Made Community Wiki by animuson
Copy edited. (its = possessive, it's = "it is" or "it has". See for example <http://www.wikihow.com/Use-its-and-it's>.)
Source Link
Peter Mortensen
  • 31.3k
  • 22
  • 109
  • 132
Loading
added 875 characters in body
Source Link
user823738
  • 17.3k
  • 8
  • 53
  • 78
Loading
deleted 63 characters in body
Source Link
user823738
  • 17.3k
  • 8
  • 53
  • 78
Loading
Source Link
user823738
  • 17.3k
  • 8
  • 53
  • 78
Loading