Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The exploit given in the README was not effective because there #3

Merged
merged 2 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ docker-compose up --build --detach
```

## Known Vulnerabilities
* SQL Injection via search box. - `a%'; insert into items values (default, 'hacker item name','bad bad description'); select * from ITEMS where name like '%banan`
* SQL Injection via search box. - `item%' union all select * from user; -- `
* Cross Site Scripting via search box. - `<script>alert("hey guy");</script>`
34 changes: 31 additions & 3 deletions bootstrapdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,45 @@ db.serialize(function () {
if (err) {
console.error(err);
} else {
const stmt = db.prepare('INSERT INTO item VALUES (null, ?, ?)', function (err) {
const itemTbl = db.prepare('INSERT INTO item VALUES (null, ?, ?)', function (err) {
if (err) {
console.error(err)
}
});

for (var i = 0; i < 3; i++) {
stmt.run('item-' + i, 'item-' + i + ' is the great item evar');
itemTbl.run('item-' + i, 'item-' + i + ' is the great item evar');
}

stmt.finalize(function (err) {
itemTbl.finalize(function (err) {
if (err) {
console.error(err)
} else {
db.close(function (err) {
if (err) {
console.error(err)
}
});
}
});
}
});


db.run('CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username NVARCHAR(1024) NOT NULL, password TEXT NOT NULL)', function (err) {
if (err) {
console.error(err);
} else {
const userTbl = db.prepare('INSERT INTO user VALUES (null, ?, ?)', function (err) {
if (err) {
console.error(err)
}
});
userTbl.run('admin', 'S3cr37P@$$w0rD!');
userTbl.run('user1', 'bad_password');
userTbl.run('user2', 'worse');
userTbl.run('user3', 'fail');
userTbl.finalize(function (err) {
if (err) {
console.error(err)
} else {
Expand Down
Binary file removed db/vulny.db
Binary file not shown.