Thursday, June 16, 2011

Windows IE Test Images in Virtual Box | VirtualBoxでWindowsIEのテストVMイメージ

This quick guide will show you how to get Microsoft's free IE testing images working in Virtual Box.

このガイドはVirtualBoxでマイクロソフトのIEテストVMイメージを動きことを説明する。


Step 1. Download MS Images | MSイメージをダウンロード
MS Images


Step 2. Download Intel 1000 Desktop Drivers | Intel 1000 デスクトップドライバーをダウンロード
Intel Driver


Step 3. Create new WinXP VM | 新しいWinXPVMを作成

Be sure when creating the image to chose the .vhd file that you extracted from the MS "installer".

マイクロソフトのイメージインストラーからの「.vhd」ファイルを選択する。






Step 4. Change Network Card | ネットワークカードを変更
Under 'Settings' -> Network -> "Adapter 1" tab chose your network type (bridged/NAT whatever). Then under Advanced chose "Intel PRO/1000 MT Desktop (82540EM)" for the driver.

設定 → ネットワーク → アダプタ1のタブのネットワーク割り当てから好きな設定を選択する。高度設定のアダプタタイプから「Intel PRO/1000 MT Desktop (82540EM)」を選び。






Step 5. Create ISO from Intel Driver | インテルドライバーのISOを作る
You should have the PROWin32.exe driver downloaded. Start up cygwin for windows (or your terminal in *nix. Go to the directory that has the driver installer and run the following command:

genisoimage -o inteldriver.iso PROWin32.exe

もう既にPROWin32.exeドライバをダウンロードした。WindowsでのcygwinかUnixでのシェールを起動し、PROWin32.exeの入っているディレクトリから以下のようなコマンドを実行する:
genisoimage -o inteldriver.iso PROWin32.exe



Step 6. Start VM | VMを起動

Step 7. Mount the Intel Driver ISO | インテルドライバのISOをマウント



Step 8. Install Driver | ゲストでドライバをインストールする

Step 9. Profit! | 利益!
Don't forget to activate!

Activateを忘れないで!

Sunday, June 12, 2011

WBTS Version 1.0 | WBTSバージョン1.0

It's been a long time but I'm back to updating WBTS. This version will contain the following changes:
1. Removal of extjs (I didn't like the gplv3 license) moved to MIT license.
2. Total re-write of service code. Removal of web resources in favour of xmlrpc. Ability to drop in new XML-RPC services is now much easier
3. Auto-configuration creation script now available to build wbts configuration.
4. Built in pydictdb for those who don't want to run MongoDB. Also a new abstracted storage API if you want to build your own storage sub-system.
5. Possible creation of windows installer / virtual environment. Still not sure yet.

Release is planned for late June, So stay tuned!

いや、久しぶりですが、またWBTSの開発を続けている。このバージョンは複数の新しい項目を含んでいる。
1.extjsを削除した。(gplv3好きじゃないから)MITライセンスに変更した。
2.全部のサービスコードを書き換えた。Webコードを切って、XML-RPCで管理できるようになった。新しいXMLRPCサービスを追加したい方が簡単にできるようになった。
3.新し自動にWBTSの構成ファイルを作るスクリプトを作った。
4.MongoDBの代わりにWBTS内に設置されているPythonDictでデータを保存できる。新しいストレージAPIで自分の好きなデーターベースに作られる。
5.まだ決めてないけど、Windowsインストーラを作成するかもしれない。

6月下旬にリリースする予定だ。

Here's some images of the new mgmt interface.
新しい管理コンソールの画像だ!

Results table:(結果表)





Here's viewing a result (テスト結果)





Here's the new DNS tab (DNS設定タブ)





Here's the new XML-RPC testing interface (新しいXML-RPCインタフェース)

Wednesday, October 20, 2010

Some Bug Reports | いくつかの脆弱性報告

Recently some bugs I found in browsers and a flash player have had their advisories released. The first is a bug in Camtasia that allows for XSS because they allow remote inclusion of configuration files. Inside of the configuration files you can specify a javascript:... URL inside of an XML Element. This javascript URL is executed after the movie has finished playing.

The other bug was one I found while working on WBTS. It's a bug in version 10.62 of Opera's browser. This allowed for CSS and potentially other data to be accessed cross origin. This bug was due to a problem with redirects and reading in the remote files cssRules. I said it in my WBTS talk and I'll say it again, redirects are a common source of browser bugs!

最近、ベンダーさんは僕が見つけた脆弱性情報を発表した。ひとつのバッグはCamtasiaというフラッシュ映画の作れるソフトにXSS攻撃が可能だった。 そのソフトはフラッシュ映画にリモート(他のサーバー)からXML設定ファイルを挿入できる。設定ファイルの中にXML要素で「javascript:」のURLを指定し、映画が終わったらフラッシュによってブラウザはこのURLをアクセスする。

他のはWBTSを作ったときに見つけた脆弱性だ。Operaバージョン10.62でのブラウザの問題だ。この脆弱性で他サイトのCSSか他の情報漏洩の問題だ。詳しくはCSSファイルをリダイレクトでアクセスすると、他のドメインのcssRulesを読める。WBTSプレゼンテーションでも再度言ったんだが、「ブラウザのセキュリティーにおいて、リダイレクトの問題は日常的だ!」。

Friday, October 8, 2010

Slides Available | スライドを発表した

Quick note I just uploaded my slides from the SyScan talk to the WBTS Project Page.

SyScanのWBTSプロジェクトのスライドをWBTS プロジェクトページにアップロードした。

Tuesday, October 5, 2010

SyScan Done WBTS Released | SyScan終わったWBTS発表した

I finally finished all the work necessary for my SyScan talk at Ho Chi Minh. It went well and I had a pretty awesome time in Vietnam. I was going to post an update when I got back but I've been too tired to do anything. After 8-9 months of work, I would like to report I have finally released WBTS. There are a few missing test cases from the initial release as I have open bugs with Opera and BlackBerry. Once they fix those bugs I'll release the WBTS cases. Anyways you can download WBTS here and WBTS Runner here.
Enjoy!

やっとSyScanでのプレゼンテーションが終わった。本当によかった、ベトナムは楽しかった。戻った後にすぐブログを書こうと思ったけど、結構疲れたから今までやらなかった。9ヶ月間の努力の末にやっとWBTSを発表した。まだ、ブラウザベンダー「BlackBerry、Opera」が脆弱性を直してないから、最初のリリースはその直してない脆弱性のテストケースを含まない。直した後に発表する。以下のようなリンクでWBTSをダウンロードできる。WBTS。。。 WBTS Runner.
楽しんで!

Wednesday, August 18, 2010

Overlong UTF-8 Generator | 不正なUTF-8シーケンスジェネレーター

Real quick post about some code I made to generate invalid UTF-8 sequences. I couldn't find this online so I made my own ;D.
Here it is:

Web検索で見つかれなかったので、自力で不正なUTF-8シーケンスジェネレーターツールを使った。


Example:


overlongyourmom.py written by wirepair
Enter an ASCII char to make overlong, or hex (ex: h27) or 'quit': '
char ['] dec [39] hex [27] url: %27
overlong 2-byte sequence: c0 a7
overlong 3-byte sequence: e0 a7
overlong 4-byte sequence: f0 80 80 a7
overlong 5-byte sequence: f8 80 80 80 a7
overlong 6-byte sequence: fc 80 80 80 80 a7
Enter an ASCII char to make overlong, or hex (ex: h27) or 'quit': /
char [/] dec [47] hex [2f] url: %2f
overlong 2-byte sequence: c0 af
overlong 3-byte sequence: e0 af
overlong 4-byte sequence: f0 80 80 af
overlong 5-byte sequence: f8 80 80 80 af
overlong 6-byte sequence: fc 80 80 80 80 af
Enter an ASCII char to make overlong, or hex (ex: h27) or 'quit': ]
char []] dec [93] hex [5d] url: %5d
overlong 2-byte sequence: c1 9d
overlong 3-byte sequence: e1 9d
overlong 4-byte sequence: f1 80 80 9d
overlong 5-byte sequence: f9 80 80 80 9d
overlong 6-byte sequence: fd 80 80 80 80 9d
Enter an ASCII char to make overlong, or hex (ex: h27) or 'quit': \
char [\] dec [92] hex [5c] url: %5c
overlong 2-byte sequence: c1 9c
overlong 3-byte sequence: e1 9c
overlong 4-byte sequence: f1 80 80 9c
overlong 5-byte sequence: f9 80 80 80 9c
overlong 6-byte sequence: fd 80 80 80 80 9c
Enter an ASCII char to make overlong, or hex (ex: h27) or 'quit': h0a
char [
] dec [10] hex [0a] url: %0a
overlong 2-byte sequence: c0 8a
overlong 3-byte sequence: e0 8a
overlong 4-byte sequence: f0 80 80 8a
overlong 5-byte sequence: f8 80 80 80 8a
overlong 6-byte sequence: fc 80 80 80 80 8a

Tuesday, August 17, 2010

Designing a testcase system for browsers | ブラウザによるテストケースシステムの設計

The testcase system is an important piece to the WBTS project. It went through a few design changes while I was working on it. It is made up of two parts, the client side and the server side.

Client Side
The client side code is just a single javascript object called TestCase. It allows you in your testcase to store the following information:
1. input: A quick summary of the input to your testcase like document.cookie = 0x00-0xff.
2. output: The output of the test, if there is any. You can supply your own html formatting as well.
3. description: A quick description of the test like: "Inject headers into xhr object"
4. target host: The host name you expect the request to becoming from (usually only used for SOP tests).
5. expected result: What you expect the result to be like: "null" or "exception"
6. result: The actual result of the test.
7. test passed: Did the test pass or fail? (Usually true or false).

There are two methods of running a test. For simple tests, you can fill out the object, run a test then just call the testcase objects saveTest method. For more complex, or dangerous testcases you can use the savePreTest method. This allows you to set up all the test information and store it in a temporary document. You then run the test. If the test causes the browser to stop, the blade automation system will call a failTest method, indicating that it was unable to complete. This also causes the temporary data to be copied into the real results database.

Here is an example testcase:

Lines 6-12 are used to ensure our testcase function "f" fires when the window finishes loading.
Lines 15-25 create a string of bytes to be used as input.
Line 26 URL decodes the data into their "raw" form.
Line 27 creates a cookie value.
Line 29 sets the testcase input (this will be directly visible in the results database).
Line 30 sets the description.
Line 31 is the actual test, creating a cookie for the document, then making a request to a special resource. After showRequest is called via XHR, the "save_test" call back function will have access to the response data and our testcase object.
Line 36 takes the response data and sets that as our output.
Line 37-38 tries to remove the cookie data.
Line 39 finally saves the test to our results database.
It should be noted, each testcase is called with a query parameter called client_id. This value is generated by the blade automation system and used for tracking purposes. A request to a testcase would look like: http://www.attacker.com/testcases/headertests/sometest.html?client_id=<some unique id>

Server Side
Our test case system is mapped to /tc/ on all virtual hosts. It offers three resources: saveTest, savePreTest, and failTest. They are not very complicated, they just take in the data as POST parameters. A few fields are base64 encoded for storage as it may contain invalid UTF-8 bytes which may cause MongoDB to throw an error. savePreTest will store data in a temporary database. The pretest data contains the testcase information configured for a failure result. This way, when failTest is called, it can just copy the information into our results database.

WBTSプロジェクトのためにテストケースシステムが大事。作りながら何回もデザインが変更した。テストケースシステムは二つの部分(クライアント側とサーバー側)がある。

クライアント側
クライアントサイドコードはTestCaseというのJavaScriptオブジェクトだけである。このオブジェクトが以下のような情報を保存する:
1. input(入力): テストケースの簡単な概要。例:document.cookie ^ 0x00 - 0xff。
2. output (出力): テストの出力。HTML様式もできる。
3. description: テストケースの説明。例: 「XHRオブジェクトにヘッダーをインジェクトする。」
4. target host: テストケースの実行されるホスト名。普段は、SOP専用
5. expected result(予想通りの結果): 例: 「null」または「exception」
6. result (結果): 実際のテスト結果。
7. test passed (テストの成否): テストは失敗か正解だったか。普段は 「true」か「false」。

(上記のコードーを見て。)
Line 6-12 Windowがロードーするのを完成したら「f」という関数を実行する。
Lines 15-25 テストの入力による、文字列を作成する。
Line 26 データーをURLデコードする。
Line 27 クッキー値を作成する。
Line 29 テストケースの入力を設定する。(この情報は結果DBで見られるようにする)
Line 30 説明を設定する。
Line 31 これが実際のテスト。ドキュメントのクッキーを作成、特別なWebリソースに呼び出す。XHRでshowRequestを呼び出した後は「save_test」のコールバック関数を呼び出す。この関数がレスポンス情報とTestCaseのオブジェクトにアクセスできる。
Line 36 レスポンス情報を出力に設定する。
Line 37-38 クッキーを削除する。
Line 39 テストの結果をDBに送信する。
実は、「client_id」と言うパラメーターは格テストケースに送信する。トラッキングのため、この「client_id」値はbladeシステムによって作られたものだ。例えば、下記のようなURLはテストケースのリクエスト。
http://www.attacker.com/testcases/headertests/sometest.html?client_id=<some unique id>

サーバー側
テストケースシステムは全部のVirtualHostsで「/tc/」にマップした。このシステムは三つのリソース「saveTest」、「savePreTest」、「failTest」を実装する。そんなに複雑ではない。POSTでのパラメーターだけ受信する。テスト結果が不正なUTF-8バイトを持っているかもうしれないので、多少のDBフィールドはbase64エンコードする必要がある。エンコードしないと、MongoDBがエラーを発生する。「savePreTest」リソースはテストデータをDBに一時的に保存する。テストが失敗する場合、bladeシステムは「failTest」に呼び出すと一時的なDBから結果DBにコピーされる。