Skip to content

Commit c570bb1

Browse files
committed
Added setup.sh
1 parent 14a289f commit c570bb1

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

setup.sh

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
3+
# Usage:
4+
# git clone https://github.com/JPCERTCC/etw-scan.git
5+
# cd etw-scan
6+
# chmod +x setup.sh
7+
# ./setup.sh [--install]
8+
9+
set -eu
10+
11+
INSTALL_VOL=false
12+
13+
while [[ $# -gt 0 ]]; do
14+
key="$1"
15+
case $key in
16+
--install)
17+
INSTALL_VOL=true
18+
shift
19+
;;
20+
*)
21+
echo "Usage: $0 [--install]"
22+
exit 1
23+
;;
24+
esac
25+
done
26+
27+
download_volatility() {
28+
if [ -d volatility3 ]; then
29+
echo "[+] Already downloaded volatility3"
30+
echo "[+] Delete volatility3 directory"
31+
rm -rf volatility3
32+
fi
33+
echo "[+] Download volatility3"
34+
git clone https://github.com/volatilityfoundation/volatility3.git
35+
cd volatility3
36+
echo "[+] Install requirements"
37+
pip3 install -r requirements.txt
38+
cd ..
39+
}
40+
41+
install_etwscan() {
42+
echo "[+] Install ETW Scanner"
43+
if [ ! -d plugins ]; then
44+
git clone https://github.com/JPCERTCC/etw-scan.git .
45+
fi
46+
cat patch/windows_init.patch >> volatility3/volatility3/framework/symbols/windows/__init__.py
47+
cat patch/extensions_init.patch >> volatility3/volatility3/framework/symbols/windows/extensions/__init__.py
48+
}
49+
50+
install_volatility() {
51+
echo "[+] Install volatility"
52+
cd volatility3
53+
python setup.py install
54+
cd ..
55+
}
56+
57+
help_etwscan() {
58+
echo
59+
echo "=== ETW Scanner ==="
60+
echo "Usage: python3 vol.py -f <memory image> -p etw-scan/plugins/ [etwscan.etwProvider|etwscan.etwConsumer]"
61+
echo "==================="
62+
}
63+
64+
main() {
65+
echo "[+] Start setup"
66+
download_volatility
67+
install_etwscan
68+
if [ "$INSTALL_VOL" = true ]; then
69+
install_volatility
70+
else
71+
echo "[+] Skip install volatility"
72+
echo "[+] Install path: $(pwd)/volatility3"
73+
fi
74+
echo "[+] Finished"
75+
help_etwscan
76+
}
77+
78+
main

0 commit comments

Comments
 (0)