Yes, if you can get access to the file where the passwords are stored, root access. In shadowed password files the actual encrypted string are stored in /etc/shadow which is 600(rw-------) only read/writable by root. Unlike the file /etc/passwd, which is 644(rw-r--r--) so that other programs and program users can access it inorder to gain certain operating privledges. In older systems with unshadowed password files by overflowing certain cervices you could gain acess to reading the /etc/passwd file by becoming the user 'webserver' or 'ftp' or the name of whichever systems daemon you were able to become by exploiting it.
There are a few examples of different ways to get access to the shadowed file using C programming functions
here .