diff --git a/installation/README.md b/installation/README.md new file mode 100644 index 0000000000000000000000000000000000000000..28c1f8a64f7cf06323247ad3a4cfc79f313f8ca6 --- /dev/null +++ b/installation/README.md @@ -0,0 +1,134 @@ +# Overview +*The installation process requires some [prerequisites](#installing-prerequisites), [Sleuthkit](#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 OS X + +*A script to install these dependencies that can be found [here](scripts/install_prereqs_osx.sh).* +- Using [Homebrew](https://brew.sh/), install dependencies that have formulas: + ``` + brew install ant automake libtool afflib libewf libpq testdisk imagemagick gstreamer gst-plugins-base gst-plugins-good imagemagick + ``` +- 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`. On OS X Big Sur (11.2.x) or later, installation can be done as follows: + ``` + brew install --cask liberica-jdk8-full + ``` + for previous versions of OS X: + ``` + brew cask install liberica-jdk8-full + ``` +- You will need to set this Java to `JAVA_HOME` with something like: + ``` + export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) && \ + echo 'export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)' | tee >> ~/.bashrc >> ~/.zshrc + ``` +- and properly link it to the OpenJDK location: + ``` + OPEN_JDK_LN=/usr/local/opt/openjdk && \ + rm $ && \ + ln -s $JAVA_HOME $OPEN_JDK_LN + ``` +- Finally, you can verify this version of Java with: + ``` + echo "/usr/local/opt/openjdk now is:" + ls -l /usr/local/opt/openjdk + echo "Java Version is:" + java -version + ``` + +## On Linux (Ubuntu / Debian-based) + +*A script to install these dependencies that can be found [here](scripts/install_prereqs_ubuntu.sh).* +- Use `apt` to install dependencies: + ``` + sudo apt update && \ + sudo apt -y install build-essential autoconf libtool git-core automake && \ + sudo apt -y build-dep imagemagick libmagickcore-dev libde265 libheif && \ + sudo apt -y install testdisk ant libafflib-dev libewf-dev libpq-dev libvhdi-dev libvmdk-dev git zip zlib1-dev wget && \ + sudo apt -y install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc 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 + ``` +- Then, you will need to set this Java to `JAVA_HOME` with something like: + ``` + export JAVA_HOME=/usr/lib/jvm/bellsoft-java8-full-amd64 && \ + echo 'export JAVA_HOME=/usr/lib/jvm/bellsoft-java8-full-amd64' | sudo tee >> ~/.bashrc >> ~/.zshrc + ``` +- Finally, you can verify this version of Java with: + ``` + echo "Java Version is:" + java -version + ``` + +# Install Sleuthkit + +## Install Sleuthkit from Source +*A script to install these dependencies on Unix-like systems (i.e. OS X, Linux) that can be found [here](scripts/install_tsk_from_src.sh).* +- 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 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 sleuthkit 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 Sleuthkit](#install-sleuthkit).* +- If you haven't already, clone the repo: + ``` + git clone 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 OS X 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 Sleuthkit](#install-sleuthkit). A script to perform these steps can be found [here](scripts/install_autopsy_from_zip.sh).* + +- 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 [Sleuthkit 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. +- 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. \ No newline at end of file diff --git a/installation/scripts/install_autopsy_from_zip.sh b/installation/scripts/install_autopsy_from_zip.sh new file mode 100644 index 0000000000000000000000000000000000000000..24d626966b893851d3b065ba3bbf694aa9654ce7 --- /dev/null +++ b/installation/scripts/install_autopsy_from_zip.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# Unzips an autopsy platform zip to specified directory and does setup +# called like: install_autopsy.sh [-z zip_path] [-i install_directory] + +usage() { + echo "Usage: install_autopsy.sh [-z zip_path] [-i install_directory] [-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." 1>&2; +} + +while getopts "z:i:v:" o; do + case "${o}" in + z) + AUTOPSY_ZIP_PATH=${OPTARG} + ;; + i) + INSTALL_DIR=${OPTARG} + ;; + *) + usage + exit 1 + ;; + esac +done + +if [[ -z "${AUTOPSY_ZIP_PATH}" ]] || [[ -z "${INSTALL_DIR}" ]]; then + usage + exit 1 +fi + +if [[ ! -z "${ASC_FILE}" ]] +then + VERIFY_DIR=$(pwd)/temp + mkdir -p ${VERIFY_DIR} && \ + pushd ${VERIFY_DIR} && \ + wget https://sleuthkit.org/carrier.asc && \ + gpg --homedir "${VERIFY_DIR}" --import https://sleuthkit.org/carrier.asc && \ + gpgv --homedir "${VERIFY_DIR}" --keyring "${VERIFY_DIR}/pubring.kbx" ${ASC_FILE} ${AUTOPSY_ZIP_PATH} && \ + rm -r ${VERIFY_DIR} + popd + if [[ $? -ne 0 ]] + then + popd + echo "Unable to successfully extract $AUTOPSY_ZIP_PATH to $AUTOPSY_EXTRACTED_PATH" >> /dev/stderr + exit 1 + fi +fi + + +zip_file_name=$(basename -- "$AUTOPSY_ZIP_PATH") +zip_name="${filename%.*}" +AUTOPSY_EXTRACTED_PATH=$INSTALL_DIR/$zip_name + +if [[ -d $AUTOPSY_EXTRACTED_PATH || -f $AUTOPSY_EXTRACTED_PATH ]] +then + echo "A file or directory already exists at $AUTOPSY_EXTRACTED_PATH" >> /dev/stderr + exit 1 +fi + +echo "Extracting $AUTOPSY_ZIP_PATH to $AUTOPSY_EXTRACTED_PATH..." +mkdir -p $AUTOPSY_EXTRACTED_PATH && \ +unzip $AUTOPSY_ZIP_PATH -d $AUTOPSY_EXTRACTED_PATH +if [[ $? -ne 0 ]] +then + echo "Unable to successfully extract $AUTOPSY_ZIP_PATH to $AUTOPSY_EXTRACTED_PATH" >> /dev/stderr + exit 1 +fi + +echo "Setting up autopsy at $AUTOPSY_EXTRACTED_PATH..." +pushd $AUTOPSY_EXTRACTED_PATH && \ +chown -R $(whoami) . && \ +chmod u+x ./unix_setup.sh && \ +./unix_setup.sh && \ +popd +if [[ $? -ne 0 ]] +then + popd + echo "Unable to setup permissions for autopsy binaries" >> /dev/stderr + exit 1 +else + echo "Autopsy setup done." +fi \ No newline at end of file diff --git a/installation/scripts/install_prereqs_osx.sh b/installation/scripts/install_prereqs_osx.sh new file mode 100644 index 0000000000000000000000000000000000000000..5e55be8516952740a8b1ff4104f1c8d5ebea01f5 --- /dev/null +++ b/installation/scripts/install_prereqs_osx.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# for macOS BigSur and later: +# based on https://www.cyberciti.biz/faq/mac-osx-find-tell-operating-system-version-from-bash-prompt/ +# and https://superuser.com/questions/1425135/parsing-macos-plist-values +OSX_VERSION_STR=$(defaults read /System/Library/CoreServices/SystemVersion ProductVersion) +if [[[ $OSX_VERSION_STR =~ "([\\d*]])\\.([\\d*])\\.([\\d*])" ]] +then + OSX_MAJOR_VERSION=BASH_REMATCH[1] + OSX_MINOR_VERSION=BASH_REMATCH[2] + OSX_PATCH_VERSION=BASH_REMATCH[3] +else + echo "Unable to determine OS X version!" >> /dev/stderr + exit 1 +fi + +echo "Installing dependencies..." +# dependencies taken from: https://github.com/sleuthkit/autopsy/pull/5111/files +# brew install postgresql gettext cppunit && \ +brew install ant automake libtool afflib libewf libpq testdisk imagemagick gstreamer gst-plugins-base gst-plugins-good imagemagick && \ +brew tap bell-sw/liberica +if [[ $? -ne 0 ]] +then + echo "Unable to install necessary dependencies" >> /dev/stderr + exit 1 +fi + +# if BigSur or greater +echo "Installing liberica java 8..." +if ((OSX_MAJOR_VERSION > 11 || (OSX_MAJOR_VERSION == 11 && OSX_MAJOR_VERSION >= 2))) +then + brew install --cask liberica-jdk8-full +else + brew cask install liberica-jdk8-full +fi + +if [[ $? -ne 0 ]] +then + echo "Unable to install liberica java" >> /dev/stderr + exit 1 +fi + +# put this in bash_rc +export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) && \ +echo "Java home is now: $JAVA_HOME" && \ +echo 'export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)' | tee >> ~/.bashrc >> ~/.zshrc +if [[ $? -ne 0 ]] +then + echo "Unable to properly set up JAVA_HOME." >> /dev/stderr + exit 1 +fi + +OPEN_JDK_LN=/usr/local/opt/openjdk && \ +rm $ && \ +ln -s $JAVA_HOME $OPEN_JDK_LN +if [[ $? -ne 0 ]] +then + echo "Unable to properly set up $OPEN_JDK_LN." >> /dev/stderr + exit 1 +fi + +# Test your link file creation to ensure it is pointing at the correct java developement kit: +echo "/usr/local/opt/openjdk now is:" +ls -l /usr/local/opt/openjdk + +# check version +echo "Java Version is:" +java -version \ No newline at end of file diff --git a/installation/scripts/install_prereqs_ubuntu.sh b/installation/scripts/install_prereqs_ubuntu.sh new file mode 100644 index 0000000000000000000000000000000000000000..b405f6df71ac9b96410f8cf3dcecc5ec81855ff0 --- /dev/null +++ b/installation/scripts/install_prereqs_ubuntu.sh @@ -0,0 +1,126 @@ +#!/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..." +# other possible dependencies taken from https://github.com/sleuthkit/autopsy/pull/4743/files +# sudo apt -y install ca-certificates g++ gcc gpg java-common libafflib-dev libboost-dev libgl1-mesa-dri libgl1-mesa-glx libsolr-java libsqlite3-dev libswt-gtk-4-java libtika-java openjfx postgresql software-properties-common sqlite3 wget zip zlib1-dev + +# other possible dependencies taken from https://github.com/sleuthkit/autopsy/pull/5111/files +# sudo apt -y install autopoint libsqlite3-dev libcppunit-dev + +# TODO multi user dependencies? + +sudo apt update && \ +sudo apt -y install build-essential autoconf libtool git-core automake && \ +# sudo apt -y install libheif-dev libde265-dev imagemagick && \ +sudo apt -y build-dep imagemagick libmagickcore-dev libde265 libheif && \ +sudo apt -y install testdisk ant libafflib-dev libewf-dev libpq-dev libvhdi-dev libvmdk-dev git zip zlib1-dev wget && \ +sudo apt -y install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc 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 "Cloning source for libde265 and libheif..." +# pushd /usr/src/ && \ +# sudo git clone https://github.com/strukturag/libde265.git && \ +# sudo git clone https://github.com/strukturag/libheif.git && \ +# popd +# if [[ $? -ne 0 ]] +# then +# popd +# echo "Failed to retrieve libde265 and libheif repos" >> /dev/stderr +# exit 1 +# fi + +# echo "Installing libde265..." +# pushd /usr/src/libde265/ && \ +# sudo ./autogen.sh && \ +# sudo ./configure && \ +# sudo make && \ +# sudo make install && \ +# popd +# if [[ $? -ne 0 ]] +# then +# popd +# echo "Failed to install libde265" >> /dev/stderr +# exit 1 +# fi + +# echo "Installing libheif..." +# pushd /usr/src/libheif/ && \ +# sudo ./autogen.sh && \ +# sudo ./configure && \ +# sudo make && \ +# sudo make install && \ +# popd +# if [[ $? -ne 0 ]] +# then +# popd +# echo "Failed to install libheif" >> /dev/stderr +# exit 1 +# fi + +# echo "Installing ImageMagick..." +# pushd /usr/src/ && \ +# sudo wget https://www.imagemagick.org/download/ImageMagick.tar.gz && \ +# sudo tar xf ImageMagick.tar.gz && \ +# pushd ImageMagick-7* && \ +# sudo ./configure --with-heic=yes && \ +# sudo make && \ +# sudo make install && \ +# popd && \ +# popd +# if [[ $? -ne 0 ]] +# then +# popd && popd +# echo "Failed to install ImageMagick" >> /dev/stderr +# exit 1 +# fi + +# sudo ldconfig +# if [[ $? -ne 0 ]] +# then +# echo "ldconfig call failed" >> /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 + popd + echo "Failed to install bellsoft java 8" >> /dev/stderr + exit 1 +fi + +echo "Setting JAVA_HOME..." +export JAVA_HOME=/usr/lib/jvm/bellsoft-java8-full-amd64 && \ +echo "Java home is now: $JAVA_HOME" && \ +echo 'export JAVA_HOME=/usr/lib/jvm/bellsoft-java8-full-amd64' | sudo tee >> ~/.bashrc >> ~/.zshrc +if [[ $? -ne 0 ]] +then + echo "Failed to set up JAVA_HOME in bash_rc" >> /dev/stderr + exit 1 +fi + +echo "Java version is:" +java -version \ No newline at end of file diff --git a/installation/scripts/install_tsk_from_src.sh b/installation/scripts/install_tsk_from_src.sh new file mode 100644 index 0000000000000000000000000000000000000000..d2cf837879fccbbf61380fbbfb960a726a58e19d --- /dev/null +++ b/installation/scripts/install_tsk_from_src.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# Clones sleuthkit repo from github (if necessary) and installs +# this script does require sudo privileges +# called like: build_tsk.sh -r <repo path to be created or existing> -b <tsk branch to checkout> + +usage() { + echo "Usage: build_tsk.sh [-r repo_path] [-b tsk_branch]" 1>&2; +} + +while getopts "r:b:" o; do + case "${o}" in + r) + SLEUTHKIT_SRC_DIR=${OPTARG} + ;; + b) + TSK_BRANCH=${OPTARG} + ;; + *) + usage + exit 1 + ;; + esac +done + +if [[ -z "${SLEUTHKIT_SRC_DIR}" ]] || [[ -z "${TSK_BRANCH}" ]]; 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 https://github.com/sleuthkit/sleuthkit.git && \ + popd + if [[ ! -d $SLEUTHKIT_SRC_DIR ]] + then + popd + echo "Unable to successfully clone Sleuthkit" >> /dev/stderr + exit 1 + fi +fi + +echo "Getting latest of Sleuthkit branch: $TSK_BRANCH..." +pushd $SLEUTHKIT_SRC_DIR && \ +git reset --hard && \ +git checkout $TSK_BRANCH && \ +git pull && \ +popd +if [[ $? -ne 0 ]] +then + popd + echo "Unable to reset Sleuthkit repo and pull latest on $TSK_BRANCH" >> /dev/stderr + exit 1 +fi + +echo "Installing Sleuthkit..." +pushd $SLEUTHKIT_SRC_DIR && \ +# export CPPFLAGS="-I/usr/local/opt/libpq/include" && \ +./bootstrap && \ +./configure && \ +make && \ +sudo make install && \ +popd +if [[ $? -ne 0 ]] +then + popd + 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 \ No newline at end of file