基于PHP的在线跨站脚本检测工具.pdf
2015年 l0月 15日 现代电子技术 0ct.2015
第38卷第2O期 ModernElectronicsTechnique V01.38No.20
基于PHP的在线跨站脚本检测工具
王 佩 ,牛 晨,丁立彤
(西安邮电大学 ,陕西 西安 710121)
摘 要 :跨站脚本是一类基于网站应用程序的安全漏洞攻击 ,将研究和解决快速化的 自动化检测 。为 了有效地防止跨
站脚本被滥用,决定创建一种基于web的跨站脚本检测方式,以发现Web站点中潜在的跨站风险。完成主要的6大模块有:
登陆模块、检测模块、扫描模块、输 出模块、报表模块、日志模块。核心代码模块是检测和扫描部分,他们相互配合构造跨站
参数并抓取反馈信息,其他模块配合核心代码起到辅助作用。选择PHP进行构造是一大亮点,PHP是一种Web程序语言,能
够快速地解析前端DOM内容,在脚本语言中速度仅次于Python。用Web方式构造和检测本就属于Web攻击的跨站脚本 ,将
更加快捷 、高效 。
关键词 :跨站脚本 ;Web;PHP;安全检测 ;扫描
中图分类号:TP911-34 文献标识码 :A 文章编号:1004—373X(2015)20—0041—03
OnlineXSStestingtoolbasedonPHP
WANG Pet,NIU Chen,DING Litong
(Xi’anUniversityofPosts&Telecommunicati0ns,Xi’an710121,China)
Abstract:TheXSS (crosssitescripting)isakindofattackagainstthesecurityholebasedonnetworkapplicationpro—
gram.Itsfastauto—testisstudied inthispaper.In ordertopreventtheabuseofXSS effectively,a W eb—based XSS testing
methodisdesignedtodetectthepotentialcross—siterisksinWebsites.Sixmainmodules(1oginmodule,detectionmodule,
scanningmodule,outputmodule,reportmoduleandlogmodule)werefulfilled,inwhichthekernelcodemodulesaredetection
andscanningones,whichcooperateeachothertoconstructcross-siteparametersandgrabthefeedbackdata.PHP isaW ebpro—
gram language,which canresolvethefront—end DOM contentsquickly,anditsrateissecondonlytoPython inscriptinglan—
guage.TouseW ebmethodtostructureanddetectXSSbelongingtotheW ebattack ismoreconvenientandefficient.
Keywords:crosssitescripting;W eb;PHP;securitydetection;scan
在跨站脚本越来越隐蔽的今天 ,应对该漏洞威胁就
1 跨站脚本攻击及防范方法
成了一项艰巨的任务 。。在早期对跨站脚本的研究只
停留在简单的暴力式攻击 ,而对绕过等新兴的攻击 1.