home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume23 / crack / part01 / Scripts / do_join < prev    next >
Encoding:
Text File  |  1991-09-22  |  1.5 KB  |  112 lines

  1. #!/bin/sh
  2.  
  3. ###
  4. # This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  5. # as part of the 'Crack' password cracking package.
  6. ###
  7.  
  8. ###
  9. # Are we to run Feedback ?
  10. ###
  11.  
  12. if [ "x$1" = "x-F" ]
  13. then
  14.     shift
  15.  
  16.     fbkfiles=`sh -c "echo Runtime/fbk.*"`
  17.  
  18.     if [ "$fbkfiles" = "Runtime/fbk.*" ]
  19.     then
  20.         fbkfiles=""
  21.     fi
  22. fi
  23.  
  24. ###
  25. # Empty the output file, Error if cannot create
  26. ###
  27.  
  28. warn=$1
  29.  
  30. shift
  31.  
  32. cp /dev/null $warn || exit 1
  33.  
  34.  
  35. ###
  36. # As Walt Disney would say, we start with a simple bracket:-
  37. ###
  38.  
  39. (
  40.     if [ "$fbkfiles" != "" ]
  41.     then
  42.         cat $fbkfiles
  43.     fi
  44.  
  45.     (
  46.         for file in $*
  47.         do
  48.             awk '/^[A-Za-z0-9]/ {print "'"$file"':" $0;}' < $file
  49.         done
  50.     ) |
  51.     sort -t: +2
  52. ) |
  53. awk -F: '
  54. BEGIN {
  55.     FS = ":";
  56.     warn="'"$warn"'";
  57.     date = "'"`date`"'";
  58.     date = substr(date, 5, 15);
  59. }
  60.  
  61. /^!fb!/ {
  62.     if ($3 == "N")
  63.     {
  64.         guessable[$2] = "N";
  65.     } else if ($3 == "Y")
  66.     {
  67.         guessable[$2] = "Y";
  68.         decrypt[$2] = $4;
  69.     } else
  70.     {
  71.         print "Strange feedback: ", $0 >> "/dev/tty";
  72.     }
  73.     next;
  74. }
  75.  
  76. index($3, "*") != 0 || \
  77. index($3, "!") != 0 || \
  78. index($3, " ") != 0 {
  79.     printf("join: %s User %s (in %s) has a locked password:- %s\n", \
  80.         date, $2, $1, $3) >> warn;
  81.     next;
  82. }
  83.  
  84. $3 == "" {
  85.     printf("join: %s Warning! %s (%s in %s) has a NULL password!\n", \
  86.         date, $2, $7, $1) >> warn;
  87.     next;
  88. }
  89.  
  90. {
  91.     if (guessable[$3] == "N")
  92.     {
  93.         next;
  94.     } else if (guessable[$3] == "Y")
  95.     {
  96.         if ($4 == 0)
  97.         {
  98.             msg = "ROOT PASSWORD ";
  99.         } else
  100.         {
  101.             msg = "";
  102.         }
  103.         printf("join: %s Guessed %s%s (%s in %s) [%s] %s\n", \
  104.             date, $2, msg, $8, $1, decrypt[$3], $3) >> warn;
  105.     } else
  106.     {
  107.         print $0;
  108.     }
  109. }'
  110.  
  111. exit 0
  112.