Last active
July 20, 2016 13:39
-
-
Save apolloclark/0884c79d40ef6774e5c0 to your computer and use it in GitHub Desktop.
Kali 2016.1, Railsgoat install
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
#!/bin/bash | |
# @see https://gorails.com/setup/ubuntu/15.10 | |
# update, install git | |
export DEBIAN_FRONTEND="noninteractive" | |
sudo apt-get update | |
sudo apt-get install -y git-core build-essential libssl-dev libreadline-dev \ | |
libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev \ | |
libcurl4-openssl-dev python-software-properties libffi-dev zlib1g-dev | |
# install rbenv | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init -)" | |
type rbenv | |
# install rbenv pugins | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash | |
# install ruby | |
rbenv install 2.3.0 -k | |
rbenv global 2.3.0 | |
rbenv versions | |
ruby -v | |
# install MySQL and sqlite | |
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password \"''\"" | |
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password \"''\"" | |
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev | |
# download, install, configure, run Railsgoat | |
git clone https://github.com/OWASP/railsgoat | |
cd railsgoat | |
gem install bundler | |
bundle install | |
sleep 10 | |
# setup database, use MySQL | |
echo -e "INFO: setting up database..." | |
RAILS_ENV=mysql | |
echo 'export RAILS_ENV=mysql' >> ~/.bashrc | |
rake db:setup | |
sleep 10 | |
# run Railsgoat | |
echo -e "INFO: starting railsgoat..." | |
rails s -b 0.0.0.0 > /dev/null & | |
sleep 15 | |
# firefox http://127.0.0.1:3000 | |
# sudo pkill -9 ruby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment