-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
136 lines (120 loc) · 3.98 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<script>
const txt = `
Congratulations on successfully conducting a JS Injection attack!
<br>
Here's your flag: NUV_CTF{W3LC0ME-T0-CTF-1337}
<br>
There's more where that came from!
<br>
<a href="https://forms.office.com/r/RLeSMHnnhx" target="_blank">Register Now!</a>
<img src="QRCode_for_CTF_Registration.png" alt="https://forms.office.com/r/RLeSMHnnhx">
`;
const originalAlert = window.alert;
function alertCallback(...args) {
document.getElementById("res1").innerHTML = txt;
console.log("Callback-ed!");
return originalAlert(args);
}
window.alert = alertCallback;
alert = alertCallback;
Object.defineProperty(globalThis, "alert", { value: alertCallback });
document.addEventListener("DOMContentLoaded", () => {
document.getElementById("form").addEventListener("submit", (e) => {
e.preventDefault();
let a = document.getElementById("sum").value;
document.getElementById("result").innerHTML = "The answer is: ";
document.getElementById("result").innerHTML += eval(a);
});
});
</script>
<style>
* {
box-sizing: border-box;
padding: 0;
margin: 0;
overflow-y: auto;
}
html,
body {
width: 100%;
height: 100%;
}
img {
display: block;
max-width: 50vw;
/* max-width: 100%; */
max-height: 50vh;
}
body {
display: flex;
justify-content: center;
align-items: center;
background: rgb(238, 174, 202);
background: radial-gradient(circle, rgba(238, 174, 202, 1) 0%, rgba(148, 187, 233, 1) 100%);
}
body>div {
text-align: center;
}
body>div>form>* {
padding: 1rem;
}
.btn {
padding: 0.5rem;
background-color: #e879f9;
border: 2px solid #c026d3;
border-radius: 0.25rem;
color: rgb(31 41 55);
transition-property: color, border-color;
transition-duration: 100ms;
transition-timing-function: linear;
}
.btn:hover,
.btn:active,
.btn:focus {
background-color: #c026d3;
color: rgb(243 244 246);
}
textarea {
background-color: transparent;
border-radius: 0.25rem;
}
label {
font-weight: 600;
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1.25rem;
/* 20px */
line-height: 1.75rem;
/* 28px */
margin-block-end: 1.5rem;
}
</style>
</head>
<body>
<noscript>
You'll want to enable javascript if you want to complete this challenge!
</noscript>
<div>
<form action="." method="get" id="form">
<label for="sum">Enter Mathematical Problem</label>
<br>
<textarea name="sum" id="sum"></textarea>
<div class="btns">
<input type="submit" value="Calculate" class="btn">
<input type="reset" value="Reset" class="btn">
</div>
</form>
<div class="result" id="result">
Enter mathematical problem to get a solution.
<br>
Try "13+37" to get started.
</div>
<div class="result" id="res1"></div>
</div>
</body>
</html>