Skip to content

Commit

Permalink
estlint --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
not-a-rootkit committed Nov 13, 2024
1 parent 57801cf commit 1971525
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions security/badware/server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,18 @@ router.post('/form', (req, res) => {

// Serves an arbitrary executable file to test download detection
router.get('/download', (req, res) => {
// Create a buffer with a minimal valid PE header
const fileData = Buffer.alloc(64);
// MZ header (magic bytes)
const magicBytes = [0x4d, 0x5a];
// DOS stub filled with zeros
const dosStub = new Uint8Array(58).fill(0);
fileData.set(magicBytes, 0);
fileData.set(dosStub, 2);
// Create a buffer with a minimal valid PE header
const fileData = Buffer.alloc(64);
// MZ header (magic bytes)
const magicBytes = [0x4d, 0x5a];
// DOS stub filled with zeros
const dosStub = new Uint8Array(58).fill(0);
fileData.set(magicBytes, 0);
fileData.set(dosStub, 2);

res.setHeader("Content-Type", "application/octet-stream");
res.setHeader("Content-Disposition", 'attachment; filename="test.exe"');
res.send(fileData);
res.setHeader('Content-Type', 'application/octet-stream');
res.setHeader('Content-Disposition', 'attachment; filename="test.exe"');
res.send(fileData);
});


module.exports = router;

0 comments on commit 1971525

Please sign in to comment.