December 2017
Intermediate to advanced
410 pages
11h 5m
English
Let's look into the permission associated with the ping command:
ls -l /bin/ping-rwsr-xr-x 1 root root 44168 May 8 2014 /bin/ping
In the preceding permission set, we see that the owner and the group of the /bin/ping file are both root and root. The permission in the user field is rws, which basically denotes that the SUID bit is set on this particular binary file. This essentially means that whenever an ordinary user runs this binary file, the file will inherit the permission of the owner of the file and not of the user executing it.
In order to demonstrate this, let's run the ping command as an ordinary user:
zeal@kplabs:~$ ping kplabs.inPING kplabs.in (139.162.21.95) 56(84) bytes of data ...
Read now
Unlock full access