基于客户端注入的跨站脚本漏洞检测技术研究与实现
- 格式:pdf
- 大小:655.78 KB
- 文档页数:16
分类号 密级 UDC 编号
中国科学院研究生院 硕士学位论文 基于客户端注入的跨站脚本漏洞检测技术 研究与实现
林曼
指导教师 刘美兰 研究员 61539部队 马恒太 副研究员 中国科学院软件研究所 申请学位级别 工程硕士 学科专业名称 计算机技术 论文提交日期 2012.03.26 论文答辩日期 2012.04.26 培养单位 中国科学院研究生院计算与通信工程学院 学位授予单位 中国科学院研究生院 答辩委员会主席 中国科学院研究生院直属院系 研究生学位论文原创性声明
本人郑重声明:所呈交的学位论文是本人在导师的指导下独立进行研究工作所取得的成果。尽我所知,除文中已经注明引用的内容外,本论文不包含任何其他个人或集体已经发表或撰写过的研究成果。对论文所涉及的研究工作做出贡献的其他个人和集体,均已在文中以明确方式标明或致谢。
作者签名: 日 期:
中国科学院研究生院直属院系 学位论文授权使用声明
本人完全了解并同意遵守中国科学院有关保存和使用学位论文的规定,即中国科学院有权保留送交学位论文的副本,允许该论文被查阅,可以公布该论文的全部或部分内容,可以采用影印、缩印或其他复制手段保存、汇编本学位论文。 涉密的学位论文在解密后适用本声明。
作者签名: 导师签名: 日 期: 日 期: 摘要 I 摘要 随着互联网技术的发展,Web系统得到极为广泛的应用,其自身的安全也面临越来越多的威胁,如何有效的发现Web系统中的安全漏洞已经成为目前网络安全界关注的焦点。跨站脚本漏洞是危害Web系统的重要威胁之一,尽管已经受到了安全技术人员的关注,但由于其易于发生、难以检测,因此仍大量存在于Web应用程序之中。 本文对基于客户端注入的跨站脚本漏洞检测技术进行研究,完成的主要工作如下: 1、分析了跨站脚本漏洞的产生原因、攻击模式、防护方法等,研究了XSS漏洞的动态检测技术,分析了Web应用程序的过滤机制,总结了跨站脚本的结构和变形方法。 2、构建了可交互的测试脚本库TestScriptLib,该脚本库为漏洞检测工具的一个重要组成部分,采用多种脚本结构和变形手段枚举了大量测试脚本,并实现了用户交互接口。 3、设计并实现了一款基于客户端注入的跨站脚本漏洞检测工具XSS-Scan,该工具以FireFox扩展方式内嵌于浏览器之中,可以跨平台使用,并且可选择生成不同的测试数据,具有方便使用、检测准确等特点。 4、在实验环境与互联网环境中对XSS-Scan进行了安装、运行等方面的测试。 测试结果证实了该工具的设计合理可用,检测成功率较高,可以便捷有效地帮助用户进行跨站脚本漏洞检测,并为进一步的人工分析提供参考依据。
关键词: Web,漏洞,跨站脚本,检测技术 Abstract
II Abstract With the development of Internet technology, Web systems are extremely used in wide range, their own security is also facing a growing number of threats. How to effectively discover security vulnerabilities in the Web system has become the focus of the network security community. Cross-site scripting(XSS) vulnerability is one of the major threat to the Web system, and has been the concern of security professionals. But because of the difficulty to avoid and detect, there are still a lot of XSS vulnerabilities in Web applications. The thesis research the detection technology of XSS vulnerability based on client injection, the main work is as follows: 1. Analyzed the causes, attack mode and protection methods of XSS vulnerabilities, studied the dynamic detection technology of XSS vulnerability, analyzing the filtering mechanism of Web application, summarizing the construction and transformation methods of Cross-site scripting. 2. Built TestScriptLib, an interactive script library for testing. It was the important component of the vulnerability detection tool, and enumerated a large number of test scripts of many different script structures and deformation methods. It realized an user interaction interface. 3. Designed and realized a XSS vulnerability detection tool, XSS-Scan, based on client injection. It can be embedded into FireFox as an extension, cross-platform used, and can choose to build different test data. All of these make it has the features of easy using and accurately detecting. 4. The XSS-Scan are tested in the experimental environment and the Internet environment. The test results proved that, the tool was well designed, the detection success rate is high, it can conveniently and effectively detect XSS vulnerabilities, and provide a reference for further manual analysis.
Key Words: Web,Vulnerability,Cross-Site Scripting,Detection Technology目录 III 目录 摘要 ................................................................................................................................ I Abstract ...................................................................................................................... II 第一章 绪论 ................................................................................................................. 1 1.1 研究背景与意义 .............................................. 1 1.2 本课题的研究进展 ............................................ 3 1.2.1 Web应用程序安全漏洞检测技术 ............................... 3 1.2.2 现有XSS漏洞检测工具介绍 ................................... 8 1.3 本文主要研究内容 ............................................ 9 第二章 XSS漏洞检测技术研究 ................................................................................ 10 2.1 XSS漏洞概述 ............................................... 10 2.1.1 XSS漏洞的产生 .............................................. 10 2.1.2 XSS漏洞攻击模式 ............................................ 11 2.1.3 XSS漏洞的类型 .............................................. 13 2.1.4 XSS漏洞防护方法 ............................................ 18 2.2 XSS漏洞动态检测技术 ....................................... 19 2.2.1 表单数据提交 ................................................ 19 2.2.2 漏洞点判断 .................................................. 20 2.3 Web应用程序过滤规避技术 ................................... 21 2.3.1 Web应用程序过滤机制 ....................................... 22 2.3.2 脚本的结构 .................................................. 24 2.3.3 过滤规避方法 ................................................ 25 2.4 本章小结 ................................................... 28 第三章 XSS漏洞检测工具XSS-Scan的设计与实现 .............................................. 29 3.1 设计目标与总体结构 ......................................... 29 3.2 流程设计 ................................................... 30 3.3 开发语言与环境 ............................................. 32 3.4 测试脚本库的实现 ........................................... 33 3.4.1 结构与表示 .................................................. 33 3.4.2 XML文档结构 ................................................ 34 3.4.3 测试脚本的构造 ............................................. 36 3.4.4 交互模块的实现 ............................................. 38 3.5 功能模块的实现 ............................................. 41 3.5.1 流程控制模块 ................................................ 42 3.5.2 页面解析模块 ................................................ 43 3.5.3 漏洞测试模块 ................................................ 44 3.5.4 数据访问模块 ................................................ 46