ç§ã®ä¼ç¤¾ï¼é¨ç½²ã¯ãã¡ããã»ãã¥ãªãã£ã«å¼·ããã¨ã売ãã«ãã¦ããããããæè¿ä½ã£ã¦ã Web ã¢ããªã±ã¼ã·ã§ã³ã§ã¯æã»ãã¥ãªãã£ä¼ç¤¾ã«ãã診æï¼ãããã¬ã¼ã·ã§ã³ãã¹ãï¼ãåãããã¨ãå¢ãã¦ãã¾ãã
ä»ä½ã£ã¦ã Web ããªã±ã¼ã·ã§ã³ã診æãåããã®ã§ãããä»åææãããã®ã¯ãHTTP ãªã¯ã¨ã¹ãã Host: ããããªãã§éã㨠Location: ã«å é¨ IP ã¢ãã¬ã¹ã表示ããã¦ãããã¨ãããã®ã
ãã®æ¤è¨¼ã軽ããã£ã¦ãããã¼ãã¨æã£ããçµæ§ãããããã£ã¦ãã¾ã£ãã®ã§ã¡ã¢ãã¦ããã¾ããã¡ãã£ã¨ãã HTTP ãªã¯ã¨ã¹ãæ¹ãããã¼ã«æ¯è¼ã¿ããã«ãªã£ã¦ã¾ãããä»ã«ãããããæ¹ããã£ããæãã¦ãã ããã¾ãã
ãã¼ã«ã®é¸å®åºæºã«ã¤ãã¦
ããã¼ã«ã«ãããã·ãç«ã¡ããã¦ãã©ã¦ã¶ã®ãããã·è¨å®ãç«ã¡ããã¦ããã¨ãããã¼ã«ã¯ã使ãæ¹ã説æããã®ãé¢åãªã®ã§ãã¾ã使ãããããã¾ããããã©ã¦ã¶ã®ãã©ã°ã¤ã³ã¨ãã¦åä½ãããã®ããFiddler ã®ããã«ãã©ã¦ã¶å´ã®è¨å®ãèªåçã«å¤æ´ãã¦ããããã¼ã«ãããã§ãã
使ãæ¹ããââç»é¢ã«é·ç§»ããã¨ãã«ãªã¯ã¨ã¹ããããã® Host: ãæ¶ãã¦ãããããã®èª¬æã§ãããªã使ãããã®ããã¹ãã§ããï¼çµå±è¦ã¤ãã£ã¦ãªãã§ããã©ãï¼
Web Developer ã¿ããã« HTML ã®å 容ãå¤æ´ãããã¨ã§ãã©ã¼ã ã®å¤ãæ¹ãããããã®ãããã¾ãããä»å㯠HTTP ãããã³ã«ã¬ãã«ã§ã®æ¹ãããã¡ã¤ã³ã¨ãããã¨ã§ã
TamperIE
IE ã®ãã©ã°ã¤ã³ã§ãã
- ãã¼ã«ãã¼ããæå¹ï¼ç¡å¹ã®å¶å¾¡ãã§ããã®ã§ãproxy éããããæä½ã楽
- ãã©ã°ã¤ã³å½¢å¼ãªã®ã§ HTTPS ã«ã対å¿
ã¨ããç¹é·ããã£ã¦ IE6 ã®é ã¯ãããªãã«æç¨ãã¦ããã®ã§ãããIE7 ã ã IE8 ã ãã«ãã¦ããå©ç¨ã§ããªããªã£ã¦ãã¾ã£ãã®ã§æ®å¿µã§ãã
çæã¨ãã¦ã¯ã
- ã¯ã¨ãªã¹ããªã³ã°ã urlencode/urldecode ã§ããªãã®ã§ãå¤å°ä¸è¦ªå
- ãããã®æ¹ãããä¸å®å ¨ï¼Host: ã¨ãéåºãããã¯ããªã®ã«ãRaw Headersãã«è¡¨ç¤ºãããªãï¼
- ãªã¯ã¨ã¹ããæ¹ããããå ´åãReferer: ãéä¿¡ããªã
ã¨ããç¹ãããã¾ãã
ã¡ã¤ã³ PC ã«ã¯ãã§ã« IE8 ãå ¥ã£ã¦ããã®ã§ä»å試ãã¦ã¾ããããHost: ãåã£ã¦ãªã¯ã¨ã¹ããæãããã¯ã§ããªãã£ãæ°ããã¾ãã
Tamper Data
Firefox ã¢ããªã³ã§ãã説æã«
w.r.t. to GET parameters:
GET parameters are part of the URI, which at the point I am hooking into (using the observer service) is immutable.
ã¨ããããã«ããªã¯ã¨ã¹ãè¡ï¼HTTPã¡ã½ãããURLãã¯ã¨ãªã¹ããªã³ã°ããããã³ã«ãã¼ã¸ã§ã³ï¼ãå¤æ´ã§ããªãã»ã»ã»ã¨æã£ã¦ããã§ããã©ããReplay in browserããã http/https ã®åãæ¿ãããURL ã®å¤æ´ãã¯ã¨ãªã¹ããªã³ã°ã®æ¸ãæããããã¯ã§ããããã§ãã
æåã® Tamper æã«ã§ããã°ä¾¿å©ãªãã§ããã©ã使ã£ã¦ãä»çµã¿ãéãããã§ã以ä¸ã® URL ãåèã«ãªããããªæãã§ããã
ããã§ããããã ã£ããã§ãããããèãããä»å㯠Host: ããããåé¤ããã®ã§ãHTTP/1.1 ã 㨠400 Bad Request ã«ãªã£ã¦ãã¾ãã¾ãããªã¯ã¨ã¹ãã HTTP/1.0 ã«å¤ããã«ã¯ãabout:config ãéãã¦ãnetwork.http.versionããã1.0ãã«ããå¿ è¦ãããã¾ããï¼Configuration Mania ãå ¥ãã¦ããã°ãHTTP ãããã¯ã¼ã¯ãâãæ¥ç¶ãããå¤æ´ãã§ãã¾ããï¼
ä»åã®ã±ã¼ã¹ã§ã¯ãã®ãã¼ã«ã§ãæ¤è¨¼ã§ãã¾ãããã
- ã¡ã½ããã®æ¸ãæããã§ããªãã®ã§ TRACE ã¡ã½ããã®ãã¹ããªããã«ã使ããªã
- ãããã®è¿½å ãåé¤ããã¡ãã¡ãã¦ã¹å³ã¯ãªãã¯âãAdd elementãã¨ãã§ããå¿ è¦ãããã®ã§ã¡ãã£ã¨é¢å
ã¨ããä¸æºç¹ãããã®ã§ãå¥ã®ãã¼ã«ãæ¢ãããã¨ããã§ãã
Live HTTP Headers
Firefox ã¢ããªã³ã§ãããªã¯ã¨ã¹ãï¼ã¬ã¹ãã³ã¹ã®ãã°ãæ®ãã®ãã¡ã¤ã³ã§ããããªã¯ã¨ã¹ãã®ãªãã¬ã¤æ©è½ãããããã®ã¨ãã«æ¹ãããè¡ãã¾ãããã¡ã㯠Tamper Data ã¨éã£ã¦ã¡ã½ããã®æ¸ãæããã§ããã®ã§ TRACE ã¡ã½ããã®ãã¹ãçãè¡ãã¾ãã
ãããã³ã«ãã¼ã¸ã§ã³ã®ãã«ãã¦ã³ãç¨æããã¦ãã¦ãä¸è¦ãããã HTTP/1.1 㨠HTTP/1.0 ã®åãæ¿ããã§ããããªãã§ãããã°ã¬ã¼ã¢ã¦ãããã¦ããå¤æ´ã§ããªããããªã®ã§ about:config ããè¨å®ãå¤æ´ããå¿ è¦ãããã¾ãã
ãã¡ããç®çã®æ¤è¨¼ã¯è¡ããã®ã§ãããæ¹ãããç®çã®ã¨ãã«ä¸åº¦ãªã¯ã¨ã¹ããéä¿¡ãã¦ãªãã¬ã¤ãã¨ããã®ãå°ã é¢åã§ãã
ã¡ãªã¿ã«ãä¼¼ããããªã¢ããªã³ã§ HttpFox ãããã¾ãããã¡ãã¯æ¹ãããè¡ããªã代ããã«ã¬ã¹ãã³ã¹ããã£é¨åããã°ãæ®ãã¦ãããã®ã§ããªã¯ã¨ã¹ãæ¹ããæã®ã³ã³ãã³ãã確èªããããããªå ´åã«ä½¿ã£ãããã¦ãã¾ããã
Fiddler2
ãã¼ã«ã«ãããã·ã¨ãã¦åä½ããã®ã§ãIE ã§ã Firefox ã§ã使ãã¾ããä»åã¯æ¹ããã«ä½¿ã£ã¦ãã¾ãããæ¬å½ã¯ãã£ã¨è²ã ãªãã¨ãã§ãããã¼ã«ã§ã»ã»ã»æ©è½ç´¹ä»ã¹ã©ã¤ãããã£ãã®ã§è²¼ã£ã¦ããã¾ãã
Request Builder ã使ã㨠HTTP ã¡ã½ãããURLããããã³ã«ãã¼ã¸ã§ã³ãå¤ãããããããªã®ã§ããã£ãã Host: ããããåããã¨ãããã§ãããURL ãæå®ããã¨ãããå ã« Host: ããããåæã«ã¤ãï¼HTTP/1.0 ã«ãã¦ãå¤åãªãï¼ã®ããã§ã
解決æ¹æ³ãæ¢ãã¦ã¿ãã¨ãåå解決ããããã¹ãåã¨éã Host: ããããéãããã¦å°ã£ã¦ãã人ãçºè¦ã
ãã®å ´åã¯ã¹ã¯ãªããã§å¯¾å¿ã§ããã¿ããï¼æè¿ã®ãã¼ã¸ã§ã³ã 㨠Host Remapping ã®è¨å®ã§ãã§ããã£ã½ãï¼ã ãã©ãHost: ããããåãã«ã¯ã©ãããã°ãããã ããï¼
ã¨ãScript Samples ãè¦ãªããé©å½ã«ãã£ãã¨ãããOnBeforeRequest ã¤ãã³ãã®æå¾ã«
oSession["x-overridehost"] = oSession.oRequest.host; oSession.oRequest.headers.Remove("Host");
ã¿ãããªå¦çãå ¥ãã㨠Host: ããããæ¶ããã¨ãã§ãã¾ããã
æåã¯ãoSession.oRequest.headers.Remove("Host");ãã ãã§ãããã¨æå¾ ãã¦ãããã§ããã©ãoSession.oRequest.host ã®æ å ±ãæ¶ãã¦ãã¾ã£ã¦æ¥ç¶å ã®ãã¹ããããããªããªãã®ããVMnet1 ã®ã¢ããã¿ã® IP ã¢ãã¬ã¹ã«ã¤ãªãã«è¡ããã¨ãã¦ãããã¦è¬ãªæåã«ãªã£ã¦ãã¾ããã
追å ããè¡ã«ã¤ãã¦ã¯ã
ã«è¼ã£ã¦ãã x-overrideHost ã®èª¬æã®éãã§ã
Provide the Host:Port combination which should be used for DNS resolution purposes. Note that this mechanism does not change the HOST header on the request, and thus is not useful if there's an upstream gateway.
ã®ããã«ä½¿ãããããã®ã§ãããããããããè¨å®ãã¦ããã°æ¥ç¶å ãå¤ã«ãªããã¨ããªãã¿ããã§ãã
ã§ããã£ããç®çã®ãã¹ãã«å¯¾ãã¦ä½¿ã£ã¦ã¿ããã§ããã»ã»ã»Host: ããããåã£ã¦ã¿ã¦ã 400 Bad Request ã«ãªããªãããLocation: ã¯ã¡ããã¨ãã¡ã¤ã³åã§è¿ã£ã¦ããã
ã»ã»ã»ã¨ããã¨ããã§æ°ã¥ãã¾ãããä»åã®ãµã¤ã㯠HTTPS ã®ã¿é²è¦§ã許å¯ãã¦ãããã§ãããHTTPS ã®ãããã·ã¯æåã® CONNECT æã«ãã¹ãæ å ±ã渡ãã¦ãããããã以éã® Host: ã¯å¿ è¦ãªããã§ããã
ãã¡ãããããã·ã使ããªãå ´åã® HTTPS ã®è©³ç´°ãªï¼è©³ç´°ãããï¼è§£èª¬ã§ã
HTTPS ã®ãããã·ã使ã£ãå ´åã®ãªã¯ã¨ã¹ã㯠ãã®çãä¸ãããã«ãä»åãããããã¨ã¯ãããã·åã®æ¹ãããã¼ã«ããå®ç¾ã§ããªãã£ã¦ãã¨ã§ããã»ã»ã»ã
ãããã·åãä»å使ããªããã¨ãããã£ãã®ã§è©¦ãã¾ããã§ããããå¾è ã® URL ã§ç´¹ä»ããã¦ãã Achilles 㯠.exe ãèµ·åããã ããããã§ãããFoxyProxy ãããã使ãã°ãããã·ã®åãæ¿ãã¯ç°¡åã«ã§ããã®ã§ããã®è¾ºãä»åº¦ã¯è©¦ãã¦ã¿ããã§ããã
openssl
æ®æ®µç°¡åãªãªã¯ã¨ã¹ã㯠telnet ã®ææã¡ã§ãã£ã¦ãããã§ãããä»å㯠HTTPS ãµã¤ãã ãã telnet ææã¡ã¯ã§ããªãã»ã»ã»ãã¨ããªãã¦ãããèããã msysGit ã¨ä¸ç·ã« openssl.exe ãå ¥ã£ã¦ããã®ã§ãããããã£ã¦ã¿ã¾ããã
openssl s_client -connect www.example.com:443
ãã¨ã¯ telnet ã¨åãã§ã
GET / HTTP/1.0
ã¨ãããã° OK ã¨ããã£ã±ãç°¡åãªãªã¯ã¨ã¹ããªããããä¸çªç¢ºå®ã§ããã
curl
Fiddler ã®æ²ç¤ºæ¿ã«è¼ã£ã¦ããã®ã§ãã¤ãã§ã«ãã¡ãã試ãã¦ã¿ã¾ãããã¡ãªã¿ã« curl.exe 㯠msysGit ã«ãã¤ãã¦ããããGow ã«ãå ¥ã£ã¦ã¾ãã
curl -i -0 -H "Host:" https://www.example.com/
使ã£ã¦ããªãã·ã§ã³ã¯ãã®è¾ºãã
-i/--include Include protocol headers in the output (H/F) -0/--http1.0 Use HTTP 1.0 (H) -H/--header <line> Custom header to pass to server (H)
ã¨ãããã¨ã§ããã¡ããã¡ããã¨æå¾ éãã«åä½ãã¾ããã
ãã®ä»è©¦ãããã®
ã«ç¥ããªãã®ãããã¤ãè¼ã£ã¦ããã®ã§ãããã試ãã¦ã¿ã¾ããã
UrlParams (GETãã©ã¡ã¼ã¿ãPOSTãã©ã¡ã¼ã¿ãæ¸ãæãã¦åãªã¯ã¨ã¹ã)
https://addons.mozilla.org/ja/firefox/addon/1290
ãã£ã¡ã¯ãã©ã¡ã¼ã¿ä»¥å¤ã 㨠Referer ãããããæ¸ãæãã§ããªãã¿ããã§ããããçããããããããã«ã¯ä½¿ããªãæãã§ããã
Modify Headers (HTTPãªã¯ã¨ã¹ãããããæ¸ãæã)
https://addons.mozilla.org/ja/firefox/addon/967
å ã ã¢ãã¤ã«ç«¯æ«ã®ãªã¯ã¨ã¹ãã模å£ããããã®ãã®ã§ããã¹ã¦ã®ãªã¯ã¨ã¹ãã«å¯¾ãã¦æ±ºã¾ã£ããªã¯ã¨ã¹ããããã追å ï¼å¤æ´ï¼åé¤ã§ããããã§ãã
Host: ããããåããªããAction: FilterãName: Host ã®ããã«æå®ããã°ãããã§ããã©ãHTTP/1.0 ã¸ã®åãæ¿ãã¯å¥éå¿ è¦ã§ãããç®çãéããã¼ã«ãªã®ã§ã»ãã¥ãªãã£ã¾ããã®ä½æ¥ã«ã¯åãã¦ãªãããªã¨ã
ï¼2010-12-24 追è¨ï¼
ã¨ãããã®ãè¦ãããã®ã§è©¦ãã¾ããã
- Method ã¯ãã«ãã¦ã³ããé¸æããå½¢
- çã®ãããã¯æå®ã§ãããConent-TypeãAccept ã®ãããã®ã¿æå®ãå¯è½
ã¨ãããã¨ã§ããããã®æ¹ããå ¨è¬ã«ã¯åããªããã§ãã