-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_plaso.sh
executable file
·75 lines (57 loc) · 2.27 KB
/
install_plaso.sh
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
#!/bin/sh
echo "[INFO] Verifying script requirements."
sudo apt-get -q -y install git curl python-mock python-setuptools
echo "\n[INFO] Requirements verified."
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'
}
echo "[INFO] Getting the latest release of Plaso."
release=$(get_latest_release "log2timeline/plaso")
echo "[INFO] Latest Plaso release is $release."
echo "[INFO] Trying to download the archive."
sudo rm -rRf "plaso-$release.tar.gz"
wget "https://github.com/log2timeline/plaso/releases/download/$release/plaso-$release.tar.gz" -q --show-progress
if [ "$?" -ne 0 ]; then
echo "[ERROR] Failed to download the archive plaso-$release.tar.gz"
exit 1
fi
echo "[INFO] Successfully downloaded the archive plaso-$release.tar.gz"
echo "[INFO] Trying to extract the archive."
sudo rm -rfR "plaso-$release"
tar -xzf plaso-$release.tar.gz
if [ "$?" -ne 0 ]; then
echo "[ERROR] Failed to extract plaso-$release.tar.gz"
rm -rR "plaso-$release.tar.gz"
exit 2
fi
echo "[INFO] Removed the archive after extraction."
rm -rR "plaso-$release.tar.gz"
sudo rm -rRf artifacts
artifactrelease="20180827"
echo "[INFO] Getting Forensic Artifacts."
echo "[INFO] Latest Forensic Artifacts version is $artifactrelease"
wget "https://github.com/ForensicArtifacts/artifacts/releases/download/$artifactrelease/artifacts-$artifactrelease.tar.gz" -q --show-progress
if [ "$?" -ne 0 ]; then
echo "[ERROR] Failed to download Forensic Artifacts from Github."
exit 3
fi
sudo rm -rfR "artifacts-$artifactrelease"
tar -xzf "artifacts-$artifactrelease.tar.gz"
rm -rRf "artifacts-$artifactrelease.tar.gz"
cd artifacts-$artifactrelease
sudo python setup.py install
cd ..
echo "[INFO] Forensic Artifacts installed."
echo "[INFO] Building the dependencies."
cd "plaso-$release"
sudo rm -rRf requirements.txt
wget "https://raw.githubusercontent.com/log2timeline/plaso/master/requirements.txt"
python -m pip install -r requirements.txt
echo "[INFO] Verifying that __init__.py file exists."
if [ ! -f "utils/__init__.py" ]; then
touch "utils/__init__.py"
fi
echo "[INFO] Verification done."
echo "[INFO] Installation done."
echo "[INFO] Verify that all dependencies are installed by running the check_dependencies.py script"
exit 0