Tuesday, December 16, 2003

Re: nmap etc.

I couldn't actually see what the site does as I am behind a firewall. But I suppose it's just a regular port scanner similar to nmap.

About sudo. There's a file /etc/sudoers wherein are listed the super users for the system. One of them, obviously, is root. If you want to convert a normal user to a super user, you add an entry corresponding to his login to the file. Now whenever that user runs a command sudo , the system asks you for YOUR passwd. The command is then run with root previliges. Once you 'sudo', the system remembers the authentication for a few minutes, during which time you needn't enter the passwd for further sudo's.

This brings me to another useful (although potentially dangerous) feature - the suid bit. The set user id bit or the suid bit is a permission given to an executable file by the owner of the file, which allows the file to be executed as if the owner is executing it (with the previliges of the owner). So, a file with the suid bit on owned by root would execute with root previliges when it's run by a normal user. ls -l would show the last alphabet of the permissions to be 's'. While this feature is obviously useful in circumstances where root previliges are required, the file which is suid root has to be robust. Any vulnerabilities in the program could result in obtaining a root shell by buffer overflow or any other means. So suid root programs are strongly discouraged.

More on perms later...

No comments: