Skip to content

Commit b01ba3a

Browse files
authored
Merge branch 'develop' into develop
2 parents e930126 + 78861fd commit b01ba3a

File tree

18 files changed

+209
-324
lines changed

18 files changed

+209
-324
lines changed

.github/workflows/build-unix.yml

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -139,23 +139,29 @@ jobs:
139139
MATRIX_ENABLE_JAVA: ${{ matrix.enable_java }}
140140
if: ${{ matrix.os == 'macos' }}
141141
run: |
142+
export CPPFLAGS=-I/opt/homebrew/include/
143+
export LDFLAGS=-L/opt/homebrew/lib/
142144
brew update
143-
brew install libtool autoconf automake libtool libewf libmagic
145+
brew install libtool autoconf automake libtool libewf libmagic afflib
144146
echo MATRIX_ENABLE_JAVA=$MATRIX_ENABLE_JAVA
145147
if [ ${MATRIX_ENABLE_JAVA}x == "yesx" ]; then
146148
echo Installing JAVA
147149
brew install openjdk@17
148-
export JAVA_HOME="$(brew --prefix openjdk)"
149-
export PATH="$JAVA_HOME/bin:$PATH"
150-
export CPPFLAGS="-I$JAVA_HOME/include"
151-
export JNI_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
150+
echo JAVA_HOME="$(brew --prefix openjdk)" >> $GITHUB_ENV
151+
echo PATH="$JAVA_HOME/bin:$PATH" >> $GITHUB_ENV
152+
echo JNI_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin" >> $GITHUB_ENV
153+
export CPPFLAGS="-I$JAVA_HOME/include $CPPFLAGS"
152154
fi
155+
echo search for aff
156+
find /opt/homebrew -name 'aff*'
157+
echo "CPPFLAGS=$CPPFLAGS" >> $GITHUB_ENV
158+
echo "LDFLAGS=$LDFLAGS" >> $GITHUB_ENV
153159
154160
- name: Install Linux packages
155161
if: ${{ matrix.os == 'linux' }}
156162
run: |
157163
sudo apt update
158-
sudo apt install -y ant autoconf automake g++ libssl-dev libewf-dev libqcow-dev libvhdi-dev libvmdk-dev libmagic-dev libtool make pkg-config zlib1g-dev
164+
sudo apt install -y ant autoconf automake g++ libssl-dev afflib-tools libewf-dev libqcow-dev libvhdi-dev libvmdk-dev libmagic-dev libtool make pkg-config zlib1g-dev
159165
160166
- name: Install Mingw packages and setup for cross-compiling
161167
if: ${{ matrix.os == 'mingw' }}
@@ -179,17 +185,22 @@ jobs:
179185

180186
- name: Run bootstrap
181187
run: |
188+
echo CPPFLAGS=$CPPFLAGS
189+
echo LDFLAGS=$LDFLAGS
182190
./bootstrap
183191
184192
- name: Run configure
185193
run: |
186194
./configure ${{ matrix.configure_opts }}
187195
188-
- name: Get the disk images
196+
- name: Unpack and List the test data
189197
run: |
190-
make test/get_images/test_images.txt
191-
cat test/get_images/test_images.txt
192-
ls -l test/from_brian
198+
cd ..
199+
pwd
200+
git clone https://github.com/sleuthkit/sleuthkit_test_data
201+
cd sleuthkit_test_data
202+
make unpack
203+
find . -ls | grep -v '[.]git'
193204
194205
- name: Run make
195206
run: |
@@ -219,7 +230,7 @@ jobs:
219230
run: |
220231
./configure ${{ matrix.configure_opts }} --enable-address-sanitizer CFLAGS=-g CXXFLAGS=-g
221232
222-
- name: Run make with address-sanitizer
233+
- name: Check with address-sanitizer
223234
if: ${{ matrix.address_sanitizer == 'yes' }}
224235
run: |
225236
make -j check VERBOSE=1
@@ -237,15 +248,15 @@ jobs:
237248
- name: Run make for codecov
238249
if: ${{ matrix.codecov == 'yes' }}
239250
run: |
240-
make -j test/fiwalk/fiwalk_test V=0
241-
make -j test/runner V=0
242-
243-
- name: Run unit tests for codecov
244-
if: ${{ matrix.codecov == 'yes' }}
245-
run: |
246-
test/fiwalk/fiwalk_test -s
247-
test/runner -s
251+
make -j check V=0
252+
#make -j test/fiwalk/fiwalk_test V=0
253+
#make -j test/runner V=0
248254
255+
# - name: Run unit tests for codecov
256+
# if: ${{ matrix.codecov == 'yes' }}
257+
# run: |
258+
# test/fiwalk/fiwalk_test -s
259+
# test/runner -s
249260

250261
- name: run gcov
251262
if: ${{ matrix.codecov == 'yes' }}
@@ -276,10 +287,10 @@ jobs:
276287
executables/*
277288
retention-days: 15
278289

279-
# - name: Run distcheck
280-
# run: |
281-
# ./configure
282-
# make distcheck
283-
#
284-
# - uses: ammaraskar/gcc-problem-matcher@0.2.0
285-
# name: GCC Problem Matcher
290+
- name: Run distcheck
291+
run: |
292+
./configure
293+
make distcheck
294+
295+
- uses: ammaraskar/gcc-problem-matcher@0.2.0
296+
name: GCC Problem Matcher
Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
# Build OSSFuzz fuzz targets from source.
22
name: build_ossfuzz
33
on:
4-
push:
5-
branches:
6-
- '**'
7-
pull_request:
8-
branches:
9-
- main
10-
- develop
4+
schedule:
5+
- cron: '0 0 * * *' # Runs at 00:00 UTC every day
6+
workflow_dispatch:
117
permissions: read-all
128
jobs:
139
build_ossfuzz:
14-
if: false
10+
name: Build oss-fuzz
1511
runs-on: ubuntu-22.04
12+
if: github.ref == 'refs/heads/develop'
1613
strategy:
1714
matrix:
1815
include:
@@ -27,14 +24,32 @@ jobs:
2724
with:
2825
repository: google/oss-fuzz
2926
path: oss-fuzz
27+
- name: Checkout SleuthKit repository
28+
uses: actions/checkout@v4
29+
with:
30+
path: sleuthkit
3031
- name: Build OSSFuzz fuzz targets
3132
working-directory: oss-fuzz
33+
env:
34+
# Override CFLAGS to remove -Werror and add sanitizer flags
35+
CFLAGS: "-O2 -fno-omit-frame-pointer -g -fsanitize=address"
36+
CXXFLAGS: "-O2 -fno-omit-frame-pointer -g -fsanitize=address"
3237
run: |
33-
# TODO: update ossfuzz script and then remove this work-around
34-
# Work around hardcoded -Werror flags https://github.com/sleuthkit/sleuthkit/issues/3012
35-
sed 's?./tsk/util/??' -i projects/sleuthkit/build.sh
36-
sed 's?./tsk/pool/??' -i projects/sleuthkit/build.sh
37-
sed 's?--without-libvmdk?--without-libvmdk --without-libcrypto?' -i projects/sleuthkit/build.sh
38+
# Copy SleuthKit source to oss-fuzz projects directory
39+
cp -r ../sleuthkit projects/sleuthkit
40+
# Update build script to properly configure without -Werror
41+
cat > projects/sleuthkit/build.sh << 'EOF'
42+
#!/bin/bash -eu
43+
cd $SRC/sleuthkit
44+
# Run autogen to generate configure script
45+
./bootstrap
46+
# Configure with necessary options, explicitly disabling -Werror
47+
./configure --disable-libewf --disable-libvmdk --disable-libcrypto CFLAGS="$CFLAGS -Wno-error" CXXFLAGS="$CXXFLAGS -Wno-error"
48+
make -j$(nproc)
49+
# Copy fuzzers to output directory
50+
find . -name "fuzz_*" -type f -executable -exec cp {} $OUT/ \;
51+
EOF
52+
chmod +x projects/sleuthkit/build.sh
3853
python3 infra/helper.py build_image --pull sleuthkit
3954
python3 infra/helper.py build_fuzzers --sanitizer address sleuthkit
4055
python3 infra/helper.py check_build sleuthkit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,4 @@ venv
207207
wget-log
208208
TAGS
209209
test/from_brian/
210+
*.log

Makefile.am

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ACLOCAL_AMFLAGS = -I m4
22

3-
AM_CPPFLAGS = -I$(srcdir)/tsk $(SQLITE3_CPPFLAGS) $(CRYPTO_CPPFLAGS) $(AFFLIB_CPPFLAGS) $(AFF4_CPPFLAGS) $(EWF_CPPFLAGS) $(QCOW_CPPFLAGS) $(VHDI_CPPFLAGS) $(VMDK_CPPFLAGS) $(VSLVM_CPPFLAGS) $(BFIO_CPPFLAGS) $(ZLIB_CPPFLAGS)
3+
AM_CPPFLAGS = -I$(top_srcdir)/tsk $(SQLITE3_CPPFLAGS) $(CRYPTO_CPPFLAGS) $(AFFLIB_CPPFLAGS) $(AFF4_CPPFLAGS) $(EWF_CPPFLAGS) $(QCOW_CPPFLAGS) $(VHDI_CPPFLAGS) $(VMDK_CPPFLAGS) $(VSLVM_CPPFLAGS) $(BFIO_CPPFLAGS) $(ZLIB_CPPFLAGS)
44
AM_CFLAGS = -Wall -Wextra $(PTHREAD_CFLAGS) $(SQLITE3_CFLAGS) $(CRYPTO_CFLAGS) $(AFFLIB_CFLAGS) $(AFF4_CFLAGS) $(EWF_CFLAGS) $(QCOW_CFLAGS) $(VHDI_CFLAGS) $(VMDK_CFLAGS) $(VSLVM_CFLAGS) $(BFIO_CFLAGS) $(ZLIB_CFLAGS)
55
AM_CXXFLAGS = -Wall -Wextra -Woverloaded-virtual $(PTHREAD_CXXFLAGS) $(CRYPTO_CXXFLAGS) $(SQLITE3_CXXFLAGS) $(AFFLIB_CXXFLAGS) $(AFF4_CXXFLAGS) $(EWF_CXXFLAGS) $(QCOW_CXXFLAGS) $(VHDI_CXXFLAGS) $(VMDK_CXXFLAGS) $(VSLVM_CXXFLAGS) $(BFIO_CXXFLAGS) $(ZLIB_CXXFLAGS)
66
AM_LDFLAGS = $(SQLITE3_LDFLAGS) $(AFFLIB_LDFLAGS) $(CRYPTO_LDFLAGS) $(AFF4_LDFLAGS) $(EWF_LDFLAGS) $(QCOW_LDFLAGS) $(VHDI_LDFLAGS) $(VMDK_LDFLAGS) $(VSLVM_LDFLAGS) $(BFIO_LDFLAGS) $(ZLIB_LDFLAGS)
@@ -192,7 +192,7 @@ tsk_auto_libtskauto_la_SOURCES = \
192192

193193
# Compile the bundled sqlite3 if there isn't an existing lib to use
194194
if !HAVE_LIBSQLITE3
195-
AM_CPPFLAGS += -Ivendors
195+
AM_CPPFLAGS += -I$(top_srcdir)/vendors
196196
tsk_auto_libtskauto_la_SOURCES += vendors/sqlite3.c vendors/sqlite3.h
197197
endif
198198

@@ -602,20 +602,20 @@ EXTRA_DIST += \
602602
tools/timeline/mactime.base \
603603
tools/timeline/.perltidyrc
604604

605-
tools/timeline/mactime: $(srcdir)/tools/timeline/mactime.base Makefile
605+
tools/timeline/mactime: $(top_srcdir)/tools/timeline/mactime.base Makefile
606606
@mkdir -p $(dir $@)
607607
@echo "#!$(PERL) -w" >$@
608608
@echo "my \$$VER=\"$(VERSION)\";" >>$@
609-
@cat $(srcdir)/tools/timeline/mactime.base >>$@
609+
@cat $(top_srcdir)/tools/timeline/mactime.base >>$@
610610
@chmod +x $@
611611

612-
tools/sorter/sorter: $(srcdir)/tools/sorter/sorter.base Makefile
612+
tools/sorter/sorter: $(top_srcdir)/tools/sorter/sorter.base Makefile
613613
@mkdir -p $(dir $@)
614614
@echo "#!$(PERL) -w" >$@
615615
@echo "my \$$BIN_DIR=\"$(bindir)\";" >>$@
616616
@echo "my \$$DATA_DIR=\"$(datadir)\";" >>$@
617617
@echo "my \$$VER=\"$(VERSION)\";" >>$@
618-
@cat $(srcdir)/tools/sorter/sorter.base >>$@
618+
@cat $(top_srcdir)/tools/sorter/sorter.base >>$@
619619
@chmod +x $@
620620

621621
#indent:
@@ -634,6 +634,7 @@ check_script_files = \
634634
test/img_dump/test_imgs_E01.sh \
635635
test/legacy/runtests.sh \
636636
test/tools/tool_differ.sh \
637+
test/tools/autotools/test_loaddb.sh \
637638
test/tools/fstools/test_fls.sh \
638639
test/tools/vstools/test_mmls.sh \
639640
test/tools/vstools/test_mmls_E01.sh
@@ -647,6 +648,7 @@ TESTS = \
647648
test/fiwalk/fiwalk_test \
648649
test/img_dump/test_imgs.sh \
649650
test/legacy/runtests.sh \
651+
test/tools/autotools/test_loaddb.sh \
650652
test/tools/fstools/test_fls.sh \
651653
test/tools/vstools/test_mmls.sh
652654

@@ -679,7 +681,7 @@ check_PROGRAMS = \
679681
test/legacy/fs_thread_test \
680682
test/legacy/read_apis
681683

682-
test_runner_CPPFLAGS = $(AM_CPPFLAGS) -Ivendors $(CATCH2_CPPFLAGS)
684+
test_runner_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/vendors $(CATCH2_CPPFLAGS)
683685
test_runner_LDADD = $(TSK_LIBS)
684686
test_runner_SOURCES = \
685687
test/tsk/base/test_tsk_error.cpp \
@@ -697,33 +699,12 @@ test_runner_SOURCES = \
697699
test/runner.cpp \
698700
vendors/catch.hpp
699701

700-
EXTRA_test_runner_DEPENDENCIES = test/get_images/test_images.txt
701-
702-
test_fiwalk_fiwalk_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/vendors $(CATCH2_CPPFLAGS)
702+
test_fiwalk_fiwalk_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/vendors $(CATCH2_CPPFLAGS)
703703
test_fiwalk_fiwalk_test_LDADD = $(TSK_LIBS)
704704
test_fiwalk_fiwalk_test_SOURCES = \
705705
test/fiwalk/fiwalk_test.cpp \
706706
$(tools_fiwalk_src_libfiwalk_la_SOURCES)
707707

708-
EXTRA_test_fiwalk_fiwalk_test_DEPENDENCIES = test/get_images/test_images.txt
709-
710-
# System for getting test images
711-
# This will be replaced with a sub repo
712-
713-
get_images_inputs = \
714-
test/get_images/get_test_images.bash \
715-
test/get_images/get_test_images.py \
716-
test/get_images/test_images.yaml
717-
718-
test/get_images/test_images.txt: $(get_images_inputs)
719-
bash $(srcdir)/test/get_images/get_test_images.bash
720-
721-
EXTRA_DIST += $(get_images_inputs)
722-
723-
##
724-
725-
CLEANFILES += test/get_images/test_images.txt
726-
727708
test_img_dump_img_dump_LDADD = $(TSK_LIBS)
728709
test_img_dump_img_dump_SOURCES = test/img_dump/img_dump.cpp
729710

README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ the tool or customize it to specific needs.
1515
The Sleuth Kit uses code from the file system analysis tools of
1616
The Coroner's Toolkit (TCT) by Wietse Venema and Dan Farmer. The
1717
TCT code was modified for platform independence. In addition,
18-
support was added for the NTFS (see [wiki/ntfs](http://wiki.sleuthkit.org/index.php?title=NTFS_Implementation_Notes))
18+
support was added for the NTFS (see [wiki/ntfs](http://wiki.sleuthkit.org/index.php?title=NTFS_Implementation_Notes))
1919
and FAT (see [wiki/fat](http://wiki.sleuthkit.org/index.php?title=FAT_Implementation_Notes)) file systems. Previously, The Sleuth Kit was
2020
called The @stake Sleuth Kit (TASK). The Sleuth Kit is now independent
2121
of any commercial or academic organizations.
@@ -34,9 +34,9 @@ The Sleuth Kit allows one to analyze a disk or file system image
3434
created by 'dd', or a similar application that creates a raw image.
3535
These tools are low-level and each performs a single task. When
3636
used together, they can perform a full analysis. For a more detailed
37-
description of these tools, refer to [wiki/filesystem](http://wiki.sleuthkit.org/index.php?title=TSK_Tool_Overview).
37+
description of these tools, refer to [wiki/filesystem](http://wiki.sleuthkit.org/index.php?title=TSK_Tool_Overview).
3838
The tools are briefly described in a file system layered approach. Each
39-
tool name begins with a letter that is assigned to the layer.
39+
tool name begins with a letter that is assigned to the layer.
4040

4141
### File System Layer:
4242
A disk contains one or more partitions (or slices). Each of these
@@ -52,7 +52,7 @@ time, and the details about each "group" in UNIX file systems.
5252
The content layer of a file system contains the actual file content,
5353
or data. Data is stored in large chunks, with names such as blocks,
5454
fragments, and clusters. All tools in this layer begin with the letters
55-
'blk'.
55+
'blk'.
5656

5757
The blkcat tool can be used to display the contents of a specific unit of
5858
the file system (similar to what 'dd' can do with a few arguments).
@@ -75,7 +75,7 @@ descriptive data such as dates and size as well as the addresses of the
7575
data units. This layer describes the file in terms that the computer
7676
can process efficiently. The structures that the data is stored in
7777
have names such as inode and directory entry. All tools in this layer
78-
begin with an 'i'.
78+
begin with an 'i'.
7979

8080
The 'ils' program lists some values of the metadata structures.
8181
By default, it will only list the unallocated ones. The 'istat'
@@ -87,15 +87,15 @@ contents of the data units allocated to the metadata structure
8787
which metadata structure has allocated a given content unit or
8888
file name.
8989

90-
Refer to the [ntfs wiki](http://wiki.sleuthkit.org/index.php?title=NTFS_Implementation_Notes)
90+
Refer to the [ntfs wiki](http://wiki.sleuthkit.org/index.php?title=NTFS_Implementation_Notes)
9191
for information on addressing metadata attributes in NTFS.
9292

9393
### Human Interface Layer (file):
9494
The human interface layer allows one to interact with files in a
9595
manner that is more convenient than directly with the metadata
9696
layer. In some operating systems there are separate structures for
9797
the metadata and human interface layers while others combine them.
98-
All tools in this layer begin with the letter 'f'.
98+
All tools in this layer begin with the letter 'f'.
9999

100100
The 'fls' program lists file and directory names. This tool will
101101
display the names of deleted files as well. The 'ffind' program will
@@ -125,8 +125,8 @@ Also included is the 'hfind' tool. The 'hfind' tool allows one to create
125125
an index of a hash database and perform quick lookups using a binary
126126
search algorithm. The 'hfind' tool can perform lookups on the NIST
127127
National Software Reference Library (NSRL) (www.nsrl.nist.gov) and
128-
files created from the 'md5' or 'md5sum' command. Refer to the
129-
[wiki/hfind](http://wiki.sleuthkit.org/index.php?title=Hfind) file for more details.
128+
files created from the 'md5' or 'md5sum' command. Refer to the
129+
[wiki/hfind](http://wiki.sleuthkit.org/index.php?title=Hfind) file for more details.
130130

131131
#### File Type Categories
132132
Different types of files typically have different internal structure.
@@ -146,6 +146,17 @@ and ignore known good files. Refer to the [wiki/sorter](http://wiki.sleuthkit.o
146146
file for more details.
147147

148148

149+
## TESTING
150+
Both unit and end-to-end tests are located in the [test](test/) directory. Small and legacy disk images are located in [test/data](test/data/). Some tests require disk images that are include in the [Github repository](https://github.com/sleuthkit/sleuthkit_test_data); large disk images are distributed as compressed (.E01) images using [git's extensions for large objects](https://git-lfs.com/). By default, this repo resides at [../sleuthkit_test_data](../sleuthkit_test_data]. However, it can be installed elsewhere by setting the environment variable `SLEUTHKIT_TEST_DATA_DIR`.
151+
152+
If the disk images are not present, tests requiring the disk images will generate a warning but not an error.
153+
154+
- Tests can be run by typing `make check`.
155+
156+
- Tests can be run on a new distribution by typing `make distcheck`.
157+
158+
159+
149160
## LICENSE
150161
There are a variety of licenses used in TSK based on where they
151162
were first developed. The licenses are located in the [licenses
@@ -160,14 +171,14 @@ Public License.
160171
- The modifications to 'mactime' from the original 'mactime' in TCT
161172
and 'mac-daddy' are released under the Common Public License.
162173

163-
The library uses utilities that were released under MIT and BSD 3-clause.
174+
The library uses utilities that were released under MIT and BSD 3-clause.
164175

165176

166177
## INSTALL
167178
For installation instructions, refer to the INSTALL.txt document.
168179

169180
## OTHER DOCS
170-
The [wiki](http://wiki.sleuthkit.org/index.php?title=Main_Page) contains documents that
181+
The [wiki](http://wiki.sleuthkit.org/index.php?title=Main_Page) contains documents that
171182
describe the provided tools in more detail. The Sleuth Kit Informer is a newsletter that contains
172183
new documentation and articles.
173184

@@ -182,4 +193,3 @@ announcements list.
182193
Brian Carrier
183194

184195
carrier at sleuthkit dot org
185-

0 commit comments

Comments
 (0)