home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / tripwire / part07 < prev    next >
Encoding:
Text File  |  1993-04-19  |  74.2 KB  |  2,769 lines

  1. Newsgroups: comp.sources.unix
  2. From: spaf@cs.purdue.edu (Gene Spafford)
  3. Subject: v26i179: tripwire - security integrity monitor, Part07/08
  4. Sender: unix-sources-moderator@vix.com
  5. Approved: paul@vix.com
  6.  
  7. Submitted-By: spaf@cs.purdue.edu (Gene Spafford)
  8. Posting-Number: Volume 26, Issue 179
  9. Archive-Name: tripwire/part07
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 7 (of 8)."
  18. # Contents:  tripwire-1.0 tripwire-1.0/configs tripwire-1.0/contrib
  19. #   tripwire-1.0/lib tripwire-1.0/sigs tripwire-1.0/sigs/md2
  20. #   tripwire-1.0/sigs/md4 tripwire-1.0/sigs/md5 tripwire-1.0/src
  21. #   tripwire-1.0/tests tripwire-1.0/configs/tw.conf.sun
  22. #   tripwire-1.0/configs/Makefile.xenix tripwire-1.0/src/preen.c
  23. #   tripwire-1.0/configs/tw.conf.s5 tripwire-1.0/tests/tw.conf.test
  24. #   tripwire-1.0/lib/tw.config tripwire-1.0/contrib/README.TRIPWIRE
  25. #   tripwire-1.0/configs/tw.conf.next tripwire-1.0/Makefile
  26. #   tripwire-1.0/src/config.prim.c tripwire-1.0/src/preen.interp.c
  27. #   tripwire-1.0/sigs/md5/README.md5
  28. #   tripwire-1.0/sigs/md2/md2wrapper.c tripwire-1.0/FAQ
  29. #   tripwire-1.0/sigs/md5/md5wrapper.c tripwire-1.0/sigs/md4/md4.h
  30. #   tripwire-1.0/sigs/md4/md4wrapper.c
  31. #   tripwire-1.0/configs/tw.conf.hpux tripwire-1.0/src/config.pre.l
  32. #   tripwire-1.0/sigs/md2/Makefile
  33. # Wrapped by spaf@uther.cs.purdue.edu on Tue Nov  3 16:31:57 1992
  34. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  35. if test ! -d 'tripwire-1.0' ; then
  36.     echo shar: Creating directory \"'tripwire-1.0'\"
  37.     mkdir 'tripwire-1.0'
  38. fi
  39. if test ! -d 'tripwire-1.0/configs' ; then
  40.     echo shar: Creating directory \"'tripwire-1.0/configs'\"
  41.     mkdir 'tripwire-1.0/configs'
  42. fi
  43. if test ! -d 'tripwire-1.0/contrib' ; then
  44.     echo shar: Creating directory \"'tripwire-1.0/contrib'\"
  45.     mkdir 'tripwire-1.0/contrib'
  46. fi
  47. if test ! -d 'tripwire-1.0/lib' ; then
  48.     echo shar: Creating directory \"'tripwire-1.0/lib'\"
  49.     mkdir 'tripwire-1.0/lib'
  50. fi
  51. if test ! -d 'tripwire-1.0/sigs' ; then
  52.     echo shar: Creating directory \"'tripwire-1.0/sigs'\"
  53.     mkdir 'tripwire-1.0/sigs'
  54. fi
  55. if test ! -d 'tripwire-1.0/sigs/md2' ; then
  56.     echo shar: Creating directory \"'tripwire-1.0/sigs/md2'\"
  57.     mkdir 'tripwire-1.0/sigs/md2'
  58. fi
  59. if test ! -d 'tripwire-1.0/sigs/md4' ; then
  60.     echo shar: Creating directory \"'tripwire-1.0/sigs/md4'\"
  61.     mkdir 'tripwire-1.0/sigs/md4'
  62. fi
  63. if test ! -d 'tripwire-1.0/sigs/md5' ; then
  64.     echo shar: Creating directory \"'tripwire-1.0/sigs/md5'\"
  65.     mkdir 'tripwire-1.0/sigs/md5'
  66. fi
  67. if test ! -d 'tripwire-1.0/src' ; then
  68.     echo shar: Creating directory \"'tripwire-1.0/src'\"
  69.     mkdir 'tripwire-1.0/src'
  70. fi
  71. if test ! -d 'tripwire-1.0/tests' ; then
  72.     echo shar: Creating directory \"'tripwire-1.0/tests'\"
  73.     mkdir 'tripwire-1.0/tests'
  74. fi
  75. if test -f 'tripwire-1.0/configs/tw.conf.sun' -a "${1}" != "-c" ; then 
  76.   echo shar: Will not clobber existing file \"'tripwire-1.0/configs/tw.conf.sun'\"
  77. else
  78. echo shar: Extracting \"'tripwire-1.0/configs/tw.conf.sun'\" \(5298 characters\)
  79. sed "s/^X//" >'tripwire-1.0/configs/tw.conf.sun' <<'END_OF_FILE'
  80. X#
  81. X# tripwire.config
  82. X# Generic version for SunOS 4.x
  83. X#  Will need editing...see comments below
  84. X#
  85. X# This file contains a list of files and directories that System 
  86. X# Preener will scan.  Information collected from these files will be 
  87. X# stored in the tripwire.database file.
  88. X#
  89. X# Format:             [!|=] entry [ignore-flags]
  90. X#
  91. X# where:     '!' signifies the entry is to be pruned (inclusive) from
  92. X#                the list of files to be scanned.
  93. X#         '=' signifies the entry is to be added, but if it is
  94. X#                a directory, then all its contents are pruned
  95. X#                (useful for /tmp).
  96. X#
  97. X# where:    entry is the absolute pathname of a file or a directory
  98. X#
  99. X# where ignore-flags are in the format:
  100. X#        [template][ [+|-][pinugsam12] ... ]
  101. X#
  102. X#     - :  ignore the following atributes
  103. X#    + :  do not ignore the following attributes
  104. X#
  105. X#    p :  permission and file mode bits     a: access timestamp
  106. X#    i :  inode number            m: modification timestamp
  107. X#    n :  number of links (ref count)    c: inode creation timestamp
  108. X#    u :  user id of owner            1: signature 1
  109. X#    g :  group id of owner            2: signature 2
  110. X#    s :  size of file
  111. X#
  112. X#
  113. X# Ex:   The following entry will scan all the files in /etc, and report
  114. X#    any changes in mode bits, inode number, reference count, uid,
  115. X#    gid, modification and creation timestamp, and the signatures.
  116. X#    However, it will ignore any changes in the access timestamp.
  117. X#
  118. X#    /etc    +pinugsm12-a
  119. X#
  120. X# The following templates have been pre-defined to make these long ignore
  121. X# mask descriptions unecessary.
  122. X#
  123. X# Templates:     (default)    R :  [R]ead-only (+pinugsm12-a)
  124. X#                L :  [L]og file (+pinug-sam12)
  125. X#                N :  ignore [N]othing (+pinusgsamc12)
  126. X#                E :  ignore [E]verything (-pinusgsamc12)
  127. X#
  128. X# By default, Tripwire uses the R template -- it ignores
  129. X# only the access timestamp.
  130. X#
  131. X# You can use templates with modifiers, like:
  132. X#    Ex:  /etc/lp    E+ug
  133. X#
  134. X#    Example configuration file:
  135. X#        /etc        R    # all system files
  136. X#        !/etc/lp    R    # ...but not those logs
  137. X#        =/tmp        N    # just the directory, not its files
  138. X#
  139. X# Note the difference between pruning (via "!") and ignoring everything
  140. X# (via "E" template):  Ignoring everything in a directory still monitors
  141. X# for added and deleted files.  Pruning a directory will prevent Tripwire
  142. X# from even looking in the specified directory.
  143. X#
  144. X#
  145. X# Tripwire running slowly?  Modify your tripwire.config entries to
  146. X# ignore the (signature 2) attribute when this computationally-exorbitant 
  147. X# protection is not needed.  (See README and design document for further
  148. X# details.)
  149. X#
  150. X
  151. X#  First, root's "home"
  152. X=/        L
  153. X/.rhosts    R    # may not exist
  154. X/.profile    R    # may not exist
  155. X/.cshrc        R    # may not exist
  156. X/.login        R    # may not exist
  157. X/.exrc        R    # may not exist
  158. X/.logout    R    # may not exist
  159. X/.emacs        R    # may not exist
  160. X/.forward    R    # may not exist
  161. X/.netrc        R    # may not exist
  162. X
  163. X# Unix itself
  164. X/vmunix        R
  165. X
  166. X# Now, some critical directories and files
  167. X#  Some exceptions are noted further down
  168. X/etc        R
  169. X/etc/inetd.conf    R
  170. X/etc/rc        R
  171. X/etc/rc.boot    R
  172. X/etc/rc.local    R
  173. X/etc/rc.single    R
  174. X/etc/rc.ip    R
  175. X/etc/ttytab    R
  176. X/etc/exports    R
  177. X/etc/ttys    L
  178. X/etc/dumpdates    L
  179. X/etc/mtab    L
  180. X/etc/motd    L
  181. X/etc/rmtab    L
  182. X/etc/utmp    L
  183. X/etc/group    R    # changes should be infrequent
  184. X#  The next line may need to be replaced with /etc/security
  185. X#   if C2 is enabled
  186. X/etc/passwd    L
  187. X
  188. X/var        L
  189. X
  190. X/dev        L
  191. X
  192. X/usr/etc    R
  193. X
  194. X# Checksumming the following is not so critical.  However,
  195. X#  setuid/setgid files are special-cased further down.
  196. X
  197. X/lib        R-2
  198. X
  199. X/bin        R-2
  200. X
  201. X/usr/bin    R-2
  202. X
  203. X/usr/ucb    R-2
  204. X
  205. X/usr/lib    R-2
  206. X
  207. X=/usr        L
  208. X=/usr/spool    L
  209. X/usr/spool/cron        L
  210. X/usr/spool/mqueue    L
  211. X/usr/spool/mail        L
  212. X
  213. X# You may or may not have the following
  214. X#/usr/ftp    L
  215. X#/usr/ftp/bin    R
  216. X#/usr/ftp/etc    R
  217. X
  218. X# put entries in for /var/yp if you need it
  219. X# put entries for uucp if you need them
  220. X# put entries for /var/adm if you need it
  221. X
  222. X=/tmp
  223. X=/var/tmp
  224. X
  225. X#  Here are entries for setuid/setgid files.  On these, we use
  226. X#  both signatures just to be sure.
  227. X#
  228. X#  You may want/need to edit this list.  Batteries not inc.
  229. X
  230. X/bin/at            R
  231. X/bin/atq        R
  232. X/bin/atrm        R
  233. X/bin/cancel        R
  234. X/bin/chfn        R
  235. X/bin/chsh        R
  236. X/bin/crontab        R
  237. X/bin/cu            R
  238. X/bin/df            R
  239. X/bin/iostat        R
  240. X/bin/ipcs        R
  241. X/bin/login        R
  242. X/bin/lpstat        R
  243. X/bin/mail        R
  244. X/bin/newgrp        R
  245. X/bin/passwd        R
  246. X/bin/su            R
  247. X/bin/sunview1/sv_acquire        R
  248. X/bin/sunview1/sv_release        R
  249. X/bin/sunview1/toolplaces        R
  250. X/bin/tip        R
  251. X/bin/uucp        R
  252. X/bin/uuname        R
  253. X/bin/uustat        R
  254. X/bin/uux        R
  255. X/bin/wall        R
  256. X/bin/write        R
  257. X/bin/ypchfn        R
  258. X/bin/ypchsh        R
  259. X/bin/yppasswd        R
  260. X/usr/bin/at        R
  261. X/usr/bin/atq        R
  262. X/usr/bin/atrm        R
  263. X/usr/bin/cancel        R
  264. X/usr/bin/chfn        R
  265. X/usr/bin/chsh        R
  266. X/usr/bin/crontab    R
  267. X/usr/bin/cu        R
  268. X/usr/bin/df        R
  269. X/usr/bin/iostat        R
  270. X/usr/bin/ipcs        R
  271. X/usr/bin/login        R
  272. X/usr/bin/lpstat        R
  273. X/usr/bin/mail        R
  274. X/usr/bin/newgrp        R
  275. X/usr/bin/passwd        R
  276. X/usr/bin/su        R
  277. X/usr/bin/sunview1/sv_acquire        R
  278. X/usr/bin/sunview1/sv_release        R
  279. X/usr/bin/sunview1/toolplaces        R
  280. X/usr/bin/tip        R
  281. X/usr/bin/uucp        R
  282. X/usr/bin/uuname        R
  283. X/usr/bin/uustat        R
  284. X/usr/bin/uux        R
  285. X/usr/bin/wall        R
  286. X/usr/bin/write        R
  287. X/usr/bin/ypchfn        R
  288. X/usr/bin/ypchsh        R
  289. X/usr/bin/yppasswd    R
  290. X/usr/etc/arp        R
  291. X/usr/etc/chill        R
  292. X/usr/etc/devinfo    R
  293. X/usr/etc/dkinfo        R
  294. X/usr/etc/dmesg        R
  295. X/usr/etc/dump        R
  296. X/usr/etc/dumpfs        R
  297. X/usr/etc/keyenvoy    R
  298. X/usr/etc/kgmon        R
  299. X/usr/etc/lpc        R
  300. X/usr/etc/nfsstat    R
  301. X/usr/etc/ping        R
  302. X/usr/etc/rpc.rwalld    R
  303. X/usr/etc/trpt        R
  304. X/usr/ucb/lpq        R
  305. X/usr/ucb/lpr        R
  306. X/usr/ucb/netstat    R
  307. X/usr/ucb/rcp        R
  308. X/usr/ucb/rdist        R
  309. X/usr/ucb/rlogin        R
  310. X/usr/ucb/rsh        R
  311. X/usr/ucb/talk        R
  312. X/usr/ucb/vmstat        R
  313. X
  314. END_OF_FILE
  315. if test 5298 -ne `wc -c <'tripwire-1.0/configs/tw.conf.sun'`; then
  316.     echo shar: \"'tripwire-1.0/configs/tw.conf.sun'\" unpacked with wrong size!
  317. fi
  318. # end of 'tripwire-1.0/configs/tw.conf.sun'
  319. fi
  320. if test -f 'tripwire-1.0/configs/Makefile.xenix' -a "${1}" != "-c" ; then 
  321.   echo shar: Will not clobber existing file \"'tripwire-1.0/configs/Makefile.xenix'\"
  322. else
  323. echo shar: Extracting \"'tripwire-1.0/configs/Makefile.xenix'\" \(5278 characters\)
  324. sed "s/^X//" >'tripwire-1.0/configs/Makefile.xenix' <<'END_OF_FILE'
  325. X# $Id: Makefile.xenix,v 1.1.1.3 92/11/03 15:37:13 genek Exp $
  326. X#
  327. X#     Tripwire build
  328. X#
  329. X# Gene Kim
  330. X# Purdue University
  331. X#
  332. X
  333. X# XENIX Makefile
  334. X
  335. X# support for parallel compiles (ala Dynix)
  336. X# comment the following line out if your Make doesn't support this syntax.
  337. X#P      = &
  338. X
  339. X# you can use ANSI C if you like, but K&R is equally fine.
  340. XCC     = cc
  341. XCFLAGS = -O
  342. X
  343. X#CC     = gcc
  344. X#CFLAGS = -O -ansi
  345. X
  346. X# make sure libraries are not linked dynamically (as a security measure)
  347. X#LDFLAGS= -Bstatic
  348. XLDFLAGS= -s -lx
  349. X
  350. X# NOTICE/TNL   -lx required for dir type functions in LDFLAGS
  351. X
  352. X# If you don't have the install command, you need to replace
  353. X# the use of it later in the makefile with a cp and chmod
  354. XINSTALL= /etc/install
  355. X
  356. X# where you want to install the Tripwire binary
  357. XTARGET = /usr/tmp/ch.Z.1123
  358. X# NOTICE/TNL   above is a sneaky dir stored UNDER mounted /usr/tmp filesystem
  359. X# to be exposed only during tripwire runs. A daemon (that does other things)
  360. X# has a chdir("/usr/tmp");  that keeps the filesystem busy to confuse bad guys.
  361. X# tripwire will kill -17 $TRIPWIREPID   to tell the daemon to chdir away
  362. X# from /usr/tmp so root can umount it for the tripwire run. Then another
  363. X# SIGUSR2 to tell daemon to reoccupy /usr/tmp after the run.
  364. X
  365. X# how you get hostname information (BSD vs. SYSV style)
  366. XHOSTNAME    = uname -n
  367. X#HOSTNAME    = hostname
  368. X
  369. XOFILES =     config.parse.o main.o list.o ignorevec.o databs.build.o \
  370. X        utils.o preen.o diff.sorted.o diff.parse.o preen.interp.o \
  371. X        preen.report.o nullsig.o \
  372. X        $(SIG1) $(SIG2)
  373. X
  374. XSIG1DIR   = ./md5
  375. XSIG2DIR   = ./snefru
  376. X
  377. XSIG1      = $(SIG1DIR)/md5wrapper.o $(SIG1DIR)/md5.o
  378. XSIG2      = $(SIG2DIR)/snefru.o
  379. X
  380. X# for generating shar distribution package
  381. X
  382. XDIST    = tripwire-0.9
  383. XDISTPKG = Makefile README README.FIRST README.coast TODO Announce \
  384. X      tripwire.config *.[ch] tripwire.8 tripwire.design.ms Changelog
  385. X
  386. X###
  387. X
  388. Xall:    tripwire 
  389. X
  390. Xtripwire:    $(P) $(OFILES)
  391. X    $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES)
  392. X
  393. X$(SIG1):
  394. X    (cd $(SIG1DIR); make CC="$(CC)" CFLAGS="$(CFLAGS)")
  395. X$(SIG2):
  396. X    (cd $(SIG2DIR); make CC="$(CC)" CFLAGS="$(CFLAGS)")
  397. X
  398. X.c.o:
  399. X    $(CC) $(CFLAGS) -c $<
  400. X
  401. Xinstall:    tripwire
  402. X    $(INSTALL) tripwire $(TARGET)
  403. X
  404. Xtest:    tripwire
  405. X    @HOST=`$(HOSTNAME)`; \
  406. X    CURRPATH=`pwd`;    \
  407. X    sed s,/tmp/genek/tripwire-0.9,$$CURRPATH, \
  408. X            < ./Tests/tripwire.database_TEST \
  409. X            > ./Databases/tripwire.database_$$HOST; \
  410. X    cp tripwire.config tripwire.config.orig; \
  411. X    sed s,/tmp/genek/tripwire-0.9,$$CURRPATH, \
  412. X            < ./tripwire.config.orig \
  413. X            > ./tripwire.config; 
  414. X    @echo ======= test begin ======= ;
  415. X    ./tripwire; 
  416. X    @echo ======= test end ======= ;
  417. X    @echo ''; 
  418. X    mv tripwire.config.orig tripwire.config; 
  419. X    @CURRPATH=`pwd`; \
  420. X    echo ''; \
  421. X    echo Tripwire should have only reported: ; \
  422. X    echo "    added:   $$CURRPATH/tripwire.config.orig" ; \
  423. X    echo "             $$CURRPATH/Databases/... " ; \
  424. X    echo "    changed: $$CURRPATH (your current directory) " ; \
  425. X    echo "             ...and any other files you may have changed!"
  426. X
  427. X#
  428. X# only for building distribution
  429. X#
  430. Xmaketest:
  431. X    HOST=`$(HOSTNAME)`; \
  432. X    CURRPATH=`pwd`;    \
  433. X    ./tripwire -initialize; \
  434. X    cp ./Databases/tripwire.database_$$HOST ./Tests/tripwire.database_TEST;\
  435. X    cp ./Tests/tripwire.database_TEST /tmp/genek/tripwire-0.9/Tests
  436. X
  437. X
  438. Xtags:    force
  439. X    ctags *.[ch]
  440. X
  441. Xshar:
  442. X    -mkdir $(DIST)
  443. X    -mkdir $(DIST)/Databases
  444. X    -cp $(DISTPKG) $(DIST)
  445. X    -cp -r $(SIG1DIR) $(SIG2DIR) ./$(DIST)
  446. X    -cp -r configs Tests $(DIST)
  447. X    -rm -fr ./$(DIST)/$(SIG1DIR)/RCS
  448. X    -rm -fr ./$(DIST)/$(SIG1DIR)/CVS.adm
  449. X    -rm -fr ./$(DIST)/$(SIG2DIR)/RCS
  450. X    -rm -fr ./$(DIST)/$(SIG2DIR)/CVS.adm
  451. X    -rm -fr ./$(DIST)/Tests/CVS.adm
  452. X    -rm -fr $(DIST)/./configs/CVS.adm
  453. X    -rm -f ./$(DIST)/$(SIG1DIR)/*.o
  454. X    -rm -f ./$(DIST)/$(SIG2DIR)/*.o
  455. X    shar -a $(DIST) > Tripwire.Dist.shar
  456. X    -rm -rf ./$(DIST)
  457. X
  458. Xtar:
  459. X    -mkdir $(DIST)
  460. X    -mkdir $(DIST)/Databases
  461. X    -cp $(DISTPKG) $(DIST)
  462. X    -cp -r $(SIG1DIR) $(SIG2DIR) ./$(DIST)
  463. X    -cp -r configs Tests $(DIST)
  464. X    -rm -fr ./$(DIST)/$(SIG1DIR)/RCS
  465. X    -rm -fr ./$(DIST)/$(SIG1DIR)/CVS.adm
  466. X    -rm -fr ./$(DIST)/$(SIG2DIR)/RCS
  467. X    -rm -fr ./$(DIST)/$(SIG2DIR)/CVS.adm
  468. X    -rm -fr $(DIST)/./Tests/CVS.adm
  469. X    -rm -fr $(DIST)/./configs/CVS.adm
  470. X    -rm -f ./$(DIST)/$(SIG1DIR)/*.o
  471. X    -rm -f ./$(DIST)/$(SIG2DIR)/*.o
  472. X    tar cf Tripwire.Dist.tar $(DIST)
  473. X    -rm -rf ./$(DIST)
  474. X
  475. Xdepend:    force
  476. X    makedep
  477. X    mv Makefile Makefile.old
  478. X    mv Makefile.new Makefile
  479. X
  480. Xproto:    force
  481. X    makeproto tripwire.h *.c
  482. X
  483. Xclean:
  484. X    rm -f $(OFILES)
  485. X
  486. Xclobber:    clean
  487. X
  488. Xforce:
  489. X
  490. X# include dependencies
  491. X
  492. X#### Do not remove this line.  Makedep depends on it! ####
  493. Xconfig.parse.o: ./config.h
  494. Xconfig.parse.o: ./list.h
  495. Xconfig.parse.o: ./tripwire.h
  496. Xdatabs.build.o: ./config.h
  497. Xdatabs.build.o: ./list.h
  498. Xdatabs.build.o: ./tripwire.h
  499. Xdiff.parse.o: ./config.h
  500. Xdiff.parse.o: ./list.h
  501. Xdiff.parse.o: ./tripwire.h
  502. Xdiff.sorted.o: ./config.h
  503. Xdiff.sorted.o: ./list.h
  504. Xdiff.sorted.o: ./tripwire.h
  505. Xdiff.sorted.o: ./utils.c
  506. Xignorevec.o: ./config.h
  507. Xignorevec.o: ./list.h
  508. Xignorevec.o: ./tripwire.h
  509. Xlist.o: ./config.h
  510. Xlist.o: ./list.h
  511. Xmain.o: ./config.h
  512. Xmain.o: ./list.h
  513. Xmain.o: ./tripwire.h
  514. Xmain.o: ./snefru/snefru.h
  515. Xmain.o: ./md5/md5.h
  516. Xmain.o: ./nullsig.h
  517. Xnullsig.o: ./config.h
  518. Xpreen.o: ./config.h
  519. Xpreen.o: ./list.h
  520. Xpreen.o: ./tripwire.h
  521. Xpreen.interp.o: ./config.h
  522. Xpreen.interp.o: ./list.h
  523. Xpreen.interp.o: ./utils.h
  524. Xpreen.interp.o: ./tripwire.h
  525. Xpreen.report.o: ./config.h
  526. Xpreen.report.o: ./list.h
  527. Xpreen.report.o: ./tripwire.h
  528. Xutils.o: ./config.h
  529. Xutils.o: ./list.h
  530. Xutils.o: ./tripwire.h
  531. END_OF_FILE
  532. if test 5278 -ne `wc -c <'tripwire-1.0/configs/Makefile.xenix'`; then
  533.     echo shar: \"'tripwire-1.0/configs/Makefile.xenix'\" unpacked with wrong size!
  534. fi
  535. # end of 'tripwire-1.0/configs/Makefile.xenix'
  536. fi
  537. if test -f 'tripwire-1.0/src/preen.c' -a "${1}" != "-c" ; then 
  538.   echo shar: Will not clobber existing file \"'tripwire-1.0/src/preen.c'\"
  539. else
  540. echo shar: Extracting \"'tripwire-1.0/src/preen.c'\" \(4868 characters\)
  541. sed "s/^X//" >'tripwire-1.0/src/preen.c' <<'END_OF_FILE'
  542. X#ifndef lint
  543. Xstatic char rcsid[] = "$Id: preen.c,v 1.2 92/11/03 02:43:57 genek Exp $";
  544. X#endif
  545. X
  546. X/*
  547. X * preen.c
  548. X *
  549. X *    preen the filesystems in preen.config against the data stored in
  550. X *    in preen.database.
  551. X *
  552. X * Gene Kim
  553. X * Purdue University
  554. X */
  555. X
  556. X#include "../include/config.h"
  557. X#include <stdio.h>
  558. X#ifdef STDLIBH
  559. X#include <stdlib.h>
  560. X#include <unistd.h>
  561. X#endif
  562. X#include <sys/param.h>
  563. X#ifdef STRINGH
  564. X#include <string.h>
  565. X#else
  566. X#include <strings.h>
  567. X#endif
  568. X#ifdef __STDC__
  569. X# include <sys/types.h>
  570. X# include <sys/stat.h>
  571. X#endif
  572. X#if (defined(SYSV) && (SYSV < 3))
  573. X# include <limits.h>
  574. X#endif    /* SVR2 */
  575. X#include "../include/list.h"
  576. X#include "../include/tripwire.h"
  577. X
  578. Xstatic struct list *preenlist = NULL;
  579. X
  580. X/* prototypes */
  581. Xchar *mktemp();
  582. Xstatic void preen_database_load();
  583. X
  584. X/*
  585. X * preen_gather()
  586. X *
  587. X *    routine that calls all the other functions for preening.
  588. X */
  589. X
  590. Xvoid
  591. Xpreen_gather()
  592. X{
  593. X    FILE *fp_in;
  594. X    struct list *entry_list = (struct list *) NULL;
  595. X
  596. X    /* build the filelist from the preen.config file
  597. X     *         it will create the linked list of files
  598. X     */
  599. X    configfile_read(&preenlist, &entry_list);
  600. X
  601. X    /* read in the old database */
  602. X    preen_database_load();
  603. X
  604. X    /* preen ourselves:
  605. X     *         build a temporary database, then check for diffs
  606. X     */
  607. X    database_build(&preenlist, DBASE_TEMPORARY, &entry_list);
  608. X
  609. X    /* open it, and begin interp */
  610. X    if ((fp_in = fopen(tempdatabase_file, "r")) == NULL)
  611. X      die_with_err("preen_gather: fopen(%s)", tempdatabase_file);
  612. X
  613. X    /* build the diff_xxx_lists of ADDED, CHANGED, DELETED */
  614. X    preen_interp(fp_in);
  615. X
  616. X    /* now build the report */
  617. X    preen_report();
  618. X    (void) fclose(fp_in);
  619. X
  620. X    /* remove the temporary database file */
  621. X    (void) unlink(tempdatabase_file);
  622. X
  623. X    return;
  624. X}
  625. X
  626. X/*
  627. X * preen_update(char *entry)
  628. X *
  629. X *    build the filelist from tw.config file.
  630. X *    check if (updateentry) is an entry
  631. X *        if it is, update all entries with the same entrynum
  632. X *        else if (updateentry) exists
  633. X *            if so, update, w/same entrynum
  634. X *            else append to database, w/entrynum = -1
  635. X */
  636. X
  637. Xvoid
  638. Xpreen_update(entry)
  639. X    char *entry;
  640. X{
  641. X    struct list *entry_list = (struct list *) NULL;
  642. X
  643. X    /* build the filelist from the preen.config file
  644. X     *         it will create the linked list of files
  645. X     */
  646. X    configfile_read(&preenlist, &entry_list);
  647. X
  648. X    /* read in the old database */
  649. X    preen_database_load();
  650. X
  651. X    /* is (updateentry) an entry */
  652. X    if (list_isthere(entry, &entry_list)) {
  653. X    char s[MAXPATHLEN];
  654. X    int entrynum;
  655. X
  656. X    /* get entry number */
  657. X    (void) strcpy(s, list_lookup(entry, &entry_list));
  658. X    if (sscanf(s, "%d", &entrynum) != 1) {
  659. X        fprintf(stderr, "preen_update: sscanf() parse error!\n");
  660. X        exit(1);
  661. X    }
  662. X
  663. X    /* mark all files with this entry number as FLAG_UPDATE */
  664. X    database_update_markentries(&filelist, entrynum);
  665. X
  666. X    }
  667. X    /* is there even such a file? */
  668. X    else if (list_isthere(entry, &preenlist) == 0) {
  669. X    fprintf(stderr, "tripwire: update couldn't find entry '%s'! Aborting...\n", entry);
  670. X    exit(1);
  671. X    }
  672. X    /* entry is just a regular file */
  673. X    else {
  674. X    /* make sure it's in our database */
  675. X    if (list_isthere(entry, &filelist) < 0) {
  676. X        fprintf(stderr, "preen_update: entry `%s' not found!\n",
  677. X                entry);
  678. X        exit(1);
  679. X    }
  680. X    list_setflag(entry, FLAG_UPDATE, &filelist);
  681. X    }
  682. X
  683. X    /* preen ourselves:
  684. X     *         build a temporary database, then check for diffs
  685. X     */
  686. X    database_build(&filelist, DBASE_UPDATE, &entry_list);
  687. X
  688. X    /* print banner */
  689. X    fputs("###\n", stderr);
  690. X    fprintf(stderr,
  691. X"### Warning:   Old database file moved to `%s'\n", backupfile);
  692. X    fputs("###            in ./Databases.\n", stderr);
  693. X    exit(0);
  694. X
  695. X    return;
  696. X}
  697. X
  698. X/*
  699. X * void
  700. X * preen_database_load()
  701. X *
  702. X *    load in the old database file.
  703. X */
  704. X
  705. Xstatic void
  706. Xpreen_database_load()
  707. X{
  708. X    char filename[MAXPATHLEN];
  709. X    FILE *fp;
  710. X    char s[MAXPATHLEN];
  711. X    char key[MAXPATHLEN], value[512];
  712. X
  713. X    if (specified_dbasefile == NULL)
  714. X    sprintf(filename, "%s/%s", database_path, database_file);
  715. X    else
  716. X    (void) strcpy(filename, specified_dbasefile);
  717. X
  718. X    /* check if we are to read from stdin */
  719. X    if (strcmp(filename, "-") == 0) {
  720. X    fp = stdin;
  721. X    }
  722. X    /* else open the file */
  723. X    else {
  724. X    if ((fp = fopen(filename, "r")) == NULL)
  725. X        die_with_err("%s: Couldn't open database file '%s'",
  726. X                filename);
  727. X    }
  728. X
  729. X    /* read in entire file */
  730. X    while (fgets(s, sizeof(s), fp) != NULL) {
  731. X
  732. X    /* skip comments */
  733. X    if (s[0] == '#')
  734. X        continue;
  735. X    
  736. X    string_split_space(s, key, value);
  737. X
  738. X    /* build table of contents */
  739. X    if (strcmp(key, "@@contents") == 0) {
  740. X        continue;
  741. X    }
  742. X    /* skip database version */
  743. X    else if (strcmp(key, "@@dbaseversion") == 0) {
  744. X        continue;
  745. X    }
  746. X    /* else it's a file */
  747. X    else {
  748. X        /* expand any escaped characters */
  749. X        filename_escape_expand(key);
  750. X
  751. X        list_set(key, value, 0, &filelist);
  752. X    }
  753. X    }
  754. X
  755. X    /* close the file descriptor */
  756. X    if (fp != stdin) {
  757. X    (void) fclose(fp);
  758. X    }
  759. X
  760. X    return;
  761. X}
  762. X
  763. END_OF_FILE
  764. if test 4868 -ne `wc -c <'tripwire-1.0/src/preen.c'`; then
  765.     echo shar: \"'tripwire-1.0/src/preen.c'\" unpacked with wrong size!
  766. fi
  767. # end of 'tripwire-1.0/src/preen.c'
  768. fi
  769. if test -f 'tripwire-1.0/configs/tw.conf.s5' -a "${1}" != "-c" ; then 
  770.   echo shar: Will not clobber existing file \"'tripwire-1.0/configs/tw.conf.s5'\"
  771. else
  772. echo shar: Extracting \"'tripwire-1.0/configs/tw.conf.s5'\" \(4729 characters\)
  773. sed "s/^X//" >'tripwire-1.0/configs/tw.conf.s5' <<'END_OF_FILE'
  774. X#
  775. X# tripwire.config
  776. X# Generic version for:
  777. X#
  778. X# SystemV/386 R3.2 configuration by W. Purvis <W.Purvis@daresbury.ac.uk>
  779. X#
  780. X# This file contains a list of files and directories that System 
  781. X# Preener will scan.  Information collected from these files will be 
  782. X# stored in the tripwire.database file.
  783. X#
  784. X# Format:             [!|=] entry [ignore-flags]
  785. X#
  786. X# where:     '!' signifies the entry is to be pruned (inclusive) from
  787. X#                the list of files to be scanned.
  788. X#         '=' signifies the entry is to be added, but if it is
  789. X#                a directory, then all its contents are pruned
  790. X#                (useful for /tmp).
  791. X#
  792. X# where:    entry is the absolute pathname of a file or a directory
  793. X#
  794. X# where ignore-flags are in the format:
  795. X#        [template][ [+|-][pinugsam12] ... ]
  796. X#
  797. X#     - :  ignore the following atributes
  798. X#    + :  do not ignore the following attributes
  799. X#
  800. X#    p :  permission and file mode bits     a: access timestamp
  801. X#    i :  inode number            m: modification timestamp
  802. X#    n :  number of links (ref count)    c: inode creation timestamp
  803. X#    u :  user id of owner            1: signature 1
  804. X#    g :  group id of owner            2: signature 2
  805. X#    s :  size of file
  806. X#
  807. X#
  808. X# Ex:   The following entry will scan all the files in /etc, and report
  809. X#    any changes in mode bits, inode number, reference count, uid,
  810. X#    gid, modification and creation timestamp, and the signatures.
  811. X#    However, it will ignore any changes in the access timestamp.
  812. X#
  813. X#    /etc    +pinugsm12-a
  814. X#
  815. X# The following templates have been pre-defined to make these long ignore
  816. X# mask descriptions unecessary.
  817. X#
  818. X# Templates:     (default)    R :  [R]ead-only (+pinugsm12-a)
  819. X#                L :  [L]og file (+pinug-sam12)
  820. X#                N :  ignore [N]othing (+pinusgsamc12)
  821. X#                E :  ignore [E]verything (-pinusgsamc12)
  822. X#
  823. X# By default, Tripwire uses the R template -- it ignores
  824. X# only the access timestamp.
  825. X#
  826. X# You can use templates with modifiers, like:
  827. X#    Ex:  /etc/lp    E+ug
  828. X#
  829. X#    Example configuration file:
  830. X#        /etc        R    # all system files
  831. X#        !/etc/lp    R    # ...but not those logs
  832. X#        =/tmp        N    # just the directory, not its files
  833. X#
  834. X# Note the difference between pruning (via "!") and ignoring everything
  835. X# (via "E" template):  Ignoring everything in a directory still monitors
  836. X# for added and deleted files.  Pruning a directory will prevent Tripwire
  837. X# from even looking in the specified directory.
  838. X#
  839. X#
  840. X# Tripwire running slowly?  Modify your tripwire.config entries to
  841. X# ignore the (signature 2) attribute when this computationally-exorbitant 
  842. X# protection is not needed.  (See README and design document for further
  843. X# details.)
  844. X#
  845. X
  846. X#  First, root's "home"
  847. X=/        L
  848. X/.rhosts    R    # may not exist
  849. X/.profile    R    # may not exist
  850. X/.cshrc        R    # may not exist
  851. X/.login        R    # may not exist
  852. X#/.exrc        R    # may not exist
  853. X
  854. X# Unix itself
  855. X/unix        R
  856. X
  857. X# Now, some critical directories and files
  858. X#  Some exceptions are noted further down
  859. X/etc        R
  860. X/etc/inetd.conf    R
  861. X/etc/rc        R
  862. X/etc/rc.boot    R
  863. X/etc/rc.local    R
  864. X/etc/rc.single    R
  865. X/etc/rc.ip    R
  866. X/etc/ttytab    R
  867. X/etc/exports    R
  868. X/etc/ttys    L
  869. X/etc/dumpdates    L
  870. X/etc/mtab    L
  871. X/etc/motd    L
  872. X/etc/rmtab    L
  873. X/etc/utmp    L
  874. X/etc/group    R    # changes should be infrequent
  875. X#  The next line may need to be replaced with /etc/security
  876. X#   if C2 is enabled
  877. X/etc/passwd    L
  878. X
  879. X!/dev
  880. X
  881. X/usr/etc    R
  882. X/usr/local    R
  883. X/usr/local/log    L
  884. X
  885. X# Checksumming the following is not so critical.  However,
  886. X#  setuid/setgid files are special-cased further down.
  887. X
  888. X/lib                R-2
  889. X
  890. X/bin                R-2
  891. X
  892. X/usr/bin            R-2
  893. X
  894. X/usr/ucb            R-2
  895. X
  896. X/usr/lib            R-2
  897. X
  898. X/usr/local/lib/nqs/logfile    L
  899. X=/usr                L
  900. X=/usr/spool            L
  901. X/usr/spool/cron            L
  902. X/usr/spool/mqueue        L
  903. X/usr/spool/mail            L
  904. X=/usr/spool/nqs/private
  905. X=/usr/spool/nqs/times
  906. X
  907. X# You may or may not have the following
  908. X#/usr/ftp    L
  909. X#/usr/ftp/bin    R
  910. X#/usr/ftp/etc    R
  911. X
  912. X# put entries in for /var/yp if you need it
  913. X# put entries for uucp if you need them
  914. X# put entries for /var/adm if you need it
  915. X
  916. X=/tmp
  917. X
  918. X#  Here are entries for setuid/setgid files.  On these, we use
  919. X#  both signatures just to be sure.
  920. X#
  921. X#  You may want/need to edit this list.  Batteries not inc.
  922. X
  923. X/bin/at            R
  924. X/bin/atq        R
  925. X/bin/atrm        R
  926. X/bin/cancel        R
  927. X/bin/chfn        R
  928. X/bin/chsh        R
  929. X/bin/crontab        R
  930. X/bin/cu            R
  931. X/bin/df            R
  932. X/bin/iostat        R
  933. X/bin/ipcs        R
  934. X/bin/login        R
  935. X/bin/lpstat        R
  936. X/bin/mail        R
  937. X/bin/newgrp        R
  938. X/bin/passwd        R
  939. X/bin/su            R
  940. X/bin/tip        R
  941. X#/bin/uucp        R
  942. X#/bin/uuname        R
  943. X#/bin/uustat        R
  944. X#/bin/uux        R
  945. X/bin/wall        R
  946. X/bin/write        R
  947. X/bin/ypchfn        R
  948. X/bin/ypchsh        R
  949. X/bin/yppasswd        R
  950. X/usr/bin/at        R
  951. X/usr/bin/atq        R
  952. X/usr/bin/atrm        R
  953. X/usr/bin/cancel        R
  954. X/usr/bin/chfn        R
  955. X/usr/bin/chsh        R
  956. X/usr/bin/crontab    R
  957. X/usr/bin/cu        R
  958. X/usr/bin/df        R
  959. X/usr/bin/iostat        R
  960. X/usr/bin/ipcs        R
  961. X/usr/bin/login        R
  962. X/usr/bin/lpstat        R
  963. X/usr/bin/mail        R
  964. X/usr/bin/newgrp        R
  965. X/usr/bin/passwd        R
  966. X/usr/bin/su        R
  967. X/usr/bin/tip        R
  968. X#/usr/bin/uucp        R
  969. X#/usr/bin/uuname        R
  970. X#/usr/bin/uustat        R
  971. X#/usr/bin/uux        R
  972. X/usr/bin/wall        R
  973. X/usr/bin/write        R
  974. X/usr/bin/ypchfn        R
  975. X/usr/bin/ypchsh        R
  976. X/usr/bin/yppasswd    R
  977. END_OF_FILE
  978. if test 4729 -ne `wc -c <'tripwire-1.0/configs/tw.conf.s5'`; then
  979.     echo shar: \"'tripwire-1.0/configs/tw.conf.s5'\" unpacked with wrong size!
  980. fi
  981. # end of 'tripwire-1.0/configs/tw.conf.s5'
  982. fi
  983. if test -f 'tripwire-1.0/tests/tw.conf.test' -a "${1}" != "-c" ; then 
  984.   echo shar: Will not clobber existing file \"'tripwire-1.0/tests/tw.conf.test'\"
  985. else
  986. echo shar: Extracting \"'tripwire-1.0/tests/tw.conf.test'\" \(4659 characters\)
  987. sed "s/^X//" >'tripwire-1.0/tests/tw.conf.test' <<'END_OF_FILE'
  988. X#
  989. X# tw.config
  990. X#
  991. X# This file contains a list of files and directories that System 
  992. X# Preener will scan.  Information collected from these files will be 
  993. X# stored in the tw.database file.
  994. X#
  995. X# Format:             [!|=] entry [ignore-flags]
  996. X#
  997. X# where:     '!' signifies the entry is to be pruned (inclusive) from
  998. X#                the list of files to be scanned.
  999. X#         '=' signifies the entry is to be added, but if it is
  1000. X#                a directory, then all its contents are pruned
  1001. X#                (useful for /tmp).
  1002. X#
  1003. X# where:    entry is the absolute pathname of a file or a directory
  1004. X#
  1005. X# where ignore-flags are in the format:
  1006. X#        [template][ [+|-][pinugsam12] ... ]
  1007. X#
  1008. X#     - :  ignore the following atributes
  1009. X#    + :  do not ignore the following attributes
  1010. X#
  1011. X#    p :  permission and file mode bits     a: access timestamp
  1012. X#    i :  inode number            m: modification timestamp
  1013. X#    n :  number of links (ref count)    c: inode creation timestamp
  1014. X#    u :  user id of owner            1: signature 1
  1015. X#    g :  group id of owner            2: signature 2
  1016. X#    s :  size of file
  1017. X#
  1018. X#
  1019. X# Ex:   The following entry will scan all the files in /etc, and report
  1020. X#    any changes in mode bits, inode number, reference count, uid,
  1021. X#    gid, modification and creation timestamp, and the signatures.
  1022. X#    However, it will ignore any changes in the access timestamp.
  1023. X#
  1024. X#    /etc    +pinugsm12-a
  1025. X#
  1026. X# The following templates have been pre-defined to make these long ignore
  1027. X# mask descriptions unecessary.
  1028. X#
  1029. X# Templates:     (default)    R :  [R]ead-only (+pinugsm12-a)
  1030. X#                L :  [L]og file (+pinug-sam12)
  1031. X#                N :  ignore [N]othing (+pinusgsamc12)
  1032. X#                E :  ignore [E]verything (-pinusgsamc12)
  1033. X#
  1034. X# By default, Tripwire uses the R template -- it ignores
  1035. X# only the access timestamp.
  1036. X#
  1037. X# You can use templates with modifiers, like:
  1038. X#    Ex:  /etc/lp    E+ug
  1039. X#
  1040. X#    Example configuration file:
  1041. X#        /etc        R    # all system files
  1042. X#        !/etc/lp    R    # ...but not those logs
  1043. X#        =/tmp        N    # just the directory, not its files
  1044. X#
  1045. X# Note the difference between pruning (via "!") and ignoring everything
  1046. X# (via "E" template):  Ignoring everything in a directory still monitors
  1047. X# for added and deleted files.  Pruning a directory will prevent Tripwire
  1048. X# from even looking in the specified directory.
  1049. X#
  1050. X#
  1051. X# Hint: Tripwire running slowly?  Modify your tripwire.config entries to
  1052. X# ignore the (signature 2) attribute when this computationally-exorbitant 
  1053. X# protection is not needed.  (See README and design document for further
  1054. X# details.)
  1055. X#
  1056. X# ====
  1057. X#
  1058. X# Preprocessor directives:
  1059. X#
  1060. X#    The following directives provide C-preprocessor and m4-like
  1061. X#    functionality:
  1062. X#
  1063. X#        @@ifhost hostname    :    included if (hostname) matches
  1064. X#        @@ifhost hostname    :    included if (hostname) doesn't
  1065. X#                        match.
  1066. X#                        (both need matching @@endif)
  1067. X#
  1068. X#        @@define x        :     defines (x)
  1069. X#        @@undef x        :     undefines (x)
  1070. X#
  1071. X#        @@ifdef x        :     included if (x) is defined.
  1072. X#        @@ifndef x        :     included if (x) is not defined.
  1073. X#                        (both need matching @@endif)
  1074. X#
  1075. X#        @@endif            :     closes up @@ifhost, @@ifdef,
  1076. X#                        and @@ifndef.
  1077. X#
  1078. X#    Example:
  1079. X#    A host-dependent inclusion can be specified many ways so tw.config
  1080. X#    files can be shared among multiple machines.  So, if the machine 
  1081. X#    "mentor.cc.purdue.edu" is the only machine that has a certain file,
  1082. X#    you could use:
  1083. X#
  1084. X#        @@ifhost mentor.cc.purdue.edu
  1085. X#        /etc/tw.log.mentor    R
  1086. X#        @@endif
  1087. X#
  1088. X
  1089. X/tmp/genek/tripwire-1.0                R+0123456789-ugpmci
  1090. X/tmp/genek/tripwire-1.0/tests             E
  1091. X/tmp/genek/tripwire-1.0/databases         E
  1092. X
  1093. X!/tmp/genek/tripwire-1.0/src/config.parse.o
  1094. X!/tmp/genek/tripwire-1.0/src/main.o
  1095. X!/tmp/genek/tripwire-1.0/src/list.o
  1096. X!/tmp/genek/tripwire-1.0/src/ignorevec.o
  1097. X!/tmp/genek/tripwire-1.0/src/dbase.build.o
  1098. X!/tmp/genek/tripwire-1.0/src/utils.o
  1099. X!/tmp/genek/tripwire-1.0/src/preen.o
  1100. X!/tmp/genek/tripwire-1.0/src/preen.interp.o
  1101. X!/tmp/genek/tripwire-1.0/src/preen.report.o
  1102. X!/tmp/genek/tripwire-1.0/src/nullsig.o
  1103. X!/tmp/genek/tripwire-1.0/src/config.prim.o
  1104. X!/tmp/genek/tripwire-1.0/src/dbase.update.o
  1105. X!/tmp/genek/tripwire-1.0/src/sigfetch
  1106. X!/tmp/genek/tripwire-1.0/src/tripwire
  1107. X!/tmp/genek/tripwire-1.0/src/config.pre.o
  1108. X!/tmp/genek/tripwire-1.0/sigs/crc/crc.o
  1109. X!/tmp/genek/tripwire-1.0/sigs/crc32/crc32.o
  1110. X!/tmp/genek/tripwire-1.0/sigs/md2/md2wrapper.o
  1111. X!/tmp/genek/tripwire-1.0/sigs/md2/md2.o
  1112. X!/tmp/genek/tripwire-1.0/sigs/md4/md4.o
  1113. X!/tmp/genek/tripwire-1.0/sigs/md4/md4wrapper.o
  1114. X!/tmp/genek/tripwire-1.0/sigs/md5/md5.o
  1115. X!/tmp/genek/tripwire-1.0/sigs/md5/md5wrapper.o
  1116. X!/tmp/genek/tripwire-1.0/sigs/snefru/snefru.o
  1117. X
  1118. X!/tmp/genek/tripwire-1.0/aux/types
  1119. X!/tmp/genek/tripwire-1.0/aux/byteorder
  1120. X
  1121. X!/tmp/genek/tripwire-1.0/src/config.lex.c
  1122. X!/tmp/genek/tripwire-1.0/src/config.pre.c
  1123. X!/tmp/genek/tripwire-1.0/Makefile
  1124. X!/tmp/genek/tripwire-1.0/include/config.h
  1125. X!/tmp/genek/tripwire-1.0/include/byteorder.h
  1126. X!/tmp/genek/tripwire-1.0/include/inode.h
  1127. END_OF_FILE
  1128. if test 4659 -ne `wc -c <'tripwire-1.0/tests/tw.conf.test'`; then
  1129.     echo shar: \"'tripwire-1.0/tests/tw.conf.test'\" unpacked with wrong size!
  1130. fi
  1131. # end of 'tripwire-1.0/tests/tw.conf.test'
  1132. fi
  1133. if test -f 'tripwire-1.0/lib/tw.config' -a "${1}" != "-c" ; then 
  1134.   echo shar: Will not clobber existing file \"'tripwire-1.0/lib/tw.config'\"
  1135. else
  1136. echo shar: Extracting \"'tripwire-1.0/lib/tw.config'\" \(4132 characters\)
  1137. sed "s/^X//" >'tripwire-1.0/lib/tw.config' <<'END_OF_FILE'
  1138. X#
  1139. X# tw.config
  1140. X#
  1141. X# This file contains a list of files and directories that System 
  1142. X# Preener will scan.  Information collected from these files will be 
  1143. X# stored in the tw.database file.
  1144. X#
  1145. X# Format:             [!|=] entry [ignore-flags]
  1146. X#
  1147. X# where:     '!' signifies the entry is to be pruned (inclusive) from
  1148. X#                the list of files to be scanned.
  1149. X#         '=' signifies the entry is to be added, but if it is
  1150. X#                a directory, then all its contents are pruned
  1151. X#                (useful for /tmp).
  1152. X#
  1153. X# where:    entry is the absolute pathname of a file or a directory
  1154. X#
  1155. X# where ignore-flags are in the format:
  1156. X#        [template][ [+|-][pinugsam12] ... ]
  1157. X#
  1158. X#     - :  ignore the following atributes
  1159. X#    + :  do not ignore the following attributes
  1160. X#
  1161. X#    p :  permission and file mode bits     a: access timestamp
  1162. X#    i :  inode number            m: modification timestamp
  1163. X#    n :  number of links (ref count)    c: inode creation timestamp
  1164. X#    u :  user id of owner            1: signature 1
  1165. X#    g :  group id of owner            2: signature 2
  1166. X#    s :  size of file
  1167. X#
  1168. X#
  1169. X# Ex:   The following entry will scan all the files in /etc, and report
  1170. X#    any changes in mode bits, inode number, reference count, uid,
  1171. X#    gid, modification and creation timestamp, and the signatures.
  1172. X#    However, it will ignore any changes in the access timestamp.
  1173. X#
  1174. X#    /etc    +pinugsm12-a
  1175. X#
  1176. X# The following templates have been pre-defined to make these long ignore
  1177. X# mask descriptions unecessary.
  1178. X#
  1179. X# Templates:     (default)    R :  [R]ead-only (+pinugsm12-a)
  1180. X#                L :  [L]og file (+pinug-sam12)
  1181. X#                N :  ignore [N]othing (+pinusgsamc12)
  1182. X#                E :  ignore [E]verything (-pinusgsamc12)
  1183. X#
  1184. X# By default, Tripwire uses the R template -- it ignores
  1185. X# only the access timestamp.
  1186. X#
  1187. X# You can use templates with modifiers, like:
  1188. X#    Ex:  /etc/lp    E+ug
  1189. X#
  1190. X#    Example configuration file:
  1191. X#        /etc        R    # all system files
  1192. X#        !/etc/lp    R    # ...but not those logs
  1193. X#        =/tmp        N    # just the directory, not its files
  1194. X#
  1195. X# ====
  1196. X#
  1197. X# Preprocessor directives:
  1198. X#
  1199. X#    The following directives provide C-preprocessor and m4-like
  1200. X#    functionality:
  1201. X#
  1202. X#        @@ifhost hostname    :    included if (hostname) matches
  1203. X#        @@ifhost hostname    :    included if (hostname) doesn't
  1204. X#                        match.
  1205. X#                        (both need matching @@endif)
  1206. X#
  1207. X#        @@define x        :     defines (x)
  1208. X#        @@undef x        :     undefines (x)
  1209. X#
  1210. X#        @@ifdef x        :     included if (x) is defined.
  1211. X#        @@ifndef x        :     included if (x) is not defined.
  1212. X#                        (both need matching @@endif)
  1213. X#
  1214. X#        @@endif            :     closes up @@ifhost, @@ifdef,
  1215. X#                        and @@ifndef.
  1216. X#
  1217. X#    Example:
  1218. X#    A host-dependent inclusion can be specified many ways so tw.config
  1219. X#    files can be shared among multiple machines.  So, if the machine 
  1220. X#    "mentor.cc.purdue.edu" is the only machine that has a certain file,
  1221. X#    you could use:
  1222. X#
  1223. X#        @@ifhost mentor.cc.purdue.edu
  1224. X#        /etc/tw.log.mentor    R
  1225. X#        @@endif
  1226. X#
  1227. X
  1228. X/tmp/genek/tripwire-1.0                R+0123456789-ugpmci
  1229. X/tmp/genek/tripwire-1.0/tests             E
  1230. X/tmp/genek/tripwire-1.0/tw.config         E
  1231. X/tmp/genek/tripwire-1.0/databases         E
  1232. X
  1233. X/tmp/genek/tripwire-1.0/src/config.parse.o
  1234. X/tmp/genek/tripwire-1.0/src/main.o
  1235. X/tmp/genek/tripwire-1.0/src/list.o
  1236. X/tmp/genek/tripwire-1.0/src/ignorevec.o
  1237. X/tmp/genek/tripwire-1.0/src/dbase.build.o
  1238. X/tmp/genek/tripwire-1.0/src/utils.o
  1239. X/tmp/genek/tripwire-1.0/src/preen.o
  1240. X/tmp/genek/tripwire-1.0/src/preen.interp.o
  1241. X/tmp/genek/tripwire-1.0/src/preen.report.o
  1242. X/tmp/genek/tripwire-1.0/src/nullsig.o
  1243. X/tmp/genek/tripwire-1.0/src/config.prim.o
  1244. X/tmp/genek/tripwire-1.0/src/dbase.update.o
  1245. X/tmp/genek/tripwire-1.0/src/sigfetch.o
  1246. X/tmp/genek/tripwire-1.0/src/config.pre.o
  1247. X/tmp/genek/tripwire-1.0/sigs/crc/crc.o
  1248. X/tmp/genek/tripwire-1.0/sigs/crc32/crc32.o
  1249. X/tmp/genek/tripwire-1.0/sigs/md2/md2wrapper.o
  1250. X/tmp/genek/tripwire-1.0/sigs/md2/md2.o
  1251. X/tmp/genek/tripwire-1.0/sigs/md4/md4.o
  1252. X/tmp/genek/tripwire-1.0/sigs/md4/md4wrapper.o
  1253. X/tmp/genek/tripwire-1.0/sigs/md5/md5.o
  1254. X/tmp/genek/tripwire-1.0/sigs/md5/md5wrapper.o
  1255. X/tmp/genek/tripwire-1.0/sigs/snefru/snefru.o
  1256. X
  1257. X!/tmp/genek/tripwire-1.0/aux/types
  1258. X!/tmp/genek/tripwire-1.0/aux/byteorder
  1259. X
  1260. X!/tmp/genek/tripwire-1.0/src/config.lex.c
  1261. X!/tmp/genek/tripwire-1.0/src/config.pre.c
  1262. X!/tmp/genek/tripwire-1.0/Makefile
  1263. X!/tmp/genek/tripwire-1.0/include/config.h
  1264. X!/tmp/genek/tripwire-1.0/include/byteorder.h
  1265. X!/tmp/genek/tripwire-1.0/include/inode.h
  1266. END_OF_FILE
  1267. if test 4132 -ne `wc -c <'tripwire-1.0/lib/tw.config'`; then
  1268.     echo shar: \"'tripwire-1.0/lib/tw.config'\" unpacked with wrong size!
  1269. fi
  1270. # end of 'tripwire-1.0/lib/tw.config'
  1271. fi
  1272. if test -f 'tripwire-1.0/contrib/README.TRIPWIRE' -a "${1}" != "-c" ; then 
  1273.   echo shar: Will not clobber existing file \"'tripwire-1.0/contrib/README.TRIPWIRE'\"
  1274. else
  1275. echo shar: Extracting \"'tripwire-1.0/contrib/README.TRIPWIRE'\" \(3136 characters\)
  1276. sed "s/^X//" >'tripwire-1.0/contrib/README.TRIPWIRE' <<'END_OF_FILE'
  1277. X# Lance Bailey <lrb@ctrg.rri.uwo.ca>
  1278. X#
  1279. X
  1280. XTRIPWIRE
  1281. X--------
  1282. X
  1283. XTRIPWIRE is a script designed to make easier the running of tripwire on 
  1284. Xmultiple machines, but with only one floppy drive available.
  1285. X
  1286. X
  1287. XA safe, and recommended by gene, manner of running tripwire is to keep
  1288. Xthe databases and the config files on a read only floppy. A safer still 
  1289. Xapproach is to also store the binaries on the floppy.  Unfortunately, if
  1290. Xyou only have one floppy, you can run out of space while trying to support
  1291. Xa number of machines/platforms on one floppy. The obvious solution is 
  1292. Xcompression of some sort.
  1293. X
  1294. X
  1295. XTRIPWIRE is designed to take compressed binaries and databases, decompress
  1296. Xthem into a clean working area and run the [newly uncompressed] binary 
  1297. Xaccording to the appropriate config file.
  1298. X
  1299. X
  1300. XTo use TRIPWIRE, 
  1301. X
  1302. X1) 
  1303. Xset up your config.h as follows (*before* compiling :)
  1304. X
  1305. X#define CONFIG_PATH    "/usr/local/adm/tcheck/tripwire.configs"
  1306. X#define DATABASE_PATH    "./Databases"
  1307. X
  1308. X#define CONFIG_FILE     "tripwire.config_@"
  1309. X#define DATABASE_FILE    "tripwire.database_@"
  1310. X
  1311. X
  1312. X
  1313. X2) set up a floppy as follows 
  1314. X
  1315. X/floppy/Databases
  1316. X             -- directory, contains compressed Databases of the
  1317. X            form:  tripwire.database_XXX.sub.do.main
  1318. X            tripwire.database_YYY.sub.do.main
  1319. X
  1320. X            where XXX.sub.do.main and YYY.sub.do.main are
  1321. X            hostnames (as returned by the hostname(1) command)
  1322. X            of machines you are monitoring.
  1323. X
  1324. X            There will be a unique database for each machine.
  1325. X
  1326. X
  1327. X/floppy/tripwire.configs
  1328. X             -- directory containing compressed binaries for each of
  1329. X            your systems.  These are named for the hostname of
  1330. X            the system.  Continuing the above example, we would
  1331. X            have
  1332. X
  1333. X            /floppy/tripwire.configs/XXX.sub.do.main
  1334. X            /floppy/tripwire.configs/YYY.sub.do.main
  1335. X
  1336. X            if XXX and YYY were the same platform, then a single
  1337. X            file with two links to the inode could be used.
  1338. X
  1339. X
  1340. X
  1341. X/floppy/tripwire.configs
  1342. X
  1343. X             -- directory containing the *uncompressed*
  1344. X            configuration files each of your systems.  These are
  1345. X            named tripwire.config_XXX.sub.dom.ain and
  1346. X            tripwire.config_YYY.sub.dom.ain
  1347. X
  1348. X            It is expected that each host will have a unique
  1349. X            config file, although it is possible that disk-sparse
  1350. X            clients might share configs. In this case, use multiple
  1351. X            links to the same config file.
  1352. X
  1353. X
  1354. X3) for each needed platform:
  1355. X   -build the binary
  1356. X   -run the binary tripwire to create the database
  1357. X   -compress the binary and the database and store them onto the floppy
  1358. X
  1359. X
  1360. X4) Mark the floppy readonly, re-mount and export to needed machines. NFS-mount 
  1361. X   the floppy as /usr/local/adm/tcheck (or edit the TRIPWIRE script to reflect
  1362. X   your preference).  Use a symlink on the floppy's local host to point 
  1363. X   /usr/local/adm/tcheck to the floppy if you can't control a floppy's
  1364. X   mount point (stupid NeXT).
  1365. X
  1366. X5) TRIPWIRE operates as follows:
  1367. X
  1368. X    cd the the /tmp area
  1369. X    forcably remove any hierarchy called tcheck.run
  1370. X    create the directory tcheck.run, move to it and create a Databases
  1371. X        directory
  1372. X    uncompress the needed binary and database and store them in .  and
  1373. X        Databases
  1374. X    run tripwire, mailing the output to root
  1375. X    move back to the /tmp area and remove the tcheck.run hierarchy
  1376. X
  1377. X
  1378. END_OF_FILE
  1379. if test 3136 -ne `wc -c <'tripwire-1.0/contrib/README.TRIPWIRE'`; then
  1380.     echo shar: \"'tripwire-1.0/contrib/README.TRIPWIRE'\" unpacked with wrong size!
  1381. fi
  1382. # end of 'tripwire-1.0/contrib/README.TRIPWIRE'
  1383. fi
  1384. if test -f 'tripwire-1.0/configs/tw.conf.next' -a "${1}" != "-c" ; then 
  1385.   echo shar: Will not clobber existing file \"'tripwire-1.0/configs/tw.conf.next'\"
  1386. else
  1387. echo shar: Extracting \"'tripwire-1.0/configs/tw.conf.next'\" \(2892 characters\)
  1388. sed "s/^X//" >'tripwire-1.0/configs/tw.conf.next' <<'END_OF_FILE'
  1389. X# Lance R. Bailey <lrb@ctrg.rri.uwo.ca>
  1390. X#
  1391. X
  1392. X#  First, root's "home"
  1393. X=/        L
  1394. X/.rhosts    R    # may not exist
  1395. X/.profile    R    # may not exist
  1396. X/.cshrc        R    # may not exist
  1397. X/.login        R    # may not exist
  1398. X/.exrc        R    # may not exist
  1399. X/.logout    R    # may not exist
  1400. X/.emacs        R    # may not exist
  1401. X/.forward    R    # may not exist
  1402. X/.netrc        R    # may not exist
  1403. X
  1404. X# Unix itself
  1405. X/sdmach        R
  1406. X
  1407. X# Now, some critical directories and files
  1408. X#  Some exceptions are noted further down
  1409. X/etc        R
  1410. X/etc/inetd.conf    R
  1411. X/etc/rc        R
  1412. X/etc/rc.boot    R
  1413. X/etc/rc.local    R
  1414. X/etc/rc.single    R
  1415. X/etc/rc.ip    R
  1416. X/etc/ttytab    R
  1417. X/etc/exports    R
  1418. X/etc/ttys    L
  1419. X/etc/dumpdates    L
  1420. X/etc/mtab    L
  1421. X/etc/motd    L
  1422. X/etc/rmtab    L
  1423. X/etc/utmp    L
  1424. X/etc/group    R    # changes should be infrequent
  1425. X#  The next line may need to be replaced with /etc/security
  1426. X#   if C2 is enabled
  1427. X/etc/passwd    L
  1428. X
  1429. X/var        L
  1430. X
  1431. X/dev        L
  1432. X
  1433. X/usr/etc    R
  1434. X
  1435. X# Checksumming the following is not so critical.  However,
  1436. X#  setuid/setgid files are special-cased further down.
  1437. X
  1438. X/lib        R-2
  1439. X
  1440. X/bin        R-2
  1441. X
  1442. X/usr/bin    R-2
  1443. X
  1444. X/usr/ucb    R-2
  1445. X
  1446. X/usr/lib    R-2
  1447. X
  1448. X=/usr        L
  1449. X=/usr/spool    L
  1450. X/usr/spool/cron        L
  1451. X/usr/spool/mqueue    L
  1452. X/usr/spool/mail        L
  1453. X
  1454. X# You may or may not have the following
  1455. X#/usr/ftp    L
  1456. X#/usr/ftp/bin    R
  1457. X#/usr/ftp/etc    R
  1458. X
  1459. X# put entries in for /var/yp if you need it
  1460. X# put entries for uucp if you need them
  1461. X# put entries for /var/adm if you need it
  1462. X
  1463. X=/tmp
  1464. X=/var/tmp
  1465. X
  1466. X#  Here are entries for setuid/setgid files.  On these, we use
  1467. X#  both signatures just to be sure.
  1468. X#
  1469. X#  You may want/need to edit this list.  Batteries not inc.
  1470. X
  1471. X/bin/at            R
  1472. X/bin/atq        R
  1473. X/bin/atrm        R
  1474. X/bin/cancel        R
  1475. X/bin/chfn        R
  1476. X/bin/chsh        R
  1477. X/bin/crontab        R
  1478. X/bin/cu            R
  1479. X/bin/df            R
  1480. X/bin/iostat        R
  1481. X/bin/ipcs        R
  1482. X/bin/login        R
  1483. X/bin/lpstat        R
  1484. X/bin/mail        R
  1485. X/bin/newgrp        R
  1486. X/bin/passwd        R
  1487. X/bin/su            R
  1488. X/bin/sunview1/sv_acquire        R
  1489. X/bin/sunview1/sv_release        R
  1490. X/bin/sunview1/toolplaces        R
  1491. X/bin/tip        R
  1492. X/bin/uucp        R
  1493. X/bin/uuname        R
  1494. X/bin/uustat        R
  1495. X/bin/uux        R
  1496. X/bin/wall        R
  1497. X/bin/write        R
  1498. X/bin/ypchfn        R
  1499. X/bin/ypchsh        R
  1500. X/bin/yppasswd        R
  1501. X/usr/bin/at        R
  1502. X/usr/bin/atq        R
  1503. X/usr/bin/atrm        R
  1504. X/usr/bin/cancel        R
  1505. X/usr/bin/chfn        R
  1506. X/usr/bin/chsh        R
  1507. X/usr/bin/crontab    R
  1508. X/usr/bin/cu        R
  1509. X/usr/bin/df        R
  1510. X/usr/bin/iostat        R
  1511. X/usr/bin/ipcs        R
  1512. X/usr/bin/login        R
  1513. X/usr/bin/lpstat        R
  1514. X/usr/bin/mail        R
  1515. X/usr/bin/newgrp        R
  1516. X/usr/bin/passwd        R
  1517. X/usr/bin/su        R
  1518. X/usr/bin/sunview1/sv_acquire        R
  1519. X/usr/bin/sunview1/sv_release        R
  1520. X/usr/bin/sunview1/toolplaces        R
  1521. X/usr/bin/tip        R
  1522. X/usr/bin/uucp        R
  1523. X/usr/bin/uuname        R
  1524. X/usr/bin/uustat        R
  1525. X/usr/bin/uux        R
  1526. X/usr/bin/wall        R
  1527. X/usr/bin/write        R
  1528. X/usr/bin/ypchfn        R
  1529. X/usr/bin/ypchsh        R
  1530. X/usr/bin/yppasswd    R
  1531. X/usr/etc/arp        R
  1532. X/usr/etc/chill        R
  1533. X/usr/etc/devinfo    R
  1534. X/usr/etc/dkinfo        R
  1535. X/usr/etc/dmesg        R
  1536. X/usr/etc/dump        R
  1537. X/usr/etc/dumpfs        R
  1538. X/usr/etc/keyenvoy    R
  1539. X/usr/etc/kgmon        R
  1540. X/usr/etc/lpc        R
  1541. X/usr/etc/nfsstat    R
  1542. X/usr/etc/ping        R
  1543. X/usr/etc/rpc.rwalld    R
  1544. X/usr/etc/trpt        R
  1545. X/usr/ucb/lpq        R
  1546. X/usr/ucb/lpr        R
  1547. X/usr/ucb/netstat    R
  1548. X/usr/ucb/rcp        R
  1549. X/usr/ucb/rdist        R
  1550. X/usr/ucb/rlogin        R
  1551. X/usr/ucb/rsh        R
  1552. X/usr/ucb/talk        R
  1553. X/usr/ucb/vmstat        R
  1554. X
  1555. END_OF_FILE
  1556. if test 2892 -ne `wc -c <'tripwire-1.0/configs/tw.conf.next'`; then
  1557.     echo shar: \"'tripwire-1.0/configs/tw.conf.next'\" unpacked with wrong size!
  1558. fi
  1559. # end of 'tripwire-1.0/configs/tw.conf.next'
  1560. fi
  1561. if test -f 'tripwire-1.0/Makefile' -a "${1}" != "-c" ; then 
  1562.   echo shar: Will not clobber existing file \"'tripwire-1.0/Makefile'\"
  1563. else
  1564. echo shar: Extracting \"'tripwire-1.0/Makefile'\" \(2888 characters\)
  1565. sed "s/^X//" >'tripwire-1.0/Makefile' <<'END_OF_FILE'
  1566. X# $Id: Makefile,v 1.3 92/11/03 13:34:46 genek Exp $
  1567. X#
  1568. X#     Tripwire build
  1569. X#
  1570. X#  See the README file before running this!
  1571. X#
  1572. X
  1573. X###
  1574. X###   Start of user-modified settings
  1575. X###   Examine these and change the ones that need to be
  1576. X###   Altered on your system
  1577. X###
  1578. X
  1579. X# destination directory for final executables
  1580. XDESTDIR = /secureplace/bin
  1581. X
  1582. X# destination for man pages
  1583. XMANDIR  = /usr/man
  1584. X
  1585. X# system utilities
  1586. XLEX    = lex
  1587. X#LEX    = flex            # For the GNU crowd
  1588. X
  1589. XYACC    = yacc
  1590. X#YACC    = bison            # For the GNU crowd
  1591. X
  1592. X# for SVR4 make (must be a Bourne-type shell)
  1593. XSHELL    = /bin/sh
  1594. X#SHELL    = /bin/ksh        # Another common shell
  1595. X#SHELL    = /bin/bash        # For the GNU fanatics
  1596. X
  1597. X# you can use ANSI C if you like, but K&R is equally fine.
  1598. XCC     = cc            # common
  1599. X#CC     = gcc            # also common
  1600. X#CC    = /usr/ccs/bin/cc    # Pyramid DC/OSx (SVR4)
  1601. X
  1602. XCFLAGS = -O            # common 
  1603. X#CFLAGS = -g            # debugging
  1604. X#CFLAGS = -O -cckr        # SGI
  1605. X#CFLAGS = -O -Aa -N        # HP/UX ansi
  1606. X#CFLAGS = -O -Ac -N        # HP/UX K&R
  1607. X#CFLAGS = -O -Ac -N -Wl,-a,archive    # HP/UX K&R, insure archived, static link
  1608. X#CFLAGS = -systype bsd43    # ETA/10 (SVR3)
  1609. X#CFLAGS = -O -ansi        # gnu CC
  1610. X#CFLAGS = -O -ansi -W -Wreturn-type -Wswitch -Wshadow # gnu CC w/all warnings
  1611. X#CFLAGS = -OG            # Pyramid OSx
  1612. X#CFLAGS = -O -Kold        # Pyramid DC/OSx (SVR4)
  1613. X
  1614. X# a C preprocessor (to build inode.h)
  1615. XCPP    = cc -E            # common
  1616. X#CPP    = /usr/lib/cpp        # on older systems
  1617. X#CPP    = /lib/cpp        # on older systems
  1618. X
  1619. X# make sure libraries are not linked dynamically (as a security measure)
  1620. XLDFLAGS=            # common
  1621. X#LDFLAGS= -non_shared        # OSF/1
  1622. X#LDFLAGS= -Bstatic        # SunOS
  1623. X#LDFLAGS= -dn            # Pyramid DC/OSx (SVR4)
  1624. X
  1625. X# libraries
  1626. XLIBS =                 # common
  1627. X#LIBS = -lmalloc -lsun -lc_s    # IRIX 4.0
  1628. X#LIBS = -lx            # Xenix
  1629. X#LIBS = -lbsd            # MIPS RISC/OS
  1630. X
  1631. X# If you don't have the install command, you need to replace
  1632. X# the use of it later in the makefile with a cp and chmod
  1633. XINSTALL= /usr/bin/install    # common
  1634. X#INSTALL= /usr/ucb/install    # Pyramid DC/OSx (SVR4)
  1635. X#INSTALL= /etc/install        # Pyramid OSx
  1636. X#INSTALL= /bin/cp        # no install
  1637. X
  1638. X# how you get hostname information (BSD vs. SYSV style)
  1639. XHOSTNAME    = hostname        # BSD
  1640. X#HOSTNAME    = uname -n        # System V 
  1641. X
  1642. X
  1643. X###
  1644. X###   End of user-modified settings
  1645. X###   You should not need to change anything after this
  1646. X###
  1647. X
  1648. XDIST        = tripwire-1.0
  1649. X
  1650. Xall:
  1651. X    (cd aux; make CC=$(CC) CFLAGS="$(CFLAGS)"  \
  1652. X        LDFLAGS="$(LDFLAGS)" CPP="$(CPP)" SHELL=$(SHELL) all)
  1653. X    (cd src; make CC=$(CC) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" \
  1654. X        LDFLAGS="$(LDFLAGS)" CPP="$(CPP)" SHELL=$(SHELL) all)
  1655. X
  1656. Xinstall: all
  1657. X    (cd src; make INSTALL=$(INSTALL) DESTDIR=$(DESTDIR) install)
  1658. X    (cd man; make INSTALL=$(INSTALL) MANDIR=$(MANDIR) install)
  1659. X
  1660. Xtest:    all
  1661. X    (cd tests; make HOSTNAME=$(HOSTNAME) DIST=$(DIST) SHELL=$(SHELL))
  1662. X
  1663. Xclean:
  1664. X    (cd src; make clean)
  1665. X    (cd man; make clean)
  1666. X    (cd aux; make clean)
  1667. X    (cd tests; make clean)
  1668. X    rm -f core  
  1669. X
  1670. Xclobber: clean
  1671. X    (cd src; make clobber)
  1672. X    (cd man; make clean)
  1673. X    (cd aux; make clean)
  1674. X    (cd tests; make clean)
  1675. X    rm -f core  
  1676. END_OF_FILE
  1677. if test 2888 -ne `wc -c <'tripwire-1.0/Makefile'`; then
  1678.     echo shar: \"'tripwire-1.0/Makefile'\" unpacked with wrong size!
  1679. fi
  1680. # end of 'tripwire-1.0/Makefile'
  1681. fi
  1682. if test -f 'tripwire-1.0/src/config.prim.c' -a "${1}" != "-c" ; then 
  1683.   echo shar: Will not clobber existing file \"'tripwire-1.0/src/config.prim.c'\"
  1684. else
  1685. echo shar: Extracting \"'tripwire-1.0/src/config.prim.c'\" \(2728 characters\)
  1686. sed "s/^X//" >'tripwire-1.0/src/config.prim.c' <<'END_OF_FILE'
  1687. X#ifndef lint
  1688. Xstatic char rcsid[] = "$Id: config.prim.c,v 1.2 92/11/03 02:43:37 genek Exp $";
  1689. X#endif
  1690. X
  1691. X/*
  1692. X * config.prim.c
  1693. X *
  1694. X *    process configuration file directive primitives (ala m4 or cpp).
  1695. X *
  1696. X *        ifhost
  1697. X *        define
  1698. X *        undef
  1699. X *        ifdef
  1700. X *        ifndef
  1701. X *
  1702. X * Gene Kim
  1703. X * Purdue University
  1704. X * September 28, 1992
  1705. X */
  1706. X
  1707. X#include "../include/config.h"
  1708. X#include <stdio.h>
  1709. X#ifdef __STDC__
  1710. X# include <sys/types.h>
  1711. X# include <sys/stat.h>
  1712. X#endif
  1713. X#ifdef STRINGH
  1714. X#include <string.h>
  1715. X#else
  1716. X#include <strings.h>
  1717. X#endif
  1718. X#include "../include/tripwire.h"
  1719. X#include "../include/list.h"
  1720. X#include <ctype.h>
  1721. X#include <sys/param.h>
  1722. X#ifndef GETHOSTNAME
  1723. X#include <sys/utsname.h>
  1724. X#endif
  1725. X#ifndef MAXHOSTNAMELEN
  1726. X#define MAXHOSTNAMELEN 64
  1727. X#endif
  1728. X#ifndef GETHOSTNAME
  1729. X#include <sys/utsname.h>
  1730. X#endif
  1731. X
  1732. Xstatic struct list *defines_table = (struct list *) NULL;
  1733. X
  1734. X/*
  1735. X * void
  1736. X * tw_mac_define(char *varname, char *varvalue)
  1737. X *
  1738. X *    set (varname) to (varvalue) in the defines table
  1739. X */
  1740. X
  1741. Xvoid
  1742. Xtw_mac_define(varname, varvalue)
  1743. X    char *varname, *varvalue;
  1744. X{
  1745. X    list_set(varname, varvalue, 0, &defines_table);
  1746. X}
  1747. X
  1748. X/* char *
  1749. X * tw_mac_dereference(char *varname)
  1750. X *
  1751. X *    returns the (varvalue) in the defines table.
  1752. X */
  1753. X
  1754. Xchar *
  1755. Xtw_mac_dereference(varname)
  1756. X    char *varname;
  1757. X{
  1758. X    return list_lookup(varname, &defines_table);
  1759. X}
  1760. X
  1761. X/*
  1762. X * void
  1763. X * tw_mac_undef(char *varname)
  1764. X *
  1765. X *    removes (varname) from the defines table.
  1766. X */
  1767. X
  1768. Xvoid
  1769. Xtw_mac_undef(varname)
  1770. X    char *varname;
  1771. X{
  1772. X    list_unset(varname, &defines_table);
  1773. X}
  1774. X
  1775. X/*
  1776. X * int
  1777. X * tw_mac_ifdef(char *varname)
  1778. X *
  1779. X *    returns 1 if (varname) is in defines table, else 0.
  1780. X */
  1781. X
  1782. Xint
  1783. Xtw_mac_ifdef(varname)
  1784. X    char *varname;
  1785. X{
  1786. X    return list_isthere(varname, &defines_table);
  1787. X}
  1788. X
  1789. X/*
  1790. X * int
  1791. X * tw_mac_ifhost(char *hostname)
  1792. X *
  1793. X *    returns 1 if (hostname) matches our hostname
  1794. X */
  1795. X
  1796. Xint
  1797. Xtw_mac_ifhost(hostname)
  1798. X    char *hostname;
  1799. X{
  1800. X    char realhostname[MAXHOSTNAMELEN];
  1801. X    register char *tc, *sc;
  1802. X
  1803. X
  1804. X#ifndef GETHOSTNAME
  1805. X    struct utsname sysinfo;
  1806. X
  1807. X    if (uname(&sysinfo) < 0)
  1808. X    die_with_err("filename_hostname_expand: uname()", (char *) NULL);
  1809. X
  1810. X    (void) strncpy(realhostname, sysinfo.nodename, MAXHOSTNAMELEN);
  1811. X
  1812. X#else     /* GETHOSTNAME */
  1813. X
  1814. X    /* get the hostname */
  1815. X    if (gethostname(realhostname, MAXHOSTNAMELEN) < 0)
  1816. X    die_with_err("filename_hostname_expand: gethostname()", (char *) NULL);
  1817. X
  1818. X
  1819. X#endif     /* GETHOSTNAME */
  1820. X
  1821. X    /* check for a match between the hostnames (case insensitive) */
  1822. X
  1823. X    for (sc = realhostname, tc = hostname; *sc && *tc ; sc++, tc++) {
  1824. X        if (*tc == *sc)
  1825. X      continue;
  1826. X    else if (isupper(*tc) && islower(*sc)) {
  1827. X      if (tolower(*tc) != *sc)
  1828. X        return 0;
  1829. X}
  1830. X    else if (islower(*tc) && isupper(*sc)) {
  1831. X      if (*tc != tolower(*sc))
  1832. X        return 0;
  1833. X        }
  1834. X    else
  1835. X      return 0;
  1836. X    }
  1837. X    return (!(*tc || *sc));
  1838. X}
  1839. X
  1840. END_OF_FILE
  1841. if test 2728 -ne `wc -c <'tripwire-1.0/src/config.prim.c'`; then
  1842.     echo shar: \"'tripwire-1.0/src/config.prim.c'\" unpacked with wrong size!
  1843. fi
  1844. # end of 'tripwire-1.0/src/config.prim.c'
  1845. fi
  1846. if test -f 'tripwire-1.0/src/preen.interp.c' -a "${1}" != "-c" ; then 
  1847.   echo shar: Will not clobber existing file \"'tripwire-1.0/src/preen.interp.c'\"
  1848. else
  1849. echo shar: Extracting \"'tripwire-1.0/src/preen.interp.c'\" \(2618 characters\)
  1850. sed "s/^X//" >'tripwire-1.0/src/preen.interp.c' <<'END_OF_FILE'
  1851. X#ifndef lint
  1852. Xstatic char rcsid[] = "$Id: preen.interp.c,v 1.2 92/11/03 02:44:00 genek Exp $";
  1853. X#endif
  1854. X
  1855. X/*
  1856. X * preen.interp.c
  1857. X *
  1858. X *    interpret the diffs between the database files
  1859. X *
  1860. X * Gene Kim
  1861. X * Purdue University
  1862. X */
  1863. X
  1864. X#include "../include/config.h"
  1865. X#include <stdio.h>
  1866. X#ifdef STDLIBH
  1867. X#include <stdlib.h>
  1868. X#endif
  1869. X#ifdef STRINGH
  1870. X#include <string.h>
  1871. X#else
  1872. X#include <strings.h>
  1873. X#endif
  1874. X#include <sys/param.h>
  1875. X#ifdef __STDC__
  1876. X# include <sys/types.h>
  1877. X# include <sys/stat.h>
  1878. X#endif
  1879. X#include "../include/list.h"
  1880. X#include "../include/tripwire.h"
  1881. X
  1882. X                    /* the diff lists */
  1883. Xstruct list *diff_added_list = NULL,
  1884. X        *diff_deleted_list = NULL,
  1885. X        *diff_changed_list = NULL;
  1886. X
  1887. X                    /* how many in each list */
  1888. Xint diff_added_num = 0,
  1889. X    diff_changed_num = 0,
  1890. X    diff_deleted_num = 0;
  1891. X
  1892. X/*
  1893. X * preen_interp(FILE *fpin)
  1894. X *
  1895. X *    do the actual interpreation of the diff output, generated by
  1896. X *    diffing the two database files.
  1897. X */
  1898. X
  1899. Xvoid
  1900. Xpreen_interp (fpin)
  1901. X    FILE *fpin;
  1902. X{
  1903. X    char s[1024];
  1904. X    char key[MAXPATHLEN], value[512];
  1905. X    struct list_elem *plist;
  1906. X
  1907. X    fprintf(stderr, "### Phase 4:   Searching for inconsistencies\n");
  1908. X
  1909. X    /* start reading in lines from the new database */
  1910. X    while (fgets(s, sizeof(s), fpin) != NULL) {
  1911. X    char *oldvalue;
  1912. X
  1913. X    /* is it a comment? */
  1914. X    if (s[0] == '#')
  1915. X        continue;
  1916. X    if (s[0] == '@' && s[1] == '@')
  1917. X        continue;
  1918. X
  1919. X    /*
  1920. X     * if it's in the list:
  1921. X     *    flag as SEEN
  1922. X     *    a) if it's the same, next;
  1923. X     *    b) if it's different, it's CHANGED;
  1924. X     * otherwise,
  1925. X     *    it's ADDED
  1926. X     *
  1927. X     * scan entire list, find all !SEEN
  1928. X     *    they're DELETED
  1929. X     */
  1930. X
  1931. X    string_split_space(s, key, value);
  1932. X
  1933. X    /* expand any escaped characters */
  1934. X    filename_escape_expand(key);
  1935. X
  1936. X    /* if file is in saved database */
  1937. X    if ((oldvalue = list_lookup(key, &filelist)) != NULL) {
  1938. X        list_setflag(key, FLAG_SEEN, &filelist);
  1939. X
  1940. X        /* was it CHANGED? */
  1941. X        if (strcmp(value, oldvalue) != 0) {
  1942. X        list_set(key, value, 0, &diff_changed_list);
  1943. X        diff_changed_num++;
  1944. X        }
  1945. X        /* else skip it */
  1946. X        else
  1947. X        continue;
  1948. X    }
  1949. X    /* else it's been ADDED */
  1950. X    else {
  1951. X        list_set(key, value, 0, &diff_added_list);
  1952. X        diff_added_num++;
  1953. X    }
  1954. X    }
  1955. X
  1956. X    /* look for DELETED entries */
  1957. X    if (list_open(&filelist) < 0) {
  1958. X    fprintf(stderr, "preen_interp: list_open() failed!\n");
  1959. X    exit(1);
  1960. X    }
  1961. X
  1962. X    while ((plist = list_get(&filelist)) != NULL) {
  1963. X    /* skip entries that have already been seen */
  1964. X    if (plist->flag & FLAG_SEEN)
  1965. X        continue;
  1966. X
  1967. X    list_set(plist->varname, plist->varvalue, 0, &diff_deleted_list);
  1968. X    diff_deleted_num++;
  1969. X    }
  1970. X
  1971. X    if (list_close(&filelist) < 0) {
  1972. X    fprintf(stderr, "preen_interp: list_open() failed!\n");
  1973. X    exit(1);
  1974. X    }
  1975. X
  1976. X    return;
  1977. X}
  1978. END_OF_FILE
  1979. if test 2618 -ne `wc -c <'tripwire-1.0/src/preen.interp.c'`; then
  1980.     echo shar: \"'tripwire-1.0/src/preen.interp.c'\" unpacked with wrong size!
  1981. fi
  1982. # end of 'tripwire-1.0/src/preen.interp.c'
  1983. fi
  1984. if test -f 'tripwire-1.0/sigs/md5/README.md5' -a "${1}" != "-c" ; then 
  1985.   echo shar: Will not clobber existing file \"'tripwire-1.0/sigs/md5/README.md5'\"
  1986. else
  1987. echo shar: Extracting \"'tripwire-1.0/sigs/md5/README.md5'\" \(2577 characters\)
  1988. sed "s/^X//" >'tripwire-1.0/sigs/md5/README.md5' <<'END_OF_FILE'
  1989. X# $Id: README.md5,v 1.1.1.2 92/11/02 18:22:03 genek Exp $ 
  1990. X
  1991. X/***********************************************************************
  1992. X ** md5.c -- the source code for MD5 routines                         **
  1993. X ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
  1994. X ** Created: 2/17/90 RLR                                              **
  1995. X ** Revised: 1/91 SRD,AJ,BSK,JT Reference C Version                   **
  1996. X ** Revised (for MD5): RLR 4/27/91                                    **
  1997. X ***********************************************************************
  1998. X ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
  1999. X ** License to copy and use this software is granted provided that    **
  2000. X ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
  2001. X ** Digest Algorithm" in all material mentioning or referencing this  **
  2002. X ** software or this function.                                        **
  2003. X ** License is also granted to make and use derivative works          **
  2004. X ** provided that such works are identified as "derived from the RSA  **
  2005. X ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
  2006. X ** material mentioning or referencing the derived work.              **
  2007. X ** RSA Data Security, Inc. makes no representations concerning       **
  2008. X ** either the merchantability of this software or the suitability    **
  2009. X ** of this software for any particular purpose.  It is provided "as  **
  2010. X ** is" without express or implied warranty of any kind.              **
  2011. X ** These notices must be retained in any copies of any part of this  **
  2012. X ***********************************************************************/
  2013. X
  2014. X    The MD5 message-digesting package is copyrighted by RSA Data
  2015. XSecurity, Inc.  The disclaimer from the C code has been retained,
  2016. Xand is shown above.
  2017. X
  2018. X    All big-endian/little-endian specific code in md5.c has been
  2019. Xreplaced by code that can resolve this automatically at
  2020. Xcompile-time.  Tripwire specific code is in md5wrapper.c, which
  2021. Xcontains the routine 'sig_md5_get' to minimize the amount of
  2022. Xoverhead in collecting signatures from within Tripwire.  (We
  2023. Xcertainly don't want to fork() for every file we need to scan!)
  2024. X
  2025. X    Because of this, these files is no longer identical to the
  2026. XMD5 virgin distribution.  I have sent my changes to the MD5
  2027. Xauthor, but I am not aware of any buybacks at this time.
  2028. X
  2029. X    The original MD5 code can be found in the Internet Working 
  2030. XDraft RFC 1321.  This can be obtained via anonymous FTP (user =
  2031. Xanonymous, password = guest) from NIC.DDN.MIL.
  2032. X
  2033. X
  2034. XGene Kim
  2035. XSeptember 7, 1992
  2036. END_OF_FILE
  2037. if test 2577 -ne `wc -c <'tripwire-1.0/sigs/md5/README.md5'`; then
  2038.     echo shar: \"'tripwire-1.0/sigs/md5/README.md5'\" unpacked with wrong size!
  2039. fi
  2040. # end of 'tripwire-1.0/sigs/md5/README.md5'
  2041. fi
  2042. if test -f 'tripwire-1.0/sigs/md2/md2wrapper.c' -a "${1}" != "-c" ; then 
  2043.   echo shar: Will not clobber existing file \"'tripwire-1.0/sigs/md2/md2wrapper.c'\"
  2044. else
  2045. echo shar: Extracting \"'tripwire-1.0/sigs/md2/md2wrapper.c'\" \(2177 characters\)
  2046. sed "s/^X//" >'tripwire-1.0/sigs/md2/md2wrapper.c' <<'END_OF_FILE'
  2047. X#ifndef lint
  2048. Xstatic char rcsid[] = "$Id: md2wrapper.c,v 1.1.1.1 92/11/02 17:51:57 genek Exp $";
  2049. X#endif
  2050. X
  2051. X/*
  2052. X * md2wrapper.c
  2053. X *
  2054. X *    signature function hook for MD2 (the RSA Data Security, Inc. MD2 
  2055. X *    Message Digesting Algorithm) for Tripwire.
  2056. X *
  2057. X *    The original MD2 code is contained in md2.c in its entirety.
  2058. X *
  2059. X * Gene Kim
  2060. X * Purdue University
  2061. X * September 27, 1992
  2062. X */
  2063. X
  2064. X#include "../../include/config.h"
  2065. X#include <stdio.h>
  2066. X#include <sys/types.h>
  2067. X#ifdef STDLIBH
  2068. X#include <stdlib.h>
  2069. X#include <unistd.h>
  2070. X#endif
  2071. X#ifdef STRINGH
  2072. X#include <string.h>
  2073. X#else
  2074. X#include <strings.h>
  2075. X#endif
  2076. X#include "global.h"
  2077. X#include "md2.h"
  2078. X#include "../../include/sigs.h"
  2079. X#define BUFSIZE 4096
  2080. X
  2081. Xstatic MD2_CTX mdbucket;            /* MD2 data structure */
  2082. X
  2083. Xchar *ltob64();
  2084. X
  2085. X/*
  2086. X * int
  2087. X * pf_signature(int fd_in, char *ps_signature, int siglen)
  2088. X *
  2089. X *    fd_in:         pointer to input file descriptor
  2090. X *    ps_signature:     pointer to array where signature will be stored
  2091. X *    siglen:     length of the signature array (for overflow checking)
  2092. X */
  2093. X
  2094. Xint 
  2095. Xsig_md2_get (fd_in, ps_signature, siglen)
  2096. X    int fd_in;
  2097. X    char *ps_signature;
  2098. X    int siglen; 
  2099. X{
  2100. X    unsigned char buffer[BUFSIZE];
  2101. X    int        readin = -1;
  2102. X    unsigned long int words;
  2103. X    int     i;
  2104. X    MD2_CTX    *mdbuf;
  2105. X    char    s[128];
  2106. X    char    sword[128];
  2107. X    unsigned char digest[16];
  2108. X
  2109. X    mdbuf = &mdbucket;
  2110. X
  2111. X    ps_signature[0] = '\0';
  2112. X
  2113. X    /* rewind the file descriptor */
  2114. X    if (lseek(fd_in, 0, SEEK_SET) < 0) {
  2115. X    perror("sig_md2_get: lseek()");
  2116. X    exit(1);
  2117. X    }
  2118. X     
  2119. X    MD2Init (mdbuf);
  2120. X
  2121. X    while ((readin = read(fd_in, (char *)buffer, (off_t) BUFSIZE)) == BUFSIZE) {
  2122. X    MD2Update(mdbuf, buffer, BUFSIZE);
  2123. X    }
  2124. X    if (readin < 0) {
  2125. X    perror("sig_md2_get: read()");
  2126. X    exit(1);
  2127. X    }
  2128. X    if (readin > 0) {
  2129. X    MD2Update(mdbuf, buffer, (unsigned)readin);
  2130. X    }
  2131. X    MD2Final (digest, mdbuf);
  2132. X
  2133. X    words = 0L;
  2134. X    for (i = 0; i < 16; i++) {
  2135. X    words = (words << 8) | digest[i];
  2136. X    if ((i+1) % 4 == 0 && i != 0 && i != 15) {
  2137. X        /* printf("%08lx", words); */
  2138. X        sprintf(s, "%6s", ltob64(words, sword));
  2139. X        strcat(ps_signature, s);
  2140. X        words = 0L;
  2141. X    }
  2142. X    }
  2143. X    /* printf("%04lx", words); */
  2144. X    sprintf(s, "%6s", ltob64(words, sword));
  2145. X    strcat(ps_signature, s);
  2146. X    return 0;
  2147. X}
  2148. END_OF_FILE
  2149. if test 2177 -ne `wc -c <'tripwire-1.0/sigs/md2/md2wrapper.c'`; then
  2150.     echo shar: \"'tripwire-1.0/sigs/md2/md2wrapper.c'\" unpacked with wrong size!
  2151. fi
  2152. # end of 'tripwire-1.0/sigs/md2/md2wrapper.c'
  2153. fi
  2154. if test -f 'tripwire-1.0/FAQ' -a "${1}" != "-c" ; then 
  2155.   echo shar: Will not clobber existing file \"'tripwire-1.0/FAQ'\"
  2156. else
  2157. echo shar: Extracting \"'tripwire-1.0/FAQ'\" \(2127 characters\)
  2158. sed "s/^X//" >'tripwire-1.0/FAQ' <<'END_OF_FILE'
  2159. X# $Id: FAQ,v 1.2 92/11/03 13:34:43 genek Exp $
  2160. X
  2161. X#
  2162. X# FAQ for Tripwire
  2163. X#
  2164. X
  2165. X    This file answers frequently asked questions about Tripwire.
  2166. XThe first section of the file covers Tripwire concepts and design,
  2167. Xwhile the second section addresses troubleshooting.
  2168. X
  2169. XConcepts:
  2170. X=========
  2171. X
  2172. XQ:    Why doesn't Tripwire ever traverse filesystems?
  2173. X
  2174. XA:    This is a feature.  This behavior makes it possible to put a
  2175. X    directory (e.g., '/') in your tw.config file, and you won't
  2176. X    have to worry whether it will traverse all the locally-mounted
  2177. X    filesystems.
  2178. X
  2179. X
  2180. XQ:    What is the difference between pruining an entry in your 
  2181. X    tw.config file (via "!") and ignoring everything (via the "E" 
  2182. X    template)?
  2183. X
  2184. XA:    Ignoring everything in a directory still monitors for added 
  2185. X    and deleted files.  Pruning a directory will prevent Tripwire
  2186. X    from even looking in the specified directory.
  2187. X
  2188. X
  2189. XQ:    Tripwire runs very slowly.  What can I do to make it run 
  2190. X    faster?
  2191. X
  2192. XA:    You can modify your tw.config entries to skip the Snefru 
  2193. X    signatures by appending a "-2" to the ignore flags.  Or you can
  2194. X    run tell Tripwire at run-time to skip Snefru by:
  2195. X        
  2196. X            tripwire -i 2
  2197. X            
  2198. X    This computationally expensive operation may not be needed for 
  2199. X    many applications.  (See README section on security vs. 
  2200. X    performance trade-offs for further details.)
  2201. X
  2202. XTroubleshooting:
  2203. X================
  2204. X
  2205. XQ:     When running Tripwire in Integrity Checking mode, Tripwire
  2206. X    fails when it tries to find a file with a name consisting of
  2207. X    thousands of '/'s.  What went wrong?
  2208. X
  2209. XA:    Your setting for the #define DIRENT value in your conf-<os>.h
  2210. X    file is probably set wrong.  Trying switching the setting and
  2211. X    see if the problem goes away.  (i.e., switch #define to 
  2212. X    #undef, or vice versa.)
  2213. X
  2214. X
  2215. XQ:    I have /tmp in my tw.config file, but none of the files in 
  2216. X    the directory are being read by Tripwire.  What's going on?
  2217. X
  2218. XA:    Check to see that your /tmp directory isn't a symbolic link
  2219. X    to another filesystem.  When recursing down into directories,
  2220. X    Tripwire never traverses symbolic links or enters another
  2221. X    filesystem.  
  2222. X
  2223. X
  2224. XGene & Gene
  2225. XKim  & Spafford
  2226. X
  2227. XNovember 2, 1992
  2228. X(genek@mentor.cc.purdue.edu)
  2229. X(spaf@cs.purdue.edu)
  2230. X    
  2231. END_OF_FILE
  2232. if test 2127 -ne `wc -c <'tripwire-1.0/FAQ'`; then
  2233.     echo shar: \"'tripwire-1.0/FAQ'\" unpacked with wrong size!
  2234. fi
  2235. # end of 'tripwire-1.0/FAQ'
  2236. fi
  2237. if test -f 'tripwire-1.0/sigs/md5/md5wrapper.c' -a "${1}" != "-c" ; then 
  2238.   echo shar: Will not clobber existing file \"'tripwire-1.0/sigs/md5/md5wrapper.c'\"
  2239. else
  2240. echo shar: Extracting \"'tripwire-1.0/sigs/md5/md5wrapper.c'\" \(2121 characters\)
  2241. sed "s/^X//" >'tripwire-1.0/sigs/md5/md5wrapper.c' <<'END_OF_FILE'
  2242. X#ifndef lint
  2243. Xstatic char rcsid[] = "$Id: md5wrapper.c,v 1.1.1.1 92/11/02 17:53:07 genek Exp $";
  2244. X#endif
  2245. X
  2246. X/*
  2247. X * md5wrapper.c
  2248. X *
  2249. X *    signature function hook for MD5 (the RSA Data Security, Inc. MD5 
  2250. X *    Message Digesting Algorithm) for Tripwire.
  2251. X *
  2252. X *    The original MD5 code is contained in md5.c in its entirety.
  2253. X *
  2254. X * Gene Kim
  2255. X * Purdue University
  2256. X * September 27, 1992
  2257. X */
  2258. X
  2259. X#include "../../include/config.h"
  2260. X#include <stdio.h>
  2261. X#include <sys/types.h>
  2262. X#ifdef STDLIBH
  2263. X#include <stdlib.h>
  2264. X#include <unistd.h>
  2265. X#endif
  2266. X#ifdef STRINGH
  2267. X#include <string.h>
  2268. X#else
  2269. X#include <strings.h>
  2270. X#endif
  2271. X#include "../../include/sigs.h"
  2272. X#include "md5.h"
  2273. X#define BUFSIZE 4096
  2274. X
  2275. Xstatic MD5_CTX mdbucket;            /* MD5 data structure */
  2276. X
  2277. Xchar *ltob64();
  2278. X
  2279. X/*
  2280. X * int
  2281. X * pf_signature(int fd_in, char *ps_signature, int siglen)
  2282. X *
  2283. X *    fd_in:         pointer to input file descriptor
  2284. X *    ps_signature:     pointer to array where signature will be stored
  2285. X *    siglen:     length of the signature array (for overflow checking)
  2286. X */
  2287. X
  2288. Xint 
  2289. Xsig_md5_get (fd_in, ps_signature, siglen)
  2290. X    int fd_in;
  2291. X    char *ps_signature;
  2292. X    int siglen; 
  2293. X{
  2294. X    unsigned char buffer[BUFSIZE];
  2295. X    int        readin;
  2296. X    unsigned long int words;
  2297. X    int     i;
  2298. X    MD5_CTX    *mdbuf;
  2299. X    char    s[128];
  2300. X    char    sword[128];
  2301. X
  2302. X    mdbuf = &mdbucket;
  2303. X
  2304. X    ps_signature[0] = '\0';
  2305. X
  2306. X    /* rewind the file descriptor */
  2307. X    if (lseek(fd_in, 0, SEEK_SET) < 0) {
  2308. X    perror("sig_md5_get: lseek()");
  2309. X    exit(1);
  2310. X    }
  2311. X     
  2312. X    MD5Init (mdbuf);
  2313. X
  2314. X    while ((readin = read(fd_in, (char *)buffer, (off_t) BUFSIZE)) == BUFSIZE) {
  2315. X    MD5Update(mdbuf, buffer, BUFSIZE);
  2316. X    }
  2317. X    if (readin < 0) {
  2318. X    perror("sig_md5_get: read()");
  2319. X    exit(1);
  2320. X    }
  2321. X    if (readin > 0) {
  2322. X    MD5Update(mdbuf, buffer, (unsigned)readin);
  2323. X    }
  2324. X    MD5Final (mdbuf);
  2325. X
  2326. X    words = 0L;
  2327. X    for (i = 0; i < 16; i++) {
  2328. X    words = (words << 8) | mdbuf->digest[i];
  2329. X    if ((i+1) % 4 == 0 && i != 0 && i != 15) {
  2330. X        /* printf("%08lx", words); */
  2331. X        sprintf(s, "%6s", ltob64(words, sword));
  2332. X        strcat(ps_signature, s);
  2333. X        words = 0L;
  2334. X    }
  2335. X    }
  2336. X    /* printf("%04lx", words); */
  2337. X    sprintf(s, "%6s", ltob64(words, sword));
  2338. X    strcat(ps_signature, s);
  2339. X    return 0;
  2340. X}
  2341. END_OF_FILE
  2342. if test 2121 -ne `wc -c <'tripwire-1.0/sigs/md5/md5wrapper.c'`; then
  2343.     echo shar: \"'tripwire-1.0/sigs/md5/md5wrapper.c'\" unpacked with wrong size!
  2344. fi
  2345. # end of 'tripwire-1.0/sigs/md5/md5wrapper.c'
  2346. fi
  2347. if test -f 'tripwire-1.0/sigs/md4/md4.h' -a "${1}" != "-c" ; then 
  2348.   echo shar: Will not clobber existing file \"'tripwire-1.0/sigs/md4/md4.h'\"
  2349. else
  2350. echo shar: Extracting \"'tripwire-1.0/sigs/md4/md4.h'\" \(1922 characters\)
  2351. sed "s/^X//" >'tripwire-1.0/sigs/md4/md4.h' <<'END_OF_FILE'
  2352. X/* $Id: md4.h,v 1.1.1.2 92/11/02 18:21:46 genek Exp $ */
  2353. X
  2354. X/* 
  2355. X** **************************************************************************
  2356. X** md4.h -- Header file for implementation of MD4 Message Digest Algorithm **
  2357. X** Updated: 2/13/90 by Ronald L. Rivest                                    **
  2358. X** (C) 1990 RSA Data Security, Inc.                                        **
  2359. X** **************************************************************************
  2360. X*/
  2361. X
  2362. X/* MDstruct is the data structure for a message digest computation.
  2363. X*/
  2364. Xtypedef struct {
  2365. X  unsigned int buffer[4];    /* Holds 4-word result of MD computation */
  2366. X  unsigned char count[8];    /* Number of bits processed so far */
  2367. X  unsigned int done;         /* Nonzero means MD computation finished */
  2368. X} MDstruct, *MDptr;
  2369. X
  2370. X/* MDbegin(MD)
  2371. X** Input: MD -- an MDptr
  2372. X** Initialize the MDstruct prepatory to doing a message digest computation.
  2373. X*/
  2374. Xextern void MDbegin();
  2375. X
  2376. X/* MDupdate(MD,X,count)
  2377. X** Input: MD -- an MDptr
  2378. X**        X -- a pointer to an array of unsigned characters.
  2379. X**        count -- the number of bits of X to use (an unsigned int).
  2380. X** Updates MD using the first ``count'' bits of X.
  2381. X** The array pointed to by X is not modified.
  2382. X** If count is not a multiple of 8, MDupdate uses high bits of last byte.
  2383. X** This is the basic input routine for a user.
  2384. X** The routine terminates the MD computation when count < 512, so
  2385. X** every MD computation should end with one call to MDupdate with a
  2386. X** count less than 512.  Zero is OK for a count.
  2387. X*/
  2388. Xextern void MDupdate();
  2389. X
  2390. X/* MDprint(MD)
  2391. X** Input: MD -- an MDptr
  2392. X** Prints message digest buffer MD as 32 hexadecimal digits.
  2393. X** Order is from low-order byte of buffer[0] to high-order byte of buffer[3].
  2394. X** Each byte is printed with high-order hexadecimal digit first.
  2395. X*/
  2396. Xextern void MDprint();      
  2397. X
  2398. X/* 
  2399. X** End of md4.h
  2400. X****************************(cut)*****************************************/
  2401. X
  2402. Xint sig_md4_get();
  2403. END_OF_FILE
  2404. if test 1922 -ne `wc -c <'tripwire-1.0/sigs/md4/md4.h'`; then
  2405.     echo shar: \"'tripwire-1.0/sigs/md4/md4.h'\" unpacked with wrong size!
  2406. fi
  2407. # end of 'tripwire-1.0/sigs/md4/md4.h'
  2408. fi
  2409. if test -f 'tripwire-1.0/sigs/md4/md4wrapper.c' -a "${1}" != "-c" ; then 
  2410.   echo shar: Will not clobber existing file \"'tripwire-1.0/sigs/md4/md4wrapper.c'\"
  2411. else
  2412. echo shar: Extracting \"'tripwire-1.0/sigs/md4/md4wrapper.c'\" \(1915 characters\)
  2413. sed "s/^X//" >'tripwire-1.0/sigs/md4/md4wrapper.c' <<'END_OF_FILE'
  2414. X#ifndef lint
  2415. Xstatic char rcsid[] = "$Id: md4wrapper.c,v 1.1.1.1 92/11/02 17:52:24 genek Exp $";
  2416. X#endif
  2417. X
  2418. X/*
  2419. X * md4wrapper.c
  2420. X *
  2421. X *    signature function hook for MD4 (the RSA Data Security, Inc. MD4 
  2422. X *    Message Digesting Algorithm) for Tripwire.
  2423. X *
  2424. X *    The original MD4 code is contained in md4.c in its entirety.
  2425. X *
  2426. X * Gene Kim
  2427. X * Purdue University
  2428. X * October 14, 1992 
  2429. X */
  2430. X
  2431. X#include "../../include/config.h"
  2432. X#include <stdio.h>
  2433. X#include <sys/types.h>
  2434. X#ifdef STDLIBH
  2435. X#include <stdlib.h>
  2436. X#include <unistd.h>
  2437. X#endif
  2438. X#ifdef STRINGH
  2439. X#include <string.h>
  2440. X#else
  2441. X#include <strings.h>
  2442. X#endif
  2443. X#include "../../include/sigs.h"
  2444. X#include "md4.h"
  2445. X#define BUFSIZE 512
  2446. X
  2447. Xstatic MDstruct mdbucket;            /* MD4 data structure */
  2448. X
  2449. Xchar *ltob64();
  2450. X
  2451. X/*
  2452. X * int
  2453. X * pf_signature(int fd_in, char *ps_signature, int siglen)
  2454. X *
  2455. X *    fd_in:         pointer to input file descriptor
  2456. X *    ps_signature:     pointer to array where signature will be stored
  2457. X *    siglen:     length of the signature array (for overflow checking)
  2458. X */
  2459. X
  2460. Xint 
  2461. Xsig_md4_get (fd_in, ps_signature, siglen)
  2462. X    int fd_in;
  2463. X    char *ps_signature;
  2464. X    int siglen; 
  2465. X{
  2466. X    unsigned char buffer[BUFSIZE];
  2467. X    int        readin = -1;
  2468. X    unsigned long int words;
  2469. X    int     i;
  2470. X    MDstruct    *mdbuf;
  2471. X    char    s[128];
  2472. X    char    sword[128];
  2473. X
  2474. X    mdbuf = &mdbucket;
  2475. X
  2476. X    ps_signature[0] = '\0';
  2477. X
  2478. X    /* rewind the file descriptor */
  2479. X    if (lseek(fd_in, 0, SEEK_SET) < 0) {
  2480. X    perror("sig_md4_get: lseek()");
  2481. X    exit(1);
  2482. X    }
  2483. X     
  2484. X    MDbegin (mdbuf);
  2485. X
  2486. X    while ((readin = read(fd_in, (char *)buffer, (off_t) BUFSIZE)) == BUFSIZE) {
  2487. X    MDupdate(mdbuf, buffer, BUFSIZE);
  2488. X    }
  2489. X    if (readin < 0) {
  2490. X    perror("sig_md4_get: read()");
  2491. X    exit(1);
  2492. X    }
  2493. X    if (readin > 0) {
  2494. X    MDupdate(mdbuf, buffer, (unsigned)readin);
  2495. X    }
  2496. X
  2497. X    words = 0L;
  2498. X    for (i = 0; i < 4; i++) {
  2499. X    words = mdbuf->buffer[i];
  2500. X    /* printf("%08lx", words); */
  2501. X    sprintf(s, "%6s", ltob64(words, sword));
  2502. X    strcat(ps_signature, s);
  2503. X    words = 0L;
  2504. X    }
  2505. X    return 0;
  2506. X}
  2507. END_OF_FILE
  2508. if test 1915 -ne `wc -c <'tripwire-1.0/sigs/md4/md4wrapper.c'`; then
  2509.     echo shar: \"'tripwire-1.0/sigs/md4/md4wrapper.c'\" unpacked with wrong size!
  2510. fi
  2511. # end of 'tripwire-1.0/sigs/md4/md4wrapper.c'
  2512. fi
  2513. if test -f 'tripwire-1.0/configs/tw.conf.hpux' -a "${1}" != "-c" ; then 
  2514.   echo shar: Will not clobber existing file \"'tripwire-1.0/configs/tw.conf.hpux'\"
  2515. else
  2516. echo shar: Extracting \"'tripwire-1.0/configs/tw.conf.hpux'\" \(1776 characters\)
  2517. sed "s/^X//" >'tripwire-1.0/configs/tw.conf.hpux' <<'END_OF_FILE'
  2518. X# Lance R. Bailey <lrb@ctrg.rri.uwo.ca>
  2519. X#
  2520. X
  2521. X#  First, root's "home"
  2522. X=/        L
  2523. X/.rhosts    R    # may not exist
  2524. X/.profile    R    # may not exist
  2525. X/.cshrc        R    # may not exist
  2526. X/.login        R    # may not exist
  2527. X/.exrc        R    # may not exist
  2528. X/.logout    R    # may not exist
  2529. X/.emacs        R    # may not exist
  2530. X/.forward    R    # may not exist
  2531. X/.netrc        R    # may not exist
  2532. X
  2533. X# Unix itself
  2534. X/hp-ux        R
  2535. X/SYSBCKUP    R
  2536. X
  2537. X# Now, some critical directories and files
  2538. X#  Some exceptions are noted further down
  2539. X/etc        R
  2540. X=/etc/conf
  2541. X=/etc/filesets
  2542. X=/etc/interface.lib
  2543. X=/etc/newconfig
  2544. X=/etc/oldconfig
  2545. X=/etc/update.lib
  2546. X=/etc/sm
  2547. X=/etc/sm.bak
  2548. X=/etc/rmfn.lib
  2549. X
  2550. X/etc/inetd.conf    R
  2551. X/etc/rc        R
  2552. X/etc/gettydefs    R
  2553. X/etc/exports    R
  2554. X/etc/motd    L
  2555. X/etc/rmtab    L
  2556. X/etc/utmp    L
  2557. X/etc/group    R    # changes should be infrequent
  2558. X/etc/passwd    L
  2559. X
  2560. X/dev        L
  2561. X
  2562. X/usr/etc    R
  2563. X
  2564. X# Checksumming the following is not so critical.  However,
  2565. X#  setuid/setgid files are special-cased further down.
  2566. X
  2567. X/lib        R-2
  2568. X
  2569. X/bin        R-2
  2570. X
  2571. X/usr/bin    R-2
  2572. X
  2573. X/usr/lib    R-2
  2574. X=/usr/lib/nls    
  2575. X
  2576. X=/usr        L
  2577. X=/usr/spool    L
  2578. X/usr/spool/cron        L
  2579. X/usr/spool/mqueue    L
  2580. X/usr/mail        L
  2581. X
  2582. X=/tmp
  2583. X=/usr/tmp
  2584. X
  2585. X#  Here are entries for setuid/setgid files.  On these, we use
  2586. X#  both signatures just to be sure.
  2587. X#
  2588. X#  You may want/need to edit this list.  Batteries not inc.
  2589. X
  2590. X/bin/df            R
  2591. X/bin/ipcs        R
  2592. X/bin/login        R
  2593. X/bin/mail        R
  2594. X/bin/passwd        R
  2595. X/bin/rmail        R
  2596. X/bin/su            R
  2597. X/bin/write        R
  2598. X/etc/diskinfo        R
  2599. X/etc/dmesg        R
  2600. X/etc/dump        R
  2601. X/etc/ping        R
  2602. X/etc/wall        R
  2603. X/usr/bin/at        R
  2604. X/usr/bin/bdf        R
  2605. X/usr/bin/cancel        R
  2606. X/usr/bin/chfn        R
  2607. X/usr/bin/chsh        R
  2608. X/usr/bin/crontab    R
  2609. X/usr/bin/cu        R
  2610. X/usr/bin/iostat        R
  2611. X/usr/bin/lpr        R
  2612. X/usr/bin/lpstat        R
  2613. X/usr/bin/mailx        R
  2614. X/usr/bin/netstat    R
  2615. X/usr/bin/rcp        R
  2616. X/usr/bin/rlogin        R
  2617. X/usr/bin/remsh        R
  2618. X/usr/bin/uucp        R
  2619. X/usr/bin/uuname        R
  2620. X/usr/bin/uustat        R
  2621. X/usr/bin/uux        R
  2622. X/usr/bin/vmstat        R
  2623. X/etc/arp        R
  2624. X/usr/etc/nfsstat    R
  2625. X/usr/etc/rpc.rwalld    R
  2626. END_OF_FILE
  2627. if test 1776 -ne `wc -c <'tripwire-1.0/configs/tw.conf.hpux'`; then
  2628.     echo shar: \"'tripwire-1.0/configs/tw.conf.hpux'\" unpacked with wrong size!
  2629. fi
  2630. # end of 'tripwire-1.0/configs/tw.conf.hpux'
  2631. fi
  2632. if test -f 'tripwire-1.0/src/config.pre.l' -a "${1}" != "-c" ; then 
  2633.   echo shar: Will not clobber existing file \"'tripwire-1.0/src/config.pre.l'\"
  2634. else
  2635. echo shar: Extracting \"'tripwire-1.0/src/config.pre.l'\" \(1728 characters\)
  2636. sed "s/^X//" >'tripwire-1.0/src/config.pre.l' <<'END_OF_FILE'
  2637. X%{
  2638. X/* $Id: config.pre.l,v 1.1.1.1 92/11/02 17:54:21 genek Exp $ */
  2639. X
  2640. X/*
  2641. X * config.pre.l
  2642. X *
  2643. X *    lexical analyzer for preprocessing tw.config files.
  2644. X *
  2645. X *    note that escaped sequences in the <string> token must be 
  2646. X *    expanded manually.
  2647. X *
  2648. X * Gene Kim
  2649. X * Purdue University
  2650. X * October 4, 1992
  2651. X */
  2652. X
  2653. X            /* 
  2654. X             * note that strings can contain '@'s, but they
  2655. X             * cannot start with them! 
  2656. X             *
  2657. X             * similarly, we can have #'s in strings, but they
  2658. X             * cannot be the first character! 
  2659. X             */
  2660. X
  2661. X%}
  2662. X
  2663. XWS            [ \t]
  2664. XCOMMENT            [#]
  2665. XEOL            [\n]
  2666. XDIRECTIVE        @{2,2}
  2667. XSTRING            ([^ \t\n\#\@\(\)]|\\.)+([^ \t\n\(\)]|\\.)*
  2668. XLPAREN            [\(]
  2669. XRPAREN            [\)]
  2670. XANDAND            \&{2,2}
  2671. XOROR            \|{2,2}
  2672. XBSLASH            [\\]
  2673. X
  2674. X%%
  2675. X
  2676. X{WS}+            { /* eat spaces */ }
  2677. X{BSLASH}{EOL}        {   
  2678. X                /* eat line continuations */ 
  2679. X                linenumber++; 
  2680. X            }
  2681. X{COMMENT}[^\n]*        { /* eat comments */ }
  2682. X
  2683. X^{DIRECTIVE}{WS}*include    { return INCLUDE; }
  2684. X^{DIRECTIVE}{WS}*define        { return DEFINE; }
  2685. X^{DIRECTIVE}{WS}*undef        { return UNDEF; }
  2686. X^{DIRECTIVE}{WS}*ifdef        { return IFDEF; }
  2687. X^{DIRECTIVE}{WS}*ifndef        { return IFNDEF; }
  2688. X^{DIRECTIVE}{WS}*ifhost        { return IFHOST; }
  2689. X^{DIRECTIVE}{WS}*ifnhost    { return IFNHOST; }
  2690. X^{DIRECTIVE}{WS}*contents    { return CONTENTS; }
  2691. X^{DIRECTIVE}{WS}*dbaseversion    { return DBASEVERSION; }
  2692. X^{DIRECTIVE}{WS}*else        { return ELSE; }
  2693. X^{DIRECTIVE}{WS}*endif        { return ENDIF; }
  2694. X^{DIRECTIVE}{WS}*echo        { return ECHOTHIS; }
  2695. X{DIRECTIVE}            { return DIRECTIVE; }
  2696. X
  2697. X{EOL}            { linenumber++; return EOL; }
  2698. X{ANDAND}        { return ANDAND; }
  2699. X{OROR}            { return OROR; }
  2700. X{LPAREN}        { return LPAREN; }
  2701. X{RPAREN}        { return RPAREN; }
  2702. X{STRING}        {
  2703. X                yytext[yyleng] = '\0';
  2704. X                yylval.string = yytext;
  2705. X                if (yaccdebuglevel > 10) 
  2706. X                printf("--(STRING)--> %s\n", yytext);
  2707. X                return STRING;
  2708. X            }
  2709. X
  2710. END_OF_FILE
  2711. if test 1728 -ne `wc -c <'tripwire-1.0/src/config.pre.l'`; then
  2712.     echo shar: \"'tripwire-1.0/src/config.pre.l'\" unpacked with wrong size!
  2713. fi
  2714. # end of 'tripwire-1.0/src/config.pre.l'
  2715. fi
  2716. if test -f 'tripwire-1.0/sigs/md2/Makefile' -a "${1}" != "-c" ; then 
  2717.   echo shar: Will not clobber existing file \"'tripwire-1.0/sigs/md2/Makefile'\"
  2718. else
  2719. echo shar: Extracting \"'tripwire-1.0/sigs/md2/Makefile'\" \(289 characters\)
  2720. sed "s/^X//" >'tripwire-1.0/sigs/md2/Makefile' <<'END_OF_FILE'
  2721. X# $Id: Makefile,v 1.1.1.2 92/11/02 18:21:15 genek Exp $
  2722. X#
  2723. X# Makefile for MD2 wrapper
  2724. X#
  2725. X# Gene Kim
  2726. X# Purdue University
  2727. X# October 18, 1992
  2728. X#
  2729. X
  2730. Xall:    md2wrapper.o md2.o
  2731. X
  2732. X.c.o:
  2733. X    $(CC) $(CFLAGS) -c $<
  2734. X
  2735. Xclean:
  2736. X    -rm -rf *.o
  2737. X
  2738. Xmd2.o: ../../include/byteorder.h
  2739. Xmd2wrapper.o: ../../include/byteorder.h
  2740. END_OF_FILE
  2741. if test 289 -ne `wc -c <'tripwire-1.0/sigs/md2/Makefile'`; then
  2742.     echo shar: \"'tripwire-1.0/sigs/md2/Makefile'\" unpacked with wrong size!
  2743. fi
  2744. # end of 'tripwire-1.0/sigs/md2/Makefile'
  2745. fi
  2746. echo shar: End of archive 7 \(of 8\).
  2747. cp /dev/null ark7isdone
  2748. MISSING=""
  2749. for I in 1 2 3 4 5 6 7 8 ; do
  2750.     if test ! -f ark${I}isdone ; then
  2751.     MISSING="${MISSING} ${I}"
  2752.     fi
  2753. done
  2754. if test "${MISSING}" = "" ; then
  2755.     echo You have unpacked all 8 archives.
  2756.     echo "Now read the README file"
  2757.     rm -f ark[1-9]isdone
  2758. else
  2759.     echo You still need to unpack the following archives:
  2760.     echo "        " ${MISSING}
  2761. fi
  2762. ##  End of shell archive.
  2763. exit 0
  2764. -- 
  2765. Gene Spafford
  2766. Software Engineering Research Center & Dept. of Computer Sciences
  2767. Purdue University, W. Lafayette IN 47907-1398
  2768. Internet:  spaf@cs.purdue.edu    phone:  (317) 494-7825
  2769.