
Go Webアプリケーションペネトレーションテスト
GOWAPT は wfuzz の弟分で、WAPT のスイスアーミーナイフです。ペネトレーションテスターは設定するだけで、クリックひとつで大規模なアクティビティをストレスなく実行できます。
gowapt をインストールするには、以下のコマンドを入力します:
make
sudo make install
-h メニューより
Usage of gowapt:
-H value
追加ヘッダーのリスト
-a string
Basic 認証 (ユーザー:パスワード)
-c string
クッキーのリスト
-d string
リクエスト用 POST データ
-e string
カンマ区切りのエンコーダーリスト (デフォルト "plain")
-f string
結果をフィルター
-from-proxy
プロキシサーバー経由でリクエストを取得
-fuzz
内蔵ファザーを使用
-p string
アップストリームプロキシを使用
-plugin-dir string
すべてのスキャンモジュールを含むディレクトリ
-scanner
スキャンモードで実行
-ssl
SSL を使用
-t string
リクエストのテンプレート
-threads int
スレッド数 (デフォルト 10)
-u string
ファズ対象の URL
-w string
ワードリストファイル
-x string
拡張ファイルの例.js
例
http://www.example.com をスキャンし、すべての 200 OK リクエストをフィルター
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -f "code == 200"
http://www.example.com をスキャンし、vuln GET パラメータをファズして XSS を探す (正規のリクエストで 200 タグがあったと仮定)
gowapt -u "http://www.example.com/?vuln=FUZZ" -w wordlist/Injections/XSS.txt -f "tags > 200"
http://www.example.com をスキャンし、vuln POST パラメータをファズして XSS を探す (正規のリクエストで 200 タグがあったと仮定)
gowapt -u "http://www.example.com/" -d "vuln=FUZZ" -w wordlist/Injections/XSS.txt -f "tags > 200"
認証保護された http://www.example.com をスキャンし、すべての 200 OK リクエストをフィルター
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -f "code == 200" -a "user:password"
http://www.example.com をスキャンし、ヘッダー Hello: world を追加してすべての 200 OK リクエストをフィルター
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -f "code == 200" -H "Hello: world"
http://www.example.com を Basic 認証 (ユーザー/パスワード guest:guest) でスキャン
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -a "guest:guest"
http://www.example.com をスキャンし、拡張子を追加
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -x myextension.js
プロキシ (Burp など) 経由で http://www.example.com をスキャン:
gowapt -p "http://localhost:8080" -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt
プロキシから受信した http://www.example.com をスキャンし、すべての 200 OK リクエストをフィルター
gowapt --from-proxy -w wordlist/general/common.txt
http://www.example.com でスキャナーモードを実行 (プロキシから受信) し、デフォルトプラグインを使用
gowapt --from-proxy --scanner --plugin-dir plugin/
次に BurpSuite を開き、ファズしたいリクエストを Repeater に送り、アップストリームプロキシを 127.0.0.1:31337 に設定します。
準備ができたら Send をクリックします。すべて正しければ、応答として Request received by GOWAPT が表示されるはずです。
拡張機能は gowapt の機能を簡単に拡張する方法です。JavaScript VM が拡張ファイルの読み込みと実行を担当します。
以下は現在実装されている API のリストです。
* PS: setHTTPInterceptor を使用する場合、コールバックメソッドは 3 つのパラメータを受け取ります:
sendRequestSync の性質上、同期リクエストによりエンジンが遅くなりますので、控えめに使用してください。
以下の拡張例で詳細を説明します:
example.js
/*
* Create a custom encoder called helloworld
*
* This encore just add the string "_helloworld" to every payload
* coming from the wordlist
*/
addCustomEncoder("helloworld", myenc);
/*
* Define the callback method for the helloworld encoder
*/
function myenc(data) {
return data + "_helloword";
}
/*
* Create an HTTP interceptor
*
* The interceptor will hook every request / response
* is possible to modify request before send it, anyway the respose item
* it's just shadow copy of the one received from the server so no modification
* are possible
*
*
* request_response is an object which may contains both http.Request
* or http.Response , to know which on is contained check is_request flag
*
* REMEMBER! request_response is an http.* object so you must interact with
* this one just like you would do in golang!
*
* dumpResponse is a built-in function which dump full request-response to
* disk.
* result is an object filled with stats about the response it contains some fields
*
* result.tags => Number of tags in the response
* result.code => HTTP Response status
* result.words => Number of words in the response
* result.lines => Number of lines in the response
* result.chars => Number of chars in the response
* result.request => Full dump of the request
* result.response => Full dump of the response
* result.response => The injected payload
*
*/
setHTTPInterceptor(function(request_response, result, is_request){
if(is_request){
request_response.Header.Set("Hello", "world")
}else{
dumpResponse(request_response, "/tmp/dump.txt")
/*
* Send an HTTP request in a synchronous way
*
* This API accept 4 parameters:
* method => GET | POST | HEAD | PUT | PATCH | UPDATE
* url => The url of the HTTP service
* post_data => The content of request bodyBytes
* headers => A javascript dictionary {headerName => headerValue}
*
* The response object may be null or undefined or an http.Response from golang
*/
var response = sendRequestSync("GET", "http://example.com/", null, {"Fake": "Header"})
}
})
最新のコミットで Scanner という新しいモードが導入されました。これにより、ユーザーは完全にカスタマイズ可能なプラグインを作成し、アクティブな Web スキャンを実行できます。詳細は Wiki をご覧ください!
ワードリストは wfuzz プロジェクトから提供されています!ありがとうございます!
以下は利用可能なエンコーダーのリストです。
以下の変数にフィルターを適用できます。
gowapt は GPL 3.0 ライセンスの下でリリースされており、Daniele 'dzonerzy' Linguaglossa のコピーレフトです。
| メソッド | パラメータ数 | 説明 | パラメータ |
|---|
| addCustomEncoder | 2 | ワードリストで使用するカスタムエンコーダーを作成 | Param1 -> EncoderName (文字列) Param2 -> EncoderLogic (関数) |
| panic | 1 | デバッグ目的でアプリケーションをクラッシュさせる | Param1 -> PanicText (文字列) |
| dumpResponse | 2 | 完全なリクエスト/レスポンスをディスクにダンプする(テストケースの保存に便利) | Param1 -> ResponseObject (http.Response) Param2 -> Path (文字列) |
| setHTTPInterceptor | 1 | 送信 HTTP リクエストと受信レスポンスのインターセプターを作成 | Param1 -> HTTPCallback (関数) * |
| sendRequestSync * | 4 | 同期的に HTTP リクエストを送信する | Param1 -> Method (文字列) Param2 -> Url (文字列) Param3 -> PostData (文字列) Param4 -> Headers (Object{Name:Value}) |