RatProxy - 구글에서 사용하는 보안 검사툴
Programming/Web 2008/07/18 14:39간단한 소개및 사용방법등등...
- 동작환경
- Linux
- FreeBSD
- MacOS X
- Windows (Cygwin)
- 인스톨 방법
윈도우 기준으로 설명
아래링크에서 파일 다운로드하거나
Windows (Cygwin) 에서
wget http://ratproxy.googlecode.com/files/ratproxy-1.51.tar.gz
로 다운로드
$ wget http://ratproxy.googlecode.com/files/ratproxy-1.51.tar.gz
--14:00:24-- http://ratproxy.googlecode.com/files/ratproxy-1.51.tar.gz
=> `ratproxy-1.51.tar.gz'
Resolving ratproxy.googlecode.com... 64.233.187.82
Connecting to ratproxy.googlecode.com|64.233.187.82|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 168,409 (164K) [application/x-gzip]
100%[=======================================================================>] 168,409 135.60K/s
14:00:26 (135.22 KB/s) - `ratproxy-1.51.tar.gz' saved [168409/168409]
$ tar -xvf ratproxy-1.51.tar.gz로 압축풀기
$ cd ratproxymake를 하면 위와 같은 에러 발생.
$ make
cc ratproxy.c -o ratproxy -Wall -O3 -Wno-pointer-sign -D_GNU_SOURCE http.c mime.c ssl.c -lcrypto -lssl
cc1: error: unrecognized command line option "-Wno-pointer-sign"
cc1: error: unrecognized command line option "-Wno-pointer-sign"
cc1: error: unrecognized command line option "-Wno-pointer-sign"
cc1: error: unrecognized command line option "-Wno-pointer-sign"
make: *** [ratproxy] Error 1
에러 발생 옵션을 사용하지 않게 메이크파일 수정
Makefile 파일의 23 줄의
CFLAGS = -Wall -O3 -Wno-pointer-sign -D_GNU_SOURCE
를
CFLAGS = -Wall -O3 -D_GNU_SOURCE
로 수정
다시 make 하면
$ make경고가 발생.
cc ratproxy.c -o ratproxy -Wall -O3 -D_GNU_SOURCE http.c mime.c ssl.c -lcrypto -lssl
*** WARNING: flare-dist/flare bianry is not operational.
*** Please see flare-dist/README and update it for your OS.
flare-dist 디렉토리의 README 파일 확인
http://www.nowrap.de/download/flare06doswin.zip 에서 파일 다운로드후
flare-dist 디렉토리에 풀기
풀면 flare.exe 파일로 풀린다. 기존 flare 파일을 삭제후 이 파일의 이름을 flare 로 바꿀것.
다시 make 하면 에러없이 완료되며 ratproxy.exe 가 생성된다.
- RatProxy 기동방법
기본 옵션은
$ ./ratproxy.exe --help
ratproxy version 1.51-beta by <lcamtuf@google.com>
ratproxy: unknown option -- -
Usage: ./ratproxy [ -w logfile ] [ -v logdir ] [ -p port ] [ -d domain ] [ -P host:port ] [ -xtifkgmjscael2XCr ]
-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
Example settings suitable for most tests:
1) Low verbosity : -v <outdir> -w <outfile> -d <domain> -lfscm
2) High verbosity : -v <outdir> -w <outfile> -d <domain> -lextifscgjm
3) Active testing : -v <outdir> -w <outfile> -d <domain> -XClfscm
Multiple -d options are allowed. Consult the documentation for more.
로 확인가능.
$ ./ratproxy.exe -w test.log
ratproxy version 1.51-beta by <lcamtuf@google.com>
[!] WARNING: Running with no 'friendly' domains specified. Many cross-domain
checks will not work. Please consult the documentation for advice.
[*] Proxy configured successfully. Have fun, and please do not be evil.
[+] Accepting connections on port 8080/tcp (local only)...
로 기동
- RatProxy 사용하여 웹어플리케이션 다루기
Web브라우저의 프락시설정에서 ratproxy 를 경유하도록 설정
ratproxy는 기본 포트를 지정하지 않으면 8080 포트를 사용한다.
작업이 끝나면 ratproxy 종료
- 로그 결과를 출력
$ ./ratproxy-report.sh test.log >test.html
test.html 파일을 브라우저로 열어서 리포트 결과 확인.
링크 : http://code.google.com/p/ratproxy/
'Programming > Web' 카테고리의 다른 글
| RatProxy - 구글에서 사용하는 보안 검사툴 (0) | 2008/07/18 |
|---|---|
| 티스토리에서 네이버크롤러가 정보수집 못하게 하는방법 (1) | 2008/07/14 |