-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathinstall.sh
More file actions
342 lines (326 loc) · 11.9 KB
/
install.sh
File metadata and controls
342 lines (326 loc) · 11.9 KB
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
#!/bin/bash
RED='\033[1;91m'
BLUE='\033[1;94m'
GRAY='\033[90m'
RESET='\033[0m'
GREEN='\033[1;92m'
YELLOW='\033[1;33m'
banner() {
clear
echo -e "${BLUE}"
echo " ╔════════════════════════════════════════╗"
echo " ║ SARA v3.1.1 - Auto Installer ║"
echo " ║ Simple Android Ransomware Attack ║"
echo " ╚════════════════════════════════════════╝"
echo -e "${RESET}"
}
print_info() {
echo -e "${BLUE}[*]${RESET} $1"
}
print_success() {
echo -e "${GREEN}[✓]${RESET} $1"
}
print_error() {
echo -e "${RED}[✗]${RESET} $1"
}
print_warning() {
echo -e "${YELLOW}[!]${RESET} $1"
}
detect_os() {
if [ -n "$TERMUX_VERSION" ]; then
OS="termux"
elif [ -f /etc/os-release ]; then
. /etc/os-release
case "$ID" in
ubuntu|debian|kali|parrot)
OS="debian"
;;
arch|manjaro)
OS="arch"
;;
fedora|centos|rhel)
OS="redhat"
;;
*)
OS="unknown"
;;
esac
else
OS="unknown"
fi
print_info "Detected OS: ${GREEN}$OS${RESET}"
}
command_exists() {
command -v "$1" >/dev/null 2>&1
}
install_termux() {
print_info "Installing dependencies for Termux..."
print_info "Updating package list..."
pkg update -y || print_error "Failed to update packages"
pkg upgrade -y || print_warning "Some packages failed to upgrade"
print_info "Installing required packages..."
pkg install -y python python-pip openjdk-17 wget curl git || {
print_error "Failed to install base packages"
exit 1
}
if ! command_exists apktool; then
print_info "Installing apktool..."
pkg install -y apktool || {
print_warning "Package manager install failed, trying manual installation..."
wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -O $PREFIX/bin/apktool
wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.12.1.jar -O $PREFIX/bin/apktool.jar
chmod +x $PREFIX/bin/apktool
if command_exists apktool; then
print_success "Apktool installed manually"
else
print_error "Failed to install apktool"
exit 1
fi
}
else
print_success "Apktool already installed"
fi
print_info "Installing ImageMagick..."
pkg install -y imagemagick || print_warning "ImageMagick installation failed"
if ! command_exists msfconsole; then
print_warning "Metasploit not found"
read -p "Do you want to install Metasploit? (y/n): " install_msf
if [[ $install_msf == "y" || $install_msf == "Y" ]]; then
print_info "Installing Metasploit..."
pkg install -y metasploit || {
print_warning "Package install failed, trying from source..."
cd $HOME
git clone https://github.com/rapid7/metasploit-framework.git
cd metasploit-framework
gem install bundler
bundle install
print_success "Metasploit installed from source"
}
fi
else
print_success "Metasploit already installed"
fi
}
install_debian() {
print_info "Installing dependencies for Debian/Ubuntu..."
if [ "$EUID" -ne 0 ]; then
print_error "Please run as root or with sudo"
exit 1
fi
print_info "Updating package list..."
apt update || print_error "Failed to update packages"
print_info "Installing required packages..."
apt install -y python3 python3-pip openjdk-11-jdk wget curl git imagemagick || {
print_error "Failed to install base packages"
exit 1
}
if ! command_exists apktool; then
print_info "Installing apktool..."
apt install -y apktool 2>/dev/null || {
print_warning "Package manager install failed, trying manual installation..."
wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -O /usr/local/bin/apktool
wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.12.1.jar -O /usr/local/bin/apktool.jar
chmod +x /usr/local/bin/apktool
if command_exists apktool; then
print_success "Apktool installed manually"
else
print_error "Failed to install apktool"
exit 1
fi
}
else
print_success "Apktool already installed"
fi
if ! command_exists msfconsole; then
print_warning "Metasploit not found"
read -p "Do you want to install Metasploit? (y/n): " install_msf
if [[ $install_msf == "y" || $install_msf == "Y" ]]; then
print_info "Installing Metasploit..."
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall
chmod 755 msfinstall
./msfinstall
rm msfinstall
fi
else
print_success "Metasploit already installed"
fi
}
install_arch() {
print_info "Installing dependencies for Arch Linux..."
if [ "$EUID" -ne 0 ]; then
print_error "Please run as root or with sudo"
exit 1
fi
print_info "Updating package list..."
pacman -Sy || print_error "Failed to update packages"
print_info "Installing required packages..."
pacman -S --noconfirm python python-pip jdk11-openjdk wget curl git imagemagick || {
print_error "Failed to install base packages"
exit 1
}
if ! command_exists apktool; then
print_info "Installing apktool..."
pacman -S --noconfirm apktool 2>/dev/null || {
print_warning "Package manager install failed, trying manual installation..."
wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -O /usr/local/bin/apktool
wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.12.1.jar -O /usr/local/bin/apktool.jar
chmod +x /usr/local/bin/apktool
if command_exists apktool; then
print_success "Apktool installed manually"
else
print_error "Failed to install apktool"
exit 1
fi
}
else
print_success "Apktool already installed"
fi
if ! command_exists msfconsole; then
print_warning "Metasploit not found"
read -p "Do you want to install Metasploit from AUR? (y/n): " install_msf
if [[ $install_msf == "y" || $install_msf == "Y" ]]; then
print_info "Installing Metasploit..."
pacman -S --noconfirm metasploit
fi
else
print_success "Metasploit already installed"
fi
}
install_python_deps() {
print_info "Installing Python dependencies..."
if [ -f "requirements.txt" ]; then
if [ "$OS" = "termux" ]; then
pip install -r requirements.txt --no-cache-dir || {
print_error "Failed to install Python packages"
exit 1
}
else
if command_exists pip3; then
pip3 install -r requirements.txt --break-system-packages 2>/dev/null || \
pip3 install -r requirements.txt || {
print_error "Failed to install Python packages"
exit 1
}
else
print_error "pip3 not found"
exit 1
fi
fi
print_success "Python dependencies installed"
else
print_error "requirements.txt not found!"
exit 1
fi
}
setup_directories() {
print_info "Setting up directories..."
mkdir -p data/bin data/key data/tmp
if [ ! -f "data/bin/ubersigner.jar" ]; then
print_warning "uber-apk-signer not found in data/bin/"
print_info "Please download uber-apk-signer.jar and place it in data/bin/ as ubersigner.jar"
print_info "Download from: https://github.com/patrickfav/uber-apk-signer/releases"
fi
if [ ! -f "data/key/debug.jks" ]; then
print_warning "Debug keystore not found in data/key/"
print_info "Generating debug keystore..."
if command_exists keytool; then
keytool -genkey -v -keystore data/key/debug.jks \
-storepass debugging -alias debugging -keypass debugging \
-keyalg RSA -keysize 2048 -validity 10000 \
-dname "CN=Debug, OU=Debug, O=Debug, L=Debug, S=Debug, C=US" 2>/dev/null
if [ -f "data/key/debug.jks" ]; then
print_success "Debug keystore generated"
else
print_warning "Failed to generate keystore"
fi
else
print_warning "keytool not found, cannot generate keystore"
fi
fi
print_success "Directories setup complete"
}
verify_installation() {
print_info "Verifying installation..."
local errors=0
if command_exists python3 || command_exists python; then
print_success "Python installed"
else
print_error "Python not found"
((errors++))
fi
if command_exists java; then
print_success "Java installed"
else
print_error "Java not found"
((errors++))
fi
if command_exists apktool; then
print_success "Apktool installed"
else
print_error "Apktool not found"
((errors++))
fi
if command_exists convert || command_exists mogrify; then
print_success "ImageMagick installed"
else
print_warning "ImageMagick not found (optional)"
fi
if command_exists msfconsole; then
print_success "Metasploit installed"
else
print_warning "Metasploit not found (optional for trojan features)"
fi
if [ $errors -eq 0 ]; then
print_success "All required dependencies installed!"
return 0
else
print_error "Installation incomplete. $errors error(s) found."
return 1
fi
}
main() {
banner
print_info "Starting SARA v3.1 installation..."
echo ""
detect_os
echo ""
case "$OS" in
termux)
install_termux
;;
debian)
install_debian
;;
arch)
install_arch
;;
*)
print_error "Unsupported OS: $OS"
print_info "Supported: Termux, Debian/Ubuntu, Arch Linux"
exit 1
;;
esac
echo ""
setup_directories
echo ""
install_python_deps
echo ""
verify_installation
echo ""
if [ $? -eq 0 ]; then
echo -e "${GREEN}╔════════════════════════════════════════════╗${RESET}"
echo -e "${GREEN}║ Installation completed successfully! ║${RESET}"
echo -e "${GREEN}╚════════════════════════════════════════════╝${RESET}"
echo ""
print_info "Run the tool with: ${GREEN}python sara.py${RESET}"
echo ""
print_warning "Remember: This tool is for educational purposes only!"
else
echo -e "${RED}╔════════════════════════════════════════════╗${RESET}"
echo -e "${RED}║ Installation completed with errors ║${RESET}"
echo -e "${RED}╚════════════════════════════════════════════╝${RESET}"
echo ""
print_info "Please check the errors above and try again"
fi
}
main