$ ls -l /bin/pingLook Ma, no SUID! I've been using them all this time. :)
-rwxr-xr-x 1 root root 44104 Jun 18 17:37 /bin/ping
One thing escaped me, though: are capabilities set up at boot time (like sysctl), or are they stored on the filesystem, like the old SUID? Turns out they are indeed stored, as attributes:
$ lsattr /bin/pingErm, I mean, extended attributes:
-------------e-- /bin/ping
$ getfattr /bin/pingOops, getfattr(1) only displays user attributes by default. My bad:
$ getfattr -m '-' /bin/pingOops, getfattr only displays the list of attribute names by default. My bad:
# file: bin/ping
security.capability
$ getfattr -d -m '-' /bin/pingHuh. This kinda looks like base64, doesn't it? Ah, the manpage doesn't really say which encoding is chosen by default. Let's give this another try:
# file: bin/ping
security.capability=0sAQAAAgAgAAAAAAAAAAAAAAAAAAA=
$ getfattr -d -e hex -m '-' /bin/pingThere we go.
# file: bin/ping
security.capability=0x0100000200200000000000000000000000000000
No comments:
Post a Comment