This repository has been archived by the owner on May 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (50 loc) · 1.4 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const PORT = 19777;
import express from "express";
import https from "https";
import cors from "cors";
import fs from "fs";
import { faker } from "@faker-js/faker";
import { exec } from "child_process";
const app = express();
const cert = fs.readFileSync("./edr-bypass.crt", "utf8");
const key = fs.readFileSync("./edr-bypass.private.key", "utf8");
const server = https.createServer(
{
key,
cert,
},
app
);
exec(
`sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ./edr-bypass.crt`,
(error, stdout, stderr) => {
if (error || stderr) {
console.log(`error: ${error.message || stderr}`);
console.log("You may need to add the cert as trusted yourself");
console.log(
"Url:",
"https://github.com/marklai1998/edr-bypass/blob/main/edr-bypass.crt"
);
}
app.use(cors());
app.post("/", (req, res) => {
res.setHeader("Content-Type", "application/json");
const fakeResponse = {
ret: 0,
data: {
dlp: true,
mac_address: faker.internet.mac(),
device_id: faker.datatype.uuid(),
ip: faker.internet.ip(),
spend_time: 0,
is_install_soft: true,
},
};
console.log("Response: ", fakeResponse);
res.send(fakeResponse);
});
server.listen(PORT, () => {
console.log(`Listening on port: ${PORT}`);
});
}
);