Skip to content

karthigaiselvanm/sql-injection-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sql-injection-example

Initial setup for application to run

Pls set below properties in application.properties as per your mysql database setup.

application.mysql.username=root
application.mysql.password=admin
application.mysql.database-name=demodb

Create table in your database

create table credentials(
username varchar(128) not null,
password varchar(128) not null
);

Insert data into table

insert into credentials(username, password) values ('superuser', 'superuser'), ('admin', 'admin');

How to build

mvn clean install

How to run

mvn spring-boot:run

How to test?

Pls test insecure login

Please open http://localhost:8080/index.html in browser and provide the values as below:

Username: dummy
Password: ' or '1'='1

Pls test SECURE login

Please open http://localhost:8080/securelogin.html in browser and provide the values as below:

Username: dummy
Password: ' or '1'='1

About

this example demonstrates the vulnerable sql injection code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 74.9%
  • HTML 25.1%