当前位置:网站首页>SQL注入原理即sqli-labs搭建,sql注入简单实战
SQL注入原理即sqli-labs搭建,sql注入简单实战
2022-06-12 06:18:00 【Cwillchris】
一、SQL注入概述
1、SQL注入原理
用户登录的基本 SQL 语句:
select * from users where username = '用户输入的用户名' and password='用户输入的密码'
用户输入的内容是可控的,例如我们可以在用户名中输入' or 1=1 --空格
select * from users where username = '' or 1=1 --空格 'and password = '用户输入的密码'
此时我们输入的第一个单引号将 username 的单引号闭合,相当于输入了一个空用户,or 表示左右两边只要有一边条件判断成立则该语句返回结果为真,其中 1=1 永远为真,所以当前 SQL 语句无论怎么执行结果永远为真,--空格表示注释,注释后面所有代码不再执行。
我们可以看到上面我们闭合的方法是没有输入用户名的,所以并不能成功登录
select * from users where username = 'admin' or 1=1 --空格 'and password ='用户输入的
密码'
我们在单引号前面加上用户名表示我们要登录的用户。这样就成功绕过了用户密码认证。
边栏推荐
- Sqlite Cross - compile Dynamic Library
- (UE4 4.27) customize globalshader
- Excel VBA opens a file that begins with the specified character
- Leetcode 第 80 場雙周賽題解
- RMB classification II
- MNIST handwritten data recognition by CNN
- 夜神模拟器adb查看log
- Video fire detection based on Gaussian mixture model and multi-color
- Why do I object so [1.01 to the power of 365 and 0.99 to the power of 365]
- EBook upload
猜你喜欢

MNIST handwritten data recognition by CNN

Dlib face detection

Leetcode-1706. Where does the club fall

Three years of sharpening a sword: insight into the R & D efficiency of ant financial services
![How to increase heap size of JVM [duplicate] - how to increase heap size of JVM [duplicate]](/img/65/a214d137e230b1a1190feb03660f2c.jpg)
How to increase heap size of JVM [duplicate] - how to increase heap size of JVM [duplicate]

(UE4 4.27) customize globalshader

EBook list page

Unity implements smooth interpolation

Logistic regression model

夜神模擬器adb查看log
随机推荐
Leetcode-1604. Warning people who use the same employee card more than or equal to three times within one hour
Leetcode-1552. Magnetic force between two balls
User login (medium)
Findasync and include LINQ statements - findasync and include LINQ statements
Cross compile libev
数据库为什么不使用hash表?
Solution to the problem of the 80th fortnight competition of leetcode
User login 【 I 】
Getting started with houdininengine HDA and UE4
Houdini terrain creation
[reinstall system] 01 system startup USB flash disk production
Guns framework multi data source configuration without modifying the configuration file
Video fire detection based on Gaussian mixture model and multi-color
Bert use
(UE4 4.27) add globalshder to the plug-in
IDEA常用配置
RMB classification II
Video summary with long short term memory
Simple spiral ladder generation for Houdini program modeling
Leetcode-1043. Separate arrays for maximum sum