Skip to content

Commit 356465b

Browse files
authored
Merge pull request snyk-labs#9 from snyk/rework-walkthrough
Rework walkthrough
2 parents 1c78314 + 2624de7 commit 356465b

7 files changed

+153
-88
lines changed

README.md

+18-88
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,12 @@ In this step by step workshop you'll learn how to exploit various real world vul
33

44
# Required software you need to install for this workshop
55

6-
* A proper terminal (linux based) - pick your favourite
7-
* [cUrl](https://curl.haxx.se/download.html) - download and install a binary for your OS
8-
* [Httpie](https://httpie.org/) - (brew install httpie)
9-
* [Node.js & npm](https://nodejs.org/en/) - (brew install node)
10-
* [Maven](https://maven.apache.org/install.html)
11-
* [Java 8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
12-
* [Git](https://git-scm.com/downloads)
13-
* [Mongod](https://docs.mongodb.com/manual/installation/) - (brew install mongodb)
6+
You can do this workshop in 2 different flavours
7+
* Using the prepared [Docker images](install/docker.md)
148

15-
## Docker images
16-
Or you can download this zip files that contains the prepared docker images
17-
* https://drive.google.com/file/d/11LfofyGnQRRGkxcBbobw1S5Yn_pBlHxF/view?usp=sharing
9+
**OR**
1810

19-
By downloading and using the docker images, the tools needed are already included in the containers
20-
21-
### Using the docker images for Goof
22-
- go to the "goof" directory in (unpacked) zip file
23-
24-
Import docker images
25-
```
26-
$ docker load -i snyk-demo-todo_goof.tar
27-
$ docker load -i mongo.tar
28-
```
29-
Start application
30-
```
31-
$ docker-compose up
32-
```
33-
navigate to [http://localhost:3001](http://localhost:3001)
34-
35-
To access the shell
36-
```
37-
$ docker exec -it goof bash
38-
```
39-
40-
### Using the docker images for Java Goof
41-
- go to the "java_goof_docker" directory in (unpacked) zip file
42-
43-
Import docker images
44-
```
45-
$ docker load -i javagoof.tar
46-
```
47-
Start application
48-
```
49-
$ docker-compose up
50-
```
51-
navigate to [http://localhost:8080](http://localhost:8080)
52-
53-
To access the shell
54-
```
55-
$ docker exec -it javagoof bash
56-
```
11+
* Install everything on your [local machine](install/manual.md)
5712

5813

5914
# An introduction to this workshop
@@ -72,27 +27,11 @@ For each vulnerability section in this workshop, you’ll be given information a
7227

7328
# Goof installation
7429

75-
In a terminal, start mongod, using the following command:
76-
77-
```
78-
$ mongod &
79-
```
80-
81-
Next you’ll need to fork the goof repository, clone it and build your application. The application can be found on GitHub here: [https://github.com/snyk/goof](https://github.com/snyk/goof).
82-
83-
Fork this application to your local repository so that any remediation you choose to perform will only happen on your repository and won’t affect others in this workshop.
84-
85-
Clone the repository onto your local file system and navigate into the project’s root directory. Run the following commands to download the dependencies for the goof application:
30+
Depending on your choice before pick the appropriate install manual
31+
* using [Docker Images](install/goof_docker.md)
32+
* install on [Local machine](install/goof_local.md)
8633

87-
```
88-
$ npm install
89-
```
9034

91-
Your application should be ready to run. You can start the application by running the following command from within the main project directory:
92-
93-
```
94-
$ npm start
95-
```
9635

9736
From your browser of choice, navigate to [http://localhost:3001](http://localhost:3001) and you should see the following page.
9837

@@ -105,7 +44,10 @@ Take a few minutes playing with the site, and in particular, create a few todo i
10544

10645
## Scan your application
10746

108-
First of all, let's look at it from the blue (defensive) side. We need to scan our application to understand the direct and indirect dependencies that exist in the application, as well as the vulnerabilities in each library. To do this, navigate to [https://snyk.io](https://snyk.io) and click "Sign up" or "Log in" (if you're already a user), on the top right of the site:
47+
First of all, let's look at it from the blue (defensive) side.
48+
Fork the goof application to your own github account. The application can be found on GitHub here: [https://github.com/snyk/goof](https://github.com/snyk/goof).
49+
We need to scan our application to understand the direct and indirect dependencies that exist in the application, as well as the vulnerabilities in each library. To do this, navigate to [https://snyk.io](https://snyk.io) and click "Sign up" or "Log in" (if you're already a user), on the top right of the site:
50+
10951

11052
![Login button](images/image13.png)
11153

@@ -187,6 +129,8 @@ Make sure your new PR tests do not introduce any new security or licence issue h
187129

188130
When you're happy with the PR, merge the changes.
189131

132+
#### Local machine install only (This will not work when you are using the Docker images)
133+
190134
If you're running the application locally stop it by hitting ```Ctrl+C``` in the window you ran ```npm start```. Get the latest code from GitHub by running ```git fetch```. Download the new version of ```st``` by running ```npm install``` and then start your application again, using ```npm start```.
191135

192136
Try your hacks again. *Congratulations!*, you’ve remediated the vulnerability and should now be redirected to the homepage each time you try to break free of the public folder.
@@ -274,25 +218,10 @@ After updating your application, try your hacks again. Congratulations, you’ve
274218

275219
# Java Goof Installation
276220

277-
To start with, you’ll need to clone the java-goof repository, and build your application. The application can be found on GitHub here: [https://github.com/snyk/java-goof](https://github.com/snyk/java-goof).
278-
279-
Clone the repository onto your local file system
221+
Depending on your choice before pick the appropriate install manual
222+
* using [Docker Images](install/javagoof_docker.md)
223+
* install on [Local machine](install/javagoof_local.md)
280224

281-
```
282-
$ git clone https://github.com/benas/todolist-mvc.git
283-
```
284-
285-
Open a terminal and run the following command from the root directory:
286-
287-
```
288-
$ mvn install
289-
```
290-
291-
Navigate into the ```todolist-web-struts``` directory and run the following to start the server:
292-
293-
```
294-
$ mvn tomcat7:run
295-
```
296225

297226
From a browser navigate to the following URL: [http://localhost:8080/](http://localhost:8080/)
298227

@@ -312,8 +241,9 @@ When signed in, you’ll see a number of todo entries. If you click about at the
312241
## Scan your application
313242

314243
Back on the blue (defensive) team, now. We need to scan our application to understand the direct and indirect dependencies that exist in the application, as well as the vulnerabilities in each library.
244+
Fork Java Goof to your own github account. The application can be found on GitHub here: [https://github.com/snyk/java-goof](https://github.com/snyk/java-goof)
315245

316-
If you've already got a Snyk account from earlier in the workshop, you just need to add the Java Goof repository you cloned earlier into the Snyk dashboard. If you haven't done so, create your account as follows:
246+
If you've already got a Snyk account from earlier in the workshop, you just need to add the Java Goof repository into the Snyk dashboard. If you haven't done so, create your account as follows:
317247

318248
Navigate to [https://snyk.io](https://snyk.io) if you haven't done so already, click "Log in" or "Sign up" on the top right of the site.
319249

install/docker.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Using Docker images for the workshop
2+
3+
Software needed:
4+
* Docker
5+
6+
You can do this entire workshop based on the Docker images we supply you.
7+
This way you do not have to install any software manually if you dont want to.
8+
9+
The Docker images will be supplied by USB pen-drive or you can download the zip file from the internet if WIFI is sufficient
10+
* https://drive.google.com/file/d/11LfofyGnQRRGkxcBbobw1S5Yn_pBlHxF/view?usp=sharing
11+
12+
Unzip workshop.zip and work from there.
13+
14+
15+
16+
17+
18+

install/goof_docker.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Using the docker images for Goof
2+
3+
- go to the "goof" directory in the (unpacked) zip file
4+
5+
Import docker images
6+
```
7+
$ docker load -i snyk-demo-todo_goof.tar
8+
$ docker load -i mongo.tar
9+
```
10+
Start application
11+
```
12+
$ docker-compose up
13+
```
14+
From your browser of choice, navigate to [http://localhost:3001](http://localhost:3001) and you should see the following page.
15+
16+
![Goof homepage](../images/image12.png)
17+
18+
### Important:
19+
20+
We will use be using the following tools
21+
* [cUrl](https://curl.haxx.se/download.html) - download and install a binary for your OS
22+
* [Httpie](https://httpie.org/) - (brew install httpie)
23+
24+
You can use these tools from your local machine **OR** you can access the Docker image that have these tools pre-installed
25+
26+
To access the shell (this is only needed if you do not have cUrl on your local machine)
27+
```
28+
$ docker exec -it goof bash
29+
```

install/goof_local.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#Goof on local machine
2+
3+
In a terminal, start mongod, using the following command:
4+
5+
```
6+
$ mongod &
7+
```
8+
9+
Next you’ll need to fork the goof repository, clone it and build your application. The application can be found on GitHub here: [https://github.com/snyk/goof](https://github.com/snyk/goof).
10+
11+
Fork this application to your local repository so that any remediation you choose to perform will only happen on your repository and won’t affect others in this workshop.
12+
13+
Clone the repository onto your local file system and navigate into the project’s root directory. Run the following commands to download the dependencies for the goof application:
14+
15+
```
16+
$ npm install
17+
```
18+
19+
Your application should be ready to run. You can start the application by running the following command from within the main project directory:
20+
21+
```
22+
$ npm start
23+
```
24+
25+
From your browser of choice, navigate to [http://localhost:3001](http://localhost:3001) and you should see the following page.
26+
27+
![Goof homepage](../images/image12.png)

install/javagoof_docker.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Using the docker images for Java Goof
2+
- go to the "java_goof_docker" directory in the (unpacked) zip file
3+
4+
Import docker images
5+
```
6+
$ docker load -i javagoof.tar
7+
```
8+
Start application
9+
```
10+
$ docker-compose up
11+
```
12+
From a browser navigate to the following URL: [http://localhost:8080/](http://localhost:8080/).
13+
You will see this application.
14+
15+
![Java Goof homepage](../images/image9.png)
16+
17+
18+
### Important:
19+
20+
We will use be using the following tools
21+
* [cUrl](https://curl.haxx.se/download.html) - download and install a binary for your OS
22+
* [Httpie](https://httpie.org/) - (brew install httpie)
23+
24+
You can use these tools from your local machine **OR** you can access the Docker image that have these tools pre-installed
25+
26+
To access the shell
27+
```
28+
$ docker exec -it javagoof bash
29+
```

install/javagoof_local.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Java Goof on local machine
2+
To start with, you’ll need to clone the java-goof repository, and build your application. The application can be found on GitHub here: [https://github.com/snyk/java-goof](https://github.com/snyk/java-goof).
3+
4+
Clone the repository onto your local file system
5+
6+
```
7+
$ git clone https://github.com/benas/todolist-mvc.git
8+
```
9+
10+
Open a terminal and run the following command from the root directory:
11+
12+
```
13+
$ mvn install
14+
```
15+
16+
Navigate into the ```todolist-web-struts``` directory and run the following to start the server:
17+
18+
```
19+
$ mvn tomcat7:run
20+
```

install/local.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Install on local machine
2+
3+
This is the software you need if you want to run everything on your local machine
4+
5+
* A proper terminal (linux based) - pick your favourite
6+
* [cUrl](https://curl.haxx.se/download.html) - download and install a binary for your OS
7+
* [Httpie](https://httpie.org/) - (brew install httpie)
8+
* [Node.js & npm](https://nodejs.org/en/) - (brew install node)
9+
* [Maven](https://maven.apache.org/install.html)
10+
* [Java 8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
11+
* [Git](https://git-scm.com/downloads)
12+
* [Mongod](https://docs.mongodb.com/manual/installation/) - (brew install mongodb)

0 commit comments

Comments
 (0)