TRACEã¡ã½ããã£ã¦æããã§ã
â»2013/01/24 add:
徳丸å
çã®æ¸ããã実はそんなに怖くないTRACEメソッド | 徳丸浩の日記ãå
ã«è¦ã¦ããããªã¹ã¹ã¡ãã¾ããæ·±ã追æ±ã§ãã¦ããªãã¾ã¾è¨äºã«ãã¦ãã¾ãç³ã訳ããã¾ããã
ã¿ã¤ãã«ã®éãã§ããHTTPã®ã¡ã½ããã«ã¯ããã使ããã®ã¨ãã¦GETãPOSTã¨ãããã®ãããã¾ãããTRACEã¡ã½ããã¨ãããã®ãããã¾ãã¦ããããæå¹ã«ãã¦ããã¨å±ãªããã¨ãã話ãã§ãã
TRACEã¡ã½ããã«ã¤ãã¦
ç¾èã¯ä¸è¦ã«ããããã©ããªæåããããè¦ã¦ããã¾ãããã
$ telnet example.org 80 Trying example.org... Connected to example.org. Escape character is '\^]'. TRACE / HTTP/1.1 #ãã㨠HOST: example.org #ãããæã§å ¥åãã¦ãã¨ã³ã¿ã¼ãã¼äºå
ãã®ããã«telnetã§80çªã«æ¥ç¶ããTRACEã¡ã½ãããçºè¡ãã¾ãããã¹ãåãªã©ã¯èªåã®ç°å¢ã«åããã¦å¤æ´ããã®ããããã¨ã
ããããã¨ãã¬ã¹ãã³ã¹ãè¿ã£ã¦ãã¾ãã ãã§ãããã®ä½ãæããã¨ããã¨ã
Escape character is '\^]'. TRACE / HTTP/1.1 HOST: example.org HTTP/1.1 200 OK Date: Fri, 25 Feb 2011 00:00:00 GMT Server: Apache/0.0.0 (Unix) mod\_ssl/0.0.0 OpenSSL/0.0.0 Content-Type: message/http TRACE / HTTP/1.1 #ãã㨠HOST: example.org #ããããã®ã¾ã¾ã¬ã¹ãã³ã¹ã¨ãã¦è¿ãããã
TRACEã¡ã½ãããæå¹ã ã¨ããã®ããã«ã¹ãã¼ã¿ã¹ã³ã¼ã200ãè¿ãããã®ãã¨ã«å
¥åããå
容ããã®ã¾ã¾è¿ããã¾ãã
ï¼â»ããã«ã¦ã§ã¢ã®ãã¼ã¸ã§ã³ãä¸é¨æ
å ±ãæ¹å¤ãã¦ãã¾ãï¼
ãããèªåã§å
¥åãã¦ããããã ã¯å¹³åã§ããããã©ã¦ã¶ã§ã¢ã¯ã»ã¹ããã¨ãã«TRACEã¡ã½ãããçºè¡ãããããã«ä»äººã«åãè¾¼ã¾ãã¦ãã¾ãã¨ã
ãã©ã¦ã¶ã§å
¥åããBASICèªè¨¼ã®ã¦ã¼ã¶åããã¹ã¯ã¼ããæ¼ãã¦ãã¾ãã¾ãã
Javascriptãæ¸ãã人ãªãåãããã¨æãã¾ãããGETãPOSTãç¹å®ã®URLã«å¯¾ãã¦é£ã°ãã®ã¯ç°¡åãªããã§ãTRACEã¡ã½ãããä»çµã¿ã¯å¤ããã¾ããã
BASICèªè¨¼ããããã¼ã¸ã§èªè¨¼ã®éã«ãã¨ãã«TRACEã¡ã½ãããçºè¡ããã¦ããã®çµæãç¹å®ã®ãµã¼ãã«éã£ããããã¡ã¤ã«ã¨ãã¦çæããããããªã¹ã¯ãªãããåãè¾¼ãã°ããããã§ãã¦ã¼ã¶æ å ±ãå ¥æã§ãã¦ãã¾ãã¾ããã»ãã·ã§ã³IDãªã©ãåå¾ã§ããã®ã§ãã»ãã·ã§ã³ãã¤ã¸ã£ãã¯ãªãããã§ãã¦ãã¾ãã¾ãã
TRACEã¡ã½ããã«å¯¾ãã対ç
ããã§å¯¾çãããªãã¨ãããªãããã§ãã対çã®æ¹æ³ã¯apacheã®ãã¼ã¸ã§ã³ã«ãã£ã¦éãã®ã§ããã2.2ããã ã¨TraceEnableãã£ã¬ã¯ãã£ãã§è¨å®ã§ããã®ã§ã
TraceEnable Off
ã¨httpd.confã«æ¸ãã¦åèµ·åããã¾ãããã å°ãå¤ãã®ãã¼ã¸ã§ã³ã§ããã°ã
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} ^TRACE RewriteRule ^.*$ - [F] </IfModule\>
ã¨ãã¦ãrewriteããã¦ãã¾ãã®ãããã§ãããã
çµããã«
ç°¡åã«TRACEã¡ã½ããã«ã¤ãã¦æ¸ãã¦ã¿ã¾ãããããããæ¬ã§ã»ãã·ã§ã³ãã¤ã¸ã£ãã¯ã¨ãã¹ã¯ãªããåãè¾¼ã¿ã¨ãããã¦ãã
ããããã®ã£ã¦èªåã§è¦ã¦ã¿ãªãã¨ãã£ã±åãããªãæ°ããã¾ãã
èªåã¯æåTRACEã¡ã½ããã«ã¤ãã¦ç¥ããªãã¦ãtelnetã§çºè¡ãããã¨ãã«ããã®ã¾ã¾æã£ãå
容ãè¿ã£ã¦ãã¦ã
ãã®ã¾ã¾çµæè¿ã£ã¡ããããããè¦ããããæããã¨æã£ãéå»ãããã¾ãã
ãªã®ã§ãã¨ããããèªåã®ç°å¢ã§è©¦ãã¦ãå¿
è¦ã ã£ããBASICèªè¨¼ã¨ãããã£ã¦ã¿ã¦ãä»å¾ã¯å¿
ããã§ãã¯ãã¦å¿ããªãããã«ã¨æããã¨ãéè¦ãªã®ã ã¨æãã¾ãã
ï¼ããã§ãã絶対å¿ããã¨ãããããæãâ¦