home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!cs.utexas.edu!rutgers!ub!acsu.buffalo.edu!jcmurphy
- From: jcmurphy@acsu.buffalo.edu (Jeff Murphy)
- Newsgroups: alt.hackers
- Subject: Re: cracking login?
- Message-ID: <By6Ho1.C4J@acsu.buffalo.edu>
- Date: 23 Nov 92 16:55:10 GMT
- References: <1eorh6INN684@dixie.cs.ubc.ca>
- Sender: nntp@acsu.buffalo.edu
- Organization: UB
- Lines: 48
- Approved: by me.
- Nntp-Posting-Host: vodalus.acsu.buffalo.edu
-
- In article <1eorh6INN684@dixie.cs.ubc.ca> hassan@cs.ubc.ca (Moustafa Hassan) writes:
- >I've thought of a scheme for logging in as any user in a given file system.
- >The only problem is that it's too easy. I must be under some illusion.
- >I'd appreciate it if someone pointed out the flaw in my algorithm:
- >
- >1. Obtain the code for login.c. I've done this. I'm having some trouble
-
- the code is trivial, and therein lies the flaw.
-
- >3. Remove the encryption step where the password is encrypted.
-
- doesn't matter. the password really has nothing to do with
- changing to another user.
-
- >5. When executing login, give it (the publically available) user id and
- > encrypted password of any user on the system, and you're in.
-
- this is what login does:
- read username
- read password
- encrypt password
- compare encrypted password to encrypted version on file
- if they are equal, setuid to uid of username
- and setgid to gid of username and start a shell
- else quit.
-
- so what *you* are actually doing is:
-
- setgid to gid of user
- setuid to uid of user
- start shell
-
- unfortunately, the flaw in this is that the only the superuser
- can change uid and gid arbitrarily, so you will notice that the
- login program has permissions set like this:
-
- -rwsr-xr-x root ..... login
-
- the "s" on the owner field means that when login is executed it
- runs as a root process with root privs, so your login program will
- run as your process with your privs, and since you dont have root
- privs, you can setgid and setuid. to sum up: your hack will fail.
-
- hope this clears things up for you.
-
- .
- .
- Jm..
-