home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / unixhkck.hac < prev    next >
Encoding:
Text File  |  2003-06-11  |  6.3 KB  |  145 lines

  1. Unix-Hacker 90'
  2. Brought to you by: Ar-Kane 
  3. Finished on: June 26, 1990
  4. Based on a program by: Shooting Shark
  5. --------------------------------------------------------------------------------
  6.  
  7. Hello all, Unix-Hacker 90', was something I came up with after seeing Shooting
  8. Shark's original "Discreet Unix Hacker" that came out in 1986, and appeared in
  9. the second LOD/H Technical Journal.  So, if there was already a Unix hacker 
  10. out for so long why did I bother to write this one?  Well, first of all this
  11. was hacked(in the programmers sense) up from Shooting Sharks original file, and
  12. a few sections of code are the excat same thing.  However his program seemed
  13. to break on many of the new cc compiler version.  This has been fixed.
  14. However mine is very different in the way it goes about hacking the passwords
  15. on his, you entered the name of the person you wanted to hack, it retrived
  16. that persons encrypted password and then proceeded to hack the password
  17. by trying to match the password with encryptions of words stored in a file
  18. (usually you would use /usr/dict/words which is usually around 200k of pure words).  Mine is the same in that it uses a pool of words taken from a file, the difference in mine is that you enter the persons encrypted password instead of
  19. thier user name(the encrypted password is easily gotten by the user, as it is
  20. the second field in the /etc/passwd file).  Why? you might ask again, did I do
  21. this? why not input the name and let the program do the work? Well this was my
  22. main reason for writting and releasing this program.  The reason I did this is for network hackers out there(and most unix hackers are net hackers).
  23. I have come across many situations where I was able to tftp or ftp to a site
  24. and get ahold of a partial or full /etc/passwd file, but none of the passwords
  25. were null, so I had no way of getting online to use Shooting Sharks hacker!
  26. My version makes this possible as you can run it on any system, so long as you know the encrypted password you need, mine may be a bit less easy to understand to novice hackers who dont understand /etc/passwd, the crypt() function, etc(which is the basis of both hackers).  But they can always use his hacker until they are more skilled, I guess...well I do ramble, dont I? Well I guess I should include a short section that covers usage so here goes...
  27.  
  28. USAGE
  29. -----
  30.  
  31. This hacker can be run from any unix system(that I have tried, and I see
  32. no reason why it wouldnt run on any others) and will compile under
  33. all cc compilers ive tried(I recommend gcc, the gnu cc compiler but its not needed)
  34.  
  35. To compile:
  36. either type(% is a simulated prompt, do not enter it!):
  37.  
  38. % cc filename.c
  39. (It will then compile the filename(Which can be any 'filename' but MUST end with a .c on almost every compiler) and output it as 'a.out' which can then be 'mv' moved into any file name.)
  40. or
  41. % cc filename.c -o output
  42. (This will , on every compiler ive seen, compile filename(which must end in .c as stated before) into file "output" which is alot easier than running two commands(cc and mv) I only included the first for users that might be running some weird compiler without -o (output) option, which every compiler ive seen uses.
  43.  
  44. Well once you have it compiled there are many ways to run/use it, the general format is:
  45. 'commandname' encrypted-password wordfile
  46.    ^^^            ^^^^^^^^^         ^^^
  47. The Name       The encrypted pw   The file containing the
  48. that you gave  found as 2nd       words you want to try to
  49. the hacker.    field in           match with the password.
  50.                /etc/passwd
  51.  
  52. Of course, if you just type the commandname with no other options it will
  53. give you a usage message that tells you this
  54.  
  55. Ways to use this:
  56.  
  57. In all examples I will assume the commandname to be 'hack', the encrypted pswd
  58. to be 'passwd1' and the wordfile to be '/usr/dict/words'
  59.  
  60. 1) To just run this program the basic way(non-multitasking, output to the terminal):
  61. % hack passwd1 /usr/dict/words
  62. (% is the prompt, as said before)
  63.  
  64. 2) To run it in back ground mode, so that you can run other stuff too, but to show output to the terminal:
  65. % hack passwd1 /usr/dict/words &
  66.  
  67. 3) To run it in non-multitasking, and send the output to a text file:
  68. % hack passwd1 /usr/dict/words > filename
  69. (where 'filename' is the name of the output text file)
  70.  
  71. 4) And combining these, you get multitasking, and sending the output to a file
  72. % hack passwd1 /usr/dict/words > filename &
  73.  
  74. However, I am certain that if you're using this hacker , you are probably familiar with redirection and using & to run background jobs.
  75. You can also use the "nohup" command to run this file, and make it so it will run even if you hangup(acctually modern-csh shells are usually nohup anyways on commands that you put in the background). I realy cannot think of anything else
  76. that you will need to know to run this, if you need to contact me, do so by
  77. emailing me as "Ar-Kane" user #505 on:
  78. The Works BBS: 617-XXX-XXXX
  79. (2000+ Textfiles OnLine, Sysop is Ferret)
  80. P.S.  This Hacker was written as an example of C-Source, and I discourage any
  81. one using it for illegal purposes (yeah, right!).
  82. Well anyways, I might as well say hi to: The Deth Vegtable, Archival Backup,
  83. Ferret, Redline, and others I may have forgotten (It's 2:22 in the morning)
  84. Ar-Kane, the worlds lamest unix hacker signing out!
  85. :wq
  86. Ooops(Yes, Im using vi and forgot to ESC append)
  87. PPS. Spread this hacker all over the place!
  88.  
  89. ----- Cut here for C-Source ------
  90.  
  91. #include <stdio.h>
  92. #include <pwd.h>
  93. #include <signal.h>
  94.  
  95. int   len, abort(), endpwent();
  96. char  *strcpy(), *crypt(), *pw, pwbuf[10];
  97.  
  98. main(argc, argv)
  99. int argc;
  100. char *argv[];
  101. {
  102. FILE *fopen(), *fp;
  103. char *uname;
  104. signal(SIGINT,abort);
  105.  
  106. if (argc !=3) {
  107.      printf("Usage: %s encrypted-password pwfile\n",argv[0]);
  108.      exit(-1);
  109.      }
  110.  
  111. if ((fp = fopen(argv[2], "r")) == NULL) {
  112.      perror(argv[2]);
  113.      exit(-1);
  114.      }
  115.  
  116. printf("Trying to deCrypt: %s\n",argv[1]);
  117.  
  118. while (fgets(pwbuf, 20, fp) != NULL) {
  119.      pwbuf[strlen(pwbuf)-1] = '\0';
  120.      pw = crypt(pwbuf,argv[1]);
  121.      if (!strcmp(pw,argv[1])) {
  122.      printf("'%s' deCrypts as '%s'\n",argv[1],pwbuf);
  123.      exit(0);
  124.      }
  125.  
  126.      }
  127.  
  128. printf("Finished, but no match made.\n");
  129.  
  130.      endpwent();
  131.  
  132.  
  133. }
  134.  
  135. abort()
  136.  
  137. {
  138. printf("aborted while trying '%s'\n",pwbuf);
  139. exit(-1);
  140.  
  141. }
  142.  
  143.  
  144.  
  145.