-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall-deps.sh
executable file
·150 lines (125 loc) · 4.1 KB
/
install-deps.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/bin/bash
# Copyright (C) 2018 Stephen Farrell, [email protected]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#set -x
startdir=`/bin/pwd`
# this script will install the various bits'n'pieces needed to get this
# survey stuff working
# kinda loosely tested on a relatively clean ubuntu 16.04 - YMMV
# This assumes you're a sudoer and likely works better if you don't have
# to constantly enter the sudo password
# This isn't efficiently idempotent - it'll redo the lot each time
# start out in good state
sudo apt-get update
sudo apt-get -y upgrade
# maybe we got this script some weird way...
sudo apt-get -y install git unzip
if [ ! -d $HOME/code ]
then
mkdir -p $HOME/code
fi
if [ ! -d $HOME/code/surveys ]
then
cd $HOME/code
git clone https://github.com/sftcd/surveys
else
# may as well do an update
cd $HOME/code/surveys
git pull
fi
# make a place for stuff..
for subdir in runs IE EE
do
if [ ! -d $HOME/data/smtp/$subdir ]
then
mkdir -p $HOME/data/smtp/$subdir
fi
done
# zmap is an install
sudo apt-get -y install zmap
# maxmind - enough to just use our update tool
./mm_update.sh
# install python & pip
sudo apt-get -y install python3 python3-pip
# install finddup - needed for fp2cert.sh
sudo apt install perforate
sudo -H apt -y install python3-testresources
sudo -H apt -y install python3-geoip2
sudo -H apt -y install python3-graphviz
sudo -H apt -y install python3-dateutil
sudo -H apt -y install python3-jsonpickle
sudo -H apt -y install python3-pympler
sudo -H apt -y install python3-netaddr
sudo -H apt -y install python3-cryptography
sudo -H apt -y install python3-wordcloud
sudo -H apt -y install python3-plotly
sudo -H apt -y install python3-networkx
sudo -H apt -y install python3-scipy
# these are imports that I don't think need a pip install
# but not sure:-)
#sudo -H pip install gc
#sudo -H pip install copy
#sudo -H pip install os
#sudo -H pip install sys
#sudo -H pip install json
#sudo -H pip install socket
#sudo -H pip install subprocess
#sudo -H pip install time
#sudo -H pip install tempfile
# golang, zmap and zgrab
# ubuntu's golang version isn't currently recent enough, need to go for
# a stable version from upstream
# better get wget
sudo apt-get -y install wget
if [ ! -d /usr/lib/go-1.10 ]
then
mkdir -p $HOME/code/golang
cd $HOME/code/golang
GOTARBALL=go1.10.linux-amd64.tar.gz
GOURL=https://dl.google.com/go/$GOTARBALL
wget $GOURL
tar xzvf $GOTARBALL
sudo mv go /usr/lib/go-1.10
sudo ln -sf /usr/lib/go-1.10 /usr/lib/go
sudo ln -sf /usr/lib/go-1.10/bin/go /usr/bin/go
# add GOPATH to .bashrc
donealready=`grep GOPATH $HOME/.bashrc`
if [[ "$donealready" == "" ]]
then
echo "export GOPATH=$HOME/go" >>$HOME/.bashrc
fi
export GOPATH=$HOME/go
fi
# got get stuff
go get github.com/zmap/zgrab
cd $GOPATH/src/github.com/zmap/zgrab
go build
# put it on PATH
sudo ln -sf $HOME/go/src/github.com/zmap/zgrab/zgrab /usr/local/bin
# get ciphersuite stuff
cd $HOME/code/surveys/clustertools
if [ ! -f mapping-rfc.txt ]
then
echo "Getting TLS ciphersuite names"
wget https://testssl.sh/etc/cipher-mapping.txt
fi
# clean up
cd $starddir
echo "Done! (I hope:-)"