Skip to content

Instantly share code, notes, and snippets.

@heywoodlh
Last active August 5, 2022 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heywoodlh/4d9d90b32bde8ee424f4d00098ff0e30 to your computer and use it in GitHub Desktop.
Save heywoodlh/4d9d90b32bde8ee424f4d00098ff0e30 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# If Arch Linux
if grep -q 'Arch Linux' /etc/os-release
then
pacman -Syu --noconfirm --overwrite '*' ansible git vim curl \
&& echo 'Installed base packages' | tee -a /opt/setup.log
ln -s /usr/bin/vim /usr/bin/vi
fi
# If Debian-based
if [[ -e /etc/debian_version ]]
then
apt-get update && apt-get dist-upgrade -y
apt-get install -y python3-pip vim git curl docker.io \
&& echo 'Installed base packages' | tee -a /opt/setup.log
fi
systemctl enable docker.service
systemctl start docker.service
sed -i 's/Port 22/Port 4022/g' /etc/ssh/sshd_config && systemctl restart ssh.service
docker ps -a | grep -q vulnerable || docker run -d --restart=unless-stopped -p 21:21 -p 22:22 -p 80:80 -p 445:445 -p 631:631 -p 3000:3000 -p 3500:3500 -p 6697:6697 -p 3306:3306 -p 8181:8181 heywoodlh/sc-vulnerable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment