sql - MariaDB 给我一个错误,在 ctf 中显示 'WHERE '1'='1''
问题描述
我正在浏览初学者hackerone ctfs,并试图破解Micro-CMS v2。有一个容易受到 SQL 注入攻击的登录页面。查询是这样的:
'SELECT password FROM admins WHERE username=\'%s\'' % request.form['username'].replace('%', '%%')
在我输入的用户名字段中,' UNION SELECT '123' AS password WHERE '1'='1
但随后返回此错误
ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE '1'='1'' at line 1")
我尝试用 --' 或使用 gWHERE 1=1'
来评论它,但没有任何东西可以工作
解决方案
推荐阅读
- asp.net - AKS 中的 Web.API,许可证
- java - Spring JmsTemplate 目的地特定的消息持久性
- javascript - 为什么文件输入更改不能重复工作?
- javascript - 基于删除线(和背景颜色)的 Google 表格计数单元格
- python - 为什么我的多处理代码停止处理大型数据集?
- python - 使用 Numpy 计算带有 EEG 波段的 FFT 的错误值
- python - 统计包中的平均函数不精确
- python - 通过搁置模块引发 KeyError 将所有 python 变量保存在文件中
- c# - C# - 有没有办法反序列化在 C++ Boost ASIO 中序列化的结构?
- arrays - 使用 JModelica 将数组设置为 fmu 参数时出现问题 - “FMUException:valueref 的长度和值不一致。”