forked from intezer/linux-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·106 lines (69 loc) · 2.34 KB
/
deploy.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
#!/bin/bash
is_first_run=false
# ========================= Setup external tools =========================
if [ ! -f yara/yara ] || [ ! -f chkrootkit/chkrootkit ] ; then
is_first_run=true
if [ -f /etc/redhat-release ]; then
sudo yum -y install wget
fi
if [ -f /etc/lsb-release ]; then
sudo apt-get install wget
fi
fi
if [ ! -f yara/yara ]; then
if [ -f /etc/redhat-release ]; then
echo "Installing dependencies for yara/CentOS..."
# YARA
sudo yum -y install automake libtool make gcc
fi
if [ -f /etc/lsb-release ]; then
echo "Installing dependencies for yara/Ubuntu..."
# YARA
sudo apt-get install -y automake libtool make gcc
fi
# Build YARA from source
rm master.tar.gz
wget https://github.com/VirusTotal/yara/archive/master.tar.gz -O master.tar.gz
tar -zxf master.tar.gz
mv yara-master yara
cd yara
./bootstrap.sh
./configure
make # build without install. we'll use the binaries directly.
cd ..
fi
if [ ! -f chkrootkit/chkrootkit ] ; then
# Build chkrootkit from source
rm master.tar.gz
wget https://github.com/omri9741/chkrootkit/archive/master.tar.gz -O master.tar.gz
tar -zxf master.tar.gz
mv chkrootkit-master chkrootkit
rm master.tar.gz
cd chkrootkit
make sense
cd ..
fi
# ========================= Install Python pip if needed =========================
if [ ! -x "$(command -v pip)" ] ; then
echo "pip not installed! installing pip..."
is_first_run=true
if [ -f /etc/redhat-release ]; then
sudo yum -y install gcc python-devel
wget "https://bootstrap.pypa.io/get-pip.py" -O "get-pip.py"
sudo python get-pip.py
fi
if [ -f /etc/lsb-release ]; then
sudo apt-get install python-pip
fi
fi
# ========================= 1st run =========================
if [ "$is_first_run" = true ] ; then
# ========================= Install requirements =========================
sudo pip install -r requirements.txt
# ========================= Update YARA signatures =========================
echo -e "\033[33m[*] fetching up-to-date yara signatures...\033[0m"
./update_signatures.sh
fi
# ========================= Start Linux Expl0rer =========================
echo -e "\033[33m[*] starting Linux Expl0rer...\033[0m"
sudo python linux_explorer.py