home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume22 / crack / part01 next >
Encoding:
Text File  |  1991-08-23  |  60.3 KB  |  2,094 lines

  1. Newsgroups: comp.sources.misc
  2. From: Alec David Muffett <aem@aber.ac.uk>
  3. Subject:  v22i049:  crack - The Password Cracker, version 3.2a, Part01/04
  4. Message-ID: <csm-v22i049=crack.100312@sparky.imd.sterling.com>
  5. X-Md4-Signature: 1fab764c7c09673b5cd5a2751301ac1b
  6. Date: Fri, 23 Aug 1991 15:03:56 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Alec David Muffett <aem@aber.ac.uk>
  10. Posting-number: Volume 22, Issue 49
  11. Archive-name: crack/part01
  12. Environment: UNIX
  13.  
  14. This is Crack, v3.2a+fcrypt() : A sensible password cracker for Unix.
  15.  
  16. [ *PLEASE NOTE*:
  17. [ There was an incredibly small bug in the version recently posted to
  18. [ alt.{sources,security}. If you are using that version, please either
  19. [ use this version or apply the fix yourself.
  20. [ * Around line 633 of Sources/crack-pwc.c, there is a line which read:-
  21. [                 if (!TryManyUsers (head, scratch))
  22. [   and this was changed to :-
  23. [                 if (!TryManyUsers (head, scratch->word))
  24. [                                          ^^^^^^^^^^^^^  
  25. [   for Crack to function properly.  If you are reading this, it is fixed
  26. [   in this distribution. 
  27.  
  28. The intent of this program is twofold :-
  29.  
  30. 1) To inform the average system manager, in a simple, fast, and easy to
  31.    use manner, of those passwords which would be easily compromised by a
  32.    dictionary search.
  33.  
  34. 2) To weaken the complacency which develops amongst many inexperienced
  35.    (and some experienced) Unix systems people.  Just because crypt/DES
  36.    cannot (?) be reversed does not mean that user passwords are safe.  If
  37.    this program serves to raise the overall quotient of paranoia just
  38.    little a bit, it is all to the good in my opinion.  8-)
  39.  
  40. Crack+fcrypt() works on Ultrix and SunOS, and probably on a lot of other
  41. things too.  AIX has problems with creating a crypt compatible fcrypt().
  42. For a list of the current problems, see the BUGS file.  At worst, just
  43. run with the version of 'crypt()' which comes with your system.
  44.  
  45. Documentation provided is in the "README" file, which I've handhacked
  46. down to a unutterably boring text file.  The "README.ms" file in "Docs"
  47. generates a far prettier output using "nroff -ms", and "Docs/README.ps"
  48. is even prettier still.  I suggest that you start by reading one of
  49. these files.
  50.  
  51. To install: Just create a directory to keep it all in, move the shar
  52. files into the directory, and unshar them.
  53.  
  54. The most patently obvious difference from the last release is that I
  55. have provided two versions of the driver script "Crack" - one in 'csh'
  56. and one in 'sh'.  If the 'sh' one works out okay, I'll eventually trash
  57. the 'csh' version.
  58.  
  59. Crack will also be archived at:-     wuarchive.wustl.edu [128.252.135.4]
  60. in the directory ~/packages.
  61.  
  62. If you have problems, let me know, so long as they're not too personal.
  63.  
  64. - Alec 8-)
  65.  
  66. INET: aem@aber.ac.uk      JANET: aem@uk.ac.aber      BITNET: aem%aber@ukacrl
  67. UUCP: ...!mcsun!ukc!aber!aem         ARPA: aem%uk.ac.aber@nsfnet-relay.ac.uk
  68. SNAIL: Alec Muffett, Computer Unit, Llandinam UCW, Aberystwyth, UK, SY23 3DB
  69. ----------
  70. #! /bin/sh
  71. # This is a shell archive.  Remove anything before this line, then unpack
  72. # it by saving it into a file and typing "sh file".  To overwrite existing
  73. # files, type "sh file -c".  You can also feed this as standard input via
  74. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  75. # will see the following message at the end:
  76. #        "End of archive 1 (of 4)."
  77. # Contents:  BUGS Crack.sh DictSrc Dicts Docs MANIFEST README
  78. #   README.FIRST Scripts Scripts/Crack.network Scripts/RCrack
  79. #   Scripts/clean Scripts/crack.mf Scripts/install.mf
  80. #   Scripts/joinfiles Scripts/makedicts Scripts/network.conf
  81. #   Scripts/network.conf.example Scripts/plaster Scripts/spotless
  82. #   Sources Sources/Makefile Sources/conf.h Sources/crack-lib.c
  83. #   Sources/crack-port.c Sources/crack.h Sources/speeds.c
  84. #   Sources/tester.c
  85. # Wrapped by aem@aberda on Fri Aug 23 13:20:39 1991
  86. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  87. if test -f 'BUGS' -a "${1}" != "-c" ; then 
  88.   echo shar: Will not clobber existing file \"'BUGS'\"
  89. else
  90. echo shar: Extracting \"'BUGS'\" \(1757 characters\)
  91. sed "s/^X//" >'BUGS' <<'END_OF_FILE'
  92. XKnown bugs as of Aug 23, 1991.
  93. X
  94. X* One version of Crack 3.2 has gotten away from me with the
  95. X  DEVELOPMENT_VERSION symbol #defined.  This is OK if you are on a
  96. X  DEC Risc-Ultrix box, but probably not otherwise. Doublecheck this.
  97. X  If you are reading this message, you should be OK.
  98. X
  99. X* GCC : Doesn't seem to want to compile fcrypt() so that it is
  100. X  compatible with crypt().  Use your stock CC.  If this doesn't work,
  101. X  "#undef CRYPT" in "Sources/conf.h" and run without fcrypt().
  102. X
  103. X  If you can follow the fcrypt() code, let me know what GCC doesn't
  104. X  like.  Otherwise, just tell me about it.
  105. X
  106. X* AIX : Doesn't like the -O2 flag, which is survivable on most versions
  107. X  of Unix.  It's just a switch to turn on optimisation and so may be
  108. X  safely removed.
  109. X
  110. X* AIX : Didn't like putting static data items > 256 in a u_char.  I have
  111. X  fixed the array in question (I think).
  112. X
  113. X* AIX : After all this, fcrypt() apparently does not come out of the AIX
  114. X  CC compiler compatible with crypt().  If you really have no idea why
  115. X  it does not work, "#undef FCRYPT" in "Sources/conf.h" and proceed as
  116. X  normal. 
  117. X
  118. X* AWK : Someone at Nottingham complained that "RCrack" fell over when he
  119. X  ran it, because he was using version 2 of "awk".  I'm not sure whether
  120. X  he meant "nawk" by this, but he said that it was fixed by editing
  121. X  "RCrack" and invoking "/bin/awk" literally.  This MAY also affect
  122. X  "joinfiles" and "Crack.network".
  123. X
  124. X* There was a major bug in v3.2 crack-pwc.c which I have fixed.  Around
  125. X  line 633 of Sources/crack-pwc.c, there is a line which read:-
  126. X
  127. X        if (!TryManyUsers (head, scratch))
  128. X
  129. X  and this was changed to :-
  130. X
  131. X        if (!TryManyUsers (head, scratch->word))
  132. X
  133. X  for Crack to function properly.  If you are reading this, it is fixed
  134. X  in this distribution. 
  135. END_OF_FILE
  136. if test 1757 -ne `wc -c <'BUGS'`; then
  137.     echo shar: \"'BUGS'\" unpacked with wrong size!
  138. fi
  139. # end of 'BUGS'
  140. fi
  141. if test -f 'Crack.sh' -a "${1}" != "-c" ; then 
  142.   echo shar: Will not clobber existing file \"'Crack.sh'\"
  143. else
  144. echo shar: Extracting \"'Crack.sh'\" \(3359 characters\)
  145. sed "s/^X//" >'Crack.sh' <<'END_OF_FILE'
  146. X#!/bin/sh
  147. X
  148. X###
  149. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  150. X# as part of the 'Crack' password cracking package.
  151. X###
  152. X
  153. X###
  154. X# For Bourne shell version, CRACK home cannot be relative to ~username
  155. X# (unless you have a really weird 'sh')
  156. X###
  157. X
  158. XCRACK_HOME="/aber/aem/SEC/CRACK32"              # This is an ENVIRONMENT var.
  159. Xexport CRACK_HOME
  160. X
  161. Xtrash="/dev/null"
  162. Xremote="FALSE"
  163. Xdefault_bin="generic"
  164. Xtmpfile="/tmp/cpwfs.$$"
  165. Xnet_cf="Scripts/network.conf"
  166. X
  167. X###
  168. X# Check existance of a home directory
  169. X###
  170. X
  171. Xif [ -d $CRACK_HOME ]
  172. Xthen
  173. X    cd $CRACK_HOME || exit 1
  174. Xelse
  175. X    echo "Error: The directory $CRACK_HOME does not exist."
  176. X    echo ""
  177. X    echo "Please set the value of CRACK_HOME in the Crack script to the CRACK31"
  178. X    echo "installation directory."
  179. X    echo ""
  180. X    echo "The current working directory is" `pwd`
  181. X    exit 1
  182. Xfi
  183. X
  184. X###
  185. X# Announce ourselves.
  186. X###
  187. X
  188. Xecho "Crack 3.2a Password Cracker by ADE Muffett, 1991"
  189. X
  190. X###
  191. X# Check that we have arguments
  192. X###
  193. X
  194. Xif [ "$1" = "" ]
  195. Xthen
  196. X    echo "Usage:    $0 [options] [bindir] passwdfile [...]"
  197. X    echo "Or:       $0 -network [options] passwdfile [...]"
  198. X    echo "With options:-"
  199. X    echo "    -v              - to produce verbose output (if configured)"
  200. X    echo "    -nnicevalue     - to run niced"
  201. X    echo "    -rpointfile     - to recover a crashed-out job"
  202. X    echo "    -Rpointfile     - to recover (with verify) a crashed-out job"
  203. X    exit 1
  204. Xfi
  205. X
  206. X###
  207. X# Parse command line
  208. X###
  209. X
  210. Xargl=""
  211. X
  212. Xwhile :
  213. Xdo
  214. X    case $1 in
  215. X        -network)
  216. X            if [ ! -f $net_cf ]
  217. X            then
  218. X                echo "$0: error: no file $net_cf"
  219. X                exit 1
  220. X            fi
  221. X            shift
  222. X            Scripts/Crack.network $*
  223. X            exit 0
  224. X            ;;
  225. X
  226. X        -remote)
  227. X            echo "Invoked: $0 $*"
  228. X            set remote="TRUE"
  229. X            shift
  230. X            ;;
  231. X        -v*|-n*|-r*|-R*)
  232. X            argl="$argl $1"
  233. X            shift
  234. X            ;;
  235. X        -*)
  236. X            echo "Crack: unknown argument $1"
  237. X            shift
  238. X            ;;
  239. X        *)
  240. X            break
  241. X            ;;
  242. X    esac
  243. Xdone
  244. X
  245. X###
  246. X# Test first non-switch argument for existance
  247. X###
  248. X
  249. Xif [ -f "$1" ]
  250. Xthen
  251. X    CRACK_ARCH="$CRACK_HOME/$default_bin"
  252. X    if [ ! -d $default_bin ]
  253. X    then
  254. X        echo "Making default binary directory: $default_bin"
  255. X        mkdir $default_bin || exit 1
  256. X    fi
  257. Xelif [ -d "$1" ]
  258. Xthen
  259. X    CRACK_ARCH="$CRACK_HOME/$1"
  260. X    shift
  261. Xelse
  262. X    echo "Crack: error: There is no directory or file $1."
  263. X    echo "Crack: warning: Creating directory $1"
  264. X    mkdir $1 || exit 1
  265. X    CRACK_ARCH="$CRACK_HOME/$1"
  266. X    shift
  267. Xfi
  268. X
  269. Xexport CRACK_ARCH                       # This is an ENVIRONMENT var.
  270. X
  271. X###
  272. X# Double check the dictionary directory
  273. X###
  274. X
  275. Xif [ ! -d $CRACK_HOME/Dicts ]
  276. Xthen
  277. X    echo "Crack: error: There is no directory or file Dicts."
  278. X    echo "Crack: warning: Creating directory Dicts"
  279. X    mkdir Dicts || exit 1
  280. Xfi
  281. X
  282. X###
  283. X# Now to tidy up a bit
  284. X###
  285. X
  286. Xmake -f Scripts/crack.mf cleanprogs >/dev/null 2>&1
  287. X
  288. Xecho "Using binaries in directory: $CRACK_ARCH"
  289. X
  290. Xcd $CRACK_ARCH || exit 1
  291. X
  292. X###
  293. X# Install makefiles if necessary.
  294. X###
  295. X
  296. Xif [ ! -f Makefile ]
  297. Xthen
  298. X    cp $CRACK_HOME/Scripts/install.mf Makefile
  299. Xfi
  300. X
  301. Xmake crack-pwc || exit 1
  302. X
  303. Xcd $CRACK_HOME
  304. X
  305. Xmake -f Scripts/crack.mf dictstamp || exit 1
  306. X
  307. X###
  308. X# Check how we have been invoked : ergo how we get our data.
  309. X###
  310. X
  311. Xif [ "$remote" = "TRUE" ]
  312. Xthen
  313. X    cat > $tmpfile
  314. Xelse
  315. X    Scripts/joinfiles $* > $tmpfile || exit 1
  316. Xfi
  317. X
  318. Xecho "Backgrounding program. Output will be written to a file in this directory."
  319. X
  320. Xnohup $CRACK_ARCH/crack-pwc $argl -i$tmpfile Dicts/dict.* </dev/null >$trash 2>&1 &
  321. X
  322. Xsleep 1
  323. X
  324. Xtest -f nohup.out && rm nohup.out
  325. X
  326. X###
  327. X# There are horrible timeraces involved in removing $tmpfile, so I dont.
  328. X###
  329. END_OF_FILE
  330. if test 3359 -ne `wc -c <'Crack.sh'`; then
  331.     echo shar: \"'Crack.sh'\" unpacked with wrong size!
  332. fi
  333. chmod +x 'Crack.sh'
  334. # end of 'Crack.sh'
  335. fi
  336. if test ! -d 'DictSrc' ; then
  337.     echo shar: Creating directory \"'DictSrc'\"
  338.     mkdir 'DictSrc'
  339. fi
  340. if test ! -d 'Dicts' ; then
  341.     echo shar: Creating directory \"'Dicts'\"
  342.     mkdir 'Dicts'
  343. fi
  344. if test ! -d 'Docs' ; then
  345.     echo shar: Creating directory \"'Docs'\"
  346.     mkdir 'Docs'
  347. fi
  348. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  349.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  350. else
  351. echo shar: Extracting \"'MANIFEST'\" \(2300 characters\)
  352. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  353. X   File Name        Archive #    Description
  354. X-----------------------------------------------------------
  355. X APPENDIX                   2    Reasoning for Cracks methods
  356. X BUGS                       1    List of known problems
  357. X Crack                      2    The "Crack" driver script in csh
  358. X Crack.sh                   1    The "Crack" driver script in sh
  359. X DictSrc                    1    Directory of source dictionaries
  360. X DictSrc/bad_pws.dat        2    A sample source dictionary
  361. X Dicts                      1    Holding store for processed dicts
  362. X Docs                       1    Documentation directory
  363. X Docs/README.ms             3    Source code for laconic documentation
  364. X Docs/README.ps             4    Prettified laconic documentation
  365. X MANIFEST                   1    This shipping list
  366. X README                     1    Laconic documentation
  367. X README.FIRST               1    Introductory Laconic documentation
  368. X Scripts                    1    Shellscripts & config files directory
  369. X Scripts/Crack.network      1    The network driver configuration interface
  370. X Scripts/RCrack             1    Frontend to the network program (eg: rsh)
  371. X Scripts/clean              1    Diddy little tidy up script
  372. X Scripts/crack.mf           1    Miscellaneous Makefile called from everywhere
  373. X Scripts/install.mf         1    Another Makefile called from everywhere
  374. X Scripts/joinfiles          1    Formatter for passwd files
  375. X Scripts/makedicts          1    Frontend to dictionary preprocessor
  376. X Scripts/network.conf       1    Empty config file
  377. X Scripts/network.conf.example  1    Example of network configuration file
  378. X Scripts/plaster            1    Diddy little kill script
  379. X Scripts/spotless           1    Diddy little tidy up script
  380. X Sources                    1    Cracker source code directory
  381. X Sources/Makefile           1    With a name like that, what do you reckon ?
  382. X Sources/conf.h             1    CONFIGURATION HEADER FILE
  383. X Sources/crack-fcrypt.c     3    fcrypt() [Shock, horror]
  384. X Sources/crack-lib.c        1    Diddy little string manipulation fn()s
  385. X Sources/crack-port.c       1    Portability hooks src
  386. X Sources/crack-pp.c         2    Preprocessor src
  387. X Sources/crack-pwc.c        2    Password cracker src
  388. X Sources/crack.h            1    General header file
  389. X Sources/goodpass.c         2    Example of a sensible password filter
  390. X Sources/speeds.c           1    Test s/w
  391. X Sources/tester.c           1    Test s/w
  392. END_OF_FILE
  393. if test 2300 -ne `wc -c <'MANIFEST'`; then
  394.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  395. fi
  396. # end of 'MANIFEST'
  397. fi
  398. if test -f 'README' -a "${1}" != "-c" ; then 
  399.   echo shar: Will not clobber existing file \"'README'\"
  400. else
  401. echo shar: Extracting \"'README'\" \(21446 characters\)
  402. sed "s/^X//" >'README' <<'END_OF_FILE'
  403. X
  404. X
  405. X
  406. X
  407. X
  408. X
  409. X
  410. X
  411. X
  412. X                    "Crack Version 3.2"
  413. X           A Sensible Password Checker for UNIX-
  414. X
  415. X
  416. X                     Alec D.E. Muffett
  417. X
  418. X         Computer Unit, University College of Wales
  419. X                Aberystwyth, Wales, SY23 3DB
  420. X                       aem@aber.ac.uk
  421. X                       +44 970 622492
  422. X
  423. X
  424. X                          ABSTRACT
  425. X
  426. X          Crack[1]  is  a  freely   available   program
  427. X     designed to find standard UNIX eight-character DES
  428. X     encrypted passwords  by  standard  guessing  tech-
  429. X     niques outlined below.  It is written to be flexi-
  430. X     ble, configurable and fast, and to be able to make
  431. X     use  of  several  networked hosts via the Berkeley
  432. X     rsh program (or similar), where possible.
  433. X
  434. X
  435. X
  436. X1.  Intent of this program
  437. X
  438. XMy intentions, whilst writing this program, were
  439. X
  440. X1)   To provide the average system manager  with  a  simple,
  441. X     flexible and fast tool to find passwords which would be
  442. X     easily compromised by a dictionary search.
  443. X
  444. X2)   To weaken the complacency which has  developed  amongst
  445. X     many (in)?experienced UNIX systems managers about pass-
  446. X     word security. Just because the crypt() function cannot
  447. X     be  reversed  does  not  mean  that  your passwords are
  448. X     secure.  If this program helps  to  raise  the  overall
  449. X     quotient  of paranoia just one little bit, then it will
  450. X     have served its purpose and is all to the good.
  451. X
  452. XI am quite certain that some childish morons out there  will
  453. Xabuse  the  work that I have put into creating this program.
  454. XIt's up to them how they use it, but if it's used  for  some
  455. Xillegal  purpose it's not my intention, nor my fault. I hope
  456. X_________________________
  457. X  [0]
  458. X- UNIX is a trademark of Bell Laboratories.
  459. X  [1] Crack  is  available  for  anonymous   FTP   from
  460. Xwuarchive.wustl.edu (128.252.135.4) in ~/packages
  461. X
  462. X
  463. X
  464. X
  465. X                      August 21, 1991
  466. X
  467. X
  468. X
  469. X
  470. X
  471. X                           - 2 -
  472. X
  473. X
  474. Xthey get caught.
  475. X
  476. XCrack was not designed to do anything nasty, other  than  to
  477. Xattack  passwords  in  sensible order.  This is why I feel I
  478. Xcan post it to the net without fear of  recrimination.  This
  479. Xversion  of  Crack  is  supplied with a (hopefully) portable
  480. Xversion of fcrypt(), for speed reasons.  Fcrypt() is not yet
  481. Xwidely  available, but several versions have now been posted
  482. Xto USENET, and with the growing ability to access  anonymous
  483. XFTP  databases like Archie, I believe that people who really
  484. Xwant access to such programs as fcrypt() will be able to get
  485. Xthem  easily.   People who need them but don't have the time
  486. Xto look, on the other hand, will not get them.  This is  not
  487. Xa  good thing if you are a systems manager, because it gives
  488. Xthe crackers an advantage.  My philosophy  is:  give  it  to
  489. Xeveryone, then at least the people who need it can get it.
  490. X
  491. X2.  Fcrypt() Statistics
  492. X
  493. XThe version of fcrypt() that comes with Crack  is  some  3.4
  494. Xtimes  faster  than the version that was originally supplied
  495. Xto me, and should outperform most others which are  publicly
  496. Xavailable.   I  haven't tried many speed-demon style tricks,
  497. Xbut rather I have gone for portability, elegance and simpli-
  498. Xcity,  where  applicable  8-).   On  a  DECStation 5000/200,
  499. Xfcrypt() iterates ~550 times  per  second,  and  overall,  I
  500. Xmeasure  this  to  be 13 times faster than standard crypt().
  501. XThere are faster versions available, but  at  least  I  feel
  502. Xfree  to  redistrubute this version without stepping on any-
  503. Xones toes.
  504. X
  505. XA final note about my motives: If you  think  that  I  am  a
  506. Xmoron  for  writing  and then distributing this program, and
  507. Xyou think that the program is in itself dangerous, I suggest
  508. Xthat  you  carefully  consider the fact that any moron could
  509. Xhave written this program.  Flames to /dev/null, please.
  510. X
  511. X3.  Implementation
  512. X
  513. XI have tried to make Crack as portable as  possible  without
  514. Xcompromising speed.  Needless to say, it is imperfect in the
  515. Xthis respect, but I have tried.  If you have  problems  get-
  516. Xting  Crack up, please let me know what these problems were,
  517. Xand what system you were  trying  to  put  Crack  up  on.  I
  518. Xbelieve  that  Crack will work on Xenix and various versions
  519. Xof System V, but it may require a little effort if your UNIX
  520. Xis not fairly modern.
  521. X
  522. XThere have been some nasty stories sent  back  to  me  about
  523. Xproblems  encountered  due to the Crack script being written
  524. Xin c-shell.  Because of this, I enclose a  program  Crack.sh
  525. Xwhich  is  a functionally equivalent script in Bourne shell,
  526. Xusing nohup to kick the cracker off into the background.  If
  527. Xyour  version of c-shell is non standard (ie: not BSDish) or
  528. X
  529. X
  530. X
  531. X                      August 21, 1991
  532. X
  533. X
  534. X
  535. X
  536. X
  537. X                           - 3 -
  538. X
  539. X
  540. Xyou are worried, you may  use  Crack.sh  in  Crack's  place.
  541. XNote,  though,  that if you want to use the network options,
  542. Xyou will also have to  edit  Scripts/RCrack  to  change  the
  543. Xprogram-name  that is called on remote machines to Crack.sh.
  544. XFor more on this, see below.
  545. X
  546. XTo use the Crack -network option, you must have  rsh,  or  a
  547. Xsimilar  program.  rsh  is a BSD-ism which has become fairly
  548. Xcommon on non-BSD systems.  If you don't have  it  or  some-
  549. Xthing  similar,  let  me  know what you do have which might,
  550. Xwith a little ingenuity, do the job, and I shall see what  I
  551. Xcan do.  Again, have a look in Scripts/RCrack if you want to
  552. Xplay around.
  553. X
  554. X     Note: Xenix users and some others have a rcmd pro-
  555. X     gram  instead of rsh.  I'm not sure of the correct
  556. X     syntax for this program, but it should not be hard
  557. X     to  get  it  to work.  There is a note about it in
  558. X     Scripts/RCrack
  559. X
  560. X     On such System V based systems, users may also  be
  561. X     missing  the  BSD function gethostname().  If this
  562. X     is so, but you do have the  uname()  system  call,
  563. X     define  the  macro  CRACK_UNAME  in Sources/conf.h
  564. X     instead. This ought to fix the problem, but it may
  565. X     need  a little user intervention first (it depends
  566. X     where your header file for  uname()  is).   Caveat
  567. X     Emptor!
  568. X
  569. X4.  Method of Password Cracking
  570. X
  571. XCrack does not take the serial approach to password guessing
  572. Xthat  other  programs  like  the COPS password cracker does.
  573. XRather, Crack makes two  passes  over  the  users'  password
  574. Xentries.
  575. X
  576. XThe first pass bases its guesses  on  the  contents  of  the
  577. Xgecos field (containing the users' real name), and the user-
  578. Xname itself.  The first pass is fast and usually very fruit-
  579. Xful, and completes quite quickly.  You would be surprised at
  580. Xthe number of spods out there who  still  think  that  their
  581. Xmiddle name, backwards and capitalised, is a good password.
  582. X
  583. XThe second pass is made by encrypting several  pre-processed
  584. Xdictionaries  on  the  fly,  and  comparing the results with
  585. Xusers passwords.  Crack optimises the number of calls to the
  586. Xencryption  function  by sorting the user passwords by their
  587. Xencryption salt before loading,  so  that  the  dictionaries
  588. Xonly  have  to  be  encrypted  once for each different salt.
  589. XThis generally saves about 30% of the calls you  would  have
  590. Xto make to crypt().
  591. X
  592. XThe preprocessed dictionaries are  created  my  merging  the
  593. Xsource  dictionaries found in the directory DictSrc and then
  594. X
  595. X
  596. X
  597. X                      August 21, 1991
  598. X
  599. X
  600. X
  601. X
  602. X
  603. X                           - 4 -
  604. X
  605. X
  606. Xtruncating, sorting and uniq'ing the output from the prepro-
  607. Xcessor.   The default dictionaries named are /usr/dict/words
  608. Xwhich  provides  the   bulk   of   the   input   data,   and
  609. XDictSrc/bad_pws.dat  which  is meant to provide all of those
  610. Xnon-dictionary passwords, such as 12345678 or qwerty.[2]
  611. X
  612. XIf you wish to add a dictionary of your own,  just  copy  it
  613. Xinto  the  DictSrc directory and then delete the contents of
  614. Xthe Dicts directory.  Your new dictionary will be merged  in
  615. Xon the next run.  Do not worry about replication of data, as
  616. Xthe preprocessor driver script sorts  and  uniq's  the  data
  617. Xbefore putting it into the Dicts directory.
  618. X
  619. XThe formats of the output dictionaries are:
  620. X
  621. Xa)   Unique words that have been forced lowercase, forwards.
  622. X     These are the most common passwords you will find, thus
  623. X     they are tried first.
  624. X
  625. Xb)   Dictionary words which have been  artificially  plural-
  626. X     ised, because not many dictionaries contain plurals.
  627. X
  628. Xc)   Dictionary words which were supplied in mixed-case (eg:
  629. X     Capitalised).
  630. X
  631. Xd)   Dictionary words forced lowercase and backwards.
  632. X
  633. Xe)   Dictionary words, forced lowercase, with a  leading  or
  634. X     trailing  0  or  1  (this  may  be  extended by hacking
  635. X     Sources/crack-pp.c).
  636. X
  637. Xf)   Dictionary words, forced uppercase, forwards.
  638. X
  639. Xg)   Dictionary words, forced uppercase, backwards.
  640. X
  641. Xh)   Dictionary words which  were  supplied  in  mixed-case,
  642. X     backwards (eg: desilatipaC).
  643. X
  644. X
  645. XThis choice of attack is entirely  empirical,  my  own,  and
  646. Xmade up on the spot.  It has also been horrendously success-
  647. Xful, and because Crack uses each of  these  dictionaries  in
  648. Xturn,  it  tends to get passwords faster than a program like
  649. Xthe COPS password cracker which tries words  every-which-way
  650. Xfor each user.[3]
  651. X_________________________
  652. X  [2] Extra dictionaries (those used in Dan Klein's pa-
  653. Xper,  below)  can  be  obtained  via anonymous FTP from
  654. Xuunet.uu.net (192.48.96.2) as ~/pub/dictionaries.tar.Z
  655. X  [3] For more information, see "Foiling the Cracker: A
  656. XSurvey of, and Improvements to, Password  Security"  by
  657. XDaniel Klein, available from major FTP sites.
  658. X
  659. X
  660. X
  661. X
  662. X                      August 21, 1991
  663. X
  664. X
  665. X
  666. X
  667. X
  668. X                           - 5 -
  669. X
  670. X
  671. X     Optimisation  Note:  Crack  has  an   compile-time
  672. X     option,  called CRACK_SHORT_PASSWDS, which, if not
  673. X     defined, makes the dictionary  preprocessor  throw
  674. X     away  words which are less than 5 characters long.
  675. X     The reasoning for this is that many sites, with  a
  676. X     semi-sensible  passwd program, will not have pass-
  677. X     words shorter than 5 characters long.
  678. X
  679. X     It is up to you whether you bother  testing  these
  680. X     short passwords, but I would recommend that you do
  681. X     so at least once, to be safe.  (Setting the option
  682. X     also  leads  to  having smaller pre-processed dic-
  683. X     tionaries.  The option,  however,  is  defined  by
  684. X     default)
  685. X
  686. X5.  Installation
  687. X
  688. XCrack is one of those most  unusual  of  beasties,  a  self-
  689. Xinstalling   program.    Once  the  necessary  configuration
  690. Xoptions have been  set,  the  executables  are  created  via
  691. X'make' by running the main shellscript.
  692. X
  693. XSome people have complained about this  apparent  weirdness,
  694. Xbut  it has grown up with Crack ever since the earliest net-
  695. Xwork version, when I could  not  be  bothered  to  log  into
  696. Xseveral  different machines with several different architec-
  697. Xtures, just in order to build the binaries.
  698. X
  699. XCrack needs to know where it  has  been  installed.   Please
  700. Xedit the CRACK_HOME variable in the Crack shellscript to the
  701. Xcorrect value.  This variable should be set to  an  absolute
  702. Xpath name (relative to ~user is OK) through which the direc-
  703. Xtory containing Crack may be accessed on  all  the  machines
  704. Xthat Crack will be run on.
  705. X
  706. XThe other bit of installation you will have to do is  decide
  707. Xwhether you will want to use the -network option. If you do,
  708. Xedit the file Sources/conf.h and  define  the  CRACK_NETWORK
  709. Xsymbol.  This forces Crack to create all of its output files
  710. Xwith an embedded hostname  (obtained  by  the  gethostname()
  711. Xroutine)  so that you can keep track of output from all over
  712. Xthe network.  If  you  have  no  gethostname()  but  have  a
  713. Xuname()  system  call, you can use that instead, by defining
  714. XCRACK_UNAME in Sources/conf.h.
  715. X
  716. XYou will then have to generate a Scripts/network.conf  file.
  717. XThis  contains  a  list  of  hostnames to rsh to, what their
  718. Xbinary type is (useful  when  running  a  network  Crack  on
  719. Xseveral  different  architectures),  a  guesstimate of their
  720. Xrelative power (take your  slowest  machine  as  unary,  and
  721. Xmeasure  all  others relative to it), and a list of per-host
  722. Xdefault flags.  There is an example of such a file  provided
  723. Xin the Scripts directory - take a look at it.
  724. X
  725. X
  726. X
  727. X
  728. X                      August 21, 1991
  729. X
  730. X
  731. X
  732. X
  733. X
  734. X                           - 6 -
  735. X
  736. X
  737. XI also recommend that you play around with the  #defines  in
  738. Xthe  file  Sources/conf.h.   Each  switch  has  a small note
  739. Xexplaining its meaning.  Where I've been in doubt about  the
  740. Xportability  of  certain library functions, usually I've re-
  741. Xwritten it, so it shouldn't be much of a  problem.   Let  me
  742. Xknow of your problems. 8-).
  743. X
  744. X6.  Crack Usage
  745. X
  746. X
  747. XCrack [options] [bindir] /etc/passwd [...other passwd files]
  748. X
  749. XCrack -network [options] /etc/passwd [...other passwd files]
  750. X
  751. X
  752. XWhere bindir is the optional name of the directory where you
  753. Xwant  the binaries installed.  This is useful where you want
  754. Xto be able to run versions of  Crack  on  several  different
  755. Xarchitectures.  If  bindir does not exist, a warning will be
  756. Xissued, and the directory, created.
  757. X
  758. X     Note: bindir defaults to the name generic  if  not
  759. X     supplied.
  760. X
  761. X     Yellow Pages (NIS) Users: I have had some  queries
  762. X     about  how to get Crack running from a YP password
  763. X     file.  There are several methods, but by  far  the
  764. X     simplest  is  to  generate a passwd format file by
  765. X     running:-
  766. X
  767. X                    ypcat passwd > passwd.yp
  768. X
  769. X     and then running Crack on this file.
  770. X
  771. X7.  Options
  772. X
  773. X-network
  774. X     Throws Crack into network mode, in which it  reads  the
  775. X     Scripts/network.conf file, splits its input into chunks
  776. X     which are sized according to the power  of  the  target
  777. X     machine,  and  calls  rsh to run Crack on that machine.
  778. X     Options for Crack running on the target machine may  be
  779. X     supplied  on  the  command line (eg: verbose or recover
  780. X     mode), or in the network.conf file if they  pertain  to
  781. X     specific hosts (eg: nice() values).
  782. X
  783. X-v   Sets verbose mode, whereby Crack will print every guess
  784. X     it is trying on a per-user basis.  This is a very quick
  785. X     way of flooding your filestore.  If  you  undefine  the
  786. X     CRACK_VERBOSE  symbol  in  Sources/conf.h, verbose mode
  787. X     will be permanently disabled.
  788. X
  789. X-nvalue
  790. X     Sets the process to be nice()ed to value, so  that  the
  791. X
  792. X
  793. X
  794. X                      August 21, 1991
  795. X
  796. X
  797. X
  798. X
  799. X
  800. X                           - 7 -
  801. X
  802. X
  803. X     switch -n19 sets the Crack process to run at the lowest
  804. X     priority.
  805. X
  806. X-rpointfile
  807. X     This is only for use  when  running  in  recover  mode.
  808. X     When  a  running  Crack  starts pass 2, it periodically
  809. X     saves  its  state  in  a  file  named  point.<pid>   or
  810. X     point.<hostname>.<pid> depending on your naming conven-
  811. X     tion (see "Installation", above).   This  file  can  be
  812. X     used  to  recover  where  you were should a host crash.
  813. X     Simply invoke Crack in exactly the same manner  as  the
  814. X     last  time,  with the addition of the -rpoint.file.name
  815. X     switch.  Crack will startup and read the file, and jump
  816. X     to  slightly  before  where  it  left  off.  If you are
  817. X     cracking a very large  password  file,  this  can  save
  818. X     oodles of time after a crash.
  819. X
  820. X     If you are running a network Crack, then the  jobs
  821. X     will again be spawned onto all the machines of the
  822. X     original Crack.  The program will then check  that
  823. X     the  host  it is running on is the same as is men-
  824. X     tioned in the pointfile.  If it is  not,  it  will
  825. X     silently  die.  Thus, assuming that you supply the
  826. X     same  input  data   and   do   not   change   your
  827. X     network.conf  file,  Crack  should pick up exactly
  828. X     where it left off.  This is a bit  inelegant,  but
  829. X     it's better than nothing at the moment.
  830. X
  831. X8.  Multiprocessing and parallelism
  832. X
  833. XThe method of error recovery outlined above causes headaches
  834. Xfor  users who want to do multiprocessing on parallel archi-
  835. Xtectures.  Crack is in no way parallel, and because  of  the
  836. Xway  it's  structured,  readind stdin from shellscript fron-
  837. Xtends, it is a pain  to  divide  the  work  amongst  several
  838. Xprocesses via fork()ing.
  839. X
  840. XThe hack solution to get several copies of Crack running  on
  841. Xone  machine  with n processors at the moment is to run with
  842. Xthe CRACK_NETWORK option enabled, and insert n copies of the
  843. Xentry     for     your    parallel    machine    into    the
  844. XScripts/network.conf file. If you use the -r option in these
  845. Xcircumstances   however,  you  will  get  n  copies  of  the
  846. Xrecovered process running, only one of them  will  have  the
  847. Xcorrect  input data.  I'm working on this.  My current solu-
  848. Xtion is to save the current username in the checkpoint file,
  849. Xand  test  it  on  startup,  but  doing  this may break your
  850. Xrecovery if you supply different input  data  (so  that  the
  851. Xdata  is  sorted even slightly differently).  Hohum.  If you
  852. Xwant to use this verify username facility, use -R  in  place
  853. Xof -r.
  854. X
  855. XAs for not using the network.conf file to provide  multipro-
  856. Xcessing, I'm working on it.
  857. X
  858. X
  859. X
  860. X                      August 21, 1991
  861. X
  862. X
  863. X
  864. X
  865. X
  866. X                           - 8 -
  867. X
  868. X
  869. X9.  Notes on fast crypt() implementations
  870. X
  871. XThe stdlib version of the crypt() subroutine  is  incredibly
  872. Xslow.   It is a massive bottleneck to the execution of Crack
  873. Xand on typical platforms that you get at universities, it is
  874. Xrare to find a machine which will achieve more than 50 stan-
  875. Xdard crypt()s per second.  On low-end diskless workstations,
  876. Xyou  may  expect 2 or 3 per second.  It was this slowness of
  877. Xthe crypt() algorithm which originally supplied much of  the
  878. Xsecurity UNIX needed.[4]
  879. X
  880. XHowever, there are now many implementations of  faster  ver-
  881. Xsions  of  crypt() to be found on the network.  The one sup-
  882. Xplied with Crack v3.2 and upwards is called fcrypt().
  883. X
  884. Xfcrypt() was  originally  written  in  May  1986  by  Robert
  885. XBaldwin at MIT, and is a good version of the crypt() subrou-
  886. Xtine.  I received a copy from Icarus Sparry at Bath  Univer-
  887. Xsity,  who  had made a couple of portability enhancements to
  888. Xthe code.
  889. X
  890. XI rewrote most of the tables and the KeySchedule  generating
  891. Xalgorithm  in  the original fdes-init.c to knock 40% off the
  892. Xexecution overhead of fcrypt()  in  the  form  that  it  was
  893. Xshipped  to  me.   I inlined a bunch of stuff, put it into a
  894. Xsingle file, got  some  advice  from  Matt  Bishop  and  Bob
  895. XBaldwin  [both  of whom I am greatly indebted to] about what
  896. Xto do to the xform() routine  and  to  the  fcrypt  function
  897. Xitself, and tidied up some algorithms.  I've also added more
  898. Xlookup tables and reduced several formula  for  faster  use.
  899. Xfcrypt()  is  now  barely recognisable as being based on its
  900. Xformer incarnation.
  901. X
  902. XOn a DecStation 5000/200, it is also ~13 times  faster  than
  903. Xthe  standard crypt (your mileage may vary with other archi-
  904. Xtectures and compilers).  This speed puts fcrypt() into  the
  905. X"moderately fast" league of crypt implementations.  By using
  906. Xfcrypt() with Crack, I extracted 135 passwords from my stan-
  907. Xdard 1087 user password file in a little over 1 hour using 3
  908. Xnetworked machines.  This is from a moderately good password
  909. Xfile.
  910. X
  911. XWhy am I saying this sort of thing ? Am I  scaremongering  ?
  912. XIn a word, yes.
  913. X
  914. XIf a fast version of crypt() is wired into  a  program  like
  915. XCrack it can break a poorly passworded site open in minutes.
  916. XThere are such programs available, eg: the "Killer  Cracker"
  917. Xwritten  by the anonymous "Doctor Dissector", with anonymous
  918. Xmotives.  It comes with  a  modified  version  of  Baldwin's
  919. X_________________________
  920. X  [4] See: "Password Security, A Case History"  by  Bob
  921. XMorris & Ken Thomson, in the UNIX Programmer Docs.
  922. X
  923. X
  924. X
  925. X                      August 21, 1991
  926. X
  927. X
  928. X
  929. X
  930. X
  931. X                           - 9 -
  932. X
  933. X
  934. Xfcrypt, as a MS-DOS executable with a GNU copyleft licence.
  935. X
  936. XThe point that needs to be  hammered  home  is  that  unless
  937. Xsomething  is done, and done soon, about the general quality
  938. Xof passwords on UNIX systems, then in the  near  future  our
  939. Xdoors  will  be  wide  open to people who have programs like
  940. XCrack and questionable motives.
  941. X
  942. X10.  Solutions and Conclusions
  943. X
  944. XWhat can be done about this form of attack ?
  945. X
  946. XYou must get  a  drop-in  replacement  for  the  passwd  and
  947. Xyppasswd  commands; one which will stop people from choosing
  948. Xbad passwords in the first place.  There  are  several  pro-
  949. Xgrams  to  do this; Matt Bishop's passwd+ and Clyde Hoover's
  950. Xnpasswd program are good examples which  are  freely  avail-
  951. Xable.   Consult an Archie database for more details on where
  952. Xyou can get them from.
  953. X
  954. XA little common-sense is all that is required to  vet  pass-
  955. Xwords:   I   enclose  a  module  in  the  Sources  directory
  956. Xgoodpass.c which I use in a modified version of the yppasswd
  957. Xin order to provide some security.  It is quite heavily cus-
  958. Xtomised for use in the UK, but it should be easily portable.
  959. XThe routine is invoked:
  960. X
  961. X
  962. X           char *retval = GoodPass(char *input);
  963. X
  964. X
  965. Xwhere input is the password under test, and retval  will  be
  966. Xset  either to NULL (if the password is OK) or to a diagnos-
  967. Xtic string which says what is wrong with the  password.   It
  968. Xis far less complex than a system such as passwd+, but still
  969. Xeffective enough to make a password  file  withstand  Crack.
  970. XIt would be nice if an organisation (such as CERT?) could be
  971. Xpersuaded to supply skeletons of  sensible  passwd  commands
  972. Xfor  the  public  good,  as  well  as an archive of security
  973. Xrelated utilities[5] on top of the excellent COPS.  However,
  974. Xfor UNIX security to improve on a global scale, we will also
  975. Xrequire pressure on the vendors, so that programs are  writ-
  976. Xten correctly from the beginning.
  977. X
  978. X
  979. X
  980. X
  981. X
  982. X
  983. X_________________________
  984. X  [5] COPS  is  available  for   anonymous   FTP   from
  985. Xcert.sei.cmu.edu (128.237.253.5) in ~/cops
  986. X
  987. X
  988. X
  989. X
  990. X                      August 21, 1991
  991. X
  992. X
  993. END_OF_FILE
  994. if test 21446 -ne `wc -c <'README'`; then
  995.     echo shar: \"'README'\" unpacked with wrong size!
  996. fi
  997. # end of 'README'
  998. fi
  999. if test -f 'README.FIRST' -a "${1}" != "-c" ; then 
  1000.   echo shar: Will not clobber existing file \"'README.FIRST'\"
  1001. else
  1002. echo shar: Extracting \"'README.FIRST'\" \(1310 characters\)
  1003. sed "s/^X//" >'README.FIRST' <<'END_OF_FILE'
  1004. XThis is Crack, v3.2a+fcrypt() : A sensible password cracker for Unix.
  1005. X
  1006. XDocumentation provided is in the "README" file, which I've handhacked
  1007. Xdown to a unutterably boring text file.  The "README.ms" file in "Docs"
  1008. Xgenerates a far prettier output using "nroff -ms", and "Docs/README.ps"
  1009. Xis even prettier still.  I suggest that you start br reading one of
  1010. Xthese files.
  1011. X
  1012. XCrack+fcrypt() works on Ultrix and SunOS, and probably on a lot of other
  1013. Xthings too.  AIX has problems with creating a crypt compatible fcrypt().
  1014. XFor a list of the current problems, see the BUGS file.  At worst, just
  1015. Xrun with the version of 'crypt()' which comes with your system.
  1016. X
  1017. XTo install: Just create a directory to keep it all in, move the shar
  1018. Xfiles into the directory, and run them.
  1019. X
  1020. XThe most patently obvious difference from the last release is that I
  1021. Xhave provided two versions of the driver script "Crack" - one in 'csh'
  1022. Xand one in 'sh'.  If the 'sh' one works out okay, I'll eventually trash
  1023. Xthe 'csh' version.
  1024. X
  1025. XIf you have problems, let me know, so long as they're not too personal.
  1026. X
  1027. X- Alec 8-)
  1028. X
  1029. X--
  1030. XINET: aem@aber.ac.uk      JANET: aem@uk.ac.aber      BITNET: aem%aber@ukacrl
  1031. XUUCP: ...!mcsun!ukc!aber!aem         ARPA: aem%uk.ac.aber@nsfnet-relay.ac.uk
  1032. XSNAIL: Alec Muffett, Computer Unit, Llandinam UCW, Aberystwyth, UK, SY23 3DB
  1033. END_OF_FILE
  1034. if test 1310 -ne `wc -c <'README.FIRST'`; then
  1035.     echo shar: \"'README.FIRST'\" unpacked with wrong size!
  1036. fi
  1037. # end of 'README.FIRST'
  1038. fi
  1039. if test ! -d 'Scripts' ; then
  1040.     echo shar: Creating directory \"'Scripts'\"
  1041.     mkdir 'Scripts'
  1042. fi
  1043. if test -f 'Scripts/Crack.network' -a "${1}" != "-c" ; then 
  1044.   echo shar: Will not clobber existing file \"'Scripts/Crack.network'\"
  1045. else
  1046. echo shar: Extracting \"'Scripts/Crack.network'\" \(2052 characters\)
  1047. sed "s/^X//" >'Scripts/Crack.network' <<'END_OF_FILE'
  1048. X#!/bin/sh
  1049. X
  1050. X###
  1051. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1052. X# as part of the 'Crack' password cracking package.
  1053. X###
  1054. X
  1055. X###
  1056. X# This program reads the network.conf and breaks up the sorted password
  1057. X# file and kicks "Crack" up on all the machines and feeds the file to it.
  1058. X###
  1059. X
  1060. X###
  1061. X# Okay, if you don't like this bit of code, YOU think of a totally
  1062. X# portable way to do this - in shell scripts without using PERL - Alec.
  1063. X###
  1064. X
  1065. Xcf=Scripts/network.conf
  1066. Xtf=/tmp/mcpwfs.$$
  1067. X
  1068. X###
  1069. X# Check that the config file is in place
  1070. X###
  1071. X
  1072. Xif [ ! -f $cf -o ! -s $cf ]
  1073. Xthen
  1074. X    echo "Crack.network: empty or missing config file: $cf"
  1075. X    exit 1
  1076. Xfi
  1077. X
  1078. Xargs=""
  1079. Xfiles=""
  1080. X
  1081. Xfor i in $*
  1082. Xdo
  1083. X    if [ -f "$i" ]
  1084. X    then
  1085. X        files="$files $i"
  1086. X    else
  1087. X        args="$args $i"
  1088. X    fi
  1089. Xdone
  1090. X
  1091. Xecho "Merging data."
  1092. X
  1093. XScripts/joinfiles $files > $tf
  1094. Xlines=`wc -l < $tf`
  1095. X
  1096. Xecho "Starting analysis for Network-Crack."
  1097. X
  1098. Xcat $cf |
  1099. Xgrep -v '^#' |
  1100. Xsort +2 -n |
  1101. Xawk '
  1102. XBEGIN {
  1103. X    hostcount = 0;
  1104. X    totalweight = 0;
  1105. X    linecount = '"$lines"';
  1106. X    iargs = "'"$args"'";
  1107. X    file = "'"$tf"'";
  1108. X}
  1109. X
  1110. X/^[a-zA-Z0-9]/ {
  1111. X    hostname[hostcount] = $1;
  1112. X    cputype[hostcount] = $2;
  1113. X    weight[hostcount] = $3;
  1114. X    totalweight += $3;
  1115. X    args[hostcount] = iargs;
  1116. X    for (i = 4; i <= NF && substr($i,1,1) != "#"; i++)
  1117. X    {
  1118. X        args[hostcount] = args[hostcount] " " $i;
  1119. X    }
  1120. X    hostcount++;
  1121. X}
  1122. X
  1123. XEND {
  1124. X    done = 1;
  1125. X    todo = linecount;
  1126. X    print "echo Users:", linecount;
  1127. X    print "echo Remote Hosts:", hostcount;
  1128. X
  1129. X    for (i = 0; i < hostcount; i++)
  1130. X    {
  1131. X        if (i < hostcount - 1)
  1132. X        {
  1133. X            slice = weight[i] / totalweight;    # fraction
  1134. X            slice *= linecount;            # percentage
  1135. X            slice = int(slice);            # round down
  1136. X            todo -= slice;                # remainder
  1137. X        } else
  1138. X        {
  1139. X            slice = todo;    # fastest machine gets the rest.
  1140. X            todo = 0;
  1141. X        }
  1142. X        if (slice > 0)
  1143. X        {
  1144. X            print "echo Calling", hostname[i], "for", slice, "users";
  1145. X            line = sprintf("Scripts/RCrack %s %s %d %d %s < %s\n", \
  1146. X                hostname[i],\
  1147. X                cputype[i], \
  1148. X                done, \
  1149. X                done + slice - 1, \
  1150. X                args[i], \
  1151. X                file);
  1152. X            print "echo", line;
  1153. X            print line;
  1154. X        }
  1155. X        done += slice;
  1156. X    }
  1157. X}' | sh        # I'll bet you didn't expect this...
  1158. X
  1159. Xrm $tf
  1160. END_OF_FILE
  1161. if test 2052 -ne `wc -c <'Scripts/Crack.network'`; then
  1162.     echo shar: \"'Scripts/Crack.network'\" unpacked with wrong size!
  1163. fi
  1164. chmod +x 'Scripts/Crack.network'
  1165. # end of 'Scripts/Crack.network'
  1166. fi
  1167. if test -f 'Scripts/RCrack' -a "${1}" != "-c" ; then 
  1168.   echo shar: Will not clobber existing file \"'Scripts/RCrack'\"
  1169. else
  1170. echo shar: Extracting \"'Scripts/RCrack'\" \(590 characters\)
  1171. sed "s/^X//" >'Scripts/RCrack' <<'END_OF_FILE'
  1172. X#!/bin/sh
  1173. X
  1174. X###
  1175. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1176. X# as part of the 'Crack' password cracking package.
  1177. X###
  1178. X
  1179. Xremote_shell="rsh"      # This could be 'rcmd' for, say, Xenix stuff
  1180. Xcrack_prog="Crack"    # This could be "Crack.sh", for users with csh probs.
  1181. X
  1182. Xhost=$1
  1183. Xshift
  1184. Xtype=$1
  1185. Xshift
  1186. Xstartline=$1
  1187. Xshift
  1188. Xstopline=$1
  1189. Xshift
  1190. Xargs="$*"
  1191. X
  1192. Xawk 'NR >= '"$startline"' && NR <= '"$stopline"'{print $0;} {next;}' |
  1193. X$remote_shell $host "$CRACK_HOME/$crack_prog" -remote $args $type
  1194. X             #^^^^^^^^^^^^^^^^^^^^^^
  1195. X             # This is quoted to allow ~username through unexpanded
  1196. END_OF_FILE
  1197. if test 590 -ne `wc -c <'Scripts/RCrack'`; then
  1198.     echo shar: \"'Scripts/RCrack'\" unpacked with wrong size!
  1199. fi
  1200. chmod +x 'Scripts/RCrack'
  1201. # end of 'Scripts/RCrack'
  1202. fi
  1203. if test -f 'Scripts/clean' -a "${1}" != "-c" ; then 
  1204.   echo shar: Will not clobber existing file \"'Scripts/clean'\"
  1205. else
  1206. echo shar: Extracting \"'Scripts/clean'\" \(189 characters\)
  1207. sed "s/^X//" >'Scripts/clean' <<'END_OF_FILE'
  1208. X#!/bin/sh
  1209. X
  1210. X###
  1211. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1212. X# as part of the 'Crack' password cracking package.
  1213. X###
  1214. X
  1215. Xmake -f Scripts/crack.mf clean > /dev/null 2>&1
  1216. END_OF_FILE
  1217. if test 189 -ne `wc -c <'Scripts/clean'`; then
  1218.     echo shar: \"'Scripts/clean'\" unpacked with wrong size!
  1219. fi
  1220. chmod +x 'Scripts/clean'
  1221. # end of 'Scripts/clean'
  1222. fi
  1223. if test -f 'Scripts/crack.mf' -a "${1}" != "-c" ; then 
  1224.   echo shar: Will not clobber existing file \"'Scripts/crack.mf'\"
  1225. else
  1226. echo shar: Extracting \"'Scripts/crack.mf'\" \(776 characters\)
  1227. sed "s/^X//" >'Scripts/crack.mf' <<'END_OF_FILE'
  1228. X###
  1229. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1230. X# as part of the 'Crack' password cracking package.
  1231. X###
  1232. X
  1233. X###
  1234. X# Add other dictionaries here, absolute path, or relative to $CRACK_HOME
  1235. X#
  1236. XDICTSRC=    /usr/dict/words DictSrc/*
  1237. X
  1238. X###
  1239. X# Not-so configurable bitz...
  1240. X###
  1241. XPPDRIVER=    Scripts/makedicts
  1242. XSRCDIR=        Sources
  1243. XDICTDIR=    Dicts
  1244. XDS=        $(DICTDIR)/dictstamp
  1245. X
  1246. Xdictstamp:    $(DS)
  1247. X
  1248. X###
  1249. X# You could have a dependency here, but it would make an awfful mess of
  1250. X# using wildcards
  1251. X$(DS):
  1252. X        @echo Using Sources '$(DICTSRC)'
  1253. X        ( cd $$CRACK_ARCH && make crack-pp )
  1254. X        $(PPDRIVER) $(DICTDIR) $(DICTSRC)
  1255. X        touch $(DS)
  1256. X
  1257. Xcleanprogs:
  1258. X        -( cd $(SRCDIR) && make clean )
  1259. X
  1260. Xclean:        cleanprogs
  1261. X        -rm -f die.* out.* point.* dict.? nohup.out
  1262. X
  1263. Xspotless:    clean
  1264. X        -( cd $(DICTDIR) && rm dict* )
  1265. END_OF_FILE
  1266. if test 776 -ne `wc -c <'Scripts/crack.mf'`; then
  1267.     echo shar: \"'Scripts/crack.mf'\" unpacked with wrong size!
  1268. fi
  1269. # end of 'Scripts/crack.mf'
  1270. fi
  1271. if test -f 'Scripts/install.mf' -a "${1}" != "-c" ; then 
  1272.   echo shar: Will not clobber existing file \"'Scripts/install.mf'\"
  1273. else
  1274. echo shar: Extracting \"'Scripts/install.mf'\" \(375 characters\)
  1275. sed "s/^X//" >'Scripts/install.mf' <<'END_OF_FILE'
  1276. X###
  1277. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1278. X# as part of the 'Crack' password cracking package.
  1279. X###
  1280. X
  1281. XSD=    ../Sources
  1282. X
  1283. Xsource:    crack-pp crack-pwc
  1284. X    touch source
  1285. X
  1286. Xcrack-pp: $(SD)/crack-pp.c $(SD)/conf.h
  1287. X    ( cd $(SD) ; make crack-pp )
  1288. X    cp $(SD)/crack-pp .
  1289. X
  1290. Xcrack-pwc: $(SD)/crack-pwc.c $(SD)/conf.h
  1291. X    ( cd $(SD) ; make crack-pwc )
  1292. X    cp $(SD)/crack-pwc .
  1293. END_OF_FILE
  1294. if test 375 -ne `wc -c <'Scripts/install.mf'`; then
  1295.     echo shar: \"'Scripts/install.mf'\" unpacked with wrong size!
  1296. fi
  1297. # end of 'Scripts/install.mf'
  1298. fi
  1299. if test -f 'Scripts/joinfiles' -a "${1}" != "-c" ; then 
  1300.   echo shar: Will not clobber existing file \"'Scripts/joinfiles'\"
  1301. else
  1302. echo shar: Extracting \"'Scripts/joinfiles'\" \(844 characters\)
  1303. sed "s/^X//" >'Scripts/joinfiles' <<'END_OF_FILE'
  1304. X#!/bin/sh
  1305. X
  1306. X###
  1307. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1308. X# as part of the 'Crack' password cracking package.
  1309. X###
  1310. X
  1311. Xwarn=out.initial.$$
  1312. X
  1313. X###
  1314. X# Empty the output file...
  1315. X> $warn
  1316. X
  1317. X###
  1318. X# As Walt Disney would say, we start with a simple bracket:-
  1319. X
  1320. X(
  1321. Xfor file in $*
  1322. Xdo
  1323. X
  1324. Xawk '
  1325. XBEGIN {
  1326. X    FS = ":";
  1327. X    warn="'$warn'";
  1328. X    file = "'$file'";
  1329. X    date = "'"`date`"'";
  1330. X    date = substr(date, 5, 15);
  1331. X}
  1332. X
  1333. Xsubstr($2,1,1) == "!" || substr($2,1,1) == "*" {
  1334. X    printf("join: %s User %s (in %s) has a locked password.\n", \
  1335. X        date, $1, file) >> warn;
  1336. X    next;
  1337. X}
  1338. X
  1339. X$2 == "" {
  1340. X    printf("join: %s Warning! %s (%s in %s) has a NULL password!\n", \
  1341. X        date, $1, $7, file) >> warn;
  1342. X    next;
  1343. X}
  1344. X
  1345. X/^[A-Za-z]/ {
  1346. X    print file ":" $0;
  1347. X}
  1348. X        ' < $file
  1349. Xdone
  1350. X
  1351. X###
  1352. X# Using a pipe is a bit faster - no bloody fs action.
  1353. X###
  1354. X
  1355. X) | sort -t: +2             # sort all of them by salt
  1356. X
  1357. Xexit 0
  1358. END_OF_FILE
  1359. if test 844 -ne `wc -c <'Scripts/joinfiles'`; then
  1360.     echo shar: \"'Scripts/joinfiles'\" unpacked with wrong size!
  1361. fi
  1362. chmod +x 'Scripts/joinfiles'
  1363. # end of 'Scripts/joinfiles'
  1364. fi
  1365. if test -f 'Scripts/makedicts' -a "${1}" != "-c" ; then 
  1366.   echo shar: Will not clobber existing file \"'Scripts/makedicts'\"
  1367. else
  1368. echo shar: Extracting \"'Scripts/makedicts'\" \(449 characters\)
  1369. sed "s/^X//" >'Scripts/makedicts' <<'END_OF_FILE'
  1370. X#!/bin/sh
  1371. X
  1372. X###
  1373. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1374. X# as part of the 'Crack' password cracking package.
  1375. X###
  1376. X
  1377. Xpp="$CRACK_ARCH/crack-pp"
  1378. Xdictdir=$1
  1379. X
  1380. Xshift
  1381. X
  1382. Xif [ ! -f $pp ]
  1383. Xthen
  1384. X    echo "$0: No preprocessor $pp! How the hell did this happen!"
  1385. X    exit 1
  1386. Xfi
  1387. X
  1388. Xrm -f $dictdir/dict.*
  1389. X
  1390. X$pp $*
  1391. X
  1392. Xecho "Compacting. This may take some time..."
  1393. X
  1394. Xfor i in dict.*
  1395. Xdo
  1396. X    sort -r $i | uniq > $dictdir/$i
  1397. X    rm -f $i
  1398. X    echo Done $i
  1399. Xdone
  1400. X
  1401. Xexit 0
  1402. END_OF_FILE
  1403. if test 449 -ne `wc -c <'Scripts/makedicts'`; then
  1404.     echo shar: \"'Scripts/makedicts'\" unpacked with wrong size!
  1405. fi
  1406. chmod +x 'Scripts/makedicts'
  1407. # end of 'Scripts/makedicts'
  1408. fi
  1409. if test -f 'Scripts/network.conf' -a "${1}" != "-c" ; then 
  1410.   echo shar: Will not clobber existing file \"'Scripts/network.conf'\"
  1411. else
  1412. echo shar: Extracting \"'Scripts/network.conf'\" \(188 characters\)
  1413. sed "s/^X//" >'Scripts/network.conf' <<'END_OF_FILE'
  1414. X###
  1415. X# Format of this file :-
  1416. X###
  1417. X# hostname     binary_directory     relative_power     args    # comments
  1418. X###
  1419. Xaberda        mipsel            10        -n19
  1420. Xaberdb        mipsel            10        -n19
  1421. Xaberdc        mipsel            11
  1422. Xaberdq        sun4            8
  1423. END_OF_FILE
  1424. if test 188 -ne `wc -c <'Scripts/network.conf'`; then
  1425.     echo shar: \"'Scripts/network.conf'\" unpacked with wrong size!
  1426. fi
  1427. # end of 'Scripts/network.conf'
  1428. fi
  1429. if test -f 'Scripts/network.conf.example' -a "${1}" != "-c" ; then 
  1430.   echo shar: Will not clobber existing file \"'Scripts/network.conf.example'\"
  1431. else
  1432. echo shar: Extracting \"'Scripts/network.conf.example'\" \(381 characters\)
  1433. sed "s/^X//" >'Scripts/network.conf.example' <<'END_OF_FILE'
  1434. X###
  1435. X# Format of this file :-
  1436. X###
  1437. X# hostname     binary_directory     relative_power     args    # comments
  1438. X###
  1439. Xaberdc         mipsel             11            # DS5000/200
  1440. Xaberda         mipsel             10         -n10    # DEC 5830    
  1441. Xaberdb         mipsel             10         -n10    # DEC 5830
  1442. Xaberdq        sun4            8            # Sun 4/330
  1443. Xdecgca        mipsel            5        -n19    # DS3100
  1444. Xsunga        sun3            1        -n19    # Sun 3/50
  1445. Xsungb        sun3            1        -n19    # Sun 3/50
  1446. Xsungc        sun3            1        -n19    # Sun 3/50
  1447. END_OF_FILE
  1448. if test 381 -ne `wc -c <'Scripts/network.conf.example'`; then
  1449.     echo shar: \"'Scripts/network.conf.example'\" unpacked with wrong size!
  1450. fi
  1451. # end of 'Scripts/network.conf.example'
  1452. fi
  1453. if test -f 'Scripts/plaster' -a "${1}" != "-c" ; then 
  1454.   echo shar: Will not clobber existing file \"'Scripts/plaster'\"
  1455. else
  1456. echo shar: Extracting \"'Scripts/plaster'\" \(377 characters\)
  1457. sed "s/^X//" >'Scripts/plaster' <<'END_OF_FILE'
  1458. X#!/bin/sh
  1459. X
  1460. X###
  1461. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1462. X# as part of the 'Crack' password cracking package.
  1463. X###
  1464. X
  1465. X###
  1466. X# This program provides a quick network murder if running "Crack -network"
  1467. X###
  1468. X# The name is Chris Samuel's fault... "Plaster the Cracks" indeed...
  1469. X# Mail admiration of this joke to ccs7@aber.ac.uk
  1470. X###
  1471. X
  1472. Xfor i in ./die.*
  1473. Xdo
  1474. X    $i
  1475. Xdone
  1476. END_OF_FILE
  1477. if test 377 -ne `wc -c <'Scripts/plaster'`; then
  1478.     echo shar: \"'Scripts/plaster'\" unpacked with wrong size!
  1479. fi
  1480. chmod +x 'Scripts/plaster'
  1481. # end of 'Scripts/plaster'
  1482. fi
  1483. if test -f 'Scripts/spotless' -a "${1}" != "-c" ; then 
  1484.   echo shar: Will not clobber existing file \"'Scripts/spotless'\"
  1485. else
  1486. echo shar: Extracting \"'Scripts/spotless'\" \(192 characters\)
  1487. sed "s/^X//" >'Scripts/spotless' <<'END_OF_FILE'
  1488. X#!/bin/sh
  1489. X
  1490. X###
  1491. X# This program written by ADE Muffett (aem@aber.ac.uk), August 1991,
  1492. X# as part of the 'Crack' password cracking package.
  1493. X###
  1494. X
  1495. Xmake -f Scripts/crack.mf spotless > /dev/null 2>&1
  1496. END_OF_FILE
  1497. if test 192 -ne `wc -c <'Scripts/spotless'`; then
  1498.     echo shar: \"'Scripts/spotless'\" unpacked with wrong size!
  1499. fi
  1500. chmod +x 'Scripts/spotless'
  1501. # end of 'Scripts/spotless'
  1502. fi
  1503. if test ! -d 'Sources' ; then
  1504.     echo shar: Creating directory \"'Sources'\"
  1505.     mkdir 'Sources'
  1506. fi
  1507. if test -f 'Sources/Makefile' -a "${1}" != "-c" ; then 
  1508.   echo shar: Will not clobber existing file \"'Sources/Makefile'\"
  1509. else
  1510. echo shar: Extracting \"'Sources/Makefile'\" \(1572 characters\)
  1511. sed "s/^X//" >'Sources/Makefile' <<'END_OF_FILE'
  1512. X###
  1513. X# Makefile for the CRACK suite V3.2, (c) ADE Muffett, Aug 1991
  1514. X###
  1515. X
  1516. X###
  1517. X# Configurtable bitz...
  1518. X###
  1519. X
  1520. XCC=         cc
  1521. XCFLAGS=     -O2
  1522. XLIBS=
  1523. XSHELL=        /bin/sh
  1524. X
  1525. X###
  1526. X# Not so configurable bitz...
  1527. X###
  1528. X
  1529. XPWC=         crack-pwc
  1530. XPP=         crack-pp
  1531. X
  1532. X###
  1533. X# There is some redundancy in using CRACKMOD like this, as opposed to a
  1534. X# library, but it's more portable than trying to use 'ar' - as Chris Lewis
  1535. X# pointed out...  SWTF. 
  1536. X###
  1537. X
  1538. XCRACKMOD=     crack-lib.o crack-fcrypt.o crack-port.o
  1539. X
  1540. X###
  1541. X# Default target
  1542. X###
  1543. X
  1544. Xall:        $(PP) $(PWC)
  1545. X
  1546. X$(PP):        $(CRACKMOD) crack-pp.o
  1547. X        $(CC) $(CFLAGS) -o $@ crack-pp.o $(CRACKMOD) $(LIBS)
  1548. X
  1549. X$(PWC):        $(CRACKMOD) crack-pwc.o
  1550. X        $(CC) $(CFLAGS) -o $@ crack-pwc.o $(CRACKMOD) $(LIBS)
  1551. X
  1552. Xcrack-pp.c:     crack.h
  1553. X
  1554. Xcrack-pwc.c:    crack.h
  1555. X
  1556. Xcrack-lib.c:    crack.h
  1557. X
  1558. Xcrack.h:    conf.h
  1559. X        touch crack.h
  1560. Xconf.h:
  1561. X
  1562. Xclean:
  1563. X        -rm -f $(PP) $(PWC) *.o *.u *.a
  1564. X        -rm -f tester *.pixie *.Addrs *.Counts
  1565. X        -rm -f speedcrypt speedfcrypt speedxform
  1566. X
  1567. X###
  1568. X# These targets below are for fcrypt() development only
  1569. X###
  1570. X
  1571. XPIXIEF = -procedures -heavy -invocations -zero
  1572. X
  1573. Xtests:        speedcrypt tester speedxform speedfcrypt
  1574. X        -./speedcrypt
  1575. X        -./speedfcrypt
  1576. X        -./speedxform
  1577. X        -./tester
  1578. X
  1579. Xspeedfcrypt:    speeds.c $(CRACKMOD)
  1580. X        $(CC) -DT1 -o speedfcrypt speeds.c $(CRACKMOD)
  1581. X
  1582. Xspeedxform:    speeds.c $(CRACKMOD)
  1583. X        $(CC) -DT2 -o speedxform speeds.c $(CRACKMOD)
  1584. X
  1585. Xspeedcrypt:    speeds.c $(CRACKMOD)
  1586. X        $(CC) -o speedcrypt speeds.c $(CRACKMOD)
  1587. X
  1588. Xtester:        tester.o $(CRACKMOD)
  1589. X        $(CC) -o tester tester.o $(CRACKMOD)
  1590. X
  1591. Xtester.pixie:    tester
  1592. X        pixie -o tester.pixie tester
  1593. X
  1594. Xprof:        tester.pixie
  1595. X        time tester.pixie
  1596. X        prof -pixie tester $(PIXIEF)
  1597. END_OF_FILE
  1598. if test 1572 -ne `wc -c <'Sources/Makefile'`; then
  1599.     echo shar: \"'Sources/Makefile'\" unpacked with wrong size!
  1600. fi
  1601. # end of 'Sources/Makefile'
  1602. fi
  1603. if test -f 'Sources/conf.h' -a "${1}" != "-c" ; then 
  1604.   echo shar: Will not clobber existing file \"'Sources/conf.h'\"
  1605. else
  1606. echo shar: Extracting \"'Sources/conf.h'\" \(3459 characters\)
  1607. sed "s/^X//" >'Sources/conf.h' <<'END_OF_FILE'
  1608. X#include <stdio.h>
  1609. X#include <ctype.h>
  1610. X#include <pwd.h>
  1611. X#include <signal.h>
  1612. X
  1613. X#ifdef BSD
  1614. X#define strchr(a,b) index(a,b)
  1615. X#endif                /* BSD */
  1616. X
  1617. X/*
  1618. X * Switch for my use - if defined, overrides the defaults below and sets up
  1619. X * my own. It's simplest if you undefine and ignore this switch.
  1620. X */
  1621. X
  1622. X#define DEVELOPMENT_VERSION
  1623. X
  1624. X/* !!!! EVERYBODY ELSE START HERE !!!! */
  1625. X
  1626. X/*
  1627. X * if defined, this will insert code for verbose options
  1628. X */
  1629. X
  1630. X#define CRACK_VERBOSE
  1631. X
  1632. X/*
  1633. X * define this if you have _toupper() - check your manpages
  1634. X */
  1635. X
  1636. X#undef FAST_TOCASE
  1637. X
  1638. X/*
  1639. X * define this if you are on a Sys V type system with a uname() system call
  1640. X * and have no gethostname() - it fakes up a BSD gethostname() so you can use
  1641. X * CRACK_NETWORK; see crack-port.c
  1642. X */
  1643. X
  1644. X#undef CRACK_UNAME
  1645. X
  1646. X/*
  1647. X * define this if you are running multiple Cracks over a network; if you
  1648. X * aren't using "rsh" to do this, edit "Scripts/RCrack" as well
  1649. X */
  1650. X
  1651. X#undef CRACK_NETWORK
  1652. X
  1653. X/*
  1654. X * define this to search gecos entry for possible passwords - I RECOMMEND
  1655. X * THIS VERY VERY STRONGLY
  1656. X */
  1657. X
  1658. X#define CRACK_GECOS
  1659. X
  1660. X/*
  1661. X * define this to make a dictionary pass of pluralised words
  1662. X */
  1663. X
  1664. X#define CRACK_PLURAL
  1665. X
  1666. X/*
  1667. X * define this to make a dictionary pass of words with leading and trailing
  1668. X * 0's and 1's.  If you want to add other leading/trailing characters, edit
  1669. X * the "trailing_chars[]" string in "crack-pp.c"
  1670. X */
  1671. X
  1672. X#define CRACK_TRAILING
  1673. X
  1674. X/*
  1675. X * define this to print the password if you crack it
  1676. X */
  1677. X
  1678. X#define CRACK_PRINTOUT
  1679. X
  1680. X/*
  1681. X * if defined, tries guesses < 5 chars long - this wastes time if you are
  1682. X * unlikely to have REALLY short passwords, try it once though.
  1683. X */
  1684. X
  1685. X#define CRACK_SHORT_PASSWDS
  1686. X
  1687. X/*
  1688. X * if defined, do sanity checks on the DES password - this gets round expiry
  1689. X * mechanisms appending extra characters to signify "things"
  1690. X */
  1691. X
  1692. X#define CRACK_PW_VERIFY
  1693. X
  1694. X/*
  1695. X * define this if you are using fcrypt() - you might not want to if
  1696. X * fcrypt() doesn't work properly
  1697. X */
  1698. X
  1699. X#define FCRYPT
  1700. X
  1701. X/*
  1702. X * The following symbols pertain ONLY to fcrypt() usage
  1703. X */
  1704. X
  1705. X/*
  1706. X * if defined use builtin clearing in preference to using bzero(), for 4 or 8
  1707. X * byte long ints
  1708. X */
  1709. X
  1710. X#define BUILTIN_CLEAR
  1711. X
  1712. X/*
  1713. X * define if you have a bzero and do not want to use BUILTIN_CLEAR
  1714. X */
  1715. X
  1716. X#define BZERO
  1717. X
  1718. X/*
  1719. X * define this if you have a 4 byte "long_int" on RISC machines and want a
  1720. X * speedup - it should not hurt CISC machines either
  1721. X */
  1722. X
  1723. X#undef FDES_4BYTE
  1724. X
  1725. X/*
  1726. X * undef this if your compiler knows the fact that 6*x == x<<1 + x<<2
  1727. X */
  1728. X
  1729. X#undef BRAINDEAD6
  1730. X
  1731. X/*
  1732. X * Personal stuff only - I recommend you ignore stuff below this line, unless
  1733. X * you know what you're doing
  1734. X */
  1735. X
  1736. X#ifdef DEVELOPMENT_VERSION
  1737. X/*
  1738. X * for my personal use, this is my configuration on a DS5000/200
  1739. X */
  1740. X#undef BRAINDEAD6
  1741. X
  1742. X#ifndef BUILTIN_CLEAR
  1743. X#define BUILTIN_CLEAR
  1744. X#endif /* BUILTIN_CLEAR */
  1745. X
  1746. X#undef BZERO
  1747. X
  1748. X#ifndef CRACK_GECOS
  1749. X#define CRACK_GECOS
  1750. X#endif    /* CRACK_GECOS */
  1751. X
  1752. X#ifndef CRACK_NETWORK
  1753. X#define CRACK_NETWORK
  1754. X#endif    /* CRACK_NETWORK */
  1755. X
  1756. X#ifndef CRACK_PLURAL
  1757. X#define CRACK_PLURAL
  1758. X#endif    /* CRACK_PLURAL */
  1759. X
  1760. X#ifndef CRACK_PRINTOUT
  1761. X#define CRACK_PRINTOUT
  1762. X#endif    /* CRACK_PRINTOUT */
  1763. X
  1764. X#ifndef CRACK_PW_VERIFY
  1765. X#define CRACK_PW_VERIFY
  1766. X#endif    /* CRACK_PW_VERIFY */
  1767. X
  1768. X#undef CRACK_SHORT_PASSWDS
  1769. X
  1770. X#ifndef CRACK_TRAILING
  1771. X#define CRACK_TRAILING
  1772. X#endif    /* CRACK_TRAILING */
  1773. X
  1774. X#undef CRACK_UNAME
  1775. X
  1776. X#undef CRACK_VERBOSE
  1777. X
  1778. X#undef FAST_TOCASE
  1779. X
  1780. X#ifndef FCRYPT
  1781. X#define FCRYPT
  1782. X#endif    /* FCRYPT */
  1783. X
  1784. X#ifndef FDES_4BYTE
  1785. X#define FDES_4BYTE
  1786. X#endif    /* FDES_4BYTE */
  1787. X
  1788. X#endif                /* DEVELOPMENT VERSION */
  1789. END_OF_FILE
  1790. if test 3459 -ne `wc -c <'Sources/conf.h'`; then
  1791.     echo shar: \"'Sources/conf.h'\" unpacked with wrong size!
  1792. fi
  1793. # end of 'Sources/conf.h'
  1794. fi
  1795. if test -f 'Sources/crack-lib.c' -a "${1}" != "-c" ; then 
  1796.   echo shar: Will not clobber existing file \"'Sources/crack-lib.c'\"
  1797. else
  1798. echo shar: Extracting \"'Sources/crack-lib.c'\" \(1756 characters\)
  1799. sed "s/^X//" >'Sources/crack-lib.c' <<'END_OF_FILE'
  1800. X#include "crack.h"
  1801. X
  1802. X/*
  1803. X * This program is copyright (c) Alec Muffett 1991 except for certain
  1804. X * portions of code ("crack-fcrypt.c") copyright (c) Robert Baldwin, Icarus
  1805. X * Sparry and Alec Muffett.  The author(s) disclaims all responsibility or
  1806. X * liability with respect to it's usage or its effect upon hardware or
  1807. X * computer systems.  This software is in the public domain and is freely
  1808. X * redistributable PROVIDED that this notice remains intact.
  1809. X */
  1810. X
  1811. Xvoid
  1812. XTrim (string)            /* remove trailing whitespace from a string */
  1813. X    register char *string;
  1814. X{
  1815. X    register char *ptr;
  1816. X
  1817. X    for (ptr = string; *ptr; ptr++);
  1818. X    while ((--ptr >= string) && isspace (*ptr));
  1819. X    *(++ptr) = '\0';
  1820. X}
  1821. X
  1822. Xchar *
  1823. XReverse (str)            /* return a pointer to a reversal */
  1824. X    register char *str;
  1825. X{
  1826. X    register int i;
  1827. X    register int j;
  1828. X    register char *ptr;
  1829. X    static char area[STRINGSIZE];
  1830. X
  1831. X    j = i = strlen (str);
  1832. X    while (*str)
  1833. X    {
  1834. X    area[--i] = *str++;
  1835. X    }
  1836. X    area[j] = '\0';
  1837. X    return (area);
  1838. X}
  1839. X
  1840. Xchar *
  1841. XUppercase (str)            /* return a pointer to an uppercase */
  1842. X    register char *str;
  1843. X{
  1844. X    register char *ptr;
  1845. X    static char area[STRINGSIZE];
  1846. X
  1847. X    ptr = area;
  1848. X    while (*str)
  1849. X    {
  1850. X    *(ptr++) = islower (*str) ? toupper (*str) : *str;
  1851. X    str++;
  1852. X    }
  1853. X    *ptr = '\0';
  1854. X
  1855. X    return (area);
  1856. X}
  1857. X
  1858. Xchar *
  1859. XLowercase (str)            /* return a pointer to an lowercase */
  1860. X    register char *str;
  1861. X{
  1862. X    register char *ptr;
  1863. X    static char area[STRINGSIZE];
  1864. X
  1865. X    ptr = area;
  1866. X    while (*str)
  1867. X    {
  1868. X    *(ptr++) = isupper (*str) ? tolower (*str) : *str;
  1869. X    str++;
  1870. X    }
  1871. X    *ptr = '\0';
  1872. X
  1873. X    return (area);
  1874. X}
  1875. X
  1876. Xchar *
  1877. XClone (string)
  1878. X    char *string;
  1879. X{
  1880. X    int len;
  1881. X    char *retval;
  1882. X
  1883. X    retval = (char *) malloc (strlen (string) + 1);
  1884. X    strcpy (retval, string);
  1885. X    return (retval);
  1886. X}
  1887. END_OF_FILE
  1888. if test 1756 -ne `wc -c <'Sources/crack-lib.c'`; then
  1889.     echo shar: \"'Sources/crack-lib.c'\" unpacked with wrong size!
  1890. fi
  1891. # end of 'Sources/crack-lib.c'
  1892. fi
  1893. if test -f 'Sources/crack-port.c' -a "${1}" != "-c" ; then 
  1894.   echo shar: Will not clobber existing file \"'Sources/crack-port.c'\"
  1895. else
  1896. echo shar: Extracting \"'Sources/crack-port.c'\" \(296 characters\)
  1897. sed "s/^X//" >'Sources/crack-port.c' <<'END_OF_FILE'
  1898. X#include "crack.h"
  1899. X
  1900. X#ifdef CRACK_UNAME
  1901. X
  1902. X#include <sys/utsname.h>
  1903. X
  1904. Xint
  1905. Xgethostname (name, namelen)
  1906. X    char *name;
  1907. X    int namelen;
  1908. X{
  1909. X    struct utsname uts;
  1910. X    if (uname (&uts))
  1911. X    {
  1912. X    return (-1);
  1913. X    }
  1914. X    strncpy (name, uts.nodename, namelen - 1);
  1915. X    return (0);
  1916. X}
  1917. X
  1918. X#endif    /* CRACK_UNAME */
  1919. END_OF_FILE
  1920. if test 296 -ne `wc -c <'Sources/crack-port.c'`; then
  1921.     echo shar: \"'Sources/crack-port.c'\" unpacked with wrong size!
  1922. fi
  1923. # end of 'Sources/crack-port.c'
  1924. fi
  1925. if test -f 'Sources/crack.h' -a "${1}" != "-c" ; then 
  1926.   echo shar: Will not clobber existing file \"'Sources/crack.h'\"
  1927. else
  1928. echo shar: Extracting \"'Sources/crack.h'\" \(707 characters\)
  1929. sed "s/^X//" >'Sources/crack.h' <<'END_OF_FILE'
  1930. X/*
  1931. X * This program is copyright (c) Alec Muffett 1991 except for certain
  1932. X * portions of code ("fdes-crypt.c") copyright (c) Robert Baldwin, Icarus
  1933. X * Sparry and Alec Muffett.  The author(s) disclaims all responsibility or
  1934. X * liability with respect to it's usage or its effect upon hardware or
  1935. X * computer systems.  This software is in the public domain and is freely
  1936. X * redistributable PROVIDED that this notice remains intact.
  1937. X */
  1938. X
  1939. X#include "conf.h"
  1940. X
  1941. X#define STRINGSIZE    255
  1942. X
  1943. Xvoid Trim ();
  1944. Xchar *Reverse ();
  1945. Xchar *Uppercase ();
  1946. Xchar *Lowercase ();
  1947. Xchar *Clone ();
  1948. X
  1949. X#ifdef FAST_TOCASE
  1950. X#define toupper(x)     _toupper(x)
  1951. X#define tolower(x)    _tolower(x)
  1952. X#endif
  1953. X
  1954. X#ifdef FCRYPT
  1955. X#define crypt(a,b)    fcrypt(a,b)
  1956. X#endif
  1957. END_OF_FILE
  1958. if test 707 -ne `wc -c <'Sources/crack.h'`; then
  1959.     echo shar: \"'Sources/crack.h'\" unpacked with wrong size!
  1960. fi
  1961. # end of 'Sources/crack.h'
  1962. fi
  1963. if test -f 'Sources/speeds.c' -a "${1}" != "-c" ; then 
  1964.   echo shar: Will not clobber existing file \"'Sources/speeds.c'\"
  1965. else
  1966. echo shar: Extracting \"'Sources/speeds.c'\" \(866 characters\)
  1967. sed "s/^X//" >'Sources/speeds.c' <<'END_OF_FILE'
  1968. X#include <sys/time.h>
  1969. X#include <signal.h>
  1970. X#include <stdio.h>
  1971. X
  1972. Xstatic int cnt;
  1973. X#define ITIME    10        /* Number of seconds to run test. */
  1974. X
  1975. Xvoid
  1976. XStop ()
  1977. X{
  1978. X    printf ("Did %f %s()s per second.\n",
  1979. X        ((float) cnt) / ((float) ITIME),
  1980. X#if defined(T1)
  1981. X        "fcrypt"
  1982. X#elif defined(T2)
  1983. X        "xform"
  1984. X#else
  1985. X        "crypt"
  1986. X#endif
  1987. X    );
  1988. X    exit (0);
  1989. X}
  1990. Xmain ()
  1991. X{
  1992. X    struct itimerval itv;
  1993. X    static int quarters[4];
  1994. X
  1995. X    bzero (&itv, sizeof (itv));
  1996. X
  1997. X    printf ("Running for %d seconds of virtual time ...\n", ITIME);
  1998. X
  1999. X#if defined(T1) || defined(T2)
  2000. X    init_des ();
  2001. X#endif
  2002. X
  2003. X    signal (SIGVTALRM, Stop);
  2004. X    itv.it_value.tv_sec = ITIME;
  2005. X    itv.it_value.tv_usec = 0;
  2006. X    setitimer (ITIMER_VIRTUAL, &itv, NULL);
  2007. X
  2008. X    for (cnt = 0;; cnt++)
  2009. X    {
  2010. X#if defined(T1)
  2011. X    fcrypt ("fredfred", "eek");
  2012. X#elif defined(T2)
  2013. X    xform (quarters, 0);
  2014. X#else
  2015. X    crypt ("fredfred", "eek");
  2016. X#endif
  2017. X    }
  2018. X}
  2019. END_OF_FILE
  2020. if test 866 -ne `wc -c <'Sources/speeds.c'`; then
  2021.     echo shar: \"'Sources/speeds.c'\" unpacked with wrong size!
  2022. fi
  2023. # end of 'Sources/speeds.c'
  2024. fi
  2025. if test -f 'Sources/tester.c' -a "${1}" != "-c" ; then 
  2026.   echo shar: Will not clobber existing file \"'Sources/tester.c'\"
  2027. else
  2028. echo shar: Extracting \"'Sources/tester.c'\" \(612 characters\)
  2029. sed "s/^X//" >'Sources/tester.c' <<'END_OF_FILE'
  2030. X#include <stdio.h>
  2031. X#include <time.h>
  2032. X
  2033. X#define EEK 8192
  2034. X#define PROFx
  2035. X
  2036. Xmain ()
  2037. X{
  2038. X    int i;
  2039. X    char a[255];
  2040. X    char b[255];
  2041. X
  2042. X    init_des ();
  2043. X
  2044. X#ifndef PROF
  2045. X    strcpy (a, crypt ("fredfred", "fredfred"));
  2046. X    strcpy (b, fcrypt ("fredfred", "fredfred"));
  2047. X
  2048. X    printf ("Check Old: %s\tNew: %s\n", a, b);
  2049. X
  2050. X    if (!strcmp (a, b))
  2051. X    {
  2052. X    printf ("fcrypt() is compatible with standard crypt()\n");
  2053. X    } else
  2054. X    {
  2055. X    printf ("fcrypt() is not compatible !!! \7\n");
  2056. X    exit (1);
  2057. X    }
  2058. X    printf ("Doing %d fcrypts()\n", EEK);
  2059. X#endif
  2060. X
  2061. X    for (i = EEK; i; i--)
  2062. X    {
  2063. X    fcrypt ("fredfred", "eek");
  2064. X    }
  2065. X
  2066. X    return (0);
  2067. X}
  2068. END_OF_FILE
  2069. if test 612 -ne `wc -c <'Sources/tester.c'`; then
  2070.     echo shar: \"'Sources/tester.c'\" unpacked with wrong size!
  2071. fi
  2072. # end of 'Sources/tester.c'
  2073. fi
  2074. echo shar: End of archive 1 \(of 4\).
  2075. cp /dev/null ark1isdone
  2076. MISSING=""
  2077. for I in 1 2 3 4 ; do
  2078.     if test ! -f ark${I}isdone ; then
  2079.     MISSING="${MISSING} ${I}"
  2080.     fi
  2081. done
  2082. if test "${MISSING}" = "" ; then
  2083.     echo You have unpacked all 4 archives.
  2084.     rm -f ark[1-9]isdone
  2085. else
  2086.     echo You still need to unpack the following archives:
  2087.     echo "        " ${MISSING}
  2088. fi
  2089. ##  End of shell archive.
  2090. exit 0
  2091. exit 0 # Just in case...
  2092.