HOME   ·Î±×ÀΠ  ȸ¿ø°¡ÀÔ
    
ȸ¿ø°¡ÀÔ
ºñ¹Ð¹øÈ£ ã±â ÀÚµ¿·Î±ä
ÀÌÀü°Ô½ÃÆÇ
   free_board
   °Ç°­°Ô½ÃÆÇ
   ¿À¶óŬDB
   Linux
   HTML/javascript
   Áú¹®°ú ´ä
È£¼­±â
   À̹ÌÁö°Ô½ÃÆÇ  
   °Ç°­°Ô½ÃÆÇ  
   À½¾ÇÀÚ·á  
   ¼ºÁØÀÌ °Ô½ÃÆÇ  
 Hit : 5358
 À̸§ : È£¼®  (220.¢½.198.142)
 ³¯Â¥ : 2007-06-18 21:28:53
 Á¦¸ñ : À¥¿¡¼­ ½Ã½ºÅÛÆÄÀÏ °ü¸®Çϱâ good
½© > ½ºÅ©¸³Æ® > suid > ¼ÂÀ¯¾ÆÀ̵ð

µµ¸ÞÀÎÀ» °ü¸®ÇÏ´Â FTP °èÁ¤ÀÌ myname À̶ó°í ÇÏ°í,±× °èÁ¤ ±Ç
Submitted by woonuk on È­, 2006/01/03 - 10:28pm.
µµ¸ÞÀÎÀ» °ü¸®ÇÏ´Â FTP °èÁ¤ÀÌ myname À̶ó°í ÇÏ°í,
±× °èÁ¤ ±ÇÇÑÀ¸·Î ¿øÇÏ´Â ÀÛ¾÷À» ÇÒ¼öÀÖ´Â ½©½ºÅ©¸³Æ®¸¦ mywork.sh ¶ó°í ¸¸µé°í,
ÀÌ°ÍÀ» °¨½Î´Â wrapper.c ¸¦ Çϳª ÀÛ¼ºÇÕ´Ï´Ù.

#define REAL_PATH "/home/user/bin/mywork.sh"
main(ac, av)
char **av;
{
execv(REAL_PATH, av);
}

gcc -o mywork wrapper.c
chown myname mywork.sh
chmod 4711 mywork

±×·±´ÙÀ½ php ¿¡¼­ exec(), system() µîÀ¸·Î È£ÃâÇÏ¸é µË´Ï´Ù.

½©½ºÅ©¸³Æ® ½ÇÇà½Ã¿¡ EUID°¡ »ç¶óÁö´Â ¹®Á¦ ¶§¹®¿¡ #!/bin/sh -p ÀÌ·¸°Ô -p ¿É¼ÇÀ» Ãß°¡ÇØ ÁÖ¾î¾ß ÇÏ´õ±º¿ä.

man bash Çغ¸¸é ¾Æ·¡ ³»¿ëÀÌ ÀÖ½À´Ï´Ù.
Àοë:If the shell is started with the effective user (group) id not equal to the real user (group) id, and the -p option is not supplied, no startup files are read, shell functions are not inherited from the environment, the SHELLOPTS variable, if it appears in the environment, is ignored, and the effective user id is set to the real user id. If the -p option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset.
È£¼® Áß¿ä ------------> #!/bin/sh -p ÀÌ·¸°Ô -p ¿É¼ÇÀ» Ãß°¡ÇØ ÁÖ¾î¾ß ÇÏ´õ±º¿ä. 07-07-26 14:43
211.¢½.74.31
°Ô½Ã¹° 121°Ç
¹øÈ£ ºÐ·ù Á¦¸ñ
À̸§
³¯Â¥ ÀÐÀ½
37 ÀÏ¹Ý      rsync »ç¿ëÇϱâ 2 È£¼® 06-08-02 5490
49 ÀÏ¹Ý   /dev/null 2>&1 ¿¡ ´ëÇؼ­ ¾Ë·ÁÁÖ¼¼¿ä È£¼® 07-03-03 5488
46 ÀÏ¹Ý   ÇѲ¨¹ø¿¡ È®ÀåÀÚ ¹Ù²Ù±â rename È£¼® 07-01-26 5480
26 ÀÏ¹Ý   APM ¿¬µ¿ httpd-2.0.55 mysql-5.0.18 php-4.4.2 (2) È£¼® 06-03-24 5467
66 ÀÏ¹Ý   JSP À¥¼­¹ö ¼ÂÆÃ, ¾ÆÆÄÄ¡ ÅèÄÏ - ÄÁ³ØÅÍ (2) È£¼® 07-12-23 5452
29 ÀÏ¹Ý   À¥ÇØÅ· ¸ðÀ½. È£¼® 06-04-14 5408
16 ÀÏ¹Ý   umaskÀÇ »ç¿ë È£¼® 05-12-01 5384
32 ÀÏ¹Ý   [apm¼³Ä¡]Apache, PHP, MySQL, LibXML Source Compile È£¼® 06-04-22 5377
89 ÀÏ¹Ý   ¼Ö¶ó¸®½º ¸í·É¾î ( ¼Ö¶ó¸®½º ¹öÁ¯ È®ÀÎ ) (1) È£¼® 09-03-23 5377
56 ÀÏ¹Ý   [GOOD] OIS 7 °èÃþ °ü·ÃÀÚ·á È£¼® 07-06-25 5368
43 ÀÏ¹Ý   ¸®´ª½º¿¡¼­ Çϵåµð½ºÅ© Ãß°¡ ¼³Ä¡Çϱâ HDD (1) È£¼® 06-12-14 5367
28 ÀÏ¹Ý   [¹æ¾î] prevent ÇÁ·Î±×·¥ ssh 5¹ø ÀÌ»ó½ÇÆнà ÀÚµ¿µî·Ï (1) È£¼® 06-03-29 5363
51 ÀÏ¹Ý   vi ¿¡¼­ Çѱ۱úÁú°æ¿ì 󸮹æ¹ý È£¼® 07-05-10 5363
17 ÀÏ¹Ý   Spamassassin ¼³Ä¡ ( spam ¸ÞÀÏ Â÷´Ü ) È£¼® 06-01-04 5359
¡æ ÀÏ¹Ý   À¥¿¡¼­ ½Ã½ºÅÛÆÄÀÏ °ü¸®Çϱâ good (1) È£¼® 07-06-18 5359
óÀ½ÀÌÀü  [1] [2] 3 [4] [5] [6] [7] [8] [9]  ´ÙÀ½¸Ç³¡
 
Copyright © zenos.pe.kr. All rights reserved.