|
| 1 | +# Java Vulnerabilities Experiment |
| 2 | + |
1 | 3 | This is a "Vulnerable" Web Application developed by Cyber Security and Privacy Foundation(www.cysecurity.org). This app is intended for the Java Programmers and other people who wish to learn about Web application vulnerabilities and write secure code. |
2 | 4 |
|
3 | | -**The full course content is now available on Github for free:** |
| 5 | +## Prerequisites: |
4 | 6 |
|
5 | | -https://github.com/CSPF-Founder/JavaSecurityCourse |
| 7 | +- git |
| 8 | +- docker docker-compose |
| 9 | +- vagrant |
6 | 10 |
|
| 11 | +## Deploy it |
7 | 12 |
|
8 | | -**The full course on Hacking and Securing Web Java Programs is available in** |
| 13 | +1. Using Docker to run on a machine : |
9 | 14 |
|
10 | | -https://www.udemy.com/hacking-securing-java-web-programming/ |
| 15 | +```sh |
| 16 | +git clone https://github.com/softwaresecured/JavaVulnerableLab.git |
| 17 | +cd JavaVulnerableLab |
| 18 | +docker-compose up |
| 19 | +``` |
11 | 20 |
|
12 | | -**Warning**: Don't run this app in Your Main Machine or in an online server. Install it in Vitual Machine. |
| 21 | +2. Using Vagrant to run this application in a VM (containers are launched inside it) : |
13 | 22 |
|
14 | | - |
15 | | -How to Use/Setup ? |
16 | | -------------- |
| 23 | +```sh |
| 24 | +git clone https://github.com/softwaresecured/JavaVulnerableLab.git |
| 25 | +cd JavaVulnerableLab |
| 26 | +vagrant up |
| 27 | +``` |
17 | 28 |
|
18 | | -**Method 1.Super Very Easiest Method: Docker** |
19 | | - The easiest way to use Java Vulnerable is using Docker which set up everything for you with 1 command line |
| 29 | +3. If not using Docker at all, you'll need to the JDBC URL in `config.properties` and `install.jsp` from : |
20 | 30 |
|
21 | | - Steps: |
| 31 | +``` |
| 32 | +dburl=jdbc:mysql://mysql:3306/ |
| 33 | +``` |
22 | 34 |
|
23 | | - 1. Install Docker: https://docs.docker.com/engine/installation/ |
24 | | - 2. Install docker-compose: https://docs.docker.com/compose/install/ |
25 | | - 3. Inside this directory, run `sudo docker-compose up` and wait untill everything is configured for you. |
26 | | - 4. In your Browser, go to "http://localhost:8080/JavaVulnerableLab/install.jsp |
27 | | - 5. Change the JDBC URL from jdbc:mysql://localhost:3306 to jdbc:mysql://mysql:3306 |
28 | | - 6. Click the Install Button |
29 | | - 7. Enjoy :) |
| 35 | +to this : |
30 | 36 |
|
| 37 | +``` |
| 38 | +jdbc:mysql://localhost:3306 |
| 39 | +``` |
31 | 40 |
|
32 | | -**Method 2.Very Easiest Method : VirtualBox VM** |
33 | | - The second most easiest way to use Java Vulnerable is using the VirtualBox VM which has everything set up and ready to use. |
34 | | - |
35 | | - Steps: |
36 | | - |
37 | | - 1. Install the VirtualBox : https://www.virtualbox.org/wiki/Downloads |
38 | | - 2. Download the VM Image from here : http://sourceforge.net/projects/javavulnerablelab/files/v0.1/JavaVulnerableLab.ova/download |
39 | | - 3. Import the JavaVulnerable.ova into VirtualBox. |
40 | | - 4. Change the Network Settings to Host-Only Network |
41 | | - 5. Start the Machine and Log into the Machine( Credentials; username: root password: cspf) |
42 | | - 6. Start Tomcat by entering "service tomcat start" in the Terminal |
43 | | - 7. Start mysql by entering "service mysql start" in the Terminal |
44 | | - 8. Find the IP Address of Machine |
45 | | - 9. In your Browser, go to "http://[IP_ADDRESS_OF_VM]:8080/JavaVulnerableLab/install.jsp |
46 | | - 10. Click the Install Button |
47 | | - 11. Enjoy :) |
48 | | - |
49 | | -**Method 3.Easiest Method : Standalone Web Application** |
50 | | - In this mehtod, you will be running an executable "JAR" file which runs the application with an embedded Apache Tomcat. |
51 | | - |
52 | | - Steps: |
53 | | - |
54 | | - 1. Install JDK |
55 | | - 2. Download Executable Jar from here: http://sourceforge.net/projects/javavulnerablelab/files/v0.2/JavaVulnerableLab.jar/download |
56 | | - 3. Double Click the JavaVulnerable.jar to run( if double click is not working, run this command "java -jar JavaVulnerable.jar" in your Terminal or CMD) |
57 | | - 4. In your Browser, go to "http://localhost:8080/JavaVulnerableLab/install.jsp |
58 | | - 5. Click the Install Button |
59 | | - |
60 | | -**Method 4. Using War file:** |
61 | | - This is a NORMAL method to deploy the WAR file. |
| 41 | +4. If you want to play with it on a VPS, you'll need to the JDBC URL in `config.properties` and `install.jsp` from : |
| 42 | + |
| 43 | +``` |
| 44 | +dburl=jdbc:mysql://mysql:3306/ |
| 45 | +``` |
| 46 | + |
| 47 | +to this : |
| 48 | + |
| 49 | +``` |
| 50 | +jdbc:mysql://IP_ADDRESS:3306 |
| 51 | +``` |
| 52 | +And the link at next step will require the server hostname or IP address. |
| 53 | + |
| 54 | +5. You already have a tomcat, and want to deploy the application with a war. |
62 | 55 |
|
63 | 56 | Steps: |
64 | 57 |
|
65 | | - 1. Install Apache Tomcat server |
66 | | - 2. Go to http://[Tomcat_INSTALLED_IP]:8080/manager/ (make sure you have modified tomcat-users.xml file of the tomcat to allow the manager). |
67 | | - 3. Download our WAR file from here: https://sourceforge.net/projects/javavulnerablelab/files/latest/JavaVulnerableLab.war/download |
68 | | - 4. Deploy the WAR in Apache Tomcat manager. |
69 | | - 5. Go to http://[Tomcat_INSTALLED_IP]:8080/JavaVulnerableLab/install.jsp |
70 | | - 6. Click the Install Button |
71 | | - |
72 | | - |
73 | | -Get the VulnerableSpring Project from here: |
74 | | -https://github.com/CSPF-Founder/VulnerableSpring |
| 58 | + 1. Go to http://[Tomcat_INSTALLED_IP]:8080/manager/ (make sure you have modified tomcat-users.xml file of the tomcat to allow the manager). |
| 59 | + 2. Download our WAR file from here: https://sourceforge.net/projects/javavulnerablelab/files/latest/JavaVulnerableLab.war/download |
| 60 | + 3. Deploy the WAR in Apache Tomcat manager. |
| 61 | + |
| 62 | +## Experiment it |
| 63 | + |
| 64 | +1. Once the build is completed and the application is started, go to [/JavaVulnerableLab/install.jsp](http://localhost:8080/JavaVulnerableLab/install.jsp) |
| 65 | + |
| 66 | +2. And click on `Install` button, by leaving default values as-is. |
| 67 | + |
| 68 | +## Notes |
| 69 | + |
| 70 | +**The full course on Hacking and Securing Web Java Programs is available in** |
| 71 | + |
| 72 | +https://www.udemy.com/hacking-securing-java-web-programming/ |
| 73 | + |
| 74 | +**Warning**: It's not recommanded to run this app in `Your Main Machine` or in an `online server`. Prefer using Docker or a VM (vagrant). |
| 75 | + |
| 76 | +You can also get the VulnerableSpring Project from [here](https://github.com/CSPF-Founder/VulnerableSpring). |
75 | 77 |
|
0 commit comments