Skip to Content
ウェブアプリケーションセキュリティ 第2版
book

ウェブアプリケーションセキュリティ 第2版

by Andrew Hoffman
March 2025
Intermediate to advanced
444 pages
6h 9m
Japanese
O'Reilly Media, Inc.
Audio summary available
Content preview from ウェブアプリケーションセキュリティ 第2版

第5章 API分析 API分析

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

APIエンドポイント分析 は、リコンツールキットの中で、サブドメイン発見の次に論理的なスキルである。このアプリケーションはどのドメインを利用しているのか?このアプリケーションが3つのドメイン(例えばx.domainy.domainz.domain)を持っている場合、それぞれのドメインが独自のAPIエンドポイントを持っている可能性があることに注意しなければならない。

一般化すると、サブドメインを発見しようとしたときと非常によく似たテクニックを使うことができる。ブルートフォースアタックや辞書攻撃はここでも有効だが、手作業や論理的分析もしばしば報われる。

APIを発見することは、サブドメインを発見することに続く、ウェブアプリケーションの構造について学ぶ2番目のステップである。このステップは、公開されたAPIの目的を理解し始めるために必要な情報を提供してくれる。APIがネットワーク上で公開されている理由を理解すれば、それがアプリケーションにどのように適合し、そのビジネス上の目的が何であるかを理解し始めることができる。

エンドポイントディスカバリー

前回 、今日のほとんどのエンタープライズ・アプリケーションがAPIの構造を定義する際、特定のスキームに従っていることを説明した。通常、APIはREST形式かSOAP形式のどちらかに従う。RESTはより一般的になりつつあり、今日のモダンなWebアプリケーションAPIの理想的な構造であると考えられている。

ブラウザの開発者ツールを使ってアプリケーションを操作し、ネットワークリクエストを分析することができる。もしこのようなHTTPリクエストがいくつもあれば、これはREST APIだと考えていいだろう:

GET api.mega-bank.com/users/1234
GET api.mega-bank.com/users/1234/payments
POST api.mega-bank.com/users/1234/payments

各エンドポイントは、関数ではなく特定のリソースを指定していることに注目してほしい。

さらに、ネストされたリソースpayments はユーザ1234 に属していると推測できる。これはこのAPIが階層的であることを示している。これは、このAPIが階層的であることを物語っている。

各リクエストで送信されるクッキーを見て、各リクエストのヘッダを見れば、RESTfulアーキテクチャの兆候も発見できるかもしれない:

POST /users/1234/payments HTTP/1.1
Host: api.mega-bank.com
Authorization: Bearer abc21323
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/1.0 (KHTML, like Gecko)

リクエストのたびにトークンが送信されるのも、RESTful API設計の証だ。REST APIはステートレスであるべきであり、サーバはリクエスト元を追跡すべきではない。

これが本当にREST APIであることが分かれば、利用可能なエンドポイントに関して論理的な仮説を立て始めることができる。

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

ハイパーモダンPython ―信頼性の高いワークフローを構築するモダンテクニック

ハイパーモダンPython ―信頼性の高いワークフローを構築するモダンテクニック

Claudio Jolowicz, 嶋田 健志, 鈴木 駿
Kubernetesで実践するクラウドネイティブDevOps

Kubernetesで実践するクラウドネイティブDevOps

John Arundel, Justin Domingus, 須田 一輝, 渡邉 了介
流暢なReact

流暢なReact

Tejas Kumar

Publisher Resources

ISBN: 9798341627505