Skip to content

Commit cedc0b6

Browse files
authored
Create cybersecurity.js
1 parent 4249771 commit cedc0b6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

routes/cybersecurity.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import express from 'express';
2+
import * as OWASP from 'owasp-password-strength-test';
3+
4+
const router = express.Router();
5+
6+
router.post('/password-strength-test', (req, res) => {
7+
const { password } = req.body;
8+
const result = OWASP.test(password);
9+
res.json({ strength: result.score });
10+
});
11+
12+
router.post('/vulnerability-scan', async (req, res) => {
13+
const { url } = req.body;
14+
const scanner = new OWASP.Scanner();
15+
const results = await scanner.scan(url);
16+
res.json({ vulnerabilities: results });
17+
});
18+
19+
export default router;

0 commit comments

Comments
 (0)