Sample log in page for assignment / project
Ensure that you have postgres and node installed on your system Installed all the libraries and dependencies
Enter own postgres details for running locally You will need to create a database and database table Create psql user postgres
- Creat user postgres
psql -U postgres
- Createa a DB
login_form_example
- Enter DB
\c login_form_example
In Server.js you we will need to add in your own credentials below is the code that you will need to modify
const db = knex({
client: 'pg',
connection: {
host: '127.0.0.1',
user: '', // Enter own details for postgres
password: '', // Enter own details for postgres
database: '' // Enter own details for postgres server my db was login_form_example. Table name was users
}
})
The vulnerable code exmaple can be seen in server.js The code that is commetned out is the query parameterization which fixes the vulnerabilty
whatever' OR email LIKE 'admin%'--