-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
83 lines (67 loc) · 1.5 KB
/
install.sh
File metadata and controls
83 lines (67 loc) · 1.5 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
#!/usr/bin/env bash
set -e
echo "[*] ShellCraft dependency installer"
echo "[*] Checking environment..."
# Require Linux
if [[ "$(uname -s)" != "Linux" ]]; then
echo "[-] Unsupported OS. Linux required."
exit 1
fi
# Require root
if [[ "$EUID" -ne 0 ]]; then
echo "[-] Please run as root (sudo ./install.sh)"
exit 1
fi
echo "[*] Detecting package manager..."
if command -v apt >/dev/null 2>&1; then
PM="apt"
elif command -v dnf >/dev/null 2>&1; then
PM="dnf"
elif command -v pacman >/dev/null 2>&1; then
PM="pacman"
else
echo "[-] Unsupported package manager"
exit 1
fi
echo "[*] Using package manager: $PM"
install_apt() {
apt update
apt install -y \
python3 \
python3-pip \
mingw-w64 \
metasploit-framework
}
install_dnf() {
dnf install -y \
python3 \
python3-pip \
mingw64-gcc-c++ \
metasploit-framework
}
install_pacman() {
pacman -Sy --noconfirm \
python \
mingw-w64-gcc \
metasploit
}
echo "[*] Installing dependencies..."
case "$PM" in
apt) install_apt ;;
dnf) install_dnf ;;
pacman) install_pacman ;;
esac
echo "[*] Verifying tools..."
REQUIRED_TOOLS=(
python3
msfvenom
x86_64-w64-mingw32-g++
)
for tool in "${REQUIRED_TOOLS[@]}"; do
if ! command -v "$tool" >/dev/null 2>&1; then
echo "[-] Missing tool: $tool"
exit 1
fi
done
echo "[+] All dependencies installed successfully"
echo "[*] You can now run: python3 shellcraft.py"