forked from WebGoat/WebGoat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webgoat_developer_bootstrap.sh
executable file
·44 lines (39 loc) · 1.83 KB
/
webgoat_developer_bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Bootstrap the setup of WebGoat for developer use in Linux/Mac machines
# This script will clone the necessary git repositories, call the maven goals
# in the order the are needed and launch tomcat listening on localhost:8080
# Happy hacking !
# Clone WebGoat and WebGoat-lessons from GitHub if they don't exist
if [ ! -d "WebGoat" ]; then
git clone https://github.com/WebGoat/WebGoat.git
fi
if [ ! -d "WebGoat-Lessons" ]; then
git clone https://github.com/WebGoat/WebGoat-Lessons.git
fi
# Compile and Install the WebGoat lesson server
mvn -file WebGoat/pom.xml clean compile install
# Compile and package the WebGoat Lessons
mvn -file WebGoat-Lessons/pom.xml package
# Copy the Lessons into the WebGoat-Container
cp -fa ./WebGoat-Lessons/target/plugins/*.jar ./WebGoat/webgoat-container/src/main/webapp/plugin_lessons/
# Start WebGoat using the maven tomcat7:run-war goal
printf "\n"
printf "\n"
printf "\n"
printf "\n"
printf "\n"
echo "-----------------------------------------------------------------------------------"
echo "____________________ Starting WebGoat using the embedded Tomcat ___________________"
echo "###################################################################################"
echo "### Open a web browser and navigate to http://localhost:8080/WebGoat/"
echo "### STDOUT and STDERR logs are captured in ./webgoat_developer_bootstrap.log"
echo "### To stop the Tomcat execution, press CTRL + C"
echo "### If you close this terminal window, Tomcat and WebGoat will stop running"
echo "##################################### HAPPY HACKING! ##############################"
echo "-----------------------------------------------------------------------------------"
printf "\n"
printf "\n"
printf "\n"
printf "\n"
printf "\n"
mvn -file WebGoat/pom.xml -pl webgoat-container tomcat7:run-war &> webgoat_developer_bootstrap.log