nikto/burpsuiteを触ってみよう
@ionis_h
niktoとは?
● 脆弱性診断スキャナ
● http://www.cirt.net/nikto2
● perlで動く
実行結果の画面
環境構築
環境構築
● VirtualBoxをホストであるMacに立てる
● ゲストOSとしてKaliLinuxとBadstoreを利用する
KaliLinux?
● BackTrackの後継
● ペネトレーションテストで有名な
ディストリビューション
● Ubuntuベース
● Debianベース
● このディストリビューションが出て来たのは、
Ubuntuがスマートフォンやタブレット方向へ
走っていっている事と関係しているという噂
Badstore?
● 勉強用に脆弱性が組み込まれたWebアプリ
● 昔のやつ
● アプリを立ち上げると2004-2006とか書いてある
● ちょっとした動作確認には簡単で楽
今回の環境はこんな感じで
Mac
BadStore KaliLinux
192.168.56.100
192.168.56.2 192.168.56.3
DHCP
192.168.56.1
調査
VirtualBoxの設定
● 環境設定からネットワークを選択
● ネットワークを作成or編集
VirtualBoxの設定:アダプター
● アダプターは192.168.56.100
● ホストのアドレスになる
VirtualBoxの設定:DHCPサーバー
● サーバーアドレス192.168.56.1
● その他よしなに
VirtualBoxの設定
● 後はインストールするゲストOSで
ホストオンリーを選択ればOK
● 今回はゲストから外部に接続しないため
● ゲストから外部にも接続したい場合、
ネットワークアダプターを追加し、
NATを利用すると良い
ゲストOSのインストール
● 大体目標をセンターに入れて
クリックしとけばOK
● 最近のディストリビューションはぼんやりしてても
インストール出来る
http://evasouko.tripod.com/eva3/eva
3.html
BadStore起動画面
● インストール後、
ブラウザから
アクセス
したところ
準備ができました。
niktoを実行
● nikto -host http://192.168.56.2 - o output.txt
● -host スキャン対象
● -o レポート出力先
root@kali:
- Nikto v2.1.4 :
--------------------------------------------------------------------------- :
+ Target IP: 192.168.56.2 :
+ Target Hostname: 192.168.56.2 :
+ Target Port: 80 :
+ Start Time: 2013-05-25 23:06:27 :
--------------------------------------------------------------------------- :
+ Server: Apache/1.3.28 (Unix) mod_ssl/2.8.15 OpenSSL/0.9.7c :
$ :
:
:
+ No CGI Directories found (use '-C all' to force check all possible dirs) :
+ robots.txt contains 6 entries which should be manually viewed. :
+ ETag header found on server, inode: 333, size: 3583, mtime: 0x44679e27 :
+ OSVDB-27487: Apache is vulnerable to XSS via the Expect header :
+ OpenSSL/0.9.7c appears to be outdated (current is at least 1.0.0d). OpenSSL 0.9.8r is also current. :
+ mod_ssl/2.8.15 appears to be outdated (current is at least 2.8.31) (may depend on server version) :
+ Apache/1.3.28 appears to be outdated (current is at least Apache/2.2.17). Apache 1.3.42 (final release) and 2.0.64 are
also current. :
+ Allowed HTTP Methods: GET, HEAD, OPTIONS, TRACE :
+ OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST :
+ OSVDB-2733: Apache/1.3.28 - Apache 1.3 below 1.3.29 are vulnerable to overflows in mod_rewrite and mod_cgi. CAN-
2003-0542. :
+ OSVDB-59658: /?mod=some_thing&op=browse: Sage 1.0b3 reveals system paths with invalid module names. :
+ OSVDB-2799: dose.pl?daily&somefile.txt&|ls|: DailyDose 1.1 is vulnerable to a directory traversal attack in the 'list'
parameter. :
+ OSVDB-3268: /backup/: Directory indexing found. :
+ OSVDB-3092: /backup/: This might be interesting... :
+ OSVDB-3092: : This might be interesting... possibly a system shell found. :
+ OSVDB-3092: /cgi-bin/test.cgi: This might be interesting... :
+ OSVDB-3268: /icons/: Directory indexing found. :
+ OSVDB-3268: /images/: Directory indexing found. :
+ OSVDB-3268: /images/?pattern=/etc/*&sort=name: Directory indexing found. :
+ 6448 items checked: 29 error(s) and 18 item(s) reported on remote host :
+ End Time: 2013-05-25 23:16:25 (598 seconds) :
--------------------------------------------------------------------------- :
+ 1 host(s) tested :
まず覚えておくと良い表示
● OSVDB
● Open Sourced Vulnerability Database
● http://www.osvdb.org
● * appears to be outdated (current is …
● 最新版じゃないからアップデートしろ!
いくつかピックアップ
● + OSVDB-27487: Apache is vulnerable to XSS
via the Expect header :
● http://www.osvdb.org/27487
● 予期せぬヘッダーによるXSSの脆弱性がある
● apache1.3や2.2以前のバージョンのapacheではエラー
メッセージのサニタイズをしていないため
いくつかピックアップ
● + OSVDB-877: HTTP TRACE method is active,
suggesting the host is vulnerable to XST :
● http://www.osvdb.org/877
● CrossSiteTracing
● http://www.atmarkit.co.jp/ait/articles/0308/21/news001.ht
ml
● Cross Site Scriptingの一種
● TRACEメソッドを利用する事で、Basic認証のIDとPASS
が盗まれる
● TRACEメソッドを使うアプリはあまりないので、オフに
しておけば、脅威はなくなるが、根本的には、XSSを治
すべき
Badstoreは作成から年月が経っており、
使用ソフトのバージョンによる脆弱性も抱え込ん
でいます。
ですが、どちらかというと、
「webアプリでこういうのを ると作 危ないよ〜」
というのを試すのがメインだと思っています。
なので、リクエストを弄って遊ぶのがメインで
しょう。
burpsuite
burpsuiteとは?
● 有料の脆弱性スキャナ
● Freeエディションがある
● 脆弱性スキャナは使えない
● リクエストをいじる事が出来る
● 繰返しアタックをかけたり、ファジングに使ったり
出来る
● JREで動く
今回はこう使う
burpsuite BadStorebrowser
イメージとしてはProxy
ブラウザから た のリクエストを い出 後 拾
ざん を ってから改 等 行
Webサーバーへ り す送 出
burpsuite設定
● Proxy → options 127.0.0.1:8080が
running
である事を
確認する。
burpsuite設定
● リクエストを投げるブラウザのproxy設定を
burpsuiteに
向ける
(localhostの
8080ポート)
実際にリクエストをする
● あとは、リクエストをキャプチャして自由に変
更する
● キャプチャ後
リクエストを
投げるには
forward
破棄するには
drop
あとは皆様で
enjoy yourself !!
今回コレを話した理由は?
● 近いうちに実際にこの手のハンズオンがしてみ
たかったから!
● ハンズオン(Hands-on 直訳は「手を置く(手を触
れる)」)とは、体験学習を意味する教育用語。参
加体験、実用的体験、インタラクティブ体験、実
習、実験、体感など、体を使うことによる学習補助
教育手法を指す。またトレーニングなどにおいては
専門家から直接手取り足取り指導を受けることも意
味する。
● http://ja.wikipedia.org/wiki/%E3%83%8F
%E3%83%B3%E3%82%BA%E3%82%AA%E3%83%B3
一緒にやってみたい人いますか?
?(・ω・)/
http://blogs.yahoo.co.jp/taigablog99/GALLERY/show_image.html?id=6012475&no=0
ぁ。では、別の何かを考えま
す。
http://pics.livedoor.com/u/max555_55/5785081
ご清聴ありがとうございます。

Niktoとかburpsuite触ってみよう