

安全攻防-03 SQL的漏洞原理 检测与防御
source link: http://www.mrliangqi.com/1753.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

安全攻防-03 SQL的漏洞原理 检测与防御
什么是SQL注入?SQL注入的产生原因,开发时未对用户的输入数据进行过滤将数据当代码解析,最终导致的注入漏洞.
<!–more–>
一.SQL注入的分类:
1)整数型注入,数字型注入
SELECT * FROM table WHERE id=1
2)字符串注入
SELECT * FROM table WHERE name=’user’
3)搜索型注入
本质上也属于字符注入
区分数字型和字符型的注入的时候,看是否存在引号.
二.SQL利用工具SQLMAP
1.)SQLMAP具有检测,利用,防御,绕过,扩展,getshell等功能
Automatic SQL injection and database takeover tool
官方网站: https://github.com/sqlmapproject/sqlmap
SQLMAP安装:
#git clone –depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
#python sqlmap.py -h
2.)主要的参数如下:
BEUSTQ:
B 布尔型盲注
E 报错型注入
U 联合查询注入
S 多语句堆叠注入
T 基于诗句延迟盲注
Q 内嵌/嵌套查询注入
B: 判断真假请求内容来判断是否存在SQL注入
E: 设法构造错误的SQL语句使其执行错误
U: 是用union语句来查询
S: 使用分号间隔多个查询语句来执行
T: 通过时间延迟来判断是否存在SQL注入的常用方法,无错误回显的情况下盲注
Q: 嵌入在另一个查询中的查询
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK