Last active
June 9, 2023 18:14
-
-
Save d0now/4e9f08b6859c67fa7ef7ab59b64ae934 to your computer and use it in GitHub Desktop.
linode-for-pwn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
NEWUSER=d0now | |
set -ex | |
cd `dirname $0` | |
export DEBIAN_FRONTEND=noninteractive | |
export DEBCONF_NONINTERACTIVE_SEEN=true | |
{ echo 'tzdata tzdata/Areas select Etc'; echo 'tzdata tzdata/Zones/Etc select UTC'; } | debconf-set-selections | |
dpkg --add-architecture i386 | |
sed -i -e 's/mirrors.linode.com/mirror.kakao.com/g' /etc/apt/sources.list | |
apt-get update | |
apt-get install -y --fix-missing build-essential software-properties-common | |
# Install utilities | |
apt-get install -y zsh netcat curl wget net-tools vim git make procps socat | |
# Install compiler & libraries | |
apt-get install -y \ | |
gcc gcc-multilib g++-multilib \ | |
libpcre3-dev libdb-dev libxt-dev libxaw7-dev libc6:i386 libncurses5:i386 libstdc++6:i386 | |
# Install debugger | |
apt-get install -y gdb gdb-multiarch strace ltrace | |
# Install python & packages | |
apt-get install -y python3 python3-pip | |
# Install etc. | |
apt-get install -y ruby binwalk qemu qemu-system | |
gem install one_gadget | |
# Intall docker | |
apt-get install -y ca-certificates curl gnupg lsb-release | |
mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | |
# add user | |
useradd -m -s $(which zsh) $NEWUSER | |
usermod -aG docker $NEWUSER | |
usermod -aG sudo $NEWUSER | |
mkdir -p /home/$NEWUSER/.ssh | |
cat $HOME/.ssh/authorized_keys > /home/$NEWUSER/.ssh/authorized_keys | |
chown -R $NEWUSER:$NEWUSER /home/$NEWUSER/.ssh | |
cp ./linode-for-pwn.user.sh /home/$NEWUSER/.install.sh | |
chown $NEWUSER:$NEWUSER /home/$NEWUSER/.install.sh | |
su $NEWUSER -c '$HOME/.install.sh' -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
echo "source $HOME/.zprofile" >> $HOME/.zshrc | |
echo "export PATH=$HOME/.local/bin:$PATH" >> $HOME/.zprofile | |
python3 -m pip install --upgrade pip | |
python3 -m pip install pwntools ropper requests unicorn angr capstone | |
bash -c "$(curl -fsSL https://gef.blah.cat/sh)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment