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
- ✏️ 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.
📖 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.
✏️ Install Google Chrome if you don't have it
✏️ 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!