Skip to content

Instantly share code, notes, and snippets.

@infosanity
Last active January 2, 2020 19:58
Show Gist options
  • Save infosanity/19e5bf812ec9b0b203a75c50f79d4710 to your computer and use it in GitHub Desktop.
Save infosanity/19e5bf812ec9b0b203a75c50f79d4710 to your computer and use it in GitHub Desktop.
AWS EC2 User-Data for basic Cowrie Build
#!/bin/bash
# based on https://cowrie.readthedocs.io/en/latest/INSTALL.html
apt -y update
DEBIAN_FRONTEND=noninteractive apt -y upgrade
apt -y install git python-virtualenv libssl-dev libffi-dev build-essential libpython3-dev python3-minimal authbind virtualenv
adduser --disabled-password --gecos "" cowrie
sudo -H -u cowrie /bin/bash -s << EOF >> /home/cowrie/heredoc.out
cd /home/cowrie/
git clone http://github.com/cowrie/cowrie
cd /home/cowrie/cowrie
virtualenv --python=python3 cowrie-env
source cowrie-env/bin/activate
pip install --upgrade pip
pip install --upgrade -r requirements.txt
bin/cowrie start
EOF
# runs with cowrie.cfg.dist - will need tuning to specific usecase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment