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
に戻してサーバに送らないとダメみたい。
- OPTIONSメソッドのURIの書き方で、本来
-
- 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ヘッダーというのがでてきまして、これなんだろうと。
-
https://tools.ietf.org/html/rfc7230
- A.1.2. Keep-Alive Connections
- "As a result, clients are encouraged not to send the Proxy-Connection header field in any requests."
- 現状としてはクライアントはこのHTTPリクエストヘッダーを送る必要は無い。むしろ送らないことを推奨。
-
https://developer.mozilla.org/ja/docs/HTTP/Headers
- "注記: Keep-Alive リクエストヘッダは、Gecko 5.0 では送信されません。前のバージョンでは送信していましたが正しい形式ではなかったため、当分の間削除することになりました。ただし、Connection: または Proxy-Connection: ヘッダは依然として値 "keep-alive" で送信されます。"
- 過去の互換性で送ってる?
-
https://wiki.suikawiki.org/n/Proxy-Connection
- 歴史的な事情などソースURL付きで解説されてるが、やはり結論としては、最新のWebでは使われないということで一致。
-
http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/web-proxy-connection-header.html
- 歴史的な事情。最終的に Connection リクエストヘッダーで完結するので、Proxy-Connection は使われなくなった。
-
http://stackoverflow.com/questions/15460819/what-is-the-difference-between-connection-and-proxy-connection-in-http-header
- 同上。