Skip to content

Commit

Permalink
Merge pull request #71 from SamuraiWTF/samurai-dojo-docker
Browse files Browse the repository at this point in the history
switch to hybrid samurai-dojo
  • Loading branch information
secureideas authored Apr 29, 2019
2 parents 8e472a9 + 4f770ce commit fb512d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vagrant
*.log
.DS_Store
config/home/Burp*
*.retry
33 changes: 15 additions & 18 deletions install/target_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,29 @@ sudo docker pull bit0pus/docker-mutillidae
#DOJO
echo 'Setting up Samurai Dojo...'
echo '...cloning repo...'
sudo git clone --recursive https://github.com/SamuraiWTF/samurai-dojo-docker.git /opt/targets/samurai-dojo-docker
sudo git clone --recursive https://github.com/SamuraiWTF/Samurai-Dojo.git /opt/targets/samurai-dojo
echo '...rewriting db config...'
sudo rm /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/basic/config.inc
echo "<?php" | sudo tee /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/basic/config.inc
echo "\$dbhost = 'basicdb';" | sudo tee -a /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/basic/config.inc
echo "\$dbuser = 'root';" | sudo tee -a /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/basic/config.inc
echo "\$dbpass = 'samurai';" | sudo tee -a /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/basic/config.inc
echo "\$dbname = 'samurai_dojo_basic';" | sudo tee -a /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/basic/config.inc
echo "?>" | sudo tee -a /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/basic/config.inc
sudo rm /opt/targets/samurai-dojo/src/basic/config.inc
echo "<?php" | sudo tee /opt/targets/samurai-dojo/src/basic/config.inc
echo "\$dbhost = 'basicdb';" | sudo tee -a /opt/targets/samurai-dojo/src/basic/config.inc
echo "\$dbuser = 'root';" | sudo tee -a /opt/targets/samurai-dojo/src/basic/config.inc
echo "\$dbpass = 'samurai';" | sudo tee -a /opt/targets/samurai-dojo/src/basic/config.inc
echo "\$dbname = 'samurai_dojo_basic';" | sudo tee -a /opt/targets/samurai-dojo/src/basic/config.inc
echo "?>" | sudo tee -a /opt/targets/samurai-dojo/src/basic/config.inc
echo '...initializing services...'
cd /opt/targets/samurai-dojo-docker
sudo rm /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/basic/.htaccess
sed "s/localhost/scavengerdb/g" /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/scavenger/partners.php | sudo tee /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/scavenger/partners.php
sudo tr '\r\n' '\n' < /tmp/config/init_db.sh > /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/scavenger/init_db.sh
sudo chmod 755 /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/scavenger/init_db.sh
cd /opt/targets/samurai-dojo
sudo rm /opt/targets/samurai-dojo/src/basic/.htaccess
sed "s/localhost/scavengerdb/g" /opt/targets/samurai-dojo/src/scavenger/partners.php | sudo tee /opt/targets/samurai-dojo/src/scavenger/partners.php
sudo tr '\r\n' '\n' < /tmp/config/init_db.sh > /opt/targets/samurai-dojo/src/scavenger/init_db.sh
sudo chmod 755 /opt/targets/samurai-dojo/src/scavenger/init_db.sh
echo '...starting app...'
sudo docker-compose up -d
sleep 15
echo '...calling db init php script...'
cd /opt/targets/samurai-dojo-docker/apps/Samurai-Dojo/scavenger
cd /opt/targets/samurai-dojo/src/scavenger
sudo bash init_db.sh
cd /opt/targets/samurai-dojo-docker
cd /opt/targets/samurai-dojo
curl http://localhost:30080/reset-db.php #currently doesn't work. Might need a dependson directive in the compose yml
echo '...stopping app...'
sudo docker-compose down
echo 'Done.'

#Client-Side Attack Lab
echo "Setting up Mic_WG's Client-Side Attacks Lab"
Expand Down

0 comments on commit fb512d5

Please sign in to comment.