Skip to content

Instantly share code, notes, and snippets.

@kaldown
Last active September 26, 2018 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaldown/1a0df9af50b6d08ddc32 to your computer and use it in GitHub Desktop.
Save kaldown/1a0df9af50b6d08ddc32 to your computer and use it in GitHub Desktop.
vagrant(chef/centos-7.0; httpd, mariadb, php, docker, nc, unzip, tcsh)
UPDATE mysql.user SET Password=PASSWORD('sqlpasswd') WHERE User='root';
FLUSH PRIVILEGES;
#!/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/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment