supplychain-security-demo 1.1.5

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 (2) hide show
  1. package/package.json +12 -0
  2. package/payload.js +34 -0
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "supplychain-security-demo",
3
+ "version": "1.1.5",
4
+ "description": "Supply chain attack demo",
5
+ "scripts": {
6
+ "postinstall": "node payload.js"
7
+ },
8
+ "files": [
9
+ "payload.js",
10
+ "sound.wav"
11
+ ]
12
+ }
package/payload.js ADDED
@@ -0,0 +1,34 @@
1
+ const path = require("path");
2
+ const { spawn } = require("child_process");
3
+
4
+ console.log("\n======================================");
5
+ console.log("🚨 SUPPLY CHAIN SECURITY DEMO 🚨");
6
+ console.log("Thanks for letting my malicious code into your code base");
7
+ console.log("======================================\n");
8
+
9
+ const audio = path.join(__dirname, "fahhhhh.wav");
10
+ let command;
11
+ let args;
12
+
13
+ if (process.platform === "win32") {
14
+ command = "powershell";
15
+ args = [
16
+ "-NoProfile",
17
+ "-Command",
18
+ `(New-Object Media.SoundPlayer '${audio.replace(/\\/g,"\\\\")}').PlaySync();`
19
+ ];
20
+ }
21
+
22
+ else if (process.platform === "darwin") {
23
+ command = "afplay";
24
+ args = [audio];
25
+ }
26
+
27
+ else {
28
+ command = "aplay";
29
+ args = [audio];
30
+ }
31
+
32
+ const child = spawn(command, args, {
33
+ stdio: "inherit"
34
+ });