1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

OpenAPI定義されたAPIの脆弱性診断

Posted at

脆弱性診断のやり方を軽く覚えたのでやってみた。
備忘録として記す。

環境

  • API:.NETCore3.1
  • OS: Windows
  • ツール:OWASP ZAP 2.9.0

事前準備

  • localで脆弱性診断を行うための設定を行う。
  • 脆弱性診断対象のAPI立ち上げる。
  • 脆弱性診断対象のAPIの定義ファイルを用意しておく。(私の場合Swaggerを導入してたので、Swagger.jsonを保存しておく)

localhostをZAP経由にする

firefoxの場合、初期設定ではlocalhost通信はプロキシを通さない設定になっています。

  • ブラウザを開き、URLにabout:config(警告は無視)
  • 検索欄にnetwork.proxy.allow_hijacking_localhost
  • 値をfalseからtrueに変更
  • Firefoxの接続設定「プロキシーなしで接続」が空欄ではない場合、localhost、127.0.0.1を削除

診断

診断対象OpenAPI定義ファイルをimportする

[Import]タブ -> [import an OpenAPI definition from the local file system]

  • FilePath:事前準備で保存したSwagger.jsonを選択
  • Target URL:立ち上げたAPIのURL https://localhost:XXXXX/

[Import] -> Successfully parsed OpenAPI definition が出てきたらOK

[サイト]タブをクリックして、対象サイトを右クリック。
[コンテキストに含める] -> [New Context]

新しくできたコンテキストを右クリックして[動的スキャン] -> [スキャンを開始] で診断。

結果

アラートタブで結果を確認できます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?