DevOps

Wednesday, 13 October 2010

setuid

bash-3.00# chmod u+s /usr/sbin/format
bash-3.00# ls -l /usr/sbin/format
-r-sr-xr-x   1 root     bin       191940 Sep 14  2009 /usr/sbin/format

bash-3.00# ls -l /usr/sbin/format
-r-sr-xr-x   1 root     bin       191940 Sep 14  2009 /usr/sbin/format
bash-3.00# telnet 0
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
login: murali
Password:
Last login: Wed Oct 13 14:33:09 from localhost
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
-bash-3.00$ /usr/sbin/format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0d0 <DEFAULT cyl 2085 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c2t0d0 <DEFAULT cyl 4092 alt 2 hd 128 sec 32>
          /pci@0,0/pci15ad,1976@10/sd@0,0
       2. c2t1d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@1,0
       3. c2t2d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@2,0
       4. c2t3d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@3,0
       5. c2t4d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@4,0
Specify disk (enter its number):
Root User

bash-3.00# chmod u-s /usr/sbin/format
bash-3.00# ls -l /usr/sbin/format
-r-xr-xr-x   1 root     bin       191940 Sep 14  2009 /usr/sbin/format

Normal user

-bash-3.00$ format
-bash: format: command not found






No comments:

Post a Comment