Now there is a SQL like this:
SELECT * FROM member WHERE username = params LIMIT 1
params is a variable entered by the user, supposeI know all the database table fields and can only execute one SQL statement (executed by the ORM of the project), how to fill in the value of params will become a SQL that is harmful to the database/data table/table data
当前位置:网站首页>What can be done to make this SQL into a dangerous SQL?
What can be done to make this SQL into a dangerous SQL?
2022-08-01 23:20:00 【segmentfault】
Other Answer 1:
SELECT * FROM member WHERE username = "params" LIMIT 1params = '" or (delete * from member) or username="';
The flattening becomesSELECT * FROM member WHERE username = "" or (delete * from member) or username="" LIMIT 1
But this is a theoretical situation. In fact, most frameworks have some built-in processing, which is not so easy to inject. For example, double quotes in variables are automatically escaped, so that it becomes SELECT * FROM member WHERE username= "\" or (delete * from member) or username=\"" LIMIT 1, then it's harmless.
In simple terms, don't spell SQL yourself, but use the methods provided by the object to deal with it.Isn't php generally $query->from('member')->where('username', params)->fetch().
Other Answers 2:
SQL injection, use precompile to solve
边栏推荐
- ROS2初级知识(8):Launching启动多节点
- PHP算法之电话号码的字母组合
- CAKE:一个用于多视图知识图谱补全的可扩展性常识感知框架
- 简单3D渲染器的制作
- perspectiveTransform warpPerspective getPerspectiveTransform findHomography
- JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method
- 部门项目源码分享
- Additional Features for Scripting
- excel remove all carriage return from a cell
- 计算两点之间的距离
猜你喜欢

From 0 to 1: Design and R&D Notes of Graphic Voting Mini Program

6134. Find the closest node to the given two nodes - force double hundred code

【数据分析03】

研发团队数字化转型实践

【C语言进阶】文件操作(二)

xss相关知识点以及从 XSS Payload 学习浏览器解码

E - Integer Sequence Fair

Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D Solution

还在纠结报表工具的选型么?来看看这个

Is TCP reliable?Why?
随机推荐
Nacos配置中心之加载配置
ping no reply
From 0 to 100: Notes on the Development of Enrollment Registration Mini Programs
添加大量元素时使用 DocumentFragments
chrome复制一张图片的base64数据
计算由两点定义的线的角度
When using DocumentFragments add a large number of elements
TCP 可靠吗?为什么?
软技能之UML图
Calculate the angle of a line defined by two points
检查点是否在矩形内
避免使用 <b>、<i>、<s> 和 <u> 标签
IDEA入门看这一篇就够了
【数据分析03】
华为无线设备配置全局双链路冷备份(AC全局配置方式)
数据增强--学习笔记(图像类,cnn)
PHP算法之有效的括号
深度学习基础-基于Numpy的循环神经网络(RNN)实现和反向传播训练
Avoid , ,
, and tags请问什么是 CICD