mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge pull request #7658 from gdicristofaro/7413-unixScripts
7413 unix scripts
This commit is contained in:
commit
72c610a54d
@ -1,22 +0,0 @@
|
||||
Most of the Autopsy development occurs to be run on Windows systems, but it is possible to run Autopsy on Linux and OS X. This file contains the instructions for building Autopsy on those platforms and getting it working.
|
||||
|
||||
# Prerequisites
|
||||
|
||||
You need the following:
|
||||
- X
|
||||
- Y
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
# Building
|
||||
## Building The Sleuth Kit
|
||||
|
||||
TODO
|
||||
|
||||
## Building Autopsy
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
|
171
Running_Linux_OSX.md
Normal file
171
Running_Linux_OSX.md
Normal file
@ -0,0 +1,171 @@
|
||||
# Overview
|
||||
*The installation process requires some [prerequisites](#installing-prerequisites), [The Sleuth Kit](#install-sleuthkit), and installing [Autopsy itself](#install-autopsy). If using Windows, there is a pre-built installer bundling all dependencies that can be found in the [Autopsy downloads section](https://www.autopsy.com/download/) or in the [Releases section on GitHub](https://github.com/sleuthkit/autopsy/releases/).*
|
||||
|
||||
# Installing Prerequisites
|
||||
|
||||
## On macOS
|
||||
|
||||
*A script to install these dependencies that can be found [here](./linux_macos_install_scripts/install_prereqs_macos.sh). Make sure the script is executable before running.*
|
||||
- Using [Homebrew](https://brew.sh/), install dependencies that have formulas:
|
||||
```
|
||||
brew install ant automake libtool afflib libewf postgresql testdisk
|
||||
```
|
||||
- You will also need to install Java 8 and JavaFX to run autopsy. We recommend Liberica OpenJDK which can be installed by tapping this third-party dependency:
|
||||
```
|
||||
brew tap bell-sw/liberica
|
||||
```
|
||||
- Then, you can install this dependency using `brew`:
|
||||
```
|
||||
brew install --cask liberica-jdk8-full
|
||||
```
|
||||
- - Confirm that java has been successfully installed by running `java -version`. You should get a result like the following:
|
||||
```
|
||||
% java -version
|
||||
openjdk version "1.8.0_342"
|
||||
OpenJDK Runtime Environment (build 1.8.0_342-b07)
|
||||
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)
|
||||
```
|
||||
- You will need the java path for properly setting up autopsy. You can get the path to java by calling:
|
||||
```
|
||||
/usr/libexec/java_home -v 1.8
|
||||
```
|
||||
- If you want gstreamer to open media, you can download and install gstreamer here: `https://gstreamer.freedesktop.org/data/pkg/osx/1.20.3/gstreamer-1.0-1.20.3-universal.pkg`
|
||||
|
||||
## On Linux (Ubuntu / Debian-based)
|
||||
|
||||
*A script to install these dependencies that can be found [here](./linux_macos_install_scripts/install_prereqs_ubuntu.sh). Make sure the script is executable before running.*
|
||||
- You will need to include some repositories in order to install this software. One way to do that is to uncomment lines in your `sources.list`:
|
||||
```
|
||||
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
|
||||
```
|
||||
- Use `apt` to install dependencies:
|
||||
```
|
||||
sudo apt update && \
|
||||
sudo apt -y install build-essential autoconf libtool git-core automake git zip wget ant \
|
||||
libde265-dev libheif-dev \
|
||||
libpq-dev \
|
||||
testdisk libafflib-dev libewf-dev libvhdi-dev libvmdk-dev \
|
||||
libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
|
||||
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x \
|
||||
gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
|
||||
```
|
||||
- You will also need to install Java 8 and JavaFX to run autopsy. We recommend Liberica OpenJDK which can be installed as follows:
|
||||
```
|
||||
pushd /usr/src/ && \
|
||||
wget -q -O - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | sudo apt-key add - && \
|
||||
echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list && \
|
||||
sudo apt update && \
|
||||
sudo apt -y install bellsoft-java8-full && \
|
||||
popd
|
||||
```
|
||||
- Confirm that java has been successfully installed by running `java -version`. You should get a result like the following:
|
||||
```
|
||||
% java -version
|
||||
openjdk version "1.8.0_342"
|
||||
OpenJDK Runtime Environment (build 1.8.0_342-b07)
|
||||
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)
|
||||
```
|
||||
- Take note of the location of the java 1.8 install. This will be necessary to properly setup Autopsy. If using the recommended method, the path should be `/usr/lib/jvm/bellsoft-java8-full-amd64`
|
||||
|
||||
# Install The Sleuth Kit
|
||||
|
||||
The Sleuth Kit must be installed before trying to install Autopsy. If you are on a Debian-like system (i.e. Ubuntu) you can download the most recent deb file from the [github release section](https://github.com/sleuthkit/sleuthkit/releases), and install by running something like `sudo apt install ./sleuthkit-java_4.11.1-1_amd64.deb`. Otherwise, you can follow the directions below to install The Sleuth Kit from source code.
|
||||
|
||||
## Install The Sleuth Kit from Source
|
||||
*A script to install these dependencies on Unix-like systems (i.e. macOS, Linux) that can be found [here](./linux_macos_install_scripts/install_tsk_from_src.sh). Make sure the script is executable before running.*
|
||||
- Please ensure you have all the prerequisites installed on your system (see the directions [here](#installing-prerequisites)).
|
||||
- If you don't have a copy of the repository on your local machine, clone it (this requires git):
|
||||
```
|
||||
git clone --depth 1 https://github.com/sleuthkit/sleuthkit.git
|
||||
```
|
||||
- If you want to build source from a particular branch or tag (i.e. `develop` or `release-4.11.0`), check out that branch:
|
||||
```
|
||||
git checkout <YOUR BRANCH HERE> && git pull
|
||||
```
|
||||
- Then, with The Sleuth Kit repo as your working directory, you can build with:
|
||||
```
|
||||
./bootstrap && ./configure && make
|
||||
```
|
||||
- If the output from `make` looks good, then install:
|
||||
```
|
||||
sudo make install
|
||||
```
|
||||
|
||||
# Install Autopsy
|
||||
|
||||
## Create Autopsy Zip File from Source
|
||||
*In most instances, you should download the Autopsy Zip file from the [Autopsy downloads section](https://www.autopsy.com/download/) or in the [Releases section on GitHub](https://github.com/sleuthkit/autopsy/releases/), but if you have a special use case you can do the following. Please make sure you have the [prerequisites installed](#installing-prerequisites) and have [installed The Sleuth Kit](#install-sleuthkit).*
|
||||
- If you haven't already, clone the repo:
|
||||
```
|
||||
git clone --depth 1 https://github.com/sleuthkit/autopsy.git
|
||||
```
|
||||
- With the autopsy repo as your working directory, you can run:
|
||||
```
|
||||
ant clean && ant build && ant build-zip
|
||||
```
|
||||
- The zip file should be created within the `dist` folder of the Autopsy repository and will have the version in the name (i.e. `autopsy-4.18.0.zip`).
|
||||
|
||||
## Install Autopsy from Zip File
|
||||
*These instructions are for Unix-like systems like macOS and Linux. If you are on Windows, there is an installer that can be downloaded from the [Autopsy downloads section](https://www.autopsy.com/download/) or in the [Releases section on GitHub](https://github.com/sleuthkit/autopsy/releases/). Please make sure you have the [prerequisites installed](#installing-prerequisites) and have [installed The Sleuth Kit](#install-sleuthkit). A script to perform these steps can be found [here](./linux_macos_install_scripts/install_application.sh). Make sure the script is executable before running.*
|
||||
|
||||
- Download the zip file from the [Autopsy downloads section](https://www.autopsy.com/download/) or in the [Releases section on GitHub](https://github.com/sleuthkit/autopsy/releases/). You can also create a zip file from source using [these directions](#create-autopsy-zip-file-from-source).
|
||||
- If you downloaded the zip file, you can verify the zip file with the [The Sleuth Kit key](https://sleuthkit.org/carrier.asc) and the related `.asc` file found in the [Releases section on GitHub](https://github.com/sleuthkit/autopsy/releases/). For instance, you would use `autopsy-4.18.0.zip.asc` with `autopsy-4.18.0.zip`. Here is an example where `$ASC_FILE` is the path to the `.asc` file and `$AUTOPSY_ZIP_PATH` is the path to the autopsy zip file:
|
||||
```
|
||||
mkdir -p ${VERIFY_DIR} && \
|
||||
pushd ${VERIFY_DIR} && \
|
||||
wget https://sleuthkit.org/carrier.asc && \
|
||||
gpg --homedir "${VERIFY_DIR}" --import https://sleuthkit.org/carrier.asc && \
|
||||
gpg --homedir "${VERIFY_DIR}" --keyring "${VERIFY_DIR}/pubring.kbx" ${ASC_FILE} ${AUTOPSY_ZIP_PATH} && \
|
||||
rm -r ${VERIFY_DIR}
|
||||
popd
|
||||
```
|
||||
- Extract the zip file to a location where you would like to have Autopsy installed.
|
||||
- Set up java path. There are two ways to provide the path to java: `JAVA_HOME` can be set as an environmental variable or the `autopsy.conf` file can define the home for java.
|
||||
- To update the `autopsy.conf` file, navigate to where autopsy has been extracted and then open `etc/autopsy.conf`. Within that file, replace the commented line or add a new line specifying the java home like: `jdkhome=<JAVA_PATH>`. Another option is to provide an argument to `unix_setup.sh` like the following `unix_setup.sh -j <JAVA_PATH>` when performing the next step.
|
||||
- With the extracted folder as the working directory, you can run the following commands to perform setup:
|
||||
```
|
||||
chown -R $(whoami) . && \
|
||||
chmod u+x ./unix_setup.sh && \
|
||||
./unix_setup.sh
|
||||
```
|
||||
- At this point, you should be able to run Autopsy with the command `./autopsy` from within the `bin` directory of the extracted folder.
|
||||
|
||||
## Setup macOS JNA paths
|
||||
A few features in Autopsy will only work (i.e. gstreamer) if the JNA paths are specified. If you installed the necessary dependencies through Homebrew, you will want to either run this [script](./linux_macos_install_scripts/add_macos_jna.sh) or manually add all the gstreamer lib and dependency lib paths to the env variable `jre_flags` with jre flag: `-Djna.library.path`.
|
||||
|
||||
|
||||
# Troubleshooting
|
||||
- If you see something like "Cannot create case: javafx/scene/paint/Color" it is an indication that Java FX
|
||||
is not being found. Confirm that the file `$JAVA_HOME/jre/lib/ext/jfxrt.jar` exists. If it does not exist, return to the Java
|
||||
setup steps above.
|
||||
- If you see something like "An illegal reflective access operation has occurred" it is an indication that
|
||||
the wrong version of Java is being used to run Autopsy.
|
||||
Check the version of Java reported in the `messages.log` file in the log directory. The log directory can be found by opening Autopsy, and, with no cases open, go to 'Help' > 'Open Log Folder'. `messages.log` should contain lines that looks like:
|
||||
```
|
||||
Java; VM; Vendor = 1.8.0_342; OpenJDK 64-Bit Server VM 25.342-b07; BellSoft
|
||||
Runtime = OpenJDK Runtime Environment 1.8.0_342-b07
|
||||
Java Home = /usr/lib/jvm/bellsoft-java8-full-amd64/jre
|
||||
```
|
||||
|
||||
If your `messages.log` file indicates that Java 8 is not being used:
|
||||
- Confirm that you have a version of Java 8 installed
|
||||
- Confirm that your java path environment variable is set correctly. Autopsy first uses the value of `jdkhome` in `<autopsy_install_location>/etc/autopsy.conf`, so look for an uncommented line (not starting with '#') that looks like `jdkhome=<java path>`. If that is not set, check your `$JAVA_HOME` environment variable by running `echo $JAVA_HOME`.
|
||||
- If you see something like "cannot be opened because the developer cannot be verified." it is an indication that Gatekeeper is running and is stopping a file from being executed. To fix this open a new terminal window and enter the following command `sudo spctl --master-disable`, you will be required to enter your password. This will allow any program to be be downloaded from anywhere and executed.
|
||||
- On initial run, Autopsy shows a window that can appear behind the splash screen. This looks like Autopsy has stalled during startup. The easiest way to get around this issue for the first run is to run autopsy with the `--nosplash` flag, which will hide the splash screen on startup. There will be a lag where no window appears for a bit, so please be patient.
|
||||
- If a script fails to run due to operation not permitted or something along those lines, you may need to run `chmod u+x <path to script>` from the command line to allow the script to run.
|
||||
- If you encounter an error like: `getcwd: cannot access parent directories: Operation not permitted` on Mac, you can do the following:
|
||||
1. Select System Preferences -> Security & Privacy -> Full Disk Access
|
||||
2. Click the lock to make changes
|
||||
3. Click '+'
|
||||
4. Press 'cmd' + 'shift' + '.' to show hidden files
|
||||
5. Select `/bin/sh`
|
||||
*Source: [Symscape](https://www.symscape.com/node/1727)*
|
||||
|
||||
# Known Issues
|
||||
- Not all current features in Autopsy are functional in a Linux and Mac environment including but not limited to:
|
||||
- Recent Activity
|
||||
- The LEAPP processors
|
||||
- HEIF processing
|
||||
- Timeline does not work on OS X
|
||||
- Video thumbnails
|
||||
- VHD and VMDK files not supported on OS X
|
@ -1,133 +0,0 @@
|
||||
This document outlines how to run a packaged version of Autopsy on Linux or OS X. It does not cover how to compile it from source or the Windows installer.
|
||||
|
||||
|
||||
* Prerequisites *
|
||||
|
||||
The following need to be done at least once. They do not need to be repeated for each Autopsy release.
|
||||
|
||||
- Install testdisk for photorec functionality
|
||||
-- Linux: % sudo apt-get install testdisk
|
||||
-- OS X: % brew install testdisk
|
||||
|
||||
- (Optional) Install ImageMagick for Apple's High Efficiency Photo (HEIC/HEIF) support.
|
||||
-- OS X: % brew install imagemagick
|
||||
-- Linux:
|
||||
% sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
|
||||
|
||||
% sudo apt-get update
|
||||
% sudo apt-get install build-essential autoconf libtool git-core
|
||||
% sudo apt-get build-dep imagemagick libmagickcore-dev libde265 libheif
|
||||
|
||||
% cd /usr/src/
|
||||
|
||||
% sudo git clone https://github.com/strukturag/libde265.git
|
||||
% sudo git clone https://github.com/strukturag/libheif.git
|
||||
|
||||
% cd libde265/
|
||||
% sudo ./autogen.sh
|
||||
% sudo ./configure
|
||||
% sudo make
|
||||
% sudo make install
|
||||
|
||||
% cd /usr/src/libheif/
|
||||
% sudo ./autogen.sh
|
||||
% sudo ./configure
|
||||
% sudo make
|
||||
% sudo make install
|
||||
|
||||
% cd /usr/src/
|
||||
% sudo wget https://www.imagemagick.org/download/ImageMagick.tar.gz
|
||||
% sudo tar xf ImageMagick.tar.gz
|
||||
|
||||
% cd ImageMagick-7*
|
||||
% sudo ./configure --with-heic=yes
|
||||
% sudo make
|
||||
% sudo make install
|
||||
|
||||
% sudo ldconfig
|
||||
|
||||
- Install the BellSoft Java 8 JRE and JavaFX 8 distribution and set JAVA_HOME.
|
||||
* The BellSoft distribution bundles OpenJDK and OpenJFX. Other distributions we have tried either don't
|
||||
bundle OpenJFX (AdoptOpenJDK) or don't include all necessary binaries (Amazon Corretto).
|
||||
-- Linux:
|
||||
1. Install BellSoft Java 8
|
||||
% wget -q -O - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | sudo apt-key add -
|
||||
% echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list
|
||||
% sudo apt-get update
|
||||
% sudo apt-get install bellsoft-java8-full
|
||||
2. Set JAVA_HOME
|
||||
% export JAVA_HOME=/usr/lib/jvm/bellsoft-java8-full-amd64
|
||||
|
||||
NOTE: You may need to log out and back in again after setting JAVA_HOME before the Autopsy
|
||||
unix_setup.sh script can see the value.
|
||||
|
||||
-- OS X:
|
||||
1. Install BellSoft Java 8.
|
||||
% brew tap bell-sw/liberica
|
||||
for macOS BigSur and later:
|
||||
% brew install --cask liberica-jdk8-full
|
||||
for macOS versions before BigSur:
|
||||
% brew cask install liberica-jdk8-full
|
||||
2. Set JAVA_HOME environment variable to location of JRE installation.
|
||||
e.g. add the following to ~/.bashrc
|
||||
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
|
||||
|
||||
- Confirm your version of Java by running
|
||||
% java -version
|
||||
openjdk version "1.8.0.232"
|
||||
OpenJDK Runtime Environment (build 1.8.0_232-BellSoft-b10)
|
||||
OpenJDK 64-Bit Server VM (build 25.232-b10, mixed mode)
|
||||
|
||||
* Install The Sleuth Kit Java Bindings *
|
||||
|
||||
Autopsy depends on a specific version of The Sleuth Kit. You need the Java libraries of The Sleuth Kit installed, which is not part of all packages.
|
||||
|
||||
- Linux: Install the sleuthkit-java.deb file that you can download from github.com/sleuthkit/sleuthkit/releases. This will install libewf, etc. For example:
|
||||
-- % sudo apt install ./sleuthkit-java_4.8.0-1_amd64.deb
|
||||
|
||||
- OS X: Build The Sleuth Kit from source.
|
||||
See https://slo-sleuth.github.io/tools/InstallingAutopsyOnMacOS.html for a comprehensive write-up
|
||||
on building The Sleuth Kit and getting Autopsy to run on Mac OS.
|
||||
|
||||
|
||||
* Install Autopsy *
|
||||
|
||||
- Extract the contents of the Autopsy ZIP file to a folder.
|
||||
- Open a terminal and cd into the Autopsy folder.
|
||||
- Run the unix_setup.sh script to configure Autopsy
|
||||
% sh unix_setup.sh
|
||||
|
||||
|
||||
* Running Autopsy *
|
||||
|
||||
- In a terminal, change to the ‘bin’ directory in the Autopsy folder.
|
||||
- Run Autopsy
|
||||
% ./autopsy
|
||||
|
||||
* Troubleshooting *
|
||||
|
||||
- If you see something like "Cannot create case: javafx/scene/paint/Color" it is an indication that Java FX
|
||||
is not being found.
|
||||
Confirm that the file $JAVA_HOME/jre/lib/ext/jfxrt.jar exists. If it does not exist, return to the Java
|
||||
setup steps above.
|
||||
- If you see something like "An illegal reflective access operation has occurred" it is an indication that
|
||||
the wrong version of Java is being used to run Autopsy.
|
||||
Check the version of Java reported in the ~/.autopsy/dev/var/log/messages.log file. It should contain lines that looks like:
|
||||
Java; VM; Vendor = 1.8.0_232; OpenJDK 64-Bit Server V 25.232-b10; BellSoft
|
||||
Runtime = OpenJDK Runtime Environment 1.8.0_232-BellSoft-b10
|
||||
Java Home = /usr/lib/jvm/bellsoft-java8-amd64/jre
|
||||
|
||||
If your messages.log file indicates that Java 8 is not being used:
|
||||
(a) confirm that you have a version of Java 8 installed and
|
||||
(b) confirm that your JAVA_HOME environment variable is set correctly:
|
||||
% echo $JAVA_HOME
|
||||
|
||||
- If you see something like "cannot be opened because the developer cannot be verified." it is an indication
|
||||
that Gatekeeper is running and is stopping a file from being executed. To fix this open a new terminal window
|
||||
and enter the following command "sudo spctl --master-disable", you will be required to enter your password.
|
||||
This will allow any program to be be downloaded from anywhere and executed.
|
||||
|
||||
* Limitations (Updated May 2018) *
|
||||
- Timeline does not work on OS X
|
||||
- Video thumbnails are not generated (need to get a consistent version of OpenCV)
|
||||
- VHD and VMDK files not supported on OS X
|
@ -146,8 +146,12 @@
|
||||
<copy file="${basedir}/README.txt" tofile="${zip-tmp}/${app.name}/README.txt"/>
|
||||
<copy file="${basedir}/LICENSE-2.0.txt" tofile="${zip-tmp}/${app.name}/LICENSE-2.0.txt"/>
|
||||
<copy file="${basedir}/NEWS.txt" tofile="${zip-tmp}/${app.name}/NEWS.txt"/>
|
||||
<copy file="${basedir}/Running_Linux_OSX.txt" tofile="${zip-tmp}/${app.name}/Running_Linux_OSX.txt"/>
|
||||
<copy file="${basedir}/Running_Linux_OSX.md" tofile="${zip-tmp}/${app.name}/Running_Linux_OSX.md"/>
|
||||
<copy file="${basedir}/unix_setup.sh" tofile="${zip-tmp}/${app.name}/unix_setup.sh"/>
|
||||
<copy flatten="false" todir="${zip-tmp}/${app.name}/linux_macos_install_scripts">
|
||||
<fileset dir="${basedir}/linux_macos_install_scripts"/>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/Tools/ManifestTool/ManifestTool.exe" todir="${zip-tmp}/${app.name}/bin"/>
|
||||
|
||||
<copy file="${basedir}/icons/icon.ico" tofile="${zip-tmp}/${app.name}/icon.ico" overwrite="true"/>
|
||||
|
34
linux_macos_install_scripts/add_macos_jna.sh
Normal file
34
linux_macos_install_scripts/add_macos_jna.sh
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
# Updates jna paths for mac
|
||||
|
||||
usage() {
|
||||
echo "Usage: add_macos_jna.sh [-i base_install_location (i.e. /home/usr/autopsy)] [-a application_name (default: autopsy)]" 1>&2
|
||||
}
|
||||
|
||||
APPLICATION_NAME="autopsy"
|
||||
|
||||
while getopts "a:i:" o; do
|
||||
case "${o}" in
|
||||
i)
|
||||
INSTALL_LOC=${OPTARG}
|
||||
;;
|
||||
a)
|
||||
APPLICATION_NAME=${OPTARG}
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "$INSTALL_LOC" ]]
|
||||
then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
awk '!/^\s*#?\s*export jreflags=.*$/' $INSTALL_LOC/etc/$APPLICATION_NAME.conf > $INSTALL_LOC/etc/$APPLICATION_NAME.conf.tmp && \
|
||||
mv $INSTALL_LOC/etc/$APPLICATION_NAME.conf.tmp $INSTALL_LOC/etc/$APPLICATION_NAME.conf && \
|
||||
echo -e "\nexport jreflags=-Djna.library.path=\"/Library/Frameworks/GStreamer.framework/Versions/1.0/lib\"" >> $INSTALL_LOC/etc/$APPLICATION_NAME.conf
|
||||
|
97
linux_macos_install_scripts/install_application.sh
Normal file
97
linux_macos_install_scripts/install_application.sh
Normal file
@ -0,0 +1,97 @@
|
||||
#!/bin/bash
|
||||
# Unzips an application platform zip to specified directory and does setup
|
||||
|
||||
usage() {
|
||||
echo "Usage: install_application_from_zip.sh [-z zip_path] [-i install_directory] [-j java_home] [-n application_name] [-v asc_file]" 1>&2
|
||||
echo "If specifying a .asc verification file (with -v flag), the program will attempt to create a temp folder in the working directory and verify the signature with gpg. If you already have an extracted zip, the '-z' flag can be ignored as long as the directory specifying the extracted contents is provided for the installation directory." 1>&2
|
||||
}
|
||||
|
||||
APPLICATION_NAME="autopsy";
|
||||
|
||||
while getopts "n:z:i:j:v:" o; do
|
||||
case "${o}" in
|
||||
n)
|
||||
APPLICATION_NAME=${OPTARG}
|
||||
;;
|
||||
z)
|
||||
APPLICATION_ZIP_PATH=${OPTARG}
|
||||
;;
|
||||
i)
|
||||
INSTALL_DIR=${OPTARG}
|
||||
;;
|
||||
v)
|
||||
ASC_FILE=${OPTARG}
|
||||
;;
|
||||
j)
|
||||
JAVA_PATH=${OPTARG}
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "$INSTALL_DIR" ]]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If zip path has not been specified and there is nothing at the install directory
|
||||
if [[ -z "$APPLICATION_ZIP_PATH" ]] && [[ ! -d "$INSTALL_DIR" ]]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check against the asc file if the zip exists
|
||||
if [[ -n "$ASC_FILE" ]] && [[ -n "$APPLICATION_ZIP_PATH" ]]; then
|
||||
VERIFY_DIR=$(pwd)/temp
|
||||
KEY_DIR=$VERIFY_DIR/private
|
||||
mkdir -p $VERIFY_DIR &&
|
||||
sudo wget -O $VERIFY_DIR/carrier.asc https://sleuthkit.org/carrier.asc &&
|
||||
mkdir -p $KEY_DIR &&
|
||||
sudo chmod 600 $KEY_DIR &&
|
||||
sudo gpg --homedir "$KEY_DIR" --import $VERIFY_DIR/carrier.asc &&
|
||||
sudo gpgv --homedir "$KEY_DIR" --keyring "$KEY_DIR/pubring.kbx" $ASC_FILE $APPLICATION_ZIP_PATH &&
|
||||
sudo rm -r $VERIFY_DIR
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Unable to successfully verify $APPLICATION_ZIP_PATH with $ASC_FILE" >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
ZIP_FILE_NAME=$(basename -- "$APPLICATION_ZIP_PATH")
|
||||
ZIP_NAME="${ZIP_FILE_NAME%.*}"
|
||||
APPLICATION_EXTRACTED_PATH=$INSTALL_DIR/$ZIP_NAME/
|
||||
|
||||
# if specifying a zip path, ensure directory doesn't exist and then create and extract
|
||||
if [[ -n "$APPLICATION_ZIP_PATH" ]]; then
|
||||
if [[ -d $APPLICATION_EXTRACTED_PATH || -f $APPLICATION_EXTRACTED_PATH ]]; then
|
||||
echo "A file or directory already exists at $APPLICATION_EXTRACTED_PATH" >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Extracting $APPLICATION_ZIP_PATH to $APPLICATION_EXTRACTED_PATH..."
|
||||
mkdir -p $APPLICATION_EXTRACTED_PATH &&
|
||||
unzip $APPLICATION_ZIP_PATH -d $INSTALL_DIR
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Unable to successfully extract $APPLICATION_ZIP_PATH to $INSTALL_DIR" >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Setting up application at $APPLICATION_EXTRACTED_PATH..."
|
||||
# find unix_setup.sh in least nested path (https://stackoverflow.com/a/40039568/2375948)
|
||||
UNIX_SETUP_PATH=`find $APPLICATION_EXTRACTED_PATH -name 'unix_setup.sh' -printf "%d %p\n"| sort -n | perl -pe 's/^\d+\s//;' | head -n1 | xargs -I{} dirname {}`
|
||||
|
||||
pushd $UNIX_SETUP_PATH &&
|
||||
chown -R $(whoami) . &&
|
||||
chmod u+x ./unix_setup.sh &&
|
||||
./unix_setup.sh -j $JAVA_PATH -n $APPLICATION_NAME &&
|
||||
popd
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Unable to setup permissions for application binaries" >>/dev/stderr
|
||||
exit 1
|
||||
else
|
||||
echo "Application setup done. You can run $APPLICATION_NAME from $UNIX_SETUP_PATH/bin/$APPLICATION_NAME."
|
||||
fi
|
35
linux_macos_install_scripts/install_prereqs_macos.sh
Normal file
35
linux_macos_install_scripts/install_prereqs_macos.sh
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
echo "Installing dependencies..."
|
||||
# dependencies taken from: https://github.com/sleuthkit/autopsy/pull/5111/files
|
||||
# brew install gettext cppunit && \
|
||||
brew install ant automake libtool afflib libewf postgresql testdisk
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "Unable to install necessary dependencies" >> /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# brew gstreamer packages don't seem to play nice with autopsy. Installing directly from gstreamer
|
||||
echo "Installing gstreamer..."
|
||||
gstreamer_tmp_path=$TMPDIR/gstreamer-1.0-1.20.3-universal.pkg
|
||||
curl -k -o $gstreamer_tmp_path 'https://gstreamer.freedesktop.org/data/pkg/osx/1.20.3/gstreamer-1.0-1.20.3-universal.pkg' && \
|
||||
sudo installer -pkg //Users/4911_admin/Downloads/gstreamer-1.0-1.20.3-universal.pkg -target /
|
||||
gstreamer_install_result=$?
|
||||
rm $gstreamer_tmp_path
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "Unable to install gstreamer" >> /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing liberica java 8..."
|
||||
brew tap bell-sw/liberica && \
|
||||
brew install --cask liberica-jdk8-full
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "Unable to install liberica java" >> /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
java_path=$(/usr/libexec/java_home -v 1.8)
|
||||
echo "Java 1.8 path: $java_path"
|
41
linux_macos_install_scripts/install_prereqs_ubuntu.sh
Normal file
41
linux_macos_install_scripts/install_prereqs_ubuntu.sh
Normal file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# this script is designed to install necessary dependencies on debian
|
||||
# this script requires elevated privileges
|
||||
|
||||
echo "Turning on all repositories for apt..."
|
||||
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Failed to turn on all repositories" >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing all apt dependencies..."
|
||||
sudo apt update && \
|
||||
sudo apt -y install build-essential autoconf libtool automake git zip wget ant \
|
||||
libde265-dev libheif-dev \
|
||||
libpq-dev \
|
||||
testdisk libafflib-dev libewf-dev libvhdi-dev libvmdk-dev \
|
||||
libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
|
||||
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x \
|
||||
gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Failed to install necessary dependencies" >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing bellsoft Java 8..."
|
||||
pushd /usr/src/ &&
|
||||
wget -q -O - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | sudo apt-key add - &&
|
||||
echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list &&
|
||||
sudo apt update &&
|
||||
sudo apt -y install bellsoft-java8-full &&
|
||||
popd
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Failed to install bellsoft java 8" >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Autopsy prerequisites installed."
|
||||
echo "Java path at /usr/lib/jvm/bellsoft-java8-full-amd64: "
|
||||
ls /usr/lib/jvm/bellsoft-java8-full-amd64
|
77
linux_macos_install_scripts/install_tsk_from_src.sh
Normal file
77
linux_macos_install_scripts/install_tsk_from_src.sh
Normal file
@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
# Clones sleuthkit repo from github (if necessary) and installs
|
||||
# this script does require sudo privileges
|
||||
# called like: build_tsk.sh -p <repo path to be created or existing> -b <tsk branch to checkout> -r <non-standard remote repo (optional)>
|
||||
|
||||
usage() {
|
||||
echo "Usage: install_tsk_from_src [-p repo_path (should end with '/sleuthkit')] [-b tsk_branch] [-r sleuthkit_repo]" 1>&2
|
||||
}
|
||||
|
||||
# default repo path
|
||||
REPO="https://github.com/sleuthkit/sleuthkit.git"
|
||||
TSK_BRANCH="develop"
|
||||
|
||||
while getopts "p:r:b:" o; do
|
||||
case "${o}" in
|
||||
p)
|
||||
SLEUTHKIT_SRC_DIR=${OPTARG}
|
||||
;;
|
||||
b)
|
||||
TSK_BRANCH=${OPTARG}
|
||||
;;
|
||||
r)
|
||||
REPO=${OPTARG}
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "${SLEUTHKIT_SRC_DIR}" ]]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d $SLEUTHKIT_SRC_DIR ]]; then
|
||||
TSK_REPO_PATH=$(dirname "$SLEUTHKIT_SRC_DIR")
|
||||
echo "Cloning Sleuthkit to $TSK_REPO_PATH..."
|
||||
mkdir -p $TSK_REPO_PATH &&
|
||||
pushd $TSK_REPO_PATH &&
|
||||
git clone --depth 1 -b $TSK_BRANCH $REPO &&
|
||||
popd
|
||||
if [[ ! -d $SLEUTHKIT_SRC_DIR ]]; then
|
||||
echo "Unable to successfully clone Sleuthkit" >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Getting latest of Sleuthkit branch: $TSK_BRANCH..."
|
||||
pushd $SLEUTHKIT_SRC_DIR &&
|
||||
git remote set-branches origin '*' &&
|
||||
git fetch -v &&
|
||||
git reset --hard &&
|
||||
git checkout $TSK_BRANCH &&
|
||||
git pull &&
|
||||
popd
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Unable to reset Sleuthkit repo and pull latest on $TSK_BRANCH" >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Installing Sleuthkit..."
|
||||
pushd $SLEUTHKIT_SRC_DIR &&
|
||||
./bootstrap &&
|
||||
./configure &&
|
||||
make &&
|
||||
sudo make install &&
|
||||
popd
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Unable to build Sleuthkit." >>/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
JAVA_INSTALLS=/usr/local/share/java
|
||||
echo "Sleuthkit in $JAVA_INSTALLS:"
|
||||
ls $JAVA_INSTALLS | grep sleuthkit
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Verifies programs are installed and copies native code into the Autopsy folder structure
|
||||
# Verifies programs are installed and copies native code into the Application folder structure
|
||||
#
|
||||
|
||||
# NOTE: update_sleuthkit_version.pl updates this value and relies
|
||||
@ -8,11 +8,37 @@
|
||||
TSK_VERSION=4.11.1
|
||||
|
||||
|
||||
usage() {
|
||||
echo "Usage: unix_setup.sh [-j java_home] [-n application_name]" 1>&2;
|
||||
}
|
||||
|
||||
APPLICATION_NAME="autopsy";
|
||||
|
||||
while getopts "j:n:" o; do
|
||||
case "${o}" in
|
||||
n)
|
||||
APPLICATION_NAME=${OPTARG}
|
||||
;;
|
||||
j)
|
||||
JAVA_PATH=${OPTARG}
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
# In the beginning...
|
||||
echo "---------------------------------------------"
|
||||
echo "Checking prerequisites and preparing Autopsy:"
|
||||
echo "Checking prerequisites and preparing ${APPLICATION_NAME}:"
|
||||
echo "---------------------------------------------"
|
||||
|
||||
# make sure cwd is same as script's
|
||||
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
pushd $SCRIPTPATH
|
||||
|
||||
# Verify PhotoRec was installed
|
||||
echo -n "Checking for PhotoRec..."
|
||||
photorec_filepath=/usr/bin/photorec
|
||||
@ -28,7 +54,17 @@ fi
|
||||
|
||||
# Verify Java was installed and configured
|
||||
echo -n "Checking for Java..."
|
||||
if [ -n "$JAVA_HOME" ]; then
|
||||
if [ -n "$JAVA_PATH" ]; then
|
||||
if [ -x "$JAVA_PATH/bin/java" ]; then
|
||||
# only works on linux; not os x
|
||||
awk '!/^\s*#?\s*jdkhome=.*$/' etc/$APPLICATION_NAME.conf > etc/$APPLICATION_NAME.conf.tmp && \
|
||||
mv etc/$APPLICATION_NAME.conf.tmp etc/$APPLICATION_NAME.conf && \
|
||||
echo "jdkhome=$JAVA_PATH" >> etc/$APPLICATION_NAME.conf
|
||||
else
|
||||
echo "ERROR: Java was not found in $JAVA_PATH."
|
||||
exit 1
|
||||
fi
|
||||
elif [ -n "$JAVA_HOME" ]; then
|
||||
if [ -x "$JAVA_HOME/bin/java" ]; then
|
||||
echo "found in $JAVA_HOME"
|
||||
else
|
||||
@ -56,7 +92,7 @@ else
|
||||
fi
|
||||
|
||||
ext_jar_filepath=$PWD/autopsy/modules/ext/sleuthkit-$TSK_VERSION.jar;
|
||||
echo -n "Copying sleuthkit-$TSK_VERSION.jar into the Autopsy directory..."
|
||||
echo -n "Copying sleuthkit-$TSK_VERSION.jar into the $APPLICATION_NAME directory..."
|
||||
rm -f "$ext_jar_filepath";
|
||||
if [ "$?" -gt 0 ]; then #checking if remove operation failed
|
||||
echo "ERROR: Deleting $ext_jar_filepath failed."
|
||||
@ -80,8 +116,10 @@ chmod u+x autopsy/markmckinnon/parse*
|
||||
chmod -R u+x autopsy/solr/bin
|
||||
|
||||
# make sure it is executable
|
||||
chmod u+x bin/autopsy
|
||||
chmod u+x bin/$APPLICATION_NAME
|
||||
|
||||
popd
|
||||
|
||||
echo
|
||||
echo "Autopsy is now configured. You can execute bin/autopsy to start it"
|
||||
echo "Application is now configured. You can execute bin/$APPLICATION_NAME to start it"
|
||||
echo
|
Loading…
x
Reference in New Issue
Block a user