-
Notifications
You must be signed in to change notification settings - Fork 7
/
install.sh
executable file
·121 lines (102 loc) · 3.06 KB
/
install.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
#create main install directory
mkdir -p /opt/calamity/work
maindir=/opt/calamity
#choose y/N to install
yesno(){ read -p "$question " choice;case "$choice" in y|Y|yes|Yes|YES ) decision=1;; n|N|no|No|NO ) decision=0;; * ) echo "invalid" && yesno; esac; }
##### formatting #####
#Creates variable for red color
red='\e[0;31m'
#Creates variable for bold red color
redbold='\e[1;31m'
#Creates variable for green color
green='\e[0;32m'
#Creates variable for yellow color
yellow='\e[1;33m'
#Creates variable for purple color
purple='\e[1;35m'
#Creates variable for no color
whi='\e[0m'
#blue
blue='\e[34m'
###Volatility install and updates###
volinstall(){
pushd /opt/calamity
git clone https://github.com/volatilityfoundation/volatility.git
pip2 install -r volatility/requirements.txt
popd
}
volupdate(){
pushd /opt/calamity/volatility/
git pull
popd
}
###Loki install and updates###
lokiinstall(){
pushd /opt/calamity
git clone https://github.com/Neo23x0/Loki.git
pip2 install -r Loki/requirements.txt
python /opt/calamity/Loki/loki-upgrader.py
popd
}
lokiupdate(){
pushd /opt/calamity/Loki
git pull
python /opt/calamity/Loki/loki-upgrader.py
popd
}
###Malconfscan plugin###
malconfinstall(){
pushd /opt/calamity
git clone https://github.com/JPCERTCC/MalConfScan.git
pip install -r MalConfScan/requirements.txt
cp MalConfScan/malconfscan.py /opt/calamity/volatility/volatility/plugins/malware/
cp -R MalConfScan/yara /opt/calamity/volatility/volatility/plugins/malware/
cp -R MalConfScan/utils /opt/calamity/volatility/volatility/plugins/malware/
popd
}
malconfupdate(){
pushd /opt/calamity/MalConfScan
git pull
cp malconfscan.py /opt/calamity/volatility/volatility/plugins/malware/
cp -R yara /opt/calamity/volatility/volatility/plugins/malware/
cp -R utils /opt/calamity/volatility/volatility/plugins/malware/
popd
}
if [[ -e /opt/calamity/volatility ]]; then #volatility installed run update
echo -e "$green Volatility install found, running updates $whi"
volupdate
else
volinstall
echo -e "$yellow Volatility not installed, proceeding to install $whi"
fi
if [[ -x $(which clamscan 2> /dev/null) ]]; then #clamav installed
echo -e "$green\n Found ClamAV installed continuing\n$whi"
else
echo -e "$redbold Attempting to install ClamAV\n $whi"
if [[ -x $(which apt 2>dev/null) ]]; then #run apt
apt install clamav
elif [[ -x $(which yum 2>/dev/null) ]];then #run yum
yum install clamav
else
echo -e "$redbold Please install ClamAV first, then run this script again\n $whi"
exit 0
fi
fi
if [[ -e /opt/calamity/Loki ]]; then #Loki installed run update
echo -e "$green Loki installed running update $whi"
lokiupdate
else
echo -e "$yellow Loki not found installing $whi"
lokiinstall
fi
if [[ -e /opt/calamity/MalConfScan ]];then #malconfscan installed run updates
echo -e "$green MalConfScan installed running updates$whi"
malconfupdate
else
echo -e "$yellow MalConfScan not found installing...$whi"
malconfinstall
fi
cp -av calamity /opt/calamity/calamity
chmod 755 /opt/calamity/calamity
ln -s /opt/calamity/calamity /usr/bin/calamity 2>/dev/null