vagrant provision shell from gist.github

from gist.github

vagrant_dvwa.sh
#!/usr/bin/sh

ordinaryPack="docker nc tcsh unzip"
servPack="httpd mariadb-server php-mysql php"
passwdResetURL="https://gist.githubusercontent.com/kaldown/1a0df9af50b6d08ddc32/raw/bfaf3bf4e610649437ae6ee72a1c3e3d9e7d3538/rootPasswdReset"

yum update -y
yum install -y $servPack $ordinaryPack
systemctl enable httpd.service
systemctl enable mariadb.service
curl $passwdResetURL >> /tmp/rootPasswdReset
mysqld_safe --user=mysql --init-file=/tmp/rootPasswdReset
wget -P /tmp https://github.com/RandomStorm/DVWA/archive/v1.0.8.zip
unzip /tmp/v1.0.8.zip -d /var/www/html
mv /var/www/html/DVWA-1.0.8 /var/www/html/dvwa
sed -i 's/p@ssw0rd/sqlpasswd/g' /var/www/html/dvwa/config/config.inc.php
sed -i 's/^/#/g' /etc/httpd/conf.d/welcome.conf

systemctl start mariadb.service
systemctl start httpd.service

rm -rf /tmp/*

rootPasswdReset
UPDATE mysql.user SET Password=PASSWORD('sqlpasswd') WHERE User='root';
FLUSH PRIVILEGES;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s