cgi Å×½ºÆ®Çغ¸±â |
±Û ¾´ ÀÌ |
linux |
³¯ Â¥ |
2002³â 11¿ù 14ÀÏ 00½Ã 26ºÐ 05ÃÊ |
º» ¹® |
CGI ½ÃÇèÇØ º¸±â
ÀÏ¹Ý »ç¿ëÀÚÀÇ CGI »ç¿ëÀÌ °¡´ÉÇÑÁö °£´ÜÇÑ Å×½ºÆ®¸¦ À§ÇÏ¿© ÀÚ½ÅÀÇ È¨µð·ºÅ丮 ¾Æ·¡¿¡ public_html À̶ó´Â µð·ºÅ丮¸¦ ¸¸µç ÈÄ Æ۹̼ÇÀ» 755 µîÀ¸·Î ¼³Á¤ÇÏ¿© ÁÝ´Ï´Ù. ±×¸®°í °£´ÜÇÑ ½© ½ºÅ©¸³Æ® CGI ¸¦ ¸¸µì´Ï´Ù.
[ prdd@paran public_html]$ cat > listfiles.cgi << EOF
>#!/bin/sh
>echo "Content-Type: text/html; charset=euc-kr"
>echo "Content-Transfer-Encoding: 8bit"
>echo ""
>echo "
"
>ls -l /etc/
>echo "
"
>EOF
½©À» ÀÌ¿ëÇÑ °£´ÜÇÑ ½ºÅ©¸³Æ®¸¦ ¸¸µé¾ú½À´Ï´Ù. ÀÌ´Â /etc µð·ºÅ丮¸¦ º¸¿©ÁÖ´Â CGI ÀÔ´Ï´Ù. CGI ¸¦ ½ÇÇàÇϱâ À§Çؼ Æ۹̼ÇÀ» Á¶ÀýÇÕ´Ï´Ù. 755 ·Î Á¤µµ·Î ¸¸µé¾î º¼±î¿ä?
[ prdd@paran public_html]# chmod 755 listfiles.cgi
ÆÛ¹Ì¼Ç Á¶ÀýÀÌ ³¡³µ½À´Ï´Ù.
CGI ½ÇÇà°ú ·Î±×È®ÀÎ
À¥ºê¶ó¿ìÀú¿¡¼ http://ÀÚ½ÅÀÇ IP Address/~prdd(ÀÚ±â À¯Àú)/listfiles.cgi À» Á¤È®ÇÏ°Ô ³Ö½À´Ï´Ù. ±×·³ /etc µð·ºÅ丮¸¦ º¸¿©ÁÙ °ÍÀÔ´Ï´Ù. Àß º¸À̳ª¿ä? ¸¸ÀÏ Á¤È®ÇÏ°Ô º¸¿©ÁöÁö ¾Ê´Â´Ù¸é ¾ÆÆÄÄ¡ ·Î±×¸¦ º¸µµ·Ï ÇÕ´Ï´Ù. ·Î±×´Â /var/log/httpd ¿¡ Àִµ¥ º¸¾Æ¾ß ÇÒ ·Î±×´Â error_log ¿Í suexec_log ÀÔ´Ï´Ù. ¸¸¾à Æ۹̼ÇÀÌ À߸øµÇ¾î ÀÖ´Ù¸é ´ÙÀ½°ú °°Àº ·Î±×°¡ suexec_log ¿¡ ³²½À´Ï´Ù.
[2001-08-16 21:36:42]: error: file is writable by others: (/home/prdd/public_html/listfiles.cgi)
±×¸®°í cgi ³»¿¡ Çì´õ Á¤º¸°¡ À߸øµÇ¾î ÀÖ´Ù¸é error_log ¿¡ ¾Æ·¡¿Í °°Àº ·Î±×°¡ ³²½À´Ï´Ù.
[Thu Aug 16 21:49:51 2001] [error] [client 210.205.137.156] malformed header from script. Bad header=total 2412: /home/prdd/public_html/listfiles.cgi
·Î±×¸¦ º¸¸é ¿Ö Á¤È®ÇÑ °á°ú°¡ ³ª¿ÀÁö ¾Ê´ÂÁö ±× ¿øÀÎÀ» ÆľÇÇÒ ¼ö ÀÖ½À´Ï´Ù. ±×·¸´Ù¸é ÇØ°áÇϱ⵵ ½±°ÚÁÒ?
·Î±×¸¦ º¸´Â ½À°üÀ» µéÀ̵µ·Ï ÇսôÙ. :) |
|
|
|