Skip to content

Instantly share code, notes, and snippets.

@lsr00ter
Created May 31, 2025 14:36
Show Gist options
  • Save lsr00ter/76869ce1bcc25f6f1848ba7e6bcf34b8 to your computer and use it in GitHub Desktop.
Save lsr00ter/76869ce1bcc25f6f1848ba7e6bcf34b8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
echo "== WeaponizedVSCode Environment Setup =="
# 1. Check and install dependencies
install_if_missing() {
local cmd="$1"
local pkg="$2"
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "Installing $pkg..."
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install "$pkg"
elif command -v apt-get >/dev/null 2>&1; then
sudo apt-get update && sudo apt-get install -y "$pkg"
else
echo "Please install $pkg manually."
fi
else
echo "$cmd is already installed."
fi
}
install_if_missing zsh zsh
# VSCode CLI check
if ! command -v code >/dev/null 2>&1; then
echo "VSCode CLI 'code' not found."
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Try: brew install --cask visual-studio-code"
echo "Then open VSCode and run 'Shell Command: Install 'code' command in PATH' from the Command Palette."
elif command -v apt-get >/dev/null 2>&1; then
echo "Try: sudo apt install code"
fi
else
echo "VSCode CLI 'code' is already installed."
fi
install_if_missing python3 python3
# Metasploit, with OS check
if [[ "$OSTYPE" == "darwin"* ]]; then
install_if_missing msfconsole metasploit
else
install_if_missing msfconsole metasploit-framework
fi
# Optional: Install esonhugh/sss
echo "Do you want to install optional esonhugh/sss? [y/N]"
read -r sss_ans
if [[ "$sss_ans" =~ ^[Yy]$ ]]; then
if [ ! -d "$HOME/sss" ]; then
git clone https://github.com/esonhugh/sss.git "$HOME/sss"
else
echo "esonhugh/sss already exists in \$HOME/sss"
fi
fi
# 2. Download createhackenv.sh
echo "Downloading createhackenv.sh..."
curl -fsSL https://raw.githubusercontent.com/Esonhugh/WeaponizedVSCode/master/createhackenv.sh -o createhackenv.sh
chmod +x createhackenv.sh
# 3. Source the script
if [ -f ./createhackenv.sh ]; then
echo "Sourcing createhackenv.sh..."
# shellcheck disable=SC1091
source ./createhackenv.sh || echo "Warning: Some errors occurred while sourcing createhackenv.sh"
else
echo "createhackenv.sh not found!"
fi
# 4. Offer to add to .zshrc
echo "Do you want to add 'source ~/createhackenv.sh' to your ~/.zshrc? [y/N]"
read -r zshrc_ans
if [[ "$zshrc_ans" =~ ^[Yy]$ ]]; then
cp createhackenv.sh "$HOME/createhackenv.sh"
if ! grep -q "source ~/createhackenv.sh" "$HOME/.zshrc"; then
echo "source ~/createhackenv.sh" >> "$HOME/.zshrc"
echo "Added source to ~/.zshrc"
else
echo "Already present in ~/.zshrc"
fi
fi
# 5. Optional: Create alias
echo "Do you want to create the alias 'weaponize-vsc' for 'createhack'? [y/N]"
read -r alias_ans
if [[ "$alias_ans" =~ ^[Yy]$ ]]; then
if ! grep -q "alias weaponize-vsc=createhack" "$HOME/.zshrc"; then
echo "alias weaponize-vsc=createhack" >> "$HOME/.zshrc"
echo "Alias added to ~/.zshrc"
else
echo "Alias already present in ~/.zshrc"
fi
fi
echo "Setup complete! Please restart your terminal or run 'source ~/.zshrc' to activate changes."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment