-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·77 lines (68 loc) · 3.04 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·77 lines (68 loc) · 3.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
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
#!/usr/bin/env bash
# TryHackMe + Claude Code Trainer Kit — installer.
# Pulls the kit straight from the GitHub repo (single source of truth), then
# optionally installs the Kali tooling. No files are embedded in this script.
set -euo pipefail
REPO="https://github.com/pashki975/thm-claude-kit.git"
DIR="./thm-claude-kit"
TOOLS="ask" # ask | yes | no
while [ $# -gt 0 ]; do
case "$1" in
--dir) DIR="$2"; shift 2;;
--repo) REPO="$2"; shift 2;;
--tools) TOOLS="yes"; shift;;
--no-tools) TOOLS="no"; shift;;
--help)
echo "Usage: bash install.sh [--dir PATH] [--repo URL] [--tools|--no-tools]"
echo " --dir PATH install location (default: ./thm-claude-kit)"
echo " --repo URL source repo (default: the Trainer Kit repo)"
echo " --tools install Kali tooling without prompting"
echo " --no-tools skip tooling entirely"
exit 0;;
*) echo "Unknown option: $1 (try --help)"; exit 1;;
esac
done
command -v git >/dev/null 2>&1 || { echo "ERROR: git is required. Install it first (sudo apt install -y git)."; exit 1; }
# --- get the kit from the repo (clone fresh, or update an existing checkout) ---
if [ -d "$DIR/.git" ]; then
echo "Updating existing kit in: $DIR"
git -C "$DIR" pull --ff-only
elif [ -e "$DIR" ] && [ -n "$(ls -A "$DIR" 2>/dev/null)" ]; then
echo "ERROR: $DIR exists and is not a git checkout. Move it or pick another --dir."
exit 1
else
echo "Cloning kit into: $DIR"
git clone "$REPO" "$DIR"
fi
chmod +x "$DIR/new-room.sh" 2>/dev/null || true
ABSDIR="$(cd "$DIR" && pwd)"
echo "Kit ready in $ABSDIR"
# --- prerequisite check ---
command -v claude >/dev/null 2>&1 || echo "NOTE: Claude Code (claude) not found — install: npm install -g @anthropic-ai/claude-code"
command -v node >/dev/null 2>&1 || echo "NOTE: node not found — install Node.js 18+ first."
# --- optional tooling ---
install_tools() {
echo "Installing Kali tooling (sudo required)..."
sudo apt update
sudo apt install -y seclists enum4linux smbclient hashid john hashcat rlwrap exploitdb \
tshark wpscan snmp onesixtyone tftp-hpa proxychains4 chisel mariadb-client postgresql-client redis-tools \
netexec impacket-scripts evil-winrm enum4linux-ng freerdp2-x11 ldap-utils || \
echo "Some apt packages may have different names on your Kali version — see README."
if command -v pipx >/dev/null 2>&1; then
pipx install certipy-ad || true; pipx install bloodhound || true; pipx install sshuttle || true
else
echo "pipx not found — skipping certipy/bloodhound/sshuttle. Install pipx then rerun with --tools."
fi
}
case "$TOOLS" in
yes) install_tools;;
no) echo "Skipping tooling (--no-tools).";;
ask)
printf "Install the Kali tooling now (apt + pipx, needs sudo)? [y/N] "
read -r ans || ans="n"
case "$ans" in [Yy]*) install_tools;; *) echo "Skipped. Rerun with --tools later if you want it.";; esac;;
esac
echo ""
echo "Done. Next:"
echo " cd $ABSDIR && ./new-room.sh myroom && cd rooms/myroom && claude"
echo " then in Claude: /start (paste the room description + target IP)"