一 简单介绍
cygwin, redhat在windows上的linux模拟器,虽然是玩具,但是一些小玩意儿比虚拟机方便许多
ratproxy,google开源的xss检测工具,除了win版本,什么版本都有。
两个虽然都是名门的产物,但是看起来都有点玩具的感觉,不要骂我。
因为就算我用了免费的很能干的工具,客户也不承认。上次一个小网站的测试,全套,200w日币一次,客户大概看着那一打厚厚的安全报告心里比较安心。但是开发的时候,还是想能尽量避免这些个漏洞,不想等出了安全报告再去对应。
cygwin本来就不能干太复杂的事情。ratproxy在linux上的安装很容易,没什么拐弯的地方。
二 装cygwin
不会的看这个,海明老师作品:CygWin的安装和初步使用
一直很喜欢看这个播吧的东西,我也是才学着用cygwin
配上sshd
然后配上以下几个东东(参考这个网址下面的评论http://blog.miniasp.com/post/2008/07/Google-opens-up-ratproxy-code-to-secure-your-web-environment.aspx)
make gcc binutils openssl-devel
下载 wget http://ratproxy.googlecode.com/files/ratproxy-1.58.tar.gz
tar zxvf ratproxy-1.58.tar.gz
三 编译开始
make
基本上如果正常的话,第一个错误就是
unrecognized command line option "-Wno-pointer-sign"
然后这个时候删掉Makefile 23行的 -Wno-pointer-sign 就好
然后基本上来说 ,第二个错误就是
*** WARNING: flare-dist/flare bianry is not operational.
*** Please see flare-dist/README and update it for your OS.
从以下网址
http://www.nowrap.de/download/flare06doswin.zip
下载windows用的flare包
解压,把其中的flare.exe改名字为flare,替换掉cygwin中ratproxy文件夹中的flare-dist文件夹下面的flare文件
当时我一股脑儿全都拷进来了,也许license文件也是必要的,未验证
继续make
应该成功,生成一个叫ratproxy.exe的文件
除以上两个错误外,其他错误应该是相应的包没有安装的关系。
四 使用ratproxy
最简单的用法 ./ratproxy -w test.log
此时ratproxy代理打开 ,在浏览器里设置代理为自己的8080就好
测完了ctrl-c中断,
./ratproxy-report.sh test.log > test.html
google推荐的用法是
./ratproxy -v <outdir> -w <outfile> -d <domain> -lfscm
./ratproxy -v <outdir> -w <outfile> -d <domain> -lextifscgjm
参数详细说明
http://code.google.com/p/ratproxy/wiki/RatproxyDoc
参数简单说明
http://www.maycode.com/index.php/hotspot/35-linux/865-ratproxy.html
-w logfile - write results to a specified file (default: stdout)
-v logdir - write HTTP traces to a specified directory (default: none)
-p port - listen on a custom TCP port (default: 8080)
-d domain - analyze requests to specified domains only (default: all)
-P host:port - use upstream proxy for all requests (format host:port)
-r - accept remote connections (default: 127.0.0.1 only)
-l - use response length, not checksum, for identity check
-2 - perform two, not one, page identity check
-e - perform pedantic caching headers checks
-x - log all XSS candidates
-t - log all directory traversal candidates
-i - log all PNG files served inline
-f - log all Flash applications for analysis (add -v to decompile)
-s - log all POST requests for analysis
-c - log all cookie setting URLs for analysis
-g - perform XSRF token checks on all GET requests
-j - report on risky Javascript constructions
-m - log all active content referenced across domains
-X - disruptively validate XSRF, XSS protections
-C - try to auto-correct persistent side effects of -X
-k - flag HTTP requests as bad (for HTTPS-only applications)
-a - indiscriminately report all visited URLs