-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·187 lines (159 loc) · 5.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
#!/bin/bash
# TAPE Installation Script
# Chronos Security
# https://github.com/ChronosPK/TAPE
# Exit on error
set -e
# Colors for output
RED="\033[0;31m"
GREEN="\033[0;32m"
BLUE="\033[0;34m"
YELLOW="\033[1;33m"
RESET="\033[0m"
# Banner
echo -e "${BLUE}TAPE Installation Script${RESET}"
echo -e "${GREEN}Installing necessary tools and dependencies...${RESET}"
# -----------------------------
# Define Tools and Dependencies
# -----------------------------
# Networking and enumeration tools
CORE_TOOLS=(
"nmap" # Network mapper
"hydra" # Brute-force tool
"curl" # Data transfer tool
"wget" # File retriever
"ftp" # FTP client
"netcat" # Networking utility
"enum4linux" # SMB enumeration tool
"dnsrecon" # DNS enumeration tool
"dnsutils" # DNS utilities
"smbclient" # SMB client
"masscan" # Fast port scanner
"rustscan" # Efficient port scanner
)
# Web fuzzing and exploitation tools
WEB_TOOLS=(
"gobuster" # Directory brute-forcing
"wfuzz" # Web fuzzing tool
"ffuf" # Fast web fuzzer
"feroxbuster" # Directory brute-forcing
)
# Additional utilities
EXTRA_TOOLS=(
"tmux" # Terminal multiplexer
"python3" # Python 3
"python3-pip" # Python 3 package manager
"build-essential" # Compilers and utilities
"libssl-dev" # SSL libraries
"seclists" # Wordlists
"ldap-utils" # LDAP utilities
)
# Metasploit dependencies
METASPLOIT=(
"postgresql" # Database for Metasploit
"ruby" # Required for Metasploit
"libsqlite3-dev" # SQLite3 libraries
)
# All tools combined
ALL_TOOLS=("${CORE_TOOLS[@]}" "${WEB_TOOLS[@]}" "${EXTRA_TOOLS[@]}" "${METASPLOIT[@]}")
# -----------------------------
# Installation Functions
# -----------------------------
# Update package lists
function update_system {
echo -e "${BLUE}[1/6] Updating system packages...${RESET}"
sudo apt update -y
}
# Install tools
function install_tools {
echo -e "${BLUE}[2/6] Installing tools and dependencies...${RESET}"
for tool in "${ALL_TOOLS[@]}"; do
if ! command -v $tool &>/dev/null; then
echo -e "${GREEN}Installing: $tool${RESET}"
sudo apt install -y "$tool"
else
echo -e "${GREEN}$tool is already installed.${RESET}"
fi
done
}
# Set up Metasploit
function setup_metasploit {
echo -e "${BLUE}[3/6] Setting up Metasploit Framework...${RESET}"
if ! command -v msfconsole &>/dev/null; then
curl https://raw.githubusercontent.com/rapid7/metasploit-framework/master/msfupdate | sudo bash
else
echo -e "${GREEN}Metasploit is already installed.${RESET}"
fi
}
# Install Python tools
function setup_python {
echo -e "${BLUE}[4/6] Setting up Python tools...${RESET}"
# Check for virtual environment support
if ! python3 -m ensurepip --upgrade; then
echo -e "${YELLOW}Installing virtual environment tools...${RESET}"
sudo apt install -y python3-venv
fi
# Create a virtual environment
if [ ! -d "tape_env" ]; then
echo -e "${BLUE}Creating a virtual environment for TAPE...${RESET}"
python3 -m venv tape_env
fi
# Activate the virtual environment
echo -e "${GREEN}Activating virtual environment...${RESET}"
source tape_env/bin/activate
# Install required Python packages
python_packages=("ldap3" "dnspython" "impacket" "requests")
for package in "${python_packages[@]}"; do
echo -e "${GREEN}Installing Python package: $package${RESET}"
pip install "$package"
done
echo -e "${GREEN}Python tools setup completed.${RESET}"
deactivate
}
# Check for updates in the repository
function update_repository {
echo -e "${BLUE}[5/6] Checking for updates in the repository...${RESET}"
if git rev-parse --git-dir > /dev/null 2>&1; then
git fetch origin
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse origin/main)
if [ "$LOCAL" != "$REMOTE" ]; then
echo -e "${YELLOW}Updates found. Pulling latest changes...${RESET}"
git pull
else
echo -e "${GREEN}Repository is up to date.${RESET}"
fi
else
echo -e "${RED}Not a git repository. Please clone the repository from GitHub.${RESET}"
exit 1
fi
}
# Add TAPE to system PATH
function setup_tape {
echo -e "${BLUE}[6/6] Adding TAPE to system PATH...${RESET}"
SCRIPT_SOURCE="tape.py"
SCRIPT_DEST="/usr/local/bin/tape"
# Make the script executable
chmod +x "$SCRIPT_SOURCE"
# Copy the script to /usr/local/bin
if [ -f "$SCRIPT_DEST" ]; then
echo -e "${YELLOW}Updating existing TAPE installation...${RESET}"
sudo cp "$SCRIPT_SOURCE" "$SCRIPT_DEST"
else
sudo cp "$SCRIPT_SOURCE" "$SCRIPT_DEST"
fi
# Ensure the script is executable
sudo chmod +x "$SCRIPT_DEST"
echo -e "${GREEN}TAPE is now accessible globally as 'tape'.${RESET}"
}
# -----------------------------
# Execution
# -----------------------------
update_system
install_tools
setup_metasploit
setup_python
update_repository
setup_tape
echo -e "${GREEN}Installation completed successfully!${RESET}"
echo -e "${BLUE}You are now ready to use TAPE.${RESET}"