home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume23 / crack / part01 / README < prev   
Encoding:
Text File  |  1991-09-22  |  27.8 KB  |  788 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                     "Crack Version 3.3c"
  11.            A Sensible Password Checker for UNIX-
  12.  
  13.  
  14.                      Alec D.E. Muffett
  15.  
  16.          Computer Unit, University College of Wales
  17.                 Aberystwyth, Wales, SY23 3DB
  18.                        aem@aber.ac.uk
  19.                        +44 970 622492
  20.  
  21.  
  22.                           ABSTRACT
  23.  
  24.           Crack[1]  is  a  freely   available   program
  25.      designed to find standard UNIX eight-character DES
  26.      encrypted passwords  by  standard  guessing  tech-
  27.      niques outlined below.  It is written to be flexi-
  28.      ble, configurable and fast, and to be able to make
  29.      use  of  several  networked hosts via the Berkeley
  30.      rsh program (or similar), where possible.
  31.  
  32.  
  33.  
  34. 1.  Intent of this program
  35.  
  36. My intentions, whilst writing this program, were
  37.  
  38. 1)   To provide the average system manager  with  a  simple,
  39.      flexible and fast tool to find passwords which would be
  40.      easily compromised by a dictionary search.
  41.  
  42. 2)   To weaken the complacency which has  developed  amongst
  43.      many (in)?experienced UNIX systems managers about pass-
  44.      word security. Just because the crypt() function cannot
  45.      be  reversed  does  not  mean  that  your passwords are
  46.      secure.  If this program helps  to  raise  the  overall
  47.      quotient  of paranoia just one little bit, then it will
  48.      have served its purpose and is all to the good.
  49.  
  50. I am quite certain that some childish morons out there  will
  51. abuse  the  work that I have put into creating this program.
  52. It's up to them how they use it, but if it's used  for  some
  53. illegal  purpose it's not my intention, nor my fault. I hope
  54. _________________________
  55.   [1]
  56. - UNIX is a trademark of Bell Laboratories.
  57.   [1] Crack  is  available  for  anonymous   FTP   from
  58. wuarchive.wustl.edu (128.252.135.4) in ~/packages
  59.  
  60.  
  61.  
  62.  
  63.                      September 19, 1991
  64.  
  65.  
  66.  
  67.  
  68.  
  69.                            - 2 -
  70.  
  71.  
  72. they get caught.
  73.  
  74. Crack was not designed to do anything nasty, other  than  to
  75. attack  passwords  in  sensible order.  This is why I feel I
  76. can post it to the net without fear of recrimination.   This
  77. version  of  Crack  is  supplied with a (hopefully) portable
  78. version of fcrypt(), for speed reasons.  Fcrypt() is not yet
  79. widely  available, but several versions have now been posted
  80. to USENET, and with the growing ability to access  anonymous
  81. FTP  databases like Archie, I believe that people who really
  82. want access to such programs as fcrypt() will be able to get
  83. them  easily.   People who need them but don't have the time
  84. to look, on the other hand, will not get them.  This is  not
  85. a  good thing if you are a systems manager, because it gives
  86. the crackers an advantage.  My philosophy  is:  give  it  to
  87. everyone, then at least the people who need it can get it.
  88.  
  89. 2.  Fcrypt() Statistics
  90.  
  91. The version of fcrypt() that comes  with  Crack  is  several
  92. times  faster  than the version that was originally supplied
  93. to me, and should outperform most others which are  publicly
  94. available.   I  haven't tried many speed-demon style tricks,
  95. but rather I have gone for portability, elegance and simpli-
  96. city,  where  applicable  8-).   On  a  DECStation 5000/200,
  97. fcrypt() iterates about 580 times per second, and overall, I
  98. measure  this  to  be  about  15  times faster than standard
  99. crypt().  There are faster versions available, but at  least
  100. I feel free to redistribute this version without stepping on
  101. anyones toes.
  102.  
  103. A final note about my motives: If you  think  that  I  am  a
  104. moron  for  writing  and then distributing this program, and
  105. you think that the program is in itself dangerous, I suggest
  106. that  you  carefully  consider the fact that any moron could
  107. have written this program.  Flames to /dev/null, please.
  108.  
  109. 3.  Implementation
  110.  
  111. I have tried to make Crack as portable as  possible  without
  112. compromising speed.  Needless to say, it is imperfect in the
  113. this respect, but I have tried.  If you have  problems  get-
  114. ting  Crack  up, please let me know what these problems are,
  115. and what system you were trying  to  put  Crack  up  on.   I
  116. believe  that  Crack will work on Xenix and various versions
  117. of System V, but it may require a little effort if your UNIX
  118. is not fairly modern.
  119.  
  120. To use the Crack -network option, you must have  rsh,  or  a
  121. similar  program.   rsh is a BSD-ism which has become fairly
  122. common on non-BSD systems.  If you don't have  it  or  some-
  123. thing  similar,  let  me  know what you do have which might,
  124. with a little ingenuity, do the job, and I shall see what  I
  125. can do.  Have a look in Scripts/RCrack and feel free to play
  126.  
  127.  
  128.  
  129.                      September 19, 1991
  130.  
  131.  
  132.  
  133.  
  134.  
  135.                            - 3 -
  136.  
  137.  
  138. around.
  139.  
  140.      Note: Xenix users and some others have a rcmd pro-
  141.      gram instead of rsh.  Similarly, HP-UX has a remsh
  142.      command.  I'm not sure of the correct  syntax  for
  143.      these  programs,  but  it  should  not  be hard to
  144.      integrate them, if they do not already work. There
  145.      is a note about these commands in Scripts/RCrack
  146.  
  147.      On System V based systems, users may also be miss-
  148.      ing  the  BSD  function gethostname().  If this is
  149.      so, but you  do  have  the  uname()  system  call,
  150.      define  the  macro  CRACK_UNAME  in Sources/conf.h
  151.      instead. This ought to fix the problem, but it may
  152.      need  a little user intervention first (it depends
  153.      where your header file for  uname()  is).   Caveat
  154.      Emptor!
  155.  
  156. 4.  Method of Password Cracking
  157.  
  158. Crack does not take the serial approach to password guessing
  159. that  other  programs  like  the COPS password cracker does.
  160. Rather, Crack makes two  passes  over  the  users'  password
  161. entries.
  162.  
  163. The first pass bases its guesses  on  the  contents  of  the
  164. gecos field (containing the users' real name), and the user-
  165. name itself.  The first pass is fast and usually very fruit-
  166. ful, and completes quite quickly.  You would be surprised at
  167. the number of spods who still think that their middle  name,
  168. backwards and capitalised, is a good password.
  169.  
  170. The second pass is made by encrypting several  pre-processed
  171. dictionaries  on  the  fly,  and  comparing the results with
  172. users passwords.  Crack optimises the number of calls to the
  173. encryption  function  by sorting the user passwords by their
  174. encryption salt before loading,  so  that  the  dictionaries
  175. only  have  to  be  encrypted  once for each different salt.
  176. This generally saves about 30% of the calls you  would  have
  177. to make to crypt().
  178.  
  179. The preprocessed dictionaries are  created  by  merging  the
  180. source  dictionaries found in the directory DictSrc and then
  181. truncating, sorting and uniq'ing the output from the prepro-
  182. cessor.   The default dictionaries named are /usr/dict/words
  183. which  provides  the   bulk   of   the   input   data,   and
  184. DictSrc/bad_pws.dat  which  is meant to provide all of those
  185. non-dictionary passwords, such as 12345678 or qwerty.[2]
  186. _________________________
  187.   [2] Extra dictionaries (those used in Dan Klein's pa-
  188. per,  below)  can  be  obtained  via anonymous FTP from
  189. uunet.uu.net (192.48.96.2) as ~/pub/dictionaries.tar.Z
  190.  
  191.  
  192.  
  193.  
  194.                      September 19, 1991
  195.  
  196.  
  197.  
  198.  
  199.  
  200.                            - 4 -
  201.  
  202.  
  203. If you wish to add a dictionary of your own,  just  copy  it
  204. into  the  DictSrc directory and then delete the contents of
  205. the  Dicts  directory  (run  Scripts/spotless  from   within
  206. $CRACK_HOME).   Your new dictionary will be merged in on the
  207. next run.  Do not worry about replication of  data,  as  the
  208. preprocessor's  driver  script  sorts  and  uniq's  the data
  209. before putting it into the Dicts directory.
  210.  
  211. The formats of the output dictionaries are:
  212.  
  213. a)   Unique words that have been forced lowercase, forwards.
  214.      These are the most common passwords you will find, thus
  215.      they are tried first.
  216.  
  217. b)   Dictionary words which have been  artificially  plural-
  218.      ised, because not many dictionaries contain plurals.
  219.  
  220. c)   Dictionary words forced capitalised (eg: Capitalised).
  221.  
  222. d)   Dictionary words, forced lowercase, with a  trailing  0
  223.      or  1  (this  may be extended by hacking Sources/crack-
  224.      pp.c).
  225.  
  226. e)   Dictionary words forced lowercase and backwards.
  227.  
  228. f)   Dictionary words, forced lowercase, with a leading 0 or
  229.      1 (this may be extended by hacking Sources/crack-pp.c).
  230.  
  231. g)   Dictionary words, forced uppercase, forwards.
  232.  
  233. h)   Dictionary words, forced uppercase, backwards.
  234.  
  235. i)   Dictionary  words  forced  capitalised,  reversed  (eg:
  236.      desilatipaC).
  237.  
  238.  
  239. This choice of attack is entirely  empirical,  my  own,  and
  240. made  up  on  the spot.  It is also horrendously successful,
  241. and because Crack uses each of these dictionaries  in  turn,
  242. it  tends  to  get  passwords faster than a program like the
  243. COPS password cracker which tries words every-which-way  for
  244. each user.[3]
  245.  
  246.      Optimisation  Note:  Crack  has  an   compile-time
  247.      option,  called CRACK_SHORT_PASSWDS, which, if not
  248.      defined, makes the dictionary  preprocessor  throw
  249.      away  words which are less than 5 characters long.
  250. _________________________
  251.   [3] For more information, see "Foiling the Cracker: A
  252. Survey  of,  and Improvements to, Password Security" by
  253. Daniel  Klein,  available   from   ftp.sei.cmu.edu   in
  254. ~/pub/dvk/passwd.*.   Also, read the APPENDIX file sup-
  255. plied with this distribution.
  256.  
  257.  
  258.  
  259.                      September 19, 1991
  260.  
  261.  
  262.  
  263.  
  264.  
  265.                            - 5 -
  266.  
  267.  
  268.      The reasoning for this is that many sites, with  a
  269.      semi-sensible  passwd program, will not have pass-
  270.      words shorter than 5 characters long.
  271.  
  272.      It is up to you whether you bother  testing  these
  273.      short passwords, but I would recommend that you do
  274.      so at least once, to be safe.  (Setting the option
  275.      also  leads  to  having smaller pre-processed dic-
  276.      tionaries.  The option,  however,  is  defined  by
  277.      default).
  278.  
  279. 5.  Installation
  280.  
  281. Crack is one of those most  unusual  of  beasties,  a  self-
  282. installing   program.    Once  the  necessary  configuration
  283. options have been set, the executables are created via  make
  284. by running the Crack shellscript .
  285.  
  286. Some people have complained about this  apparent  weirdness,
  287. but  it has grown up with Crack ever since the earliest net-
  288. work version, when I could  not  be  bothered  to  log  into
  289. several  different machines with several different architec-
  290. tures, just in order to build the binaries.
  291.  
  292. Down to the nitty-gritty.  Crack needs to know where it  has
  293. been  installed.  You will have to edit the CRACK_HOME vari-
  294. able in the Crack shellscript to the  correct  value.   This
  295. variable should be set to an absolute path name (relative to
  296. ~user should be OK, so long as you have some  sort  of  csh)
  297. through which the directory containing Crack may be accessed
  298. on all the machines that Crack will be run on.  There  is  a
  299. similar  variable  CRACK_OUT  which  specifies  where  Crack
  300. should put its output files - by default, this is  the  same
  301. as $CRACK_HOME.
  302.  
  303. The next thing you will have to  do  is  to  edit  the  file
  304. Sources/conf.h  and work out which switches to enable.  Each
  305. #define has a small note explaining its  purpose.   Where  I
  306. have  been in doubt about the portability of certain library
  307. functions, usually I have re-written it, so  you  should  be
  308. OK.  Let me know of your problems, if you have any.
  309.  
  310. One of the most important switches in the conf.h file is the
  311. CRACK_NETWORK  symbol.   This  forces Crack to create all of
  312. its output files with an embedded hostname (obtained by  the
  313. gethostname()  routine) so that you can keep track of output
  314. from all over the network.  If you have no gethostname() but
  315. have  a  uname()  system  call, you can use that by defining
  316. CRACK_UNAME in Sources/conf.h.
  317.  
  318. If you will be using CRACK_NETWORK, you will  then  have  to
  319. generate  a  Scripts/network.conf file. This contains a list
  320. of hostnames to rsh to, what their binary  type  is  (useful
  321. when   running   a   network   Crack  on  several  different
  322.  
  323.  
  324.  
  325.                      September 19, 1991
  326.  
  327.  
  328.  
  329.  
  330.  
  331.                            - 6 -
  332.  
  333.  
  334. architectures), a guesstimate of their relative power  (take
  335. your  slowest machine as unary, and measure all others rela-
  336. tive to it), and a list of per-host flags to  add  to  those
  337. specified on the Crack command line, when calling that host.
  338. There is an example of such a file provided in  the  Scripts
  339. directory - take a look at it.
  340.  
  341. If ever you wish to specify a more precise figure as to  the
  342. relative  power  of  your  machines,  or you are simply at a
  343. loss, play with the command make tests in  the  source  code
  344. directory.   This  will  provide  you  with  the  number  of
  345. fcrypt()s that your machine can do per second,  which  is  a
  346. number that you can plug into your network.conf as a measure
  347. of your machines' power (after  rounding  the  value  to  an
  348. integer).
  349.  
  350. 6.  Crack Usage
  351.  
  352.  
  353. Crack [options] [bindir] /etc/passwd [...other passwd files]
  354.  
  355. Crack -network [options] /etc/passwd [...other passwd files]
  356.  
  357.  
  358. Where bindir is the optional name of the directory where you
  359. want  the binaries installed.  This is useful where you want
  360. to be able to run versions of  Crack  on  several  different
  361. architectures.  If  bindir does not exist, a warning will be
  362. issued, and the directory created.
  363.  
  364.      Note: bindir defaults to the name generic  if  not
  365.      supplied.
  366.  
  367.      Notes for Yellow Pages (NIS)  Users:  I  have  had
  368.      some queries about how to get Crack running from a
  369.      YP password file.  There are several methods,  but
  370.      by far the simplest is to generate a passwd format
  371.      file by running:-
  372.  
  373.                     ypcat passwd > passwd.yp
  374.  
  375.      and then running Crack on this file.
  376.  
  377. 7.  Options
  378.  
  379. -f   Runs Crack in foreground mode, ie: the password cracker
  380.      is  not backgrounded, and messages appear on stdout and
  381.      stderr as you would expect.  This option is only really
  382.      useful  for  small  password files, or when you want to
  383.      put a wrapper script around Crack, or  after  you  have
  384.      been running in feedback mode.
  385.  
  386.      Foreground mode is disabled if you  try  running  Crack
  387.      -network  -f,  on  the  command  line,  because  of the
  388.  
  389.  
  390.  
  391.                      September 19, 1991
  392.  
  393.  
  394.  
  395.  
  396.  
  397.                            - 7 -
  398.  
  399.  
  400.      insensibility of rshing to several  machines  in  turn,
  401.      waiting for each one to finish before calling the next.
  402.      However, please read the section about Network Cracking
  403.      without NFS/RFS, below.
  404.  
  405. -F   Puts Crack into feedback mode, ie: when a  run  of  the
  406.      password  cracker  terminates  normally,  the  software
  407.      writes a list of the DES encrypted passwords which were
  408.      (or  were  not)  cracked,  into  a feedback file, named
  409.      Runtime/fbk.<pid>, or  similar.   When  Crack  is  next
  410.      invoked  with  the  -F  option,  Crack removes from its
  411.      input all encrypted passwords which can be found in one
  412.      of the feedback files, and reports on them immediately.
  413.      This prevents Crack from wasting time trying  to  crack
  414.      passwords that it has cracked (or not cracked) before.
  415.  
  416.      Obviously, use of the -F option is not recommended when
  417.      amendments  have  been made to the source dictionaries,
  418.      because new words may have been added which would guess
  419.      someones  password.   After  such  amendments have been
  420.      made, it is recommended that all the preprocessed  dic-
  421.      tionaries  are removed and the feedback files tidied by
  422.      running Scripts/spotless, and then a full run should be
  423.      done.
  424.  
  425.      Use of feedback mode is dependent on defining the  sym-
  426.      bol CRACK_PRINTOUT in Sources/conf.h.
  427.  
  428.      Please note that for feedback  mode  to  work  properly
  429.      during  network cracks, the -F option must be specified
  430.      on the Crack command line and not  in  the  crack-flags
  431.      field  of  the Scripts/network.conf file. If you do not
  432.      specify -F on the command line, the program  will  fail
  433.      to  filter  unguessable  users  from the input password
  434.      files, and will therefore waste much time.
  435.  
  436. -v   Sets verbose mode, whereby Crack will print every guess
  437.      it is trying on a per-user basis.  This is a very quick
  438.      way of flooding your filestore.  If  you  undefine  the
  439.      CRACK_VERBOSE  symbol  in  Sources/conf.h, verbose mode
  440.      will be permanently disabled.
  441.  
  442. -nvalue
  443.      Sets the process to be nice()ed to value, so  that  the
  444.      switch -n19 sets the Crack process to run at the lowest
  445.      priority.
  446.  
  447. -network
  448.      Throws Crack into network mode, in which it  reads  the
  449.      Scripts/network.conf file, splits its input into chunks
  450.      which are sized according to the power  of  the  target
  451.      machine,  and  calls  rsh to run Crack on that machine.
  452.      Options for Crack running on the target machine may  be
  453.      supplied  on  the  command line (eg: verbose or recover
  454.  
  455.  
  456.  
  457.                      September 19, 1991
  458.  
  459.  
  460.  
  461.  
  462.  
  463.                            - 8 -
  464.  
  465.  
  466.      mode), or in the network.conf file if they  pertain  to
  467.      specific hosts (eg: nice() values).
  468.  
  469. -r<pointfile>
  470.      This is only for use  when  running  in  recover  mode.
  471.      When  a  running  Crack  starts pass 2, it periodically
  472.      saves its state in a file  in  the  directory  Runtime,
  473.      named  pnt.<pid>  or  pnt.<hostname>.<pid> depending on
  474.      your naming convention (see Installation, above).  This
  475.      file  can  be  used  to recover where you were should a
  476.      host crash.  Simply invoke Crack in  exactly  the  same
  477.      manner  as  the  last  time, with the addition of the -
  478.      rRuntime/pnt.file.name switch.  Crack will startup  and
  479.      read  the  file,  and  jump to slightly before where it
  480.      left off.  If you are cracking a  very  large  password
  481.      file, this can save oodles of time after a crash.
  482.  
  483.      If you are running a network Crack, then the jobs  will
  484.      again  be spawned onto all the machines of the original
  485.      Crack.  The program will then check that the host it is
  486.      running   on  is  the  same  as  is  mentioned  in  the
  487.      pointfile.  If it is not, it will silently die.   Thus,
  488.      assuming that you supply the same input data and do not
  489.      change your network.conf file,  Crack  should  pick  up
  490.      exactly  where  it  left off.  This is a bit inelegant,
  491.      but it's better than nothing at the moment.
  492.  
  493. 8.  Support Scripts
  494.  
  495. The Scripts directory contains a small number of support and
  496. utility  scripts,  some  of which are designed to help Crack
  497. users check their progress.  Briefly, the most  useful  ones
  498. are:-
  499.  
  500. Scripts/shadmrg
  501.      This is a small (but  hopefully  readable)  script  for
  502.      merging  /etc/passwd  and /etc/shadow on System V style
  503.      shadow password systems.  It produces the  merged  data
  504.      to stdout, and will need redirecting into a file before
  505.      Crack can work on it.  The script is meant to be fairly
  506.      lucid,  on the grounds that I worry that there are many
  507.      shadowing schemes out there, and perhaps not  all  have
  508.      the same data format.
  509.  
  510. Scripts/plaster
  511.      which is named after a dumb joke, but is a simple fron-
  512.      tend to the Runtime/die.* script each copy of the pass-
  513.      word cracker generates. Invoking  Scripts/plaster  will
  514.      kill  off  all  copies  of the password cracker you are
  515.      running, over the network or otherwise.
  516.  
  517. Scripts/status
  518.      This script rshes to  each  machine  mentioned  in  the
  519.      Scripts/network.conf    file,    and    provides   some
  520.  
  521.  
  522.  
  523.                      September 19, 1991
  524.  
  525.  
  526.  
  527.  
  528.  
  529.                            - 9 -
  530.  
  531.  
  532.      information about processes and uptime on that machine.
  533.      This  is useful when you want to find out just how well
  534.      your password crackers are getting on  during  a  Crack
  535.      -network.
  536.  
  537. Scripts/{clean,spotless}
  538.      These are really just frontends to a makefile. Invoking
  539.      Scripts/clean  tidies  up the Crack home directory, and
  540.      removes probably unwanted files, but  leaves  the  pre-
  541.      processed  dictionaries  intact.  Scripts/spotless does
  542.      the same as Scripts/clean but obliterates  the  prepro-
  543.      cessed   dictionaries   and   output   files  too,  and
  544.      compresses the feedback files into one.
  545.  
  546. Scripts/guess2fbk
  547.      Only useful if  CRACK_PRINT  is  defined.  This  script
  548.      takes  your  out.* files as arguments and reformats the
  549.      'Guessed' lines into a slightly  messy  feedback  file,
  550.      suitable for storing with the others.
  551.  
  552.      An occasion where this might be  useful  is  when  your
  553.      cracker  has  guessed  many peoples passwords, and then
  554.      died for some reason before writing out the guesses  to
  555.      a feedback file. Running
  556.  
  557.      Scripts/guess2fbk out.* > Runtime/fbk.new
  558.  
  559.      will save the work that has been done.
  560.  
  561. 9.  Multiprocessing and parallelism
  562.  
  563. The method of error recovery outlined above causes headaches
  564. for  users who want to do multiprocessing on parallel archi-
  565. tectures.  Crack is in no way parallel, and because  of  the
  566. way  it's  structured,  readind stdin from shellscript fron-
  567. tends, it is a pain  to  divide  the  work  amongst  several
  568. processes via fork()ing.
  569.  
  570. The hack solution to get several copies of Crack running  on
  571. one  machine  with n processors at the moment is to run with
  572. the CRACK_NETWORK option enabled, and insert n copies of the
  573. entry     for     your    parallel    machine    into    the
  574. Scripts/network.conf file. If you use the -r option in these
  575. circumstances   however,  you  will  get  n  copies  of  the
  576. recovered process running, only one of them  will  have  the
  577. correct  input data.  I'm working on this.  My current solu-
  578. tion is to save the current username in the point file,  and
  579. test  it  on startup, but doing this may break your recovery
  580. if you supply different input data  (so  that  the  data  is
  581. sorted  even  slightly differently).  Hohum.  If you want to
  582. use this verify username facility, use -R in place of -r.
  583.  
  584. As for not using the network.conf file to provide  multipro-
  585. cessing, I'm still working on it.
  586.  
  587.  
  588.  
  589.                      September 19, 1991
  590.  
  591.  
  592.  
  593.  
  594.  
  595.                            - 10 -
  596.  
  597.  
  598. 10.  Network Cracking without NFS/RFS
  599.  
  600. For those users who have some form of rsh  command,  but  do
  601. not  have  a  a  networked  filestore running between hosts,
  602. there is now a solution which will allow you to do networked
  603. cracking,  forwarded  to me by Brian Tompsett at Hull.  Per-
  604. sonally, I consider the idea to be potty, but  it  fills  in
  605. missing functionality in a wonderfully tacky manner.
  606.  
  607. From the documentation above, you will note that Crack  will
  608. undo  the -f (output in foreground) option, if it is invoked
  609. with the -network switch at the same time (see  the  Options
  610. section  above).  This is true, but it does not apply if you
  611. specify -f option in the network.conf file.
  612.  
  613. The practical upshot of doing this is that remote copies  of
  614. Crack  can  be  made  to read from stdin and write to stdout
  615. over a network link, and thus remote  processing  is  accom-
  616. plished.   I  have  tweaked  Crack in such a way, therefore,
  617. that if the -f option is specified amongst  the  crack-flags
  618. of  a  host  in  the network.conf, rather than backgrounding
  619. itself on the remote host, the rsh command on the server  is
  620. backgrounded, and output is written directly to the files on
  621. the server's filestore.
  622.  
  623. There are restrictions upon this  method,  mostly  involving
  624. the number of processes that a user may run on the server at
  625. any one time, and the fact that if you run in feedback mode,
  626. you  will have to collect the feedback output together manu-
  627. ally (dropping it into the Runtime directory on the server).
  628. However,  it  works.  Also, if you try to use rsh as another
  629. user, you will suffer problems if  rsh  insists  on  reading
  630. something  from your terminal (eg: a password for the remote
  631. account).  Also, checkpointing goes out  the  window  unless
  632. you specify the name of the pointfile on the remote machine.
  633.  
  634. 11.  Notes on fast crypt() implementations
  635.  
  636. The stdlib version of the crypt() subroutine  is  incredibly
  637. slow.   It is a massive bottleneck to the execution of Crack
  638. and on typical platforms that you get at universities, it is
  639. rare to find a machine which will achieve more than 50 stan-
  640. dard crypt()s per second.  On low-end diskless workstations,
  641. you  may  expect 2 or 3 per second.  It was this slowness of
  642. the crypt() algorithm which originally supplied much of  the
  643. security UNIX needed.[4]
  644.  
  645. However, there are now many implementations of  faster  ver-
  646. sions  of  crypt() to be found on the network.  The one sup-
  647. plied with Crack v3.2 and upwards is called fcrypt().
  648. _________________________
  649.   [4] See: "Password Security, A Case History"  by  Bob
  650. Morris & Ken Thomson, in the UNIX Programmer Docs.
  651.  
  652.  
  653.  
  654.                      September 19, 1991
  655.  
  656.  
  657.  
  658.  
  659.  
  660.                            - 11 -
  661.  
  662.  
  663. fcrypt() was  originally  written  in  May  1986  by  Robert
  664. Baldwin at MIT, and is a good version of the crypt() subrou-
  665. tine.  I received a copy from Icarus Sparry at Bath  Univer-
  666. sity,  who  had made a couple of portability enhancements to
  667. the code.
  668.  
  669. I rewrote most of the tables and the KeySchedule  generating
  670. algorithm  in  the original fdes-init.c to knock 40% off the
  671. execution overhead of fcrypt()  in  the  form  that  it  was
  672. shipped  to  me.   I inlined a bunch of stuff, put it into a
  673. single file, got  some  advice  from  Matt  Bishop  and  Bob
  674. Baldwin  [both  of whom I am greatly indebted to] about what
  675. to do to the xform() routine  and  to  the  fcrypt  function
  676. itself,  and  tidied  up some algorithms.  I have also added
  677. more lookup tables and reduced several  formula  for  faster
  678. use.   fcrypt() is now barely recognisable as being based on
  679. its former incarnation.
  680.  
  681. On a DecStation 5000/200, it is also about 15  times  faster
  682. than  the  standard  crypt (your mileage may vary with other
  683. architectures and compilers).  This speed puts fcrypt() into
  684. the  "moderately  fast" league of crypt implementations.  By
  685. using fcrypt() with Crack, I extracted 135 passwords from my
  686. standard  1087  user  password  file in a little over 1 hour
  687. using 3 networked machines.  This is from a moderately  good
  688. password file.
  689.  
  690. Why am I saying this sort of thing ? Am I  scaremongering  ?
  691. In a word, yes.
  692.  
  693. If a fast version of crypt() is wired into  a  program  like
  694. Crack it can break a poorly passworded site open in minutes.
  695. There are such programs available, eg: the "Killer  Cracker"
  696. written  by the anonymous "Doctor Dissector", with anonymous
  697. motives.  It comes with  a  modified  version  of  Baldwin's
  698. fcrypt, as a MS-DOS executable with a GNU copyleft licence.
  699.  
  700. The point that needs to be  hammered  home  is  that  unless
  701. something  is done, and done soon, about the general quality
  702. of passwords on UNIX systems, then in the  near  future  our
  703. doors  will  be  wide  open to people who have programs like
  704. Crack and questionable motives.
  705.  
  706. 12.  Solutions and Conclusions
  707.  
  708. What can be done about this form of attack ?
  709.  
  710. You must get  a  drop-in  replacement  for  the  passwd  and
  711. yppasswd  commands; one which will stop people from choosing
  712. bad passwords in the first place.  There  are  several  pro-
  713. grams  to  do this; Matt Bishop's passwd+ and Clyde Hoover's
  714. npasswd program are good examples which  are  freely  avail-
  715. able.   Consult an Archie database for more details on where
  716. you can get them from.
  717.  
  718.  
  719.  
  720.                      September 19, 1991
  721.  
  722.  
  723.  
  724.  
  725.  
  726.                            - 12 -
  727.  
  728.  
  729. A little common-sense is all that is required to  vet  pass-
  730. words:   I   enclose  a  module  in  the  Sources  directory
  731. goodpass.c which I use in a modified version of the yppasswd
  732. in order to provide some security.  It is quite heavily cus-
  733. tomised for use in the UK, but it should be easily portable.
  734. The routine is invoked:
  735.  
  736.  
  737.            char *retval = GoodPass(char *input);
  738.  
  739.  
  740. where input is the password under test, and retval  will  be
  741. set  either to NULL (if the password is OK) or to a diagnos-
  742. tic string which says what is wrong with the  password.   It
  743. is far less complex than a system such as passwd+, but still
  744. effective enough to make a password  file  (probably)  with-
  745. stand  Crack.   It would be nice if an organisation (such as
  746. CERT?) could be persuaded to supply  skeletons  of  sensible
  747. passwd  commands  for the public good, as well as an archive
  748. of security related utilities[5] on  top  of  the  excellent
  749. COPS.  However, for UNIX security to  improve  on  a  global
  750. scale, we will also require pressure on the vendors, so that
  751. programs are written correctly from the beginning.
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778. _________________________
  779.   [5] COPS  is  available  for   anonymous   FTP   from
  780. cert.sei.cmu.edu (128.237.253.5) in ~/cops
  781.  
  782.  
  783.  
  784.  
  785.                      September 19, 1991
  786.  
  787.  
  788.