[62] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | # This script is a wrapper for reglookup, and reads one or more registry
|
---|
| 4 | # files to produce an MTIME sorted output. This is helpful when building
|
---|
| 5 | # timelines for investigations.
|
---|
| 6 | #
|
---|
[170] | 7 | # Copyright (C) 2005-2007,2010 Timothy D. Morgan
|
---|
[62] | 8 | #
|
---|
| 9 | # This program is free software; you can redistribute it and/or modify
|
---|
| 10 | # it under the terms of the GNU General Public License as published by
|
---|
| 11 | # the Free Software Foundation; version 2 of the License.
|
---|
| 12 | #
|
---|
| 13 | # This program is distributed in the hope that it will be useful,
|
---|
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 16 | # GNU General Public License for more details.
|
---|
| 17 | #
|
---|
| 18 | # You should have received a copy of the GNU General Public License
|
---|
| 19 | # along with this program; if not, write to the Free Software
|
---|
| 20 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 21 | #
|
---|
| 22 | # $Id: reglookup-timeline 170 2010-03-06 04:40:25Z tim $
|
---|
| 23 |
|
---|
| 24 |
|
---|
| 25 | usage()
|
---|
| 26 | {
|
---|
[170] | 27 | echo "Usage: $0 [-H] [-V] <REGISTRY_FILE> [<REGISTRY_FILE> ...]" 1>&2
|
---|
[91] | 28 | echo " -H Omit header line" 1>&2
|
---|
[170] | 29 | echo " -V Include values with parent timestamps" 1>&2
|
---|
[62] | 30 | }
|
---|
| 31 |
|
---|
| 32 | if [ $# -eq 0 ]; then
|
---|
| 33 | usage
|
---|
[68] | 34 | echo "ERROR: requires at least one parameter" 1>&2
|
---|
[62] | 35 | exit 1
|
---|
| 36 | fi
|
---|
| 37 |
|
---|
[90] | 38 | PRINT_HEADER=true
|
---|
| 39 | if [ "$1" = "-H" ]; then
|
---|
| 40 | PRINT_HEADER=false
|
---|
| 41 | shift
|
---|
| 42 | fi
|
---|
| 43 |
|
---|
[170] | 44 | OPTS='-t KEY'
|
---|
| 45 | if [ "$1" = "-V" ]; then
|
---|
| 46 | OPTS='-i'
|
---|
| 47 | shift
|
---|
| 48 | fi
|
---|
| 49 |
|
---|
[90] | 50 | if [ "$PRINT_HEADER" = "true" ]; then
|
---|
| 51 | echo "MTIME,FILE,PATH"
|
---|
| 52 | fi
|
---|
| 53 |
|
---|
[62] | 54 | for F in $@; do
|
---|
[170] | 55 | reglookup $OPTS -H "$F" | awk -F',' '{ printf "%s,'"$F"',%s\n",$4,$1; }'
|
---|
[62] | 56 | done | sort
|
---|