HOME   ·Î±×ÀΠ  ȸ¿ø°¡ÀÔ
    
ȸ¿ø°¡ÀÔ
ºñ¹Ð¹øÈ£ ã±â ÀÚµ¿·Î±ä
ÀÌÀü°Ô½ÃÆÇ
   free_board
   °Ç°­°Ô½ÃÆÇ
   ¿À¶óŬDB
   Linux
   HTML/javascript
   Áú¹®°ú ´ä
È£¼­±â
   À̹ÌÁö°Ô½ÃÆÇ  
   °Ç°­°Ô½ÃÆÇ  
   À½¾ÇÀÚ·á  
   ¼ºÁØÀÌ °Ô½ÃÆÇ  
 Hit : 5356
 À̸§ : È£¼®  (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°Ç
¹øÈ£ ºÐ·ù Á¦¸ñ
À̸§
³¯Â¥ ÀÐÀ½
40 ÀÏ¹Ý   iptables ·Î °£´ÜÇÑ ¹æÈ­º®À» ±¸ÃàÇÏÀÚ (1) È£¼® 06-09-16 5109
41 ÀÏ¹Ý   xhost »ç¿ëÇϱâ È£¼® 06-10-24 5619
42 ÀÏ¹Ý   ¼Ö¶ó¸®½º ½Ã½ºÅÛ Á¤º¸ ¸í·É¾î Á¤¸® È£¼® 06-12-10 4315
43 ÀÏ¹Ý   ¸®´ª½º¿¡¼­ Çϵåµð½ºÅ© Ãß°¡ ¼³Ä¡Çϱâ HDD (1) È£¼® 06-12-14 5364
44 ÀÏ¹Ý   ¸®´ª½º - Çϵåµð½ºÅ© Ãß°¡, ÆÄƼ¼Ç ¹× ¸¶¿îÆ® È£¼® 06-12-14 4733
45 ÀÏ¹Ý   DL 360 ¿¡´Ù ¸®´ª½º ¼³Ä¡Çϴµ¥ scsi Çϵåµð½ºÅ©¸¦ ÀâÁö ¸øÇÒ¶§ È£¼® 06-12-27 6246
46 ÀÏ¹Ý   ÇѲ¨¹ø¿¡ È®ÀåÀÚ ¹Ù²Ù±â rename È£¼® 07-01-26 5479
47 ÀÏ¹Ý   crontab (cronµ¥¸óÁ¦¾îÆÄÀÏ) Linux È£¼® 07-02-20 5569
48 ÀÏ¹Ý   ¸®´ª½º »ó¿¡¼­ ÆÄÀϸí ÀÏ°ýº¯È¯ ( rename ) good È£¼® 07-02-22 5504
49 ÀÏ¹Ý   /dev/null 2>&1 ¿¡ ´ëÇؼ­ ¾Ë·ÁÁÖ¼¼¿ä È£¼® 07-03-03 5488
50 ÀÏ¹Ý   »ý¼ºµÈÁö ?? ÀÏÁö³­ ÆÄÀÏ »èÁ¦ Çϱâ È£¼® 07-04-03 5646
51 ÀÏ¹Ý   vi ¿¡¼­ Çѱ۱úÁú°æ¿ì 󸮹æ¹ý È£¼® 07-05-10 5362
52 ÀÏ¹Ý   À¥2.0 ½Ã´ë¿¡ ¿ÀǼҽºÀÇ Àαâ¼øÀ§¼ø 10 °³ È£¼® 07-05-16 5543
¡æ ÀÏ¹Ý   À¥¿¡¼­ ½Ã½ºÅÛÆÄÀÏ °ü¸®Çϱâ good (1) È£¼® 07-06-18 5357
54 ÀÏ¹Ý   ssh ·Î±×ÀÎ ¾øÀÌ ÀÚµ¿À¸·Î Á¢¼ÓÇÏ´Â ¹æ¹ý (4) È£¼® 07-06-18 5852
óÀ½ÀÌÀü  [1] [2] [3] 4 [5] [6] [7] [8] [9]  ´ÙÀ½¸Ç³¡
 
Copyright © zenos.pe.kr. All rights reserved.