Skip to content

Latest commit

 

History

History

exercise-1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Exercise 1 - Up and running

In this exercise you will set up the local development environment required for the next exercises.

You will learn to:

  • Install the required software
  • Set up and run the local development environment

Before you start

  • ✏️ Start by cloning this repository into a folder on your computer if you haven't done so already. If you've never used git before, you can alternatively use the the "Download ZIP" button to the right.
  • 📖 Although you have this README.md file on your computer, it's easier to read it on GitHub with formatting. We therefore recommend you keep a web browser tab open with the exercise tasks.

1.1 Installing software

1.1.1 Node.js

📖 Node.js is the platform/runtime that's going to run our web server and backend code. You can test if you already have Node.js installed by opening a terminal and entering node -v which should return a version number if it's installed.

✏️ If you don't have Node.js installed, you can download the latest LTS (long-term support) release from nodejs.org.

Note: If you have Node installed with a version less than the latest LTS version, please upgrade to the latest LTS version before continuing.

1.1.2 Chrome

✏️ Install Google Chrome if you don't have it

1.2 Local development environment setup

✏️ Open a terminal and change directories to the vulnerable-application folder.

✏️ Install all npm dependencies by running the following command:

$ npm install

✏️ Run the following commands to start the web app:

$ npm run dev

✏️ Open http://localhost:3000 in Chrome

📖 You should now see a login prompt saying "Login to vote" on the screen.

✏️ Test that you are able to log in via username user and password user. Log out again afterwards.

✏️ To stop the application, press CTRL+C while inside the terminal window you started the application in.

📖 If you need to restore the state of the database to its initial state, you can run the command npm run seed.


Now that we're all set-up, let's try to hack the app!