¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 111°Ç
   
Proxy¸¦ °æÀ¯ÇÏ´Â Real IP È®ÀÎ - HTTP_X_FORWARDED_FOR
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2009-12-08 (È­) 22:40 Á¶È¸ : 36998
±ÛÁÖ¼Ò :
                             

ÇÁ¶ô½Ã¸¦ ÅëÇؼ­ À¥¼­¹ö¸¦ Á¢±ÙÇÏ°Ô µÇ¸é ½Ã½ºÅÛ³» ¾ÆÆÄÄ¡·Î±×¿¡´Â ÇÁ¶ô½Ã¾ÆÀÌÇÇ°¡ ÂïÈ÷°Ô µÈ´Ù...ÀÌ·²°æ¿ì ½ÇÁ¦ ¸®¾ó¾ÆÀÌÇǸ¦ È®ÀÎÇϱâÀ§ÇÑ ¹æ¹ýÀº... HTTP_X_FORWARDED_FOR ȯ°æº¯¼ö¸¦ »ç¿ë!!
 
½ÇÁ¦·Î HTTP Çì´õ¿¡´Â ¼­ºñ½º¿äû½Ã¿¡ Çì´õºÎºÐ¿¡ Ŭ¶óÀ̾ðÆ®ÀÇ IP¸¦ Æ÷ÇÔÇÏ°Ô µÇ´Âµ¥ À̶§ ¼­ºñ½º¸¦ ¿äûÇϴ Ŭ¶óÀ̾ðÆ®°¡ º¸³»´Â ÆÐŶÀÇ Çì´õ¸¦ °Ë»çÇϸé IP¸¦ ¿ªÃßÀûÀÌ °¡´ÉÇÏ´Ù..
 
Çì´õÀÇ X-Forwarded-For : IP ºÎºÐ¿¡ ³ª¿À´Â ¾ÆÀÌÇÇ°¡ ½ÇÁ¦ ¸®¾ó¾ÆÀÌÇÇ!!

ÆÐŶĸó(tcpdump)

17:45:42.048773 IP xxx.xxx.xxx.xxx.8932 > 218.236.115.222.80: P 3605509893:3605510720(827) ack 1557948306 win 170 <nop,nop,timestamp 675799409 1767044308>
E..o.f@.6...t}."..s."..P....\.g............
(G.qiR..GET /js/wrest.gif HTTP/1.0
Accept: */*
Referer: http://board.mojily.com/
Accept-Language: ko
UA-CPU: x86
Accept-Encoding: gzip, deflate
If-Modified-Since: Tue, 20 Feb 2007 01:20:48 GMT
If-None-Match: "9f38c-33-45da4cf0"
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)
Host: board.mojily.com
Cookie: f33d2ed86bd82d4c22123c9da444d8ab=MTIyNTk1Njk4NA%3D%3D; 2a0d2363701f23f8a75028924a3af643=MTE2LjEyNS4yOC4zNA%3D%3D; 96b28b766b7e0699aa91c9ff3d890663=aHR0cDovL2JvYXJkLm1vamlseS5jb20v; PHPSESSID=d3c0e000a9b2acdf8a6443dbb59426e1
Via: 1.1 proxy.smileserv.com:80 (squid)
X-Forwarded-For: 220.90.215.4
Cache-Control: max-age=259200
Connection: keep-alive

»ùÇÃ ÆÄÀÏ

<?
if ($HTTP_X_FORWARDED_FOR)
{
        echo "ÇöÀç Proxy Server »ç¿ëÁßÀ̳׿ä;;;<br>";
        echo "Proxy IP : $REMOTE_ADDR<BR>";
        echo "Real IP : $HTTP_X_FORWARDED_FOR<BR>";
}
else    {
        echo "ÇöÀç Proxy Server ¹Ì»ç¿ëÁß";
        echo "Real IP : $REMOTE_ADDR <BR>";
}
?>





ASPÀÇ °æ¿ì
asp °æ¿ì¿¡µµ ¸¶Âù°¡Áö·Î HTTP_X_FORWARDED_FOR °ªÀ¸·Î µ¿ÀÏÇÏ°Ô °ªÀ» ¹Þ½À´Ï´Ù. ¾Õ¿¡ $ ºÙ°í ¾ÊºÙ°í Â÷ÀÌ Á¤µµ ^^
±×¸®°í HTTP_CLIENT_IP ·Îµµ Á¢¼ÓÀÚÀÇ ½ÇÁ¦ ¾ÆÀÌÇǸ¦ Ãâ·ÂÇÕ´Ï´Ù.

 




 
 
ÇÁ·Ï½Ã - Proxy ´Â Å©·¡Ä¿¸¦ ÁöÄÑÁÖÁö ¸øÇÑ´Ù.  
 
ÀÎÅÍ³Ý »ó¿¡¼­ µ¥ÀÌÅ͸¦ Àü¼ÛÇÒ ¶§ ²À ÇÊ¿äÇÑ °Í Áß¿¡ Çϳª°¡ IP Address ÀÌ´Ù.
³×Æ®¿öÅ© »ó¿¡¼­ IP ´Â ÀÚ½ÅÀÇ °íÀ¯ ÁÖ¼Ò·Î½á µ¥ÀÌÅ͸¦ ¼Û/¼ö½ÅÇÒ ¶§ ²À ÇÊ¿äÇÑ
°Í Áß¿¡ ÇϳªÀÌ´Ù.

º»·¡ Proxy ´Â ³×Æ®¿öÅ©ÀÇ Áß°£¿¡ ¼³Ä¡ÇÔÀ¸·Î½á Cache µîÀÇ ±â´ÉÀ» È°¿ëÇÏ¿©
³×Æ®¿öÅ© Æ®·¡ÇÈÀ» ÁÙÀ̰ųª ÀÚ¿øÀÇ Àý¾àÀ» À§Çؼ­ »ç¿ëµÇ¾úÀ¸³ª ±Ù·¡¿¡ µé¾î¼­
±× ¿ëµµ°¡ ¸¹ÀÌ º¯ÁúµÇ¾ú´Ù.

Proxy ¶ó ÇÔÀº ÁÖ·Î Web Proxy ¸¦ ¸¹ÀÌ ¶æÇϴµ¥, Web Proxy ¸¦ ÀÌ¿ëÇÏ¿© ÀÎÅͳÝÀ»
»ç¿ëÇÒ °æ¿ì ÀÚ½ÅÀÇ IP ¸¦ ³ëÃâ½ÃÅ°Áö ¾Ê°í Proxy Server ÀÇ IP ¸¦ ÀÌ¿ëÇÑ´Ù´Â
Á¡¿¡¼­, »ç¿ëÀÚÀÇ ÇÁ¶óÀ̹ö½Ã¸¦ Áöų ¼ö ÀÖ´Ù´Â °Í¿¡ ¸¹Àº »ç¶÷µéÀÌ ¾Ö¿ëÇÏ°í ÀÖ´Ù.

±×·¯³ª ƯÁ¤ ºÎ·ùÀÇ °æ¿ì Proxy ¸¦ ÀÌ¿ëÇÏ¿© ¾Ç¼º ¸®ÇÃÀ» ³²±â°Å³ª, ºÒ¹ýÀûÀÎ
ÇàÀ§¸¦ ÇÏ´Â °æ¿ì°¡ Àִµ¥, Proxy ÀÇ ÀÍ¸í¼ºÀ» ÀÌ¿ëÇÏ¿© ÀÌ·¯ÇÑ ÇൿÀ» ÇÑ´Ù¸é
ÀÌ´Â À߸øµÈ »ý°¢ÀÌ´Ù. Proxy ´Â »ç¿ëÀÚ¸¦ ÁöÄÑÁÖ±â À§ÇØ °³¹ßµÈ °ÍÀÌ ¾Æ´Ï´Ù.

ÀÌ ±ÛÀº Proxy ÀÇ ÀÍ¸í¼ºÀ» ÀÌ¿ëÇÏ¿© ÀÎÅͳݿ¡¼­ ¾ÇÀÇÀûÀÎ ÇൿÀ» ÇÏ´Â
»ç¶÷µéÀ» ´ë»óÀ¸·Î ¾µ °ÍÀÌ´Ù.

Proxy ¼­ºñ½º¸¦ Á¦°øÇØÁÖ´Â A ¶ó´Â Proxy ¼­¹ö°¡ ÀÖ´Ù°í °¡Á¤ÇÏÀÚ. B ¶ó´Â »ç¿ëÀÚ´Â
A Proxy ¼­¹ö¸¦ ÀÌ¿ëÇÏ¿© C »çÀÌÆ®¿¡ ¿¬°áÇÒ °ÍÀÌ´Ù. B ´Â ÀÎÅÍ³Ý ÀͽºÇ÷ξîÀÇ
Proxy °ü·Ã ¼³Á¤À¸·Î A Proxy ¸¦ ÁöÁ¤ÇÏ¿´´Ù. ÀÌ·² °æ¿ì B »ç¿ëÀÚ´Â C »çÀÌÆ®¿¡ ¿¬°á
ÇÒ ¶§ ´ÙÀ½°ú °°Àº °æ·Î¸¦ °ÅÄ¡°Ô µÈ´Ù. (Áß°£ÀÇ Network °æ·Î´Â »ý·«ÇÏ¿´´Ù.)

B (»ç¿ëÀÚ) -> A (Proxy Server) -> C (À¥ »çÀÌÆ®)

º¸±â¿¡, B »ç¿ëÀÚ´Â A Proxy ¼­¹ö¸¦ °ÅÃļ­ C ¿¡ °¡±â ¶§¹®¿¡, C »çÀÌÆ®´Â B »ç¿ëÀÚÀÇ
ÁÖ¼Ò¸¦ ¸ð¸¦ °Íó·³ º¸ÀδÙ. ÀÌ °ÍÀÌ Proxy ¼­¹ö°¡ »ç¿ëÀÚÀÇ ÀÍ¸í¼ºÀ» ÁöÄÑÁشٰí
»ý°¢ÇÑ´Ù. ÇÏÁö¸¸ ½ÇÁ¦·Î´Â ±×·¸Áö ¾Ê´Ù.

Proxy ¼­¹ö°¡ C »çÀÌÆ®¿¡ Web Contents ¸¦ ¿äûÇÒ ¶§, ¿©·¯ °¡Áö Çì´õ¸¦ ³Ñ±â°Ô
µÇ´Âµ¥, ÀÌ ¶§ Proxy ¸¦ ÀÌ¿ëÇÏ´Â ¿ø·¡ »ç¿ëÀÚÀÇ IP µµ °°ÀÌ ³Ñ°ÜÁֱ⠶§¹®ÀÌ´Ù.
¿©±â¼­ A Proxy ¼­¹ö´Â C »çÀÌÆ®¿¡ Web ¿äûÀ» º¸³¾ ¶§, B »ç¿ëÀÚÀÇ IP Á¤º¸µµ
°°ÀÌ ³Ñ°ÜÁÖ°Ô µÇ´Âµ¥, ±× ¸Þ¼Òµå´Â "X-Forwarded-For" ÀÌ´Ù.

Apache À¥ ¼­¹ö¸¦ ´ë»óÀ¸·Î ¼³¸íÇÏÀÚ¸é, Apache À¥ ¼­¹ö´Â Request ÀÇ Çì´õ Áß¿¡
X-Forwarded-For ¶ó´Â °ÍÀÌ ÀÖ´Ù¸é ÀÌ °ÍÀ» ȯ°æ º¯¼ö¿¡ ÀúÀåÇÑ´Ù. Áï, C »çÀÌÆ®´Â
A Proxy ¼­¹ö¸¦ ÀÌ¿ëÇÏ´Â B »ç¿ëÀÚÀÇ IP ÁÖ¼Òµµ ¾Ë ¼ö ÀÖ´Ù´Â À̾߱Ⱑ µÈ´Ù.

¿©±â¼­´Â À¥ »çÀÌÆ®¿¡ Á¢¼ÓÇÑ »ç¿ëÀÚ°¡ Proxy ¼­¹ö¸¦ ÀÌ¿ëÇÏ¿© µé¾î¿Ô´ÂÁö ¾Ë¾Æ
³»´Â ¹æ¹ýÀ» PHP ¸¦ ´ë»óÀ¸·Î ¼³¸íÇغ¸°Ú´Ù. PHP ¿¡¼­´Â Apache À¥ ¼­¹ö¿¡¼­ ÀúÀåÇÑ
ȯ°æ º¯¼ö¸¦ »ó¼Ó¹Þ¾Æ PHP ÀÇ È¯°æ º¯¼ö·Î ´Ù½Ã ÀúÀåÇϴµ¥, Proxy °¡ º¸³»¿Â
Çì´õÀÇ Á¤º¸ Áß "X-Forwarded-For" ´Â, PHP ¿¡¼­ $HTTP_X_FORWARDED_FOR º¯¼ö¿¡
´ã±â°Ô µÈ´Ù.


¸¸¾à ¼­¹ö °ü¸®ÀÚÀÇ ÀÔÀåÀ¸·Î½á, Proxy ¼­¹ö¸¦ ÀÌ¿ëÇÏ´Â »ç¶÷µéÀ» ¸·°í ½Í´Ù¸é
HTTP_X_FORWARDED_FOR ȯ°æ º¯¼ö¸¦ üũÇÔÀ¸·Î ÀÌ¿ëÇÒ ¼ö ÀÖÀ» °ÍÀÌ´Ù. ±×·¯³ª
¿©±â¼­ ÇÑ°¡Áö ÁÖÀÇÇØ¾ß ÇÒ Á¡Àº, ȸ»ç³ª Çб³ µî¿¡¼­´Â ³»ºÎ IP ¸¦ »ç¿ëÇÏ´Â
°æ¿ì°¡ °¡²û Á¸ÀçÇϴµ¥, ÀÌ·² °æ¿ì ¿ÜºÎ·Î ³ª°¡´Â ÆÐŶÀº Áý´Ü ³»¿¡ Á¸ÀçÇÏ´Â
Proxy ¼­¹ö¸¦ ÅëÇؼ­ ³ª°¡°Ô µÇ´Â °æ¿ì°¡ ÀÖ´Ù.

ÀÌ·² °æ¿ì¿¡, HTTP_X_FORWARDED_FOR ȯ°æ º¯¼ö°¡ Á¸ÀçÇÑ´Ù°í ¹«Á¶°Ç »ç¿ëÀÚÀÇ
Á¢±ÙÀ» Â÷´ÜÇÏ´Â ¹æ¹ýÀ» ÀÌ¿ëÇؼ­´Â ¾ÈµÇ°í, Original IP °¡ °¡»ó IP ¿¡¼­¸¸
Á¸ÀçÇÒ ¼ö ÀÖ´Â °ÍÀÎÁö È®ÀÎÀ» ÇÑ ÈÄ Ã³¸®¸¦ ÇؾßÇÒ °ÍÀÌ´Ù. ¿¹¸¦ µé¾î Original
IP °¡ "192.168.0.100" À̶ó¸é °¡»ó IP ÀÌ´Ù. 

 


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.