forked from gauntlt/gauntlt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_gauntlt_deps.sh
149 lines (111 loc) · 3.77 KB
/
install_gauntlt_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
#!/bin/bash
# check for system variables
if [ -z $HOME_FOLDER ]; then
HOME_FOLDER=$HOME
echo -e "INFO: setting \$HOME_FOLDER to $HOME";
fi
if [ -z $USER_NAME ]; then
USER_NAME=`whoami`
echo -e "INFO: setting \$USER_NAME to `whoami`";
fi
# set the installation to be non-interactive
export DEBIAN_FRONTEND="noninteractive"
# pre-answer some installation questions
sudo debconf-set-selections <<< 'libc6 libraries/restart-without-asking boolean true'
sudo debconf-set-selections <<< 'libc6:amd64 libraries/restart-without-asking boolean true'
sudo debconf-set-selections <<< 'libc6 glibc/upgrade boolean true'
sudo debconf-set-selections <<< 'libc6:amd64 glibc/upgrade boolean true'
# install system dependencies
sudo apt-get update
sudo apt-get install --yes --allow-downgrades \
--allow-remove-essential --allow-change-held-packages \
build-essential git libxml2 libxml2-dev \
libxslt-dev libcurl4-openssl-dev libsqlite3-dev libyaml-dev zlib1g-dev \
python-dev python-pip python-setuptools curl nmap w3af-console \
wget locate librtmp1 lua-lpeg
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835342#76
sudo apt-get autoremove -y
sudo updatedb
# install Ruby rvm, ruby 2.3.0 w/ json patch
# @see https://github.com/rbenv/ruby-build/issues/834
gpg --keyserver hkp://keys.gnupg.net --recv-keys \
409B6B1796C275462A1703113804BB82D39DC0E3 2>&1
curl -sSL https://get.rvm.io | bash -s stable
# source /etc/profile.d/rvm.sh
# [[ -r ~/.bashrc ]] && . ~/.bashrc
echo "source $HOME_FOLDER/.rvm/scripts/rvm" >> $HOME_FOLDER/.bashrc
source $HOME_FOLDER/.rvm/scripts/rvm
rvm use 2.3.0 --default --install --fuzzy
# install gauntlt, from source
GAUNTLT_DIR=`pwd` # user current working directory, wherever you install Gauntlt
gem install bundler
bundle update
git submodule update --init --recursive --force
# install sslyze
if ! type "sslyze" > /dev/null 2>&1; then
cd $GAUNTLT_DIR/vendor/sslyze
pip install -r requirements.txt
sudo ln -s `pwd`/sslyze_cli.py /usr/bin/sslyze
fi
# install sqlmap
if ! type "sqlmap" > /dev/null 2>&1; then
cd $GAUNTLT_DIR/vendor/sqlmap
sudo ln -s `pwd`/sqlmap.py /usr/bin/sqlmap
fi
# install Go, Heartbleed
if ! type "Heartbleed" > /dev/null 2>&1; then
sudo apt-get install -y golang
export GOPATH=$HOME_FOLDER/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
cat << 'EOF' >> $HOME_FOLDER/.bashrc
# configure go pathways
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
EOF
go get github.com/FiloSottile/Heartbleed
fi
# install dirb
if ! type "dirb" > /dev/null 2>&1; then
cd $GAUNTLT_DIR/vendor
wget -q http://downloads.sourceforge.net/project/dirb/dirb/2.22/dirb222.tar.gz
tar -zxf dirb222.tar.gz
mv dirb222 dirb
chmod -R +x ./dirb
cd dirb
chown -R $(whoami) .
cd $GAUNTLT_DIR/vendor/dirb
bash ./configure
make
sudo ln -s `pwd`/dirb /usr/bin/dirb
sudo updatedb
fi
export DIRB_WORDLISTS=`locate dirb | grep "/dirb/wordlists$"`
# install Garmr, from source
if ! type "garmr" > /dev/null 2>&1; then
cd $GAUNTLT_DIR/vendor/Garmr
sudo mkdir -p /usr/local/lib/python2.7/dist-packages/
sudo python setup.py install
sudo updatedb
fi
# install Arachni, from a gem
if ! type "arachni" > /dev/null 2>&1; then
gem install arachni -v 1.0.6
gem install service_manager
sudo updatedb
fi
# start gruyere
cd $GAUNTLT_DIR/vendor/gruyere
bash ./manual_launch.sh
# set the environmental variables
export SSLYZE_PATH=`which sslyze`
export SQLMAP_PATH=`which sqlmap`
# save environmental variables to .bashrc
cat << EOF >> $HOME_FOLDER/.bashrc
# configure environmental variables for Gauntlt
export DIRB_WORDLISTS=`locate dirb | grep "/dirb/wordlists$"`
export SSLYZE_PATH=`which sslyze`
export SQLMAP_PATH=`which sqlmap`
EOF
# chown the environment
cd $GAUNTLT_DIR
sudo chown -R $USER_NAME ./