home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / a_m / lodhtj03.004 < prev    next >
Encoding:
Text File  |  2003-06-11  |  2.4 KB  |  69 lines

  1.  
  2.  
  3. ---------------------- Shooting Shark's PW Hacker Update ---------------------
  4.  
  5.  
  6.     The following is a reprint of Shooting Sharks' post which he provides
  7. another program which can be typed quickly or uploaded to the unix system of
  8. your choice. This program can be used to ensure that the algorithm does work
  9. and you could then proceed to upload his program from Issue #2 for more
  10. extensive password finding. I was able to get his HPW.C program to run
  11. perfectly, and have found quite a few passwords by having it check passwords
  12. with dictionary entries and other files of probable passwords.
  13.                               -Lex Luthor
  14.  
  15.  
  16. Taken from: The Free World II 301-668-7657 BBS (no longer up)
  17.  
  18.  
  19. %> When: 9-19-87 at 3:46 am
  20.  
  21.     Since three people have told me my source won't compile on their system,
  22. I've taken the suggestion and put together a *very* stripped-down version of
  23. my HPW.C program from Issue #2.  Now it's basically a 20-line engine that you
  24. can use to verify that the algorithm does indeed work (try it with your own
  25. password) and then add whatever bells and whistles you want (like reading
  26. words from a file, etc.)  The version presented here just prompts the user
  27. for the encrypted password string, and then goes into an endless loop where it
  28. reads a password attempt from the keyboard, encrypts and compares it, and
  29. tells the user if it's the correct password.  It calls no external routines
  30. besides crypt(), printf(), scanf(), strcmp() and exit().  crypt() is
  31. absolutely essential to the program, and the rest are defined in K&R so this
  32. program had *better* work on your unix system!
  33.  
  34.     Here it is.  Sorry for the hassles the old version gave anybody although
  35. some people were able to get it to run quite nicely.
  36.  
  37.  
  38. - - - - - - - - - - - - - - - - - cut here - - - - - - - - - - - - - - - - - -
  39.  
  40. int    len;
  41.  
  42. char    crbuf[30], *crypt(), *pw, pwbuf[10];
  43.  
  44. main()
  45. $
  46.  
  47.  
  48.     printf("first, carefully type the ENCRYPTED password string:Xn>");
  49.     scanf("%s",crbuf);
  50.     printf("Now, type a password attempt at the prompt.  type QUITXn");
  51.     printf("(yes, in caps) on a blank line to quit...XnXn");
  52.     for (;;) $
  53.         printf("try >");
  54.         scanf("%s",pwbuf);
  55.         if (!strcmp(pwbuf,"QUIT"))
  56.             break;
  57.         pw = crypt(pwbuf,crbuf);
  58.         if (!strcmp(pw,crbuf)) $
  59.             printf(" ==> %s is correct.Xn",pwbuf);
  60.             exit(0);
  61.  
  62.  
  63.     printf("done.Xn");
  64.  
  65.  
  66. - - - - - - - - - - - - - - - - - cut here - - - - - - - - - - - - - - - - - -
  67.  
  68.  
  69.