-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitialize.sh
executable file
·81 lines (73 loc) · 2.67 KB
/
initialize.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
#!/bin/bash
#------------------------------------------------------------------------------
# get updated
#------------------------------------------------------------------------------
apt update
apt -y full-upgrade
apt autoremove
apt-get install -y python git sudo locate vim pip tcpdump net-tools
#------------------------------------------------------------------------------
# powershell
#------------------------------------------------------------------------------
# dependencies
apt -y install curl gnupg apt-transport-https
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/powershell.list
apt update
# get powershell
apt -y install powershell
#------------------------------------------------------------------------------
# Python things
#------------------------------------------------------------------------------
pip install --upgrade pip
# OT libraries
pip install cpppo
pip install configparser
pip install git+https://github.com/dmroeder/pylogix
pip install pycom
# General libraries used by other tools
pip install pipenv
pip install python-ldap
#------------------------------------------------------------------------------
# Metasploit
#------------------------------------------------------------------------------
# get postgres up and running for metasploit
sudo update-rc.d postgresql enable
service postgresql restart
msfdb delete
msfdb init
#------------------------------------------------------------------------------
# Git helper
#------------------------------------------------------------------------------
BASE="~/Tools"
mkdir -p "$BASE"
gogitit(){
# $1 = git repo to pull
# $2 = directory to put it into locally
GITDIR="$(echo $(basename $1) | sed -e 's/\.git//g')"
if [ "$2" = "" ]; then
DIR="$BASE/$GITDIR"
else
DIR="$BASE/$2/$GITDIR"
fi
if [ ! -d "$DIR" ]; then
git clone "$1" "$DIR"
else
(cd "$DIR" && git pull;)
fi
}
#------------------------------------------------------------------------------
# PTF Repo
#------------------------------------------------------------------------------
gogitit "https://github.com/trustedsec/ptf.git" "Setup"
# Move over custom ptf files
cp -r ptf "$BASE/Setup/ptf/config/ptf"
(cd "$BASE/Setup/ptf/" && echo -en "use modules/install_update_all\nyes\n" | python ptf)
echo
echo "** DONE **"
echo "PTF is built and ready to use."
#------------------------------------------------------------------------------
# Terminal History
#------------------------------------------------------------------------------
cat terminal-history.sh >> ~/.bashrc
cat termianl-history.sh >> ~/.zshrc