File: configure

package info (click to toggle)
autopsy 2.08-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,460 kB
  • ctags: 268
  • sloc: perl: 11,817; sh: 644; makefile: 61
file content (426 lines) | stat: -rw-r--r-- 12,369 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
#!/bin/sh

# Minimum version of TSK that is required
minver="2.00";

# The last released version of TSK
curtskver="2.06";

# Configuration script for the Autopsy Forensic Browser
#
# Brian Carrier [carrier@sleuthkit.org]
#
# Copyright (c) 2003-2006 by Brian Carrier.  All rights reserved
#
# Copyright (c) 2001-2003 by Brian Carrier, @stake.  All rights reserved
#
# Copyright (c) 2001 by Brian Carrier.  All rights reserved
#
# This file is part of the Autopsy Forensic Browser (Autopsy)
#
# Autopsy is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# Autopsy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Autopsy; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
##
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR PURPOSE.
# IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA, OR PROFITS OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


# Directories to search in
dirs='/usr/local/bin/ /usr/bin/ /usr/ccs/bin/ /bin/ /usr/ucb/bin/ /sbin/ /usr/sbin/ /usr/local/sbin/'


echo ""
echo "   Autopsy Forensic Browser Installation"
echo ""

#############################################################################
# Setup Perl locations
#############################################################################

# Find perl - we require 5.8.0 or later
found=0;

for d in $dirs
  do if (test -x ${d}perl) then
    if (test -n "`${d}perl -v 2> /dev/null | awk '/This is perl/ {print $0}'`") then
      ver=`${d}perl -v 2> /dev/null | awk '/This is perl,/ {print $4}'`;
      if (test "$ver" '<' "v5.8.0") then 
        echo "old version of perl found: ${d}perl (version $ver) -- continuing";
      else	  
        echo "perl found: ${d}perl (version $ver)";
        echo "#!${d}perl -wT" > ./config.tmp;
        echo "#!${d}perl" > ./config2.tmp;
        found=1; 
        break; 
      fi;
    fi;
  fi;
done

# If it wasn't found, then prompt for it.
if (test $found -eq 0) then
  echo 'ERROR: perl not found or the incorrect version found';
  while (test 1 -eq 1) 
    do echo 'Enter location of perl executable:';
    read perlexe;
    if (test -x "$perlexe") then
      if (test -n "`$perlexe -v 2> /dev/null | awk '/This is perl/ {print $0}'`")       then
        ver=`$perlexe -v 2> /dev/null | awk '/This is perl,/ {print $4}'`;
        if (test "$ver" '<' "v5.8.0") then 
          echo "This version of Perl is too old, 5.8.0 or older needed";
        else	  
          echo "Correct version found";
          echo "#!${d}perl -wT" > ./config.tmp;
          echo "#!${d}perl" > ./config2.tmp;
          found=1; 
          break; 
        fi;
      else
        echo "Perl found, but is not working.  Try another";
      fi;
    else
      echo "file not found";
    fi
  done
fi

# Check if this version of Perl supports large files
if (test -z "`${d}perl -V 2> /dev/null | awk '/USE_LARGE_FILES/ {print $0}'`") then
  echo ''
  echo '    NOTE: It appears that your Perl does not support large files.';
  echo '    You therefore will not be able to analyze images larger than 2GB.';
  echo '    Download the source version from www.cpan.org and compile a new version.';
  echo "  [Press Enter to Continue]";
  read foo;
  echo ''
fi;

# Get current working directory for lib
echo "use lib '$PWD/';" >> ./config.tmp
echo "use lib '$PWD/lib/';" >> ./config.tmp

# Write autopsy
if (test -f ./autopsy) then
  echo "autopsy already exists, overwrite? (y/n):";
  read rep;
  if (test "$rep" = "y") then
    cat ./config.tmp base/autopsy.base > ./autopsy
    cat ./config2.tmp base/make-live-cd.base > ./make-live-cd
  else 
    echo '  original version was kept';
  fi
else
  cat ./config.tmp base/autopsy.base > ./autopsy
  cat ./config2.tmp base/make-live-cd.base > ./make-live-cd
fi
chmod 0755 ./autopsy
chmod 0755 ./make-live-cd

# cleanup
rm -f ./config.tmp
rm -f ./config2.tmp


#############################################################################
# create conf.pl
#############################################################################


conf='conf.pl'

if (test -f $conf) then
  echo "A configuration file already exists, overwrite? (y/n):";
  read rep;
  if (test "$rep" = "n") then
    exit 0;
  fi
fi

# echo ''
# echo '---------------------------------------------------------------'
# echo ''
# echo 'Autopsy can use the configuration file from a previous installation'
# echo ''
# echo 'Would you like to use a previous configuration file (y/n) [n]'
# read rep;
# if (test "$rep" = "y") then

#  echo 'Enter the directory of the previous installation (or cancel):'
#  while (test 1 -eq 1) 
#    do read prevdir;
#    if (test "$prevdir" = "cancel") then
#		break;
#	fi;
#    if (test -f "${prevdir}/conf.pl") then
#		/bin/cp "${prevdir}/conf.pl" .
#		echo '  Configuration file copied from $prevdir';

#		# Check the config status
#		exit 0;
#	fi;
#    echo 'Configuration file not found, try again (or 'cancel' to stop):'
#  done;
#fi;


# First add the variables that are static
#
# DEFAULT USER SETTINGS
#
echo '# Autopsy configuration settings' > $conf
echo '' >> $conf
echo '# when set to 1, the server will stop after it receives no' >> $conf
echo '# connections for STIMEOUT seconds. ' >> $conf
echo '$USE_STIMEOUT = 0;' >> $conf
echo '$STIMEOUT = 3600;'>> $conf    

echo '' >> $conf
echo '# number of seconds that child waits for input from client' >> $conf
echo '$CTIMEOUT = 15;' >> $conf

echo '' >> $conf
echo '# set to 1 to save the cookie value in a file (for scripting)' >> $conf
echo '$SAVE_COOKIE = 1;' >> $conf


#############################################################################
# INSTALLATION DIRECTORY
#############################################################################
echo '' >> $conf;
echo \$INSTALLDIR = \'$PWD/\'\; >> $conf; 


# Now add the variables that need user interaction

#
# FIND THE UTILITIES
#
echo '' >> $conf
echo '' >> $conf
echo '# System Utilities' >> $conf



#
# GREP
#
echo ''
echo '---------------------------------------------------------------'
echo ''
echo 'Autopsy uses the grep utility from your local system.' 
found=0
for d in $dirs 
  do if (test -x ${d}grep) then
    echo \$GREP_EXE = \'${d}grep\'\; >> $conf; 
    echo "grep found: ${d}grep";
    grepexe="${d}grep";
    found=1; 
    break; 
  fi;
done

# Prompt if not found
if (test $found -eq 0) then
  echo 'ERROR: grep utility not found';
  echo 'Enter location of executable:';
  while (test 1 -eq 1) 
    do read grepexe;
    if (test -x "$grepexe") then
	  echo \$GREP_EXE = \'$grepexe\'\; >> $conf; 
      break;
    else
      echo 'grep was not found (try again):';
    fi;
  done
fi



#############################################################################
# The Sleuth Kit
#############################################################################

echo '' >> $conf
echo '' >> $conf
echo '# Directories' >> $conf

# The Sleuth Kit
echo ''
echo '---------------------------------------------------------------'
echo ''
echo 'Autopsy uses forensic tools from The Sleuth Kit.' 
echo '          http://www.sleuthkit.org/sleuthkit/'
echo ''
echo 'Enter the directory where you installed it:'
while (test 1 -eq 1) 
  do read tskdir;
  if (test -x "${tskdir}/bin/icat") then
    if (test -x "${tskdir}/bin/fls") then
      echo '  Sleuth Kit bin directory was found';
      echo \$TSKDIR = \'${tskdir}/bin\'\; >> $conf;
      break;
    else
      echo 'The Sleuth Kit was not fully found (did you give me a TCT or TASK directory?) (try again):';
    fi
  else
    echo 'The Sleuth Kit was not found (try again):';
  fi;
done


# Test for latest version

ver=`"${tskdir}/bin/fls" -V | awk '/The Sleuth Kit ver / {print $5}'`;
echo "  Version $ver found";


if (test "$ver" '<' "$minver") then 
  echo "Your version of The Sleuth Kit is not current enough - $minver is needed";
  exit 1;
elif (test "$ver" '<' "$curtskver") then 
	echo '';
    echo "*** NOTE: A more recent version ($curtskver) of The Sleuth Kit Exists ***"
	echo "  [Press Enter to Continue]";
	read foo;

else
	echo '  Required version found';
fi


# Check that file exists in TSK and if not then use the local
# version
if (test -x "${tskdir}/bin/file") then
  echo \$FILE_EXE = \'${tskdir}/bin/file\'\; >> $conf; 
else

echo ''
echo '---------------------------------------------------------------'
echo ''
echo 'The file command was not found in TSK, we will use the system copy.'
found=0
for d in $dirs 
  do if (test -x ${d}file) then
    echo \$FILE_EXE = \'${d}file\'\; >> $conf; 
    echo "file found: ${d}file";
    fileexe="${d}file";
    found=1; 
    break; 
  fi;
done

# Prompt if not found
if (test $found -eq 0) then
  echo 'ERROR: file utility not found';
  echo 'Enter location of executable:';
  while (test 1 -eq 1) 
    do read fileexe;
    if (test -x "$fileexe") then
	  echo \$FILE_EXE = \'$fileexe\'\; >> $conf; 
      break;
    else
      echo 'file was not found (try again):';
    fi;
  done
fi
fi


# NSRL
echo ''
echo '---------------------------------------------------------------'
echo ''
echo 'The NIST National Software Reference Library (NSRL) contains'
echo 'hash values of known good and bad files.'
echo '         http://www.nsrl.nist.gov'
echo ''
echo 'Have you purchased or downloaded a copy of the NSRL (y/n) [n]'
read rep;
if (test "$rep" = "y") then

  echo 'Enter the directory where you installed it:'
  while (test 1 -eq 1) 
    do read nsrldir;
    if (test "$nsrldir" = "cancel") then
        echo \$NSRLDB = \'\'\; >> $conf;
		break;
	fi;
    if (test -f "${nsrldir}/NSRLFile.txt") then
      echo '  NSRL database was found (NSRLFile.txt)';
      echo \$NSRLDB = \'${nsrldir}/NSRLFile.txt\'\; >> $conf;

	  if (test -f "${nsrldir}/NSRLFile.txt-md5.idx") then
		echo '  NSRL Index file found (NSRLFile.txt-md5.idx)';
      else
        echo '  NSRL Index file not found, do you want it created? (y/n) [n]:'
        read rep;
        if (test "$rep" = "y") then
          echo ''
          echo '-------------- begin hfind output --------------'
          "${tskdir}/bin/hfind" -i nsrl-md5 "${nsrldir}/NSRLFile.txt";
          echo '--------------- end hfind output ---------------'
          echo ''
		fi;
	  fi;
      break;
    else
      echo 'The NSRL was not found (the directory should have NSRLFile.txt in it)';
	  echo 'Enter a new directory (or cancel to stop):';
    fi;
  done
else
  echo \$NSRLDB = \'\'\; >> $conf;
fi;

#############################################################################
# EVIDENCE LOCKER
#############################################################################
mdone=0
echo ''
echo '---------------------------------------------------------------'
echo ''
echo 'Autopsy saves configuration files, audit logs, and output to the'
echo 'Evidence Locker directory.'
echo ''
echo 'Enter the directory that you want to use for the Evidence Locker:';
read locker;
if (test -d "${locker}") then
  echo "  $locker already exists"
else
  echo '';
  echo "WARNING: $locker does not exist"
  mdone=1
fi

echo \$LOCKDIR = \'${locker}\'\; >> $conf;


#############################################################################
# CLEANUP
#############################################################################
echo ''
echo '---------------------------------------------------------------'
echo ''
echo "Settings saved to $conf."
echo "Execute the './autopsy' command to start with default settings."
echo ''