-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKali-Linux-Tools
More file actions
40 lines (30 loc) · 1.04 KB
/
Copy pathKali-Linux-Tools
File metadata and controls
40 lines (30 loc) · 1.04 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
#!/bin/bash
set -euo pipefail # Enable strict mode
# Check if running as root, request elevation if not
if [[ $EUID -ne 0 ]]; then
exec sudo "$0" "$@"
fi
# Setup Kali repository
KALI_LIST="/etc/apt/sources.list.d/kali.list"
KEYRING="/usr/share/keyrings/kali-archive-keyring.gpg"
cleanup() {
echo "Cleaning up..."
rm -f "$KALI_LIST" "$KEYRING" 2>/dev/null || true
apt-get update
}
trap cleanup EXIT # Ensure cleanup runs on script exit
echo "Adding Kali Linux repository..."
cat > "$KALI_LIST" <<EOF
deb [trusted=yes] http://http.kali.org/kali kali-rolling main non-free contrib
EOF
echo "Adding Kali Linux signing key..."
wget -qO - https://archive.kali.org/archive-key.asc | gpg --dearmor -o "$KEYRING"
echo "Updating repository with signed key..."
cat > "$KALI_LIST" <<EOF
deb [signed-by=$KEYRING] http://http.kali.org/kali kali-rolling main non-free contrib
EOF
echo "Updating package lists..."
apt-get update -qq
echo "Installing kali-tools-top10..."
apt-get install -y kali-tools-top10
echo "Installation completed successfully."