-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
361 lines (311 loc) · 8.24 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# Linux OSINT setup
# v2.0.0
# Currently building for Ubuntu or Kali - others by request
# (C) 2022 Richard Dawson
## Variables
# Configuration Variables
BIN_PATH=${HOME}/Downloads/Programs
DOC_PATH=${HOME}/Documents/osint
JUP_PATH=/usr/share/jupyter
BRANCH="main" # Default to main branch
DATE_VAR=$(date +'%y%m%d-%H%M') # Today's Date and time
LOG_FILE="${DATE_VAR}_osint_install.log" # Log File name
## Functions
check_root() {
# Check to ensure script is not run as root
if [[ "${UID}" -eq 0 ]]; then
printf "\nThis script should not be run as root.\n\n" >&2
usage
fi
}
echo_out() {
# Get input from stdin OR $1
local MESSAGE=${1:-$(</dev/stdin)}
# Check to see if we need a \n
if [[ "${2}" == 'n' ]]; then
:
else
MESSAGE="${MESSAGE}\n"
fi
# Decide if we output to console and log or just log
if [[ "${VERBOSE}" = 'true' ]]; then
printf "${MESSAGE}" | tee /dev/fd/3
else
printf "${MESSAGE}" >> ${LOG_FILE}
fi
}
# Install functions for non-repository tools
install_carbon14 () {
cd $BIN_PATH
git clone https://github.com/rdbh/Carbon14.git
cd ~/Downloads/Programs/Carbon14
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/Carbon14
}
install_elasticsearch () {
cd $BIN_PATH
git clone https://github.com/AmIJesse/Elasticsearch-Crawler.git
mkdir -p $DOC_PATH/Elasticsearch
}
install_email2phone () {
cd $BIN_PATH
git clone https://github.com/rdbh/email2phonenumber.git
cd ~/Downloads/Programs/email2phonenumber
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/email2phonenumber
}
install_eyewitness () {
cd $BIN_PATH
git clone https://github.com/rdbh/EyeWitness.git
cd ~/Downloads/Programs/EyeWitness
cd Python/setup
sudo -H ./setup.sh
mkdir -p $DOC_PATH/EyeWitness
}
install_google_earth () {
cd $BIN_PATH
mkdir google-earth && cd google-earth
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
wget https://dl.google.com/dl/earth/client/current/google-earth-stable_current_amd64.deb
sudo dpkg -i google-earth-stable*.deb
cd $BIN_PATH
rm -rf google-earth
}
install_osintgram () {
cd $BIN_PATH
git clone https://github.com/rdbh/Osintgram.git
cd ~/Downloads/Programs/Osintgram
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/osintgram
}
install_photon () {
cd $BIN_PATH
git pull https://github.com/rdbh/Photon.git
cd ~/Downloads/Programs/Photon
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/Photon
}
install_recon_ng () {
cd $BIN_PATH
git clone https://github.com/lanmaster53/recon-ng.git
cd ~/Downloads/Programs/recon-ng
python3 -m pip install -r REQUIREMENTS
mkdir -p $DOC_PATH/recon-ng
}
install_reddit_downloader () {
cd $BIN_PATH
git clone https://github.com/rdbh/bulk-downloader-for-reddit.git
cd ~/Downloads/Programs/bulk-downloader-for-reddit
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/reddit-downloader
}
install_sherlock () {
cd $BIN_PATH
git clone https://github.com/sherlock-project/sherlock.git
cd ~/Downloads/Programs/sherlock
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/sherlock
}
install_spiderfoot () {
sudo apt-get -y install spiderfoot
sudo mkdir -p /usr/share/spiderfoot/correlations
touch $HOME/.spiderfoot/passwd
}
install_sublist3r (){
cd $BIN_PATH
git clone https://github.com/rdbh/Sublist3r.git
cd ~/Downloads/Programs/Sublist3r
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/Sublist3r
}
install_theharvester () {
cd $BIN_PATH
git clone https://github.com/rdbh/theHarvester.git
cd ~/Downloads/Programs/theHarvester
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/theHarvester
}
install_whatsmyname () {
cd $BIN_PATH
git clone https://github.com/WebBreacher/WhatsMyName.git
cd ~/Downloads/Programs/WhatsMyName
python3 -m pip install -r requirements.txt
mkdir -p $DOC_PATH/WhatsMyName
}
pause_for () {
COUNT=${2}
printf "${1}" | tee /dev/fd/3
while [ ${COUNT} -gt 0 ]; do
printf "${COUNT}" | tee /dev/fd/3
for (( i=0; i<=${#COUNT}; i++ )); do
printf "\b" | tee /dev/fd/3
done
done
}
python_install () {
# Used to install python tools in the tools directory
cd $BIN_PATH
mkdir ${1}
cd ${1}
python3 -m pip install "${1}" -U
}
usage() {
echo "Usage: ${0} [-cfh] [-p VPN_name] " >&2
echo "Sets up Kali with useful OSINT apps."
#echo "Do not run as root."
echo
echo "-c Check internet connection before starting."
echo "-f Install Flatpak."
echo "-h Help (this list)."
echo "-p VPN_NAME Install VPN client(s) or 'all'."
echo "-v Verbose mode."
exit 1
}
## MAIN
# Create a log file with current date and time
touch ${LOG_FILE}
# Provide usage statement if no parameters
while getopts dfhv OPTION; do
case ${OPTION} in
d)
# Set installation to dev branch
BRANCH="dev"
echo_out "Branch set to dev branch"
;;
f)
# Flag for flatpak installation (not in use currently)
PACKAGE="flatpak"
echo_out "Flatpak use set to true"
install_flatpak
;;
h)
usage
;;
v)
# Verbose is first so any other elements will echo as well
VERBOSE='true'
echo_out "Verbose mode on."
;;
?)
echo "invalid option" >&2
usage
;;
esac
done
# Redirect outputs
exec 3>&1 1>>${LOG_FILE} 2>&1
# Get OS distribution
if [[ "${1}" == "Kali" ]]; then
OS_NAME="Kali"
elif [[ "${1}" == "Ubuntu" ]]; then
OS_NAME="Ubuntu"
else
OS_NAME=$(lsb_release -a | grep '^Distributor' | cut -c 17-)
fi
printf "Installing for ${OS_NAME}" | tee /dev/fd/3
printf "Ctrl-C to abort" | tee /dev/fd/3
pause_for "Ctrl-C to abort" 9
# Create config file
touch ~/osint.config
echo DOC_PATH=$DOC_PATH > osint.config
echo BIN_PATH=$BIN_PATH >> osint.config
echo JUP_PATH=$JUP_PATH >> osint.config
# Create program paths
mkdir -p "${BIN_PATH}"
# Bring OS up to date
sudo apt-get update
sudo apt-get -y dist-upgrade
sudo apt -y --fix-broken install
sudo snap refresh
# Install git
sudo apt-get -y install git
# Install Docker
sudo apt install -y docker.io
sudo apt install -y docker-compose
sudo systemctl enable docker --now
sudo usermod -aG docker $USER
# Add local installations to path
PATH=$HOME/.local/bin:$PATH
echo export PATH=$HOME/.local/bin:'$PATH' >> ~/.bashrc
echo export PATH=$HOME/.local/bin:'$PATH' >> ~/.zshenv
hash -r
# Python installation and package management
sudo apt-get -y install python3-pip
sudo apt-get -y install pipenv
case $OS_NAME in
Kali)
# Kali Distro installations
sudo apt-get -y install kali-tools-information-gathering
# Tools in Kali repository
sudo apt-get -y install instaloader
sudo apt-get -y install internetarchive
sudo apt-get -y install photon
sudo apt-get -y install sherlock
install_spiderfoot
sudo apt-get -y install youtube-dl
#non-repository tools
install_carbon14
install_elasticsearch
install_email2phone
install_google_earth
install_reddit_downloader
# Python tools
python_install holehe
python_install instalooter
python_install socialscan
python_install webscreenshot
python-install youtube-tool
;;
Ubuntu)
#non-repository tools
install_carbon14
install_elasticsearch
install_email2phone
install_google_earth
install_reddit_downloader
# Python tools
python_install holehe
python_install instaloader
python_install instalooter
python_install internetarchive
python_install socialscan
python_install webscreenshot
python-install youtube-tool
;;
*)
echo "Unrecognized OS: ${OS_NAME}"
;;
esac
# Clone the osint directory
cd $HOME/Documents
git clone https://github.com/rdbh/osint.git
cd osint/tools
sudo chmod 755 *.sh
# Create output directories
mkdir -p $DOC_PATH/gallery-dl
mkdir -p $DOC_PATH/instalooter
mkdir -p $DOC_PATH/metagoofil
mkdir -p $DOC_PATH/reddit
mkdir -p $DOC_PATH/waybackpy
# Python PyPi installations
python3 -m pip install nested-lookup -U
python3 -m pip install redditsfinder -U
python3 -m pip install streamlink -U
python3 -m pip install waybackpy -U
cd "${HOME}"/osint/install
sudo jupyter-install.sh
rm jupyter-install.sh
# Install PeTeReport
cd $BIN_PATH
git clone https://github.com/radawson/petereport
cd petereport
#export DOCKER_BUILDKIT=1
sudo docker-compose up --build
sudo apt-get -y autoremove
sudo apt-get -y clean
echo
echo Installation Complete!
echo
echo "Jupyter notebook will start next"
read -p "Press [Enter] to continue or CTRL-C to abort" THROWAWAY
~/Documents/osint/tools/jupyter.sh