LoginSignup
7
4

More than 5 years have passed since last update.

参考メモ/HTTP Proxyを通す時のHTTPリクエストについて

Posted at

Burp使ってると、Proxyのヒストリ一覧からrepeaterに移すと、たまにリクエストラインが GET http://xxxx/foo/bar.html HTTP/1.1 みたいに、URLがそのまま載ってる時があります。
別のプロキシから上位にBurp置くとそうなるのかな?

よくわからないんですが、そもそも HTTP Proxyを通すとき、HTTPのリクエストラインはどうすべきなのかRFCを軽くググッた非常に簡単なメモです。

Proxyを通した時のリクエストラインの変更について

https://tools.ietf.org/html/rfc2616 (昔のHTTP)

  • 5.1.2 Request-URI
    • リクエストラインのURIの書き方で、Proxyでの扱いについて。
    • "The absoluteURI form is REQUIRED when the request is being made to a proxy."
    • どうやら絶対URIでリクエストライン書くのはこの辺かな。
    • "The authority form is only used by the CONNECT method (section 9.9)."
    • → section 9.9 見ても "This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a tunnel (e.g. SSL tunneling [44])." としか書いてなく、"authority form"ってなんなのかこのRFC上だけでは不明。
  • 8.1.3 Proxy Servers
    • Connection ヘッダーのProxyでの扱いについて。
  • 14.33 Proxy-Authenticate
    • 認証が必要なプロキシで、407 (Proxy Authentication Required) を返す時に一緒に返すレスポンスヘッダー
    • Proxy-Authenticate = "Proxy-Authenticate" ":" 1#challenge
  • 14.34 Proxy-Authorization
    • 認証が必要なプロキシに認証情報を送るリクエストヘッダー
    • Proxy-Authorization = "Proxy-Authorization" ":" credentials

https://tools.ietf.org/html/rfc7230 (整理された最近のHTTP)

  • 5.3.2. absolute-form
    • リクエストラインのURIの書き方で、Proxyでの扱いについて。
    • "When making a request to a proxy, other than a CONNECT or server-wide OPTIONS request (as detailed below), a client MUST send the target URI in absolute-form as the request-target."
    • やっぱりProxy通すときは絶対URI形式で。
  • 5.3.3. authority-form
    • やっとCONNECTメソッドでProxy使う時の"authority-form" が何なのか言及された。
    • 例 : CONNECT www.example.com:80 HTTP/1.1
  • 5.3.4. asterisk-form
    • OPTIONSメソッドのURIの書き方で、本来 OPTIONS * HTTP/1.1 でリクエストしたいのを Proxy 通す場合は OPTIONS http://xxxxxx:8080 HTTP/1.1 に変形するらしい。
    • なので、OPTIONSメソッドで↑の形式で来たら、Proxyは OPTIONS * HTTP/1.1 に戻してサーバに送らないとダメみたい。
  • 6. Connection Management
    • 随所に、Proxyの場合はどうする、というのが記載されてる。

https://tools.ietf.org/html/rfc7235 (整理された最近のHTTPのうち、認証関連のヘッダーについて)

  • 3.2. 407 Proxy Authentication Required
    • 認証が必要なProxyが返すステータスコード407についての説明。
  • 4.3. Proxy-Authenticate
    • 認証が必要なプロキシで、407 (Proxy Authentication Required) を返す時に一緒に返すレスポンスヘッダー
  • 4.4. Proxy-Authorization
    • 認証が必要なプロキシに認証情報を送るリクエストヘッダー

Proxy-Connection HTTPヘッダーについてメモ

RFC見てたら Proxy-Connection HTTPヘッダーというのがでてきまして、これなんだろうと。

7
4
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
7
4