Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
1N3
GitHub Repository: 1N3/Sn1per
Path: blob/master/install.sh
4032 views
1
#!/bin/bash
2
# Cross-platform install script for Sn1per CE
3
# Supports: Debian/Ubuntu, RHEL/CentOS/Fedora/Amazon Linux, Arch Linux, macOS
4
# Created by @xer0dayz - https://sn1persecurity.com
5
# Optimized by D4rth R3v4n - https://github.com/gbiagomba
6
# Optimized for multi-distro support
7
8
set -e # Exit on error
9
10
# Color definitions
11
OKBLUE='\033[94m'
12
OKRED='\033[91m'
13
OKGREEN='\033[92m'
14
OKORANGE='\033[93m'
15
RESET='\e[0m'
16
17
# Banner
18
echo -e "$OKRED ____ $RESET"
19
echo -e "$OKRED _________ / _/___ ___ _____$RESET"
20
echo -e "$OKRED / ___/ __ \ / // __ \/ _ \/ ___/$RESET"
21
echo -e "$OKRED (__ ) / / // // /_/ / __/ / $RESET"
22
echo -e "$OKRED /____/_/ /_/___/ .___/\___/_/ $RESET"
23
echo -e "$OKRED /_/ $RESET"
24
echo -e "$RESET"
25
echo -e "$OKORANGE + -- --=[ https://sn1persecurity.com $RESET"
26
echo -e "$OKORANGE + -- --=[ Sn1per CE by @xer0dayz $RESET"
27
echo -e "$OKORANGE + -- --=[ Multi-distro installer $RESET"
28
echo ""
29
30
# Installation directories
31
INSTALL_DIR=/usr/share/sniper
32
LOOT_DIR=/usr/share/sniper/loot
33
PLUGINS_DIR=/usr/share/sniper/plugins
34
GO_DIR=~/go/bin
35
36
# Detect OS and distribution
37
detect_os() {
38
if [[ "$OSTYPE" == "darwin"* ]]; then
39
OS="macos"
40
echo -e "$OKBLUE[*]$RESET Detected macOS"
41
elif [[ -f /etc/os-release ]]; then
42
. /etc/os-release
43
case "$ID" in
44
ubuntu|debian|kali|parrot)
45
OS="debian"
46
PKG_MANAGER="apt"
47
echo -e "$OKBLUE[*]$RESET Detected Debian-based system: $PRETTY_NAME"
48
;;
49
rhel|centos|fedora|rocky|alma|amzn)
50
OS="rhel"
51
if command -v dnf &> /dev/null; then
52
PKG_MANAGER="dnf"
53
else
54
PKG_MANAGER="yum"
55
fi
56
echo -e "$OKBLUE[*]$RESET Detected RHEL-based system: $PRETTY_NAME"
57
;;
58
arch|manjaro|endeavouros)
59
OS="arch"
60
PKG_MANAGER="pacman"
61
echo -e "$OKBLUE[*]$RESET Detected Arch-based system: $PRETTY_NAME"
62
;;
63
opensuse*|sles)
64
OS="opensuse"
65
PKG_MANAGER="zypper"
66
echo -e "$OKBLUE[*]$RESET Detected openSUSE-based system: $PRETTY_NAME"
67
;;
68
*)
69
echo -e "$OKRED[!]$RESET Unsupported distribution: $ID"
70
echo -e "$OKRED[!]$RESET Supported: Debian/Ubuntu, RHEL/CentOS/Fedora, Arch Linux, macOS"
71
exit 1
72
;;
73
esac
74
else
75
echo -e "$OKRED[!]$RESET Unable to detect operating system"
76
exit 1
77
fi
78
}
79
80
# Check if running as root (not needed for macOS with brew)
81
check_root() {
82
if [[ "$OS" != "macos" ]] && [[ $EUID -ne 0 ]]; then
83
echo -e "$OKRED[!]$RESET This script must be run as root on Linux systems"
84
echo -e "$OKRED[!]$RESET Please run: sudo $0"
85
exit 1
86
fi
87
}
88
89
# Package manager abstraction
90
pkg_update() {
91
echo -e "$OKBLUE[*]$RESET Updating package repositories..."
92
case "$OS" in
93
debian)
94
apt update -y
95
;;
96
rhel)
97
$PKG_MANAGER makecache -y || $PKG_MANAGER makecache
98
;;
99
arch)
100
pacman -Sy --noconfirm
101
;;
102
opensuse)
103
zypper refresh -y
104
;;
105
macos)
106
brew update
107
;;
108
esac
109
}
110
111
pkg_install() {
112
local packages=("$@")
113
echo -e "$OKBLUE[*]$RESET Installing: ${packages[*]}"
114
115
case "$OS" in
116
debian)
117
apt install -y "${packages[@]}" 2>/dev/null || true
118
;;
119
rhel)
120
$PKG_MANAGER install -y "${packages[@]}" 2>/dev/null || true
121
;;
122
arch)
123
pacman -S --noconfirm --needed "${packages[@]}" 2>/dev/null || true
124
;;
125
opensuse)
126
zypper install -y "${packages[@]}" 2>/dev/null || true
127
;;
128
macos)
129
for pkg in "${packages[@]}"; do
130
brew install "$pkg" 2>/dev/null || brew upgrade "$pkg" 2>/dev/null || true
131
done
132
;;
133
esac
134
}
135
136
# Map package names across distributions
137
get_package_name() {
138
local generic_name=$1
139
140
case "$OS" in
141
debian)
142
case "$generic_name" in
143
python) echo "python3" ;;
144
pip) echo "python3-pip" ;;
145
ruby-dev) echo "ruby-dev" ;;
146
*) echo "$generic_name" ;;
147
esac
148
;;
149
rhel)
150
case "$generic_name" in
151
python) echo "python3" ;;
152
pip) echo "python3-pip" ;;
153
ruby-dev) echo "ruby-devel" ;;
154
libssl-dev) echo "openssl-devel" ;;
155
build-essential) echo "gcc gcc-c++ make" ;;
156
*) echo "$generic_name" ;;
157
esac
158
;;
159
arch)
160
case "$generic_name" in
161
python) echo "python" ;;
162
pip) echo "python-pip" ;;
163
ruby-dev) echo "ruby" ;;
164
libssl-dev) echo "openssl" ;;
165
build-essential) echo "base-devel" ;;
166
*) echo "$generic_name" ;;
167
esac
168
;;
169
macos)
170
case "$generic_name" in
171
python) echo "python@3" ;;
172
pip) echo "" ;; # comes with python
173
ruby-dev) echo "ruby" ;;
174
libssl-dev) echo "openssl" ;;
175
build-essential) echo "" ;; # xcode tools
176
*) echo "$generic_name" ;;
177
esac
178
;;
179
esac
180
}
181
182
# Install build tools
183
install_build_tools() {
184
echo -e "$OKBLUE[*]$RESET Installing build tools..."
185
186
case "$OS" in
187
debian)
188
pkg_install build-essential git curl wget
189
;;
190
rhel)
191
pkg_install gcc gcc-c++ make git curl wget
192
if [[ "$PKG_MANAGER" == "dnf" ]]; then
193
$PKG_MANAGER groupinstall -y "Development Tools" 2>/dev/null || true
194
else
195
$PKG_MANAGER groupinstall -y "Development Tools" 2>/dev/null || true
196
fi
197
;;
198
arch)
199
pkg_install base-devel git curl wget
200
;;
201
opensuse)
202
pkg_install -t pattern devel_basis
203
pkg_install git curl wget
204
;;
205
macos)
206
# Check for Xcode Command Line Tools
207
if ! xcode-select -p &>/dev/null; then
208
echo -e "$OKBLUE[*]$RESET Installing Xcode Command Line Tools..."
209
xcode-select --install 2>/dev/null || true
210
fi
211
pkg_install git curl wget
212
;;
213
esac
214
}
215
216
# Install base dependencies
217
install_base_dependencies() {
218
echo -e "$OKBLUE[*]$RESET Installing base dependencies..."
219
220
local base_pkgs=()
221
222
case "$OS" in
223
debian)
224
base_pkgs=(
225
sudo gpg curl wget git
226
nmap nikto sqlmap hydra
227
whois dnsutils dnsrecon
228
ruby rubygems ruby-dev
229
python3 python3-pip python3-paramiko
230
golang
231
nodejs npm
232
php php-curl
233
dos2unix aha jq xmlstarlet
234
libxml2-utils xsltproc
235
net-tools iputils-ping
236
nfs-common rpcbind
237
nbtscan enum4linux
238
whatweb wafw00f sslscan
239
xdg-utils xvfb
240
p7zip-full
241
libssl-dev
242
)
243
244
# Optional packages
245
pkg_install theharvester 2>/dev/null || true
246
pkg_install urlcrazy 2>/dev/null || true
247
248
# Install chromium
249
if [[ "$ID" == "ubuntu" ]]; then
250
snap install chromium 2>/dev/null || apt install -y chromium-browser 2>/dev/null || true
251
else
252
pkg_install chromium 2>/dev/null || pkg_install chromium-browser 2>/dev/null || true
253
fi
254
;;
255
256
rhel)
257
# Enable EPEL for RHEL-based systems
258
if [[ "$ID" == "rhel" ]] || [[ "$ID" == "centos" ]] || [[ "$ID" == "rocky" ]] || [[ "$ID" == "alma" ]]; then
259
$PKG_MANAGER install -y epel-release 2>/dev/null || true
260
fi
261
262
base_pkgs=(
263
sudo git curl wget
264
nmap
265
whois bind-utils
266
ruby ruby-devel rubygems
267
python3 python3-pip
268
golang
269
nodejs npm
270
php php-curl
271
jq
272
libxml2 libxslt
273
net-tools iputils
274
rpcbind
275
openssl openssl-devel
276
p7zip p7zip-plugins
277
xorg-x11-server-Xvfb
278
)
279
280
# Try to install additional tools (may not be available)
281
pkg_install nikto sqlmap hydra 2>/dev/null || true
282
;;
283
284
arch)
285
base_pkgs=(
286
sudo git curl wget
287
nmap nikto sqlmap hydra
288
whois dnsutils
289
ruby rubygems
290
python python-pip python-paramiko
291
go
292
nodejs npm
293
php
294
dos2unix jq xmlstarlet
295
libxml2 libxslt
296
net-tools iputils
297
nfs-utils rpcbind
298
sslscan
299
xorg-xauth xorg-server-xvfb
300
p7zip
301
openssl
302
)
303
;;
304
305
macos)
306
base_pkgs=(
307
git curl wget
308
nmap
309
ruby
310
python@3
311
go
312
node
313
php
314
jq
315
libxml2 libxslt
316
p7zip
317
openssl
318
)
319
320
# Some tools may need cask
321
brew install --cask chromium 2>/dev/null || true
322
;;
323
esac
324
325
pkg_install "${base_pkgs[@]}"
326
}
327
328
# Setup Python environment
329
setup_python() {
330
echo -e "$OKBLUE[*]$RESET Setting up Python environment..."
331
332
# Upgrade pip
333
python3 -m pip install --upgrade pip --break-system-packages 2>/dev/null || \
334
python3 -m pip install --upgrade pip 2>/dev/null || true
335
336
# Install Python packages
337
local py_packages=(
338
dnspython
339
colorama
340
tldextract
341
urllib3
342
ipaddress
343
requests
344
h8mail
345
webtech
346
)
347
348
for pkg in "${py_packages[@]}"; do
349
pip3 install "$pkg" --break-system-packages 2>/dev/null || \
350
pip3 install "$pkg" 2>/dev/null || true
351
done
352
}
353
354
# Setup Ruby environment
355
setup_ruby() {
356
echo -e "$OKBLUE[*]$RESET Setting up Ruby environment..."
357
358
local ruby_gems=(
359
rake
360
ruby-nmap
361
net-http-persistent
362
mechanize
363
text-table
364
public_suffix
365
)
366
367
for gem in "${ruby_gems[@]}"; do
368
gem install "$gem" 2>/dev/null || true
369
done
370
371
# Reconfigure ruby (Debian-specific)
372
if [[ "$OS" == "debian" ]]; then
373
dpkg-reconfigure ruby 2>/dev/null || true
374
fi
375
}
376
377
# Setup Go environment
378
setup_go() {
379
echo -e "$OKBLUE[*]$RESET Setting up Go environment..."
380
381
# Ensure Go is in PATH
382
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
383
export GOPATH=$HOME/go
384
385
# Create Go bin directory
386
mkdir -p "$GO_DIR" 2>/dev/null || true
387
388
# Update Go (if needed)
389
go version 2>/dev/null || {
390
echo -e "$OKRED[!]$RESET Go is not properly installed"
391
return 1
392
}
393
}
394
395
# Install Metasploit
396
install_metasploit() {
397
echo -e "$OKBLUE[*]$RESET Installing Metasploit Framework..."
398
399
case "$OS" in
400
debian|rhel)
401
# Use official installer
402
if ! command -v msfconsole &>/dev/null; then
403
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > /tmp/msfinstall
404
chmod 755 /tmp/msfinstall
405
/tmp/msfinstall 2>/dev/null || echo -e "$OKORANGE[!]$RESET Metasploit installation failed (optional)"
406
rm -f /tmp/msfinstall
407
fi
408
;;
409
arch)
410
pkg_install metasploit 2>/dev/null || true
411
;;
412
macos)
413
brew install metasploit 2>/dev/null || true
414
;;
415
esac
416
417
# Initialize database
418
if command -v msfdb &>/dev/null; then
419
msfdb init 2>/dev/null || true
420
fi
421
}
422
423
# Create directory structure
424
create_directories() {
425
echo -e "$OKBLUE[*]$RESET Creating directory structure..."
426
427
local dirs=(
428
"$INSTALL_DIR"
429
"$LOOT_DIR"
430
"$LOOT_DIR/domains"
431
"$LOOT_DIR/screenshots"
432
"$LOOT_DIR/nmap"
433
"$LOOT_DIR/reports"
434
"$LOOT_DIR/output"
435
"$LOOT_DIR/osint"
436
"$LOOT_DIR/workspaces"
437
"$PLUGINS_DIR"
438
"$GO_DIR"
439
)
440
441
for dir in "${dirs[@]}"; do
442
mkdir -p "$dir" 2>/dev/null || true
443
done
444
445
# Set permissions
446
if [[ "$OS" != "macos" ]]; then
447
chmod 755 -Rf "$INSTALL_DIR" 2>/dev/null || true
448
chown -R root:root "$INSTALL_DIR" 2>/dev/null || true
449
fi
450
}
451
452
# Install Sn1per files
453
install_sniper_files() {
454
echo -e "$OKBLUE[*]$RESET Installing Sn1per files..."
455
456
# Copy all files to install directory
457
cp -Rf ./* "$INSTALL_DIR/" 2>/dev/null || true
458
459
# Make main script executable
460
chmod +x "$INSTALL_DIR/sniper" 2>/dev/null || true
461
}
462
463
# Install Go-based tools
464
install_go_tools() {
465
echo -e "$OKBLUE[*]$RESET Installing Go-based tools..."
466
467
cd "$GO_DIR" || return
468
469
local go_tools=(
470
"github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest:nuclei"
471
"github.com/haccer/subjack@latest:subjack"
472
"github.com/Ice3man543/SubOver@latest:subover"
473
"github.com/theblackturtle/fprobe@latest:fprobe"
474
"github.com/harleo/asnip@latest:asnip"
475
"github.com/lc/gau@latest:gau"
476
"github.com/projectdiscovery/httpx@latest:httpx"
477
"github.com/ffuf/ffuf@latest:ffuf"
478
"github.com/gwen001/github-endpoints@latest:github-endpoints"
479
"github.com/d3mondev/puredns/v2@latest:puredns"
480
"github.com/OWASP/Amass/v3/...@master:amass"
481
"github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest:subfinder"
482
"github.com/1N3/dirdar@latest:dirdar"
483
)
484
485
for tool_info in "${go_tools[@]}"; do
486
IFS=':' read -r tool_path tool_name <<< "$tool_info"
487
echo -e "$OKBLUE[*]$RESET Installing $tool_name..."
488
489
GO111MODULE=on go install -v "$tool_path" 2>/dev/null || true
490
491
# Create symlink
492
if [[ -f "$HOME/go/bin/$tool_name" ]]; then
493
ln -fs "$HOME/go/bin/$tool_name" /usr/local/bin/"$tool_name" 2>/dev/null || \
494
ln -fs "$HOME/go/bin/$tool_name" /usr/bin/"$tool_name" 2>/dev/null || true
495
fi
496
done
497
498
# Update nuclei templates
499
if command -v nuclei &>/dev/null; then
500
nuclei -update-templates 2>/dev/null || nuclei --update 2>/dev/null || true
501
fi
502
}
503
504
# Install Python-based tools
505
install_python_tools() {
506
echo -e "$OKBLUE[*]$RESET Installing Python-based tools..."
507
508
cd "$PLUGINS_DIR" || return
509
510
# Sublist3r
511
if [[ ! -d "Sublist3r" ]]; then
512
echo -e "$OKBLUE[*]$RESET Installing Sublist3r..."
513
git clone https://github.com/1N3/Sublist3r.git 2>/dev/null || true
514
fi
515
516
# Shocker
517
if [[ ! -d "shocker" ]]; then
518
echo -e "$OKBLUE[*]$RESET Installing Shocker..."
519
git clone https://github.com/nccgroup/shocker.git 2>/dev/null || true
520
fi
521
522
# SSH-Audit
523
if [[ ! -d "ssh-audit" ]]; then
524
echo -e "$OKBLUE[*]$RESET Installing SSH-Audit..."
525
git clone https://github.com/arthepsy/ssh-audit 2>/dev/null || true
526
fi
527
528
# Jexboss
529
if [[ ! -d "jexboss" ]]; then
530
echo -e "$OKBLUE[*]$RESET Installing Jexboss..."
531
git clone https://github.com/1N3/jexboss.git 2>/dev/null || true
532
fi
533
534
# WIG
535
if [[ ! -d "wig" ]]; then
536
echo -e "$OKBLUE[*]$RESET Installing Wig..."
537
git clone https://github.com/jekyc/wig.git 2>/dev/null || true
538
fi
539
540
# CORStest
541
if [[ ! -d "CORStest" ]]; then
542
echo -e "$OKBLUE[*]$RESET Installing CORStest..."
543
git clone https://github.com/RUB-NDS/CORStest.git 2>/dev/null || true
544
fi
545
546
# Vulscan
547
if [[ ! -d "vulscan" ]]; then
548
echo -e "$OKBLUE[*]$RESET Installing Vulscan..."
549
git clone https://github.com/scipag/vulscan 2>/dev/null || true
550
fi
551
552
# Metagoofil
553
if [[ ! -d "metagoofil" ]]; then
554
echo -e "$OKBLUE[*]$RESET Installing Metagoofil..."
555
git clone https://github.com/laramies/metagoofil.git 2>/dev/null || true
556
fi
557
558
# Shodan
559
if [[ ! -d "shodan-python" ]]; then
560
echo -e "$OKBLUE[*]$RESET Installing Shodan..."
561
git clone https://github.com/achillean/shodan-python 2>/dev/null || true
562
cd shodan-python && python3 setup.py install 2>/dev/null || true
563
cd "$PLUGINS_DIR"
564
fi
565
566
# CMSMap
567
if [[ ! -d "CMSmap" ]]; then
568
echo -e "$OKBLUE[*]$RESET Installing CMSMap..."
569
git clone https://github.com/Dionach/CMSmap.git 2>/dev/null || true
570
cd CMSmap && pip3 install . --break-system-packages 2>/dev/null || pip3 install . 2>/dev/null || true
571
python3 setup.py install 2>/dev/null || true
572
cd "$PLUGINS_DIR"
573
fi
574
575
# Smuggler
576
if [[ ! -d "smuggler" ]]; then
577
echo -e "$OKBLUE[*]$RESET Installing Smuggler..."
578
git clone https://github.com/defparam/smuggler.git 2>/dev/null || true
579
fi
580
581
# Dirsearch
582
if [[ ! -d "dirsearch" ]]; then
583
echo -e "$OKBLUE[*]$RESET Installing Dirsearch..."
584
wget -q https://github.com/maurosoria/dirsearch/archive/refs/tags/v0.4.2.tar.gz -O /tmp/dirsearch.tar.gz
585
tar -xzf /tmp/dirsearch.tar.gz -C "$PLUGINS_DIR"
586
mv "$PLUGINS_DIR/dirsearch-0.4.2" "$PLUGINS_DIR/dirsearch" 2>/dev/null || true
587
cd dirsearch && pip3 install -r requirements.txt --break-system-packages 2>/dev/null || pip3 install -r requirements.txt 2>/dev/null || true
588
rm -f /tmp/dirsearch.tar.gz
589
cd "$PLUGINS_DIR"
590
fi
591
592
# SecretFinder
593
if [[ ! -d "secretfinder" ]]; then
594
echo -e "$OKBLUE[*]$RESET Installing SecretFinder..."
595
git clone https://github.com/m4ll0k/SecretFinder.git secretfinder 2>/dev/null || true
596
pip3 install -r "$PLUGINS_DIR/secretfinder/requirements.txt" --break-system-packages 2>/dev/null || \
597
pip3 install -r "$PLUGINS_DIR/secretfinder/requirements.txt" 2>/dev/null || true
598
fi
599
600
# LinkFinder
601
if [[ ! -d "LinkFinder" ]]; then
602
echo -e "$OKBLUE[*]$RESET Installing LinkFinder..."
603
git clone https://github.com/1N3/LinkFinder 2>/dev/null || true
604
cd LinkFinder && python3 setup.py install 2>/dev/null || true
605
cd "$PLUGINS_DIR"
606
fi
607
608
# GitGraber
609
if [[ ! -d "gitGraber" ]]; then
610
echo -e "$OKBLUE[*]$RESET Installing GitGrabber..."
611
git clone https://github.com/hisxo/gitGraber.git 2>/dev/null || true
612
pip3 install -r "$PLUGINS_DIR/gitGraber/requirements.txt" --break-system-packages 2>/dev/null || \
613
pip3 install -r "$PLUGINS_DIR/gitGraber/requirements.txt" 2>/dev/null || true
614
fi
615
616
# Censys-Subdomain-Finder
617
if [[ ! -d "censys-subdomain-finder" ]]; then
618
echo -e "$OKBLUE[*]$RESET Installing Censys-Subdomain-Finder..."
619
git clone https://github.com/christophetd/censys-subdomain-finder.git 2>/dev/null || true
620
pip3 install -r "$PLUGINS_DIR/censys-subdomain-finder/requirements.txt" --break-system-packages 2>/dev/null || \
621
pip3 install -r "$PLUGINS_DIR/censys-subdomain-finder/requirements.txt" 2>/dev/null || true
622
fi
623
624
# DNScan
625
if [[ ! -d "dnscan" ]]; then
626
echo -e "$OKBLUE[*]$RESET Installing DNScan..."
627
git clone https://github.com/rbsec/dnscan.git 2>/dev/null || true
628
pip3 install -r "$PLUGINS_DIR/dnscan/requirements.txt" --break-system-packages 2>/dev/null || \
629
pip3 install -r "$PLUGINS_DIR/dnscan/requirements.txt" 2>/dev/null || true
630
fi
631
632
# AltDNS
633
if [[ ! -d "altdns" ]]; then
634
echo -e "$OKBLUE[*]$RESET Installing AltDNS..."
635
git clone https://github.com/infosec-au/altdns.git 2>/dev/null || true
636
cd altdns
637
pip3 install -r requirements.txt --break-system-packages 2>/dev/null || pip3 install -r requirements.txt 2>/dev/null || true
638
python3 setup.py install 2>/dev/null || true
639
pip3 install py-altdns --break-system-packages 2>/dev/null || pip3 install py-altdns 2>/dev/null || true
640
cd "$PLUGINS_DIR"
641
fi
642
643
# MassDNS
644
if [[ ! -d "massdns" ]]; then
645
echo -e "$OKBLUE[*]$RESET Installing MassDNS..."
646
git clone https://github.com/blechschmidt/massdns.git 2>/dev/null || true
647
cd massdns
648
make 2>/dev/null && make install 2>/dev/null || true
649
cd "$PLUGINS_DIR"
650
fi
651
652
# DNSGen
653
if [[ ! -d "dnsgen" ]]; then
654
echo -e "$OKBLUE[*]$RESET Installing DNSGen..."
655
git clone https://github.com/ProjectAnte/dnsgen 2>/dev/null || true
656
cd dnsgen
657
pip3 install -r requirements.txt --break-system-packages 2>/dev/null || pip3 install -r requirements.txt 2>/dev/null || true
658
python3 setup.py install 2>/dev/null || true
659
cd "$PLUGINS_DIR"
660
fi
661
662
# BlackWidow
663
if [[ ! -d "BlackWidow" ]]; then
664
echo -e "$OKBLUE[*]$RESET Installing BlackWidow..."
665
git clone https://github.com/1N3/BlackWidow 2>/dev/null || true
666
cd BlackWidow && bash install.sh force 2>/dev/null || true
667
cd "$PLUGINS_DIR"
668
fi
669
670
# BruteX
671
if [[ ! -d "BruteX" ]]; then
672
echo -e "$OKBLUE[*]$RESET Installing BruteX..."
673
git clone https://github.com/1N3/BruteX.git 2>/dev/null || true
674
cd BruteX && bash install.sh 2>/dev/null || true
675
cd "$PLUGINS_DIR"
676
fi
677
678
# FindSploit
679
if [[ ! -d "Findsploit" ]]; then
680
echo -e "$OKBLUE[*]$RESET Installing FindSploit..."
681
git clone https://github.com/1N3/Findsploit.git 2>/dev/null || true
682
cd Findsploit && bash install.sh 2>/dev/null || true
683
cd "$PLUGINS_DIR"
684
fi
685
686
# GooHak
687
if [[ ! -d "Goohak" ]]; then
688
echo -e "$OKBLUE[*]$RESET Installing GooHak..."
689
git clone https://github.com/1N3/Goohak.git 2>/dev/null || true
690
chmod +x "$PLUGINS_DIR/Goohak/goohak" 2>/dev/null || true
691
fi
692
}
693
694
# Install additional tools
695
install_additional_tools() {
696
echo -e "$OKBLUE[*]$RESET Installing additional tools..."
697
698
# GoBuster
699
if ! command -v gobuster &>/dev/null; then
700
echo -e "$OKBLUE[*]$RESET Installing GoBuster..."
701
case "$OS" in
702
debian)
703
apt install -y gobuster 2>/dev/null || {
704
# Manual install if not in repos
705
wget -q https://github.com/OJ/gobuster/releases/download/v3.0.1/gobuster-linux-amd64.7z -O /tmp/gobuster.7z
706
cd /tmp && 7z e gobuster.7z && chmod +rx gobuster && mv gobuster /usr/bin/gobuster
707
}
708
;;
709
rhel)
710
# Manual install
711
wget -q https://github.com/OJ/gobuster/releases/download/v3.0.1/gobuster-linux-amd64.7z -O /tmp/gobuster.7z
712
cd /tmp && 7z e gobuster.7z && chmod +rx gobuster && mv gobuster /usr/bin/gobuster
713
;;
714
macos)
715
brew install gobuster 2>/dev/null || true
716
;;
717
esac
718
fi
719
720
# Arachni (Linux only)
721
if [[ "$OS" != "macos" ]] && [[ ! -d "/usr/share/arachni" ]]; then
722
echo -e "$OKBLUE[*]$RESET Installing Arachni..."
723
wget -q https://github.com/Arachni/arachni/releases/download/v1.5.1/arachni-1.5.1-0.5.12-linux-x86_64.tar.gz -O /tmp/arachni.tar.gz
724
cd /tmp && tar -xzf arachni.tar.gz && rm -f arachni.tar.gz
725
mkdir -p /usr/share/arachni 2>/dev/null
726
cp -Rf arachni-*/* /usr/share/arachni/ 2>/dev/null
727
rm -rf arachni-*
728
# Create symlinks
729
cd /usr/share/arachni/bin/
730
for binary in *; do
731
ln -fs "$PWD/$binary" /usr/bin/"$binary" 2>/dev/null || true
732
done
733
fi
734
735
# Vulners Nmap Script
736
echo -e "$OKBLUE[*]$RESET Installing Vulners Nmap script..."
737
local nmap_scripts_dir
738
case "$OS" in
739
debian|rhel|arch)
740
nmap_scripts_dir="/usr/share/nmap/scripts"
741
;;
742
macos)
743
nmap_scripts_dir="/usr/local/share/nmap/scripts"
744
;;
745
esac
746
747
if [[ -d "$nmap_scripts_dir" ]]; then
748
wget -q https://raw.githubusercontent.com/vulnersCom/nmap-vulners/master/vulners.nse -O "$nmap_scripts_dir/vulners.nse"
749
chmod 644 "$nmap_scripts_dir/vulners.nse" 2>/dev/null || true
750
nmap --script-updatedb 2>/dev/null || true
751
fi
752
753
# DNS Resolvers
754
echo -e "$OKBLUE[*]$RESET Downloading DNS resolvers list..."
755
mkdir -p "$INSTALL_DIR/wordlists" 2>/dev/null
756
wget -q https://raw.githubusercontent.com/janmasarik/resolvers/master/resolvers.txt -O "$INSTALL_DIR/wordlists/resolvers.txt" 2>/dev/null || true
757
}
758
759
# Create symlinks
760
create_symlinks() {
761
echo -e "$OKBLUE[*]$RESET Creating symlinks..."
762
763
# Main symlinks
764
ln -fs "$INSTALL_DIR/sniper" /usr/bin/sniper 2>/dev/null || \
765
ln -fs "$INSTALL_DIR/sniper" /usr/local/bin/sniper 2>/dev/null || true
766
767
ln -fs "$PLUGINS_DIR/Goohak/goohak" /usr/bin/goohak 2>/dev/null || \
768
ln -fs "$PLUGINS_DIR/Goohak/goohak" /usr/local/bin/goohak 2>/dev/null || true
769
770
ln -fs "$PLUGINS_DIR/dirsearch/dirsearch.py" /usr/bin/dirsearch 2>/dev/null || \
771
ln -fs "$PLUGINS_DIR/dirsearch/dirsearch.py" /usr/local/bin/dirsearch 2>/dev/null || true
772
773
# Directory symlinks
774
ln -fs /usr/share/sniper /sniper 2>/dev/null || true
775
ln -fs /usr/share/sniper /usr/share/sn1per 2>/dev/null || true
776
ln -fs /usr/share/sniper/loot/workspaces /workspace 2>/dev/null || true
777
778
# User directory symlinks (Linux only)
779
if [[ "$OS" != "macos" ]]; then
780
ln -fs /usr/share/sniper/loot/workspaces /root/workspace 2>/dev/null || true
781
ln -fs /usr/share/sniper /root/sniper 2>/dev/null || true
782
ln -fs /root/.sniper.conf /usr/share/sniper/conf/sniper.conf 2>/dev/null || true
783
ln -fs /root/.sniper_api_keys.conf /usr/share/sniper/conf/sniper_api_keys.conf 2>/dev/null || true
784
fi
785
}
786
787
# Setup desktop shortcuts (Linux only)
788
setup_desktop_shortcuts() {
789
if [[ "$OS" == "macos" ]]; then
790
return
791
fi
792
793
echo -e "$OKBLUE[*]$RESET Setting up desktop shortcuts..."
794
795
# Copy desktop files
796
cp -f "$INSTALL_DIR/sn1per.desktop" /usr/share/applications/ 2>/dev/null || true
797
cp -f "$INSTALL_DIR/sn1per.png" /usr/share/pixmaps/ 2>/dev/null || true
798
799
# Kali menu integration
800
if [[ -d /usr/share/kali-menu/applications ]]; then
801
cp -f "$INSTALL_DIR/sn1per.desktop" /usr/share/kali-menu/applications/ 2>/dev/null || true
802
fi
803
804
# Plugin desktop files
805
if [[ -f "$PLUGINS_DIR/BruteX/brutex.desktop" ]]; then
806
cp -f "$PLUGINS_DIR/BruteX/brutex.desktop" /usr/share/applications/ 2>/dev/null || true
807
cp -f "$PLUGINS_DIR/BruteX/brutex.desktop" /usr/share/kali-menu/applications/ 2>/dev/null || true
808
fi
809
810
if [[ -f "$PLUGINS_DIR/BlackWidow/blackwidow.desktop" ]]; then
811
cp -f "$PLUGINS_DIR/BlackWidow/blackwidow.desktop" /usr/share/applications/ 2>/dev/null || true
812
cp -f "$PLUGINS_DIR/BlackWidow/blackwidow.desktop" /usr/share/kali-menu/applications/ 2>/dev/null || true
813
fi
814
815
if [[ -f "$PLUGINS_DIR/Findsploit/findsploit.desktop" ]]; then
816
cp -f "$PLUGINS_DIR/Findsploit/findsploit.desktop" /usr/share/applications/ 2>/dev/null || true
817
cp -f "$PLUGINS_DIR/Findsploit/findsploit.desktop" /usr/share/kali-menu/applications/ 2>/dev/null || true
818
fi
819
820
# Desktop workspace shortcuts
821
ln -fs /usr/share/sniper/loot/workspaces/ /home/kali/Desktop/workspaces 2>/dev/null || true
822
ln -fs /usr/share/sniper/loot/workspaces/ /root/Desktop/workspaces 2>/dev/null || true
823
}
824
825
# Setup configuration
826
setup_configuration() {
827
echo -e "$OKBLUE[*]$RESET Setting up configuration..."
828
829
if [[ "$OS" != "macos" ]]; then
830
# Backup and copy config
831
mv /root/.sniper.conf /root/.sniper.conf.bak 2>/dev/null || true
832
cp -f "$INSTALL_DIR/sniper.conf" /root/.sniper.conf 2>/dev/null || true
833
834
# X11 setup for GUI tools (Linux only)
835
if [[ -f /root/.Xauthority ]]; then
836
cp -a /root/.Xauthority /root/.Xauthority.bak 2>/dev/null || true
837
fi
838
839
if [[ "$USER" != "root" ]] && [[ -f /home/$USER/.Xauthority ]]; then
840
cp -a /home/$USER/.Xauthority /root/.Xauthority 2>/dev/null || true
841
chown root:root /root/.Xauthority 2>/dev/null || true
842
fi
843
fi
844
}
845
846
# Cleanup
847
cleanup() {
848
echo -e "$OKBLUE[*]$RESET Cleaning up temporary files..."
849
rm -rf /tmp/arachni* /tmp/gobuster* /tmp/msfinstall /tmp/openssl.cnf /tmp/dirsearch* 2>/dev/null || true
850
}
851
852
# Main installation flow
853
main() {
854
echo -e "$OKRED[>]$RESET This script will install Sn1per under $INSTALL_DIR."
855
856
if [[ "$1" != "force" ]] && [[ "$1" != "-y" ]]; then
857
echo -e "$OKRED[>]$RESET Do you want to continue? (y/n) $RESET"
858
read -r answer
859
if [[ "$answer" != "y" ]] && [[ "$answer" != "Y" ]]; then
860
echo -e "$OKRED[>]$RESET Installation cancelled."
861
exit 0
862
fi
863
fi
864
865
# Detect OS
866
detect_os
867
868
# Check root privileges
869
check_root
870
871
# Create directories
872
create_directories
873
874
# Install Sn1per files
875
install_sniper_files
876
877
# Update package repos
878
pkg_update
879
880
# Install build tools
881
install_build_tools
882
883
# Install base dependencies
884
install_base_dependencies
885
886
# Setup language environments
887
setup_python
888
setup_ruby
889
setup_go
890
891
# Install tools by category
892
install_metasploit
893
install_go_tools
894
install_python_tools
895
install_additional_tools
896
897
# Create symlinks
898
create_symlinks
899
900
# Setup desktop shortcuts (Linux only)
901
setup_desktop_shortcuts
902
903
# Setup configuration
904
setup_configuration
905
906
# Cleanup
907
cleanup
908
909
echo ""
910
echo -e "$OKGREEN[✓]$RESET Installation complete!"
911
echo -e "$OKGREEN[✓]$RESET To run Sn1per, type: ${OKBLUE}sniper${RESET}"
912
echo ""
913
echo -e "$OKORANGE[*]$RESET OS Detected: $OS"
914
echo -e "$OKORANGE[*]$RESET Install Directory: $INSTALL_DIR"
915
echo -e "$OKORANGE[*]$RESET Loot Directory: $LOOT_DIR"
916
echo ""
917
918
# System-specific notes
919
case "$OS" in
920
macos)
921
echo -e "$OKORANGE[!]$RESET Note: Some tools may require additional configuration on macOS"
922
echo -e "$OKORANGE[!]$RESET Run with sudo if you encounter permission issues"
923
;;
924
rhel)
925
echo -e "$OKORANGE[!]$RESET Note: Some optional tools may not be available in RHEL repos"
926
echo -e "$OKORANGE[!]$RESET Consider enabling additional repositories if needed"
927
;;
928
esac
929
}
930
931
# Run main installation
932
main "$@"
933
934