http flood and mobile app
DESCRIPTION
TRANSCRIPT
![Page 1: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/1.jpg)
CC 攻击与移动 APP 业务云舒 2013 年 3 月
![Page 2: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/2.jpg)
前面的话
• 这不是我最想讲的题目• 这个题目老板也有些担心
![Page 3: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/3.jpg)
目录• 识别攻击• 普通攻击处理• 高级功能• 效率问题• 新业务的挑战• 动态 Cookie• 战争并未结束
![Page 4: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/4.jpg)
识别攻击——基础
• 基于客户端 IP+ 服务端 IP 的频率统计• 基于客户端 Cookie+ 服务端 IP 统计访问频
率
![Page 5: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/5.jpg)
识别攻击——辅助
• Cookie 分散度• URL 分散度• 细粒度频率统计– Host 维度– URL 维度
• 代理 IP 判定
![Page 6: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/6.jpg)
识别攻击——高级
• 跳转识别– 服务端 302 跳转– 客户端 Meta Refresh 跳转
• JS 执行验证– 简单代码– 用户行为提取
• 验证码
![Page 7: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/7.jpg)
攻击行为处理
• 静态页面• 关闭 socket• 延迟处理• 客户端连接挂起
![Page 8: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/8.jpg)
高级功能——虚拟补丁
• 不是 WAF– 简单规则集– 拦截单包型 DOS 攻击请求– 拦截特征明显的请求
![Page 9: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/9.jpg)
高级功能—— QPS 限流
• 最后的防线– 攻击行为达到完美程度– 放弃部分访问,保障重点地区用户
![Page 10: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/10.jpg)
效率问题
• C/S 架构,异步调用– Web server 端不计算– 分析端定期推送
• 内存 cache– Hashtab 查找匹配
![Page 11: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/11.jpg)
效率问题——架构图
WEB Server
SEC Module
SEC Client
SHM
CMD Interface
Client1 Client 2 Client N
CMD Interface
WEB Interface
SEC Server
register
http event
http event
configuration
configuration
![Page 12: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/12.jpg)
效率问题——效果
• Web Server 消耗约 50MB 内存• 8 万黑名单, QPS 下降小于 3%
![Page 13: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/13.jpg)
新业务带来的变化
当用户从 PC 向移动 APP 迁移时会发生什么?
![Page 14: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/14.jpg)
新业务带来的变化
正常用户来源分散,攻击者比较集中
正常用户与攻击者一样,来源比较集中
![Page 15: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/15.jpg)
新业务带来的变化
正常用户使用浏览器,攻击者使用其它程序
正常用户与攻击者一样,都使用非浏览器的其它程序
![Page 16: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/16.jpg)
变化带来哪些问题?
• 基于 IP 的访问频率统计不准确• 高级识别策略造成大范围误杀– 正常的 WEB API 接口( json 、 xml )– 正常的移动 APP 程序
![Page 17: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/17.jpg)
简单方案
• 无线 IP 库– 扩大阈值甚至豁免
• 自证清白– 你说你是浏览器, show me– 基于 user-agent 来做跳转和执行验证
![Page 18: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/18.jpg)
动态 cookie 方案——简介
• 什么是动态 cookie– 突然插入– 生存期短,不停变动
![Page 19: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/19.jpg)
动态 cookie 方案——实现
• 基于阈值触发– 人工设置很小的阈值– 基于历史学习的阈值
• 连续多次种植– 包含序列号、 IP 、时间戳,加密–种植次数与访问速率成正比
• 检验携带正确 cookie 的比率
![Page 20: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/20.jpg)
动态 cookie 方案——数据支持
• 70%左右的 APP默认支持 cookie– IOS 约 23%占有率, ASIHttpRequest默认支持– Android 约 59%占有率, httpclient默认支持• 从某市场统计,约 80%安卓 APP 使用 httpclient 库
![Page 21: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/21.jpg)
战争并未结束
这个方案是很容易绕过的
![Page 22: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/22.jpg)
战争并未结束
即使绕过,也可“缓解”攻击
![Page 23: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/23.jpg)
战争并未结束
真正的防御,不应该害怕公开抛砖引玉,期待各位有更好的方案
![Page 24: http flood and mobile app](https://reader035.vdocuments.pub/reader035/viewer/2022062511/54beffaf4a7959e4088b45ca/html5/thumbnails/24.jpg)
尾声
云舒 阿里巴巴集团安全部高级专家http://t.qq.com/yunshuhttp://weibo.com/pstyunshu