大和セキュリティ勉強会!! episode1 ·...
TRANSCRIPT
大和セキュリティ勉強会 EPISODE 1
田中ザック 2012年12月8日 @tanakazakku
@yamatosecurity
スピーカー 自己紹介
大和セキュリティコミュニティー • 目的 • アメリカンスタイル • 勉強会 – ネットワークフォレンジック – Gentoo Linux – CTF
• セキュリティ調査ツール作成・共有 • 日本人ペンテスター用Linuxディストロ作成 • 研究プロジェクト • メンバー募集
目的
目的 • 日本でハッカー文化を普及 – ホワイトハッカー – 正義ハッカー – 倫理的ハッカー・エサカルハッカー
• Evilハッカーは駄目! • セキュリティ技術を向上 • みんなのため • 自分のため • 何よりも楽しみたい!!
アメリカンスタイル
アメリカンスタイルで貢献 • なぜアメリカンスタイルなの? • アメリカ人だから!(それしかできない・・) • 先生じゃない! • どんどん突っ込んで! • みんな平等でお互いにスキルアップ! • 言論の自由が一番! • 録音して誰でも勉強できるように公開 • 情報を自由にしないと進化しない • 英語で話す?
勉強会
勉強会
• 取りあえず、「ネットワークフォレンジック」 • CTF(疑似ペンテスト) • ワイヤレスハッキング • Gentoo Linux • その他?
セキュリティ調査ツール 作成・共有
セキュリティ調査ツール
• THC (The Hacker’s Choice)のように・・ • 便利なツールを作れたら・・ • 何か作りたいけど、何が良いか分からない? • 日本の環境に合わせたツール
日本人ペンテスター用 Linux Distro
日本人ペンテスター用Linux Distro
• Backtrackの日本版 • 日本語に対応した環境 • Ubuntuではなく、Gentooベース • VMWareゲストに最適 • 速い! • カーネル3.5.7のGeek Sources – Con Kolivas’ high performance patch – Budget Fair Queuing Budget I/O Scheduler – Ingo Molnar's real Yme preempt patches – GRSecurity
研究プロジェクト
研究プロジェクト
• Wardriving • Wireless • Exploit HunYng • ICカード • 等々
メンバー募集!
メンバー募集
• ウェブデザイナー • プログラマー • チュートリアルを書きたい方 • ハッキングで楽しみたい方! • 年齢、性別、経験、知識→関係ねー!
参加者 自己紹介
なぜここに来た? バックグラウンド? 何か期待?
ネットワーク フォレンジック勉強会
EPISODE 1
フォレンジックとは? • “forensics” には「法医学」、「科学捜査」、「鑑識」といった意味があり、分かりやすく意訳すれば 「デジタル鑑識」
• 不正アクセスや機密情報漏洩などコンピュータに関する犯罪や法的紛争が生じた際に、原因究明や捜査に必要な機器やデータ、電子的記録を収集・分析し、その法的な証拠性を明らかにする手段や技術の総称 (e-words.jp)
コンピュータフォレンジックとは?
ネットワークフォレンジックとは?
本当は
ネットワークフォレンジックとは?
• ARPキャッシュ • DHCPログ • DNSログ • Firewallログ • サーバログ(システム、ウェブ) • IDS・IPSログ • ルータログ • ウェブプロクシーログ • Pcapパケットキャプチャ
必要な知識・スキル
• ログの見方 • プロトコル – IPv4, TCP, UDP, HTTP, ICMP, DHCP, ARP, FTP, IPv6, SNMP, 802.11, neelow等
• プロトコルを調べる勇気 – hfp://www.iee.org/rfc.html
• プロトコルをリバースする勇気
ネットワークフォレンジック勉強会
• Pcapだけでパケット解析 • hfp://forensicscontest.com/ • 2009年からDefconでコンテスト • 来年も行くぞ!
今日の勉強の流れ
• Puzzle 1の説明 • Puzzle 1を軽く挑戦・デモ • Puzzle 2の説明 • Puzzle 2を挑戦!デモ • Puzzle 3の説明
PUZZLE 1
Puzzle 1 (2009年9月) – 説明 Anarchy-‐R-‐Us, Inc. suspects that one of their employees, Ann Dercover, is really a secret agent working for their compeYtor. Ann has access to the company’s prize asset, the secret recipe. Security staff are worried that Ann may try to leak the company’s secret recipe. アナーキー・アル・アス株式会社は社員のアン・ダーカバーが実はライバル企業のために働いているとの疑いがあります。アンは会社のもっとも重要な資産の機密レシピにアクセスできます。セキュリティスタフは、アンがその機密レシピを漏えいしてしまうと心配しています。 Security staff have been monitoring Ann’s acYvity for some Yme, but haven’t found anything suspicious– unYl now. Today an unexpected laptop briefly appeared on the company wireless network. Staff hypothesize it may have been someone in the parking lot, because no strangers were seen in the building. Ann’s computer, (192.168.1.158) sent IMs over the wireless network to this computer. The rogue laptop disappeared shortly thereamer. セキュリティスタフはアンの通信を監視していまして、やっと怪しい通信を検知できました。今日、不明のノートPCが会社のワイヤレスネットワークに接続しました。ビルでよその人を見なかったので、駐車場から誰かが接続したと想定しています。アンのパソコン(192.168.1.158)がワイヤレス経由でこのコンピュータにIM(インスタント・メッセージ)を送りました。その後、不明のパソコンの通信が消えました。 リンク:hfp://forensicscontest.com/2009/09/25/puzzle-‐1-‐anns-‐bad-‐aim
Puzzle 1 – 説明 “We have a packet capture of the acYvity,” said security staff, “but we can’t figure out what’s going on. Can you help?” 「パケットキャプチャはありますが、手伝えますか?」 You are the forensic invesYgator. Your mission is to figure out who Ann was IM-‐ing, what she sent, and recover evidence including: あなたはフォレンジック調査官。任務は以下の質問を答える事。 1. What is the name of Ann’s IM buddy? アンがチャットしていた友達の名前(ユーザ名)は何でしょうか? 2. What was the first comment in the captured IM conversaYon? IMのチャットの一番最初のコメントは何でしょうか? 3. What is the name of the file Ann transferred? アンが送信したファイル名は何でしょうか? 4. What is the magic number of the file you want to extract (first four bytes)? ファイルのマジックナンバーは何でしょうか?(最初の4バイト) 5. What was the MD5sum of the file? ファイルのMD5Sumは何でしょうか? 6. What is the secret recipe? 機密のレシピは何でしょうか?
Puzzle 1 – 説明 The MOST ELEGANT soluYon wins. In the event of a Ye, the entry submifed first will receive the prize. ScripYng is always encouraged. もっとも優雅なソリューションが勝つ!引き分けの場合は先に提出した人が勝つ。スクリプトを作るのが望ましい。 ExcepYonal soluYons may be incorporated into the SANS Network Forensics Toolkit. Authors agree that their code submissions will be freely published under the GPL license, in order to further the state of network forensics knowledge. 優れたツールはSANS Network Forensics Toolkitに追加されるかも知れません。作者はネットワークフォレンジックのコミュニティーのために、作成したツールはGPLライセンスで無料で公開する事を同意します。
Puzzle 1 – 優勝者 We received over 100 submissions, many of which were truly excellent. Figuring out a winner was challenging, but in the end, one submission stood out over all. 100人以上から提出があり、中にとても優れた答えがありました。優勝者を決めるのは難しかったが、例外的なソリューションを見つけました。 It was possible to solve the puzzle with common tools such as Wireshark. However, modern invesYgaYons omen involve many gigabytes– if not terabytes– of packet data. In the real world, poinYng and clicking doesn’t scale. Moreover, when you’re working with large amounts of data, processing Yme is extremely valuable. Small, fast tools are key. Wiresharkのようによくあるツールで答えを見つける事ができましたが、現代の調査はGBやTBレベルなので、拡張性のないツールは使えません。更に膨大なデータを扱っている場合は小さくて速いツールが大事です。
Puzzle 1 – 優勝者
What we considered “elegant” was the construcYon of some automated process for solving the puzzle which was easy to use, easy to understand, very portable, and would easily be able to scale to much larger and more difficult problems. 優雅(エレガント)というのは: ・自動的なツール ・使いやすい ・柔軟性がある ・もっと大きく、複雑な問題にも使えるように 拡張性があるツール
Puzzle 1 – 優勝者 The WINNER is KrisYnn Gudjonsson who wrote two very elegant Perl tools: pcapcat and omcat. 優勝者はpcapcatとomcatのPerlスクリプトを書いたクリスティン・グドジョンソンです。 pcapcat # This script reads a PCAP file and prints out all the connecYons in the file and gives the user the opYon of dumping the content of the TCP stream. pcapcat:pcapからTCPストーリムをダンプできるツール。 omcat # This script reads an OFT package, which is a package created by AIM when sending files over the network (using the oscar file transfer protocol). The script reads the packet, prints out some informaYon about it and saves the captured file. Omcat:AIMがOFTプロトコルでファイル送信する時に使うOFTパッケージを抜粋して、情報を出力して、ファイルを保存。
OSCARチャットプロトコル ・AIMやICQで使われている専用プロトコル ・AIM(AOL Instant Messenger) ・AOL (American Online) ・1993年からのアメリカのISP ・2002年に3千万ユーザでピークして、落下 ・現在、iChatにライセンスされて使われている ・第三者チャットクライアントの開発者が リバースエンジニアして、2009年にAOLが プロトコルのドキュメントをある程度リリース
OSCARチャットプロトコル ・hfp://www.cs.cmu.edu/~jhclark/aim/On%20Sending%20Files%20via%20OSCAR.odt hfp://dev.aol.com/aim/oscar/#SENDIM hfp://www.shaim.net/trac/oscarlib/
OSCARファイル転送プロトコル(OFT2)
PUZZLE 1に挑戦! 証拠:hfp://philosecurity.org/558/contest_01/evidence.pcap
Puzzle 1 – デモ -‐ 手動 ・strings – ASCII文字列を出力 ・file -‐ ファイルタイプをMagic Numberで調べる
・foremost – バイナリーを抜粋 ・tshark – wiresharkのコマンドラインツール ・wireshark ・tcpflow – TCPセッションを抜粋 ・tcpxtract – pcapでforemost ・ngrep – ネットワークgrep
Puzzle 1 – デモ – 自動ツール ・hfp://forensicscontest.com/tools ・lol.perl -‐> ngrep, tshark, xxd, tcpflow, md5sum, stringを繋ぐ。しかし失敗 ・aim.rb -‐> ruby-‐pcapが必要。Ruby 1.4.xじゃないと駄目? ・contest1.pl -‐> tsharkのパスを直さないと。 ・grouch.pl, IMParse -‐> Perl Moduleが必要 ・pcapcat, omcat
Puzzle 1 – デモ 自動 ・Network Miner ・www.netresec.com/?page=NetworkMiner apt-‐get install mono-‐runYme apt-‐get install libmono-‐winforms2.0-‐cil wget sourceforge.net/projects/networkminer/files/latest -‐O /tmp/networkminer.zip unzip /tmp/networkminer.zip -‐d /opt/ cd /opt/NetworkMiner_1-‐4-‐1 chmod +x NetworkMiner.exe chmod -‐R go+w AssembledFiles/ chmod -‐R go+w Captures/ mono NetworkMiner.exe
Puzzle 1 – 答え 1. アンがチャットしていた友達の名前(ユーザ名)は? sec558user1 2. IMのチャットの一番最初のコメントは? Here’s the secret recipe… I just downloaded it from the file server. Just copy to a thumb drive and you’re good to go >:-‐) 3. アンが送信したファイル名は? recipe.docx 4. ファイルのマジックナンバーは?(最初の4バイト) 0x504B0304 (Note: one byte = 8 bits = 2 hex digits!) 5. ファイルのMD5Sumは? 8350582774e1d4dbe1d61d64c89e0ea1 6. 機密のレシピは何? 1 serving Ingredients: 4 cups sugar 2 cups water
休憩
PUZZLE 2
Puzzle 2 (2009年11月) – 説明 Amer being released on bail, Ann Dercover disappears! Fortunately, invesYgators were carefully monitoring her network acYvity before she skipped town.
Ann Dercoverが保釈後に姿を消した!幸い事に、警察捜査官はAnnが
逃げ出した前にネットワーク通信を監視していた。
“We believe Ann may have communicated with her secret lover, Mr. X, before she lem,” says the police chief. “The packet capture may contain clues to her whereabouts.” 警察署長は:「Annが飛び出した前に、恋人の「ミスターX」とやりとりがあったと想定してんねん。パケットキャプチャではAnnの行方について手掛かりを提供されるかも。」
You are the forensic invesYgator. Your mission is to figure out what Ann emailed, where she went, and recover evidence including: 皆さんはフォレンジック調査員で、任務は「Annが何をメールしたか」や「どこに行ったか」等の証拠をパケットキャプチャーでつかむ事です。
Puzzle 2 – 質問 hfp://forensicscontest.com/contest02/evidence02.pcapevidence02.pcap MD5: cfac149a49175ac8e89d5b5b5d69bad3 1. What is Ann’s email address? AnnのEメールは何でしょう?2. What is Ann’s email password? Annのメールパスワードは何でしょう?3. What is Ann’s secret lover’s email address? Annの恋人のメールアドレスは何でしょう?4. What two items did Ann tell her secret lover to bring? AnnはMr. Xに2つの物を持って来てと言いましたが、 それは何でしょうか?
Puzzle 2 – 質問 5. What is the NAME of the afachment Ann sent to her secret lover? AnnがミスターXに送った添付ファイルの名前は?6. What is the MD5sum of the afachment Ann sent to her secret lover? 添付ファイルのMD5ハッシュは?7. In what CITY and COUNTRY is their rendezvous point? AnnとMr. Xは何処の国と市で集合する予定?8. What is the MD5sum of the image embedded in the document? 添付ファイルの中に埋め込んだ画像のMD5ハッシュは?
Puzzle 2 – 答え 1. AnnのEメールは何でしょう? [email protected] 2. Annのメールパスワードは何でしょう? 558r00lz 3. Annの恋人のメールアドレスは何でしょう?[email protected] 4. AnnはMr. Xに2つの物を持って来てと言いましたが、 それは何でしょうか? A fake passport and a bathing suit. 偽造パスポートと水着
Puzzle 2 – 答え 5. AnnがミスターXに送った添付ファイルの名前は?secretrendezvous.docx 6. 添付ファイルのMD5ハッシュは?9e423e11db88f01bbff81172839e1923 7. AnnとMr. Xは何処の国と市で集合する予定? Playa del Carmen, Mexico 8.添付ファイルの中に埋め込んだ画像のMD5ハッシュは? aadeace50997b1ba24b09ac2ef1940b7
PUZZLE 3
Puzzle 3 (2010年2月) – 説明 Ann and Mr. X have set up their new base of operaYons. While waiYng for the extradiYon paperwork to go through, you and your team of invesYgators covertly monitor her acYvity. Recently, Ann got a brand new AppleTV, and configured it with the staYc IP address 192.168.1.10.
AnnさんとミスターXは新しいアジトを作りました。身柄引渡を要求している間に、こっそり行動をモニターします。Annさんは新しいAppleTVを購入して、192.168.1.10の静的IPアドレスを使っています。 hfp://forensicscontest.com/contest03/evidence03.pcap
Puzzle 3 – 質問 1. What is the MAC address of Ann’s AppleTV? AnnのAppleTVのMACアドレスは? 2. What User-‐Agent string did Ann’s AppleTV use in HTTP requests? AnnのAppletTVはHTTPリクエストにどのUser-‐Agentを使った? 3. What were Ann’s first four search terms on the AppleTV (all incremental searches count)? AnnがAppleTVで検索したキーワードの最初の四つは? 4. What was the Ytle of the first movie Ann clicked on? Annが最初にクリックした映画のタイトルは?
Puzzle 3 – 質問 5. What was the full URL to the movie trailer (defined by “preview-‐url”)? 映画の予告編のフルURLは?(”preview-‐url”で定義された) 6. What was the Ytle of the second movie Ann clicked on? Annが二番にクリックした映画のタイトルは? 7. What was the price to buy it (defined by “price-‐display”)? その値段は?(”price-‐display”で定義された) 8. What was the last full term Ann searched for? Annが最後に検索したフルキーワードは?
おすすめ Network Forensics: Tracking Hackers through Cyberspace