-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi_key_management.html
executable file
·377 lines (352 loc) · 17.2 KB
/
api_key_management.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<html lang="en">
<head>
<meta charset="utf-8">
<title>XposedOrNot: API Key Management</title>
<link rel="dns-prefetch" href="cdnjs.cloudflare.com">
<link rel="dns-prefetch" href="static.hotjar.com">
<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
<link rel=stylesheet
href='https://fonts.googleapis.com/css?family=Poppins%3A300%2C400%2C500%2C600%2C700%2C900&subset'
type=text/css media=all>
<link href="/static/css/style.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css"
integrity="sha512-rt/SrQ4UNIaGfDyEXZtNcyWvQeOq0QLygHluFQcSjaGB04IxWhal71tKuzP6K8eYXYB6vJV4pHkXcmFGGQ1/0w=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css"
integrity="sha256-BtbhCIbtfeVWGsqxk1vOHEYXS6qcvQvLMZqjtpWUEx8=" crossorigin="anonymous" />
<script src="/static/scripts/utils.js"></script>
<link href="/static/css/style2.css" type="text/css" rel="stylesheet" defer>
<link href="/static/css/xon-report.css" type="text/css" rel="stylesheet" defer>
<meta name="viewport" content="width=device-width, maximum-scale=5.0, initial-scale=1.0">
<meta name="description" content="XposedOrNot: Get a detailed report of your data breach exposure">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="Devanand Premkumar">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-validator/0.5.3/js/bootstrapValidator.js"></script>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<style>
body {
background-color: #f5f5f5;
}
.navbar {
margin-bottom: 20px;
}
.card {
box-shadow: 0px 0px 15px 0px rgba(50, 50, 50, 0.2);
}
h3 {
color: #007bff;
//text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}
.benefit-card {
border: none;
border-radius: 10px;
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
}
.benefit-card:nth-child(even) {
background: #007bff;
color: #fff;
}
.benefit-card:nth-child(odd) {
background: #fff;
color: #007bff;
}
.benefit-card .card-title {
font-weight: 700;
font-size: 1.2em;
}
.benefit-card .card-text {
font-size: 1em;
}
</style>
<script src="/static/scripts/other-libraries.js" defer></script>
</head>
<body data-gr-c-s-loaded="true" class="" style="" data-new-gr-c-s-check-loaded="8.884.0" data-gr-ext-installed="">
<div class="mobileheader-area">
<div class="container">
<div class="row">
<div class="col-lg-12">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="index.html">
<p>XposedorNot</p>
</a>
<button class="hamburger hamburger--squeeze navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto"></ul>
<div class="main-menu-part">
<ul>
<li>
<a href="password.html">Password</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
<li>
<a target="_blank" rel="noopener noreferrer" href="https://blog.xposedornot.com/">Blog</a>
</li>
<li>
<a target="_blank" rel="noopener noreferrer" href="https://twitter.com/XposedOrNot">
<em class="fab fa-twitter"></em>
</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
</div>
</div>
<header class="header-area">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-3">
<div class="header-left">
<a href="https://XposedOrNot.com">
<p>XposedorNot</p>
</a>
</div>
</div>
<div class="col-lg-9 col-md-9">
<div class="header-right">
<ul>
<li>
<a href="password.html">Password</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
<li>
<a target="_blank" rel="noopener noreferrer" href="https://blog.xposedornot.com/">Blog</a>
</li>
<li>
<a target="_blank" rel="noopener noreferrer" href="https://twitter.com/XposedOrNot">
<em class="fab fa-twitter"></em>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</header>
<div class="container">
<br>
<div class="row justify-content-center align-items-center" style="height:80vh">
<div class="col-12">
<div class="card" align="center">
<div class="card-body">
<h3 class="text-center mb-5"> XposedOrNot API Key Management</h3>
<p align="center">This is your current API key which can be used to query breaches related to domains
which are verified.
<form id="emailForm">
<div class="form-group">
<div class="input-group">
<input type="text" style="text-align:center; font-weight: bold; font-size:16px;"
class="form-control w-75 form-control" id="api_key" name="api_key"
placeholder="ImRldmEuc2VjdXJpdHlAZ21haWwuY29tIg.ZJpu5g.MrhgMQk60I5TJyYHke6YNqrsabk"
readonly>
<div class="input-group-append">
<button type="submit" class="btn btn-primary" id="submitButton">
<span id="submitText">Reset API Key</span>
<span id="submitSpinner" class="spinner-border spinner-border-sm d-none" role="status"
aria-hidden="true"></span>
</button>
</div>
</div>
</div>
</form>
<div id="rateLimitMessage" class="alert alert-warning mt-3" style="display: none;">
<i class="fas fa-exclamation-triangle"></i> Too many requests. Please slow down and try again
later.
</div>
<div id="successMessage" class="alert alert-success mt-3" style="display: none;">
<i class="fas fa-check-circle"></i> API Reset successfully completed. You may use the new API key.
</div>
<div id="errorMessage" class="alert alert-danger mt-3" style="display: none;">
<i class="fas fa-times-circle"></i> There was an error processing your request. Please try again
later.
</div>
<div id="curl" name="curl" class="alert alert-primary mt-3">
<blockquote>
curl -L -X POST -H "x-api-key: [KEY]" -H "Content-Length: 0"
https://api.xposedornot.com/v1/domain-breaches/
</blockquote>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-3 col-md-6 mb-4">
<div class="card benefit-card">
<div class="card-body">
<h5 class="card-title">Breach Checks</h5>
<p class="card-text">Our API allows checks for data breaches, providing an up-to-date
insight into potential user data expsure across all validated domains.</p>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 mb-4">
<div class="card benefit-card">
<div class="card-body">
<h5 class="card-title">Seamless Integration</h5>
<p class="card-text">Our API is designed to integrate seamlessly with SIEM, SOAR and
other security systems, enhancing your cybersecurity posture.</p>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 mb-4">
<div class="card benefit-card">
<div class="card-body">
<h5 class="card-title">Real-Time Updates</h5>
<p class="card-text">Our API delivers real-time updates, enabling swift response to any
new or emerging data breaches that could impact your validated domains.</p>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 mb-4">
<div class="card benefit-card">
<div class="card-body">
<h5 class="card-title">Robust Security</h5>
<p class="card-text">The API is designed with strong security measures, ensuring the
protection of sensitive data while providing a robust tool for breach management.
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br><br>
<div align="center">Please read our <a href="api_doc.html">API Documentation</a> and <a
href="xposedornot.apiary.com">API Playground</a> for more details.</strong></div>
<div align="center">
<button type="button" class="btn-lg btn-primary" style="background-color:#FC9E11;color:white">
</em> Back to Breaches Dashboard </button>
</div>
</div>
<div class="container text-center" style="font-family:Poppins">
<footer>
<aside>
<hr>
<div xmlns:cc="https://creativecommons.org/ns#" about="https://creativecommons.org">
<div class="footer-menu" style="width:30%;Text-align:center;float:left;">
<a style="color:blue" href="privacy">Privacy Policy</a>
</div>
</div>
<p>
<div class="custom-control custom-switch" style="Text-align:right;Width:30%;float:right">
<input type="checkbox" class="custom-control-input" id="darkSwitch">
<label class="custom-control-label" for="darkSwitch">Dark Mode</label>
</div>
</p>
</aside>
</footer>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/js/bootstrap.min.js"
integrity="sha512-7rusk8kGPFynZWu26OKbTeI+QPoYchtxsmPeBqkHIEXJxeun4yJ4ISYe7C6sz9wdxeE1Gk3VxsIWgCZTc+vX3g=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-108891851-1" rel="preconnect"></script>
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=_turnstileCb" async defer></script>
<script src="/static/scripts/common.js"></script>
<script type="text/javascript">
$.urlParam = function (name) {
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
}
let token;
try {
email = decodeURIComponent($.urlParam('email'));
token = decodeURIComponent($.urlParam('token'));
} catch (error) {
window.location.replace("https://xposedornot.com");
}
$(document).ready(function () {
$('.btn-lg.btn-primary').click(function () {
var newUrl = 'breach-dashboard.html?email=' + encodeURIComponent(email) + '&token=' + encodeURIComponent(token);
window.location.href = newUrl;
});
});
let api_url = "https://api.xposedornot.com/v1/get-api-key/" + token;
$.ajax({
url: api_url,
type: 'GET',
success: function (res) {
$('#api_key').val(res.api_key);
message = '💡 You may test using this : curl -L -X POST -H "x-api-key: ' + res.api_key + '" -H "Content-Length: 0" https://api.xposedornot.com/v1/domain-breaches/'
document.getElementById('curl').innerText = message
},
error: function (error) {
if (error.responseJSON && error.responseJSON.error === 'invalid_token') {
alert("Invalid token. Please try again.");
}
}
});
document.getElementById('emailForm').addEventListener('submit', function (event) {
event.preventDefault();
hideAllMessages();
resetApiKey();
});
function showRateLimitMessage() {
document.getElementById('rateLimitMessage').style.display = "block";
}
function showSuccessMessage() {
document.getElementById('successMessage').style.display = "block";
}
function showErrorMessage(message) {
document.getElementById('errorMessage').innerText = message;
document.getElementById('errorMessage').style.display = "block";
}
function resetApiKey() {
document.getElementById('submitText').style.display = "none";
document.getElementById('submitSpinner').style.display = "inline-block";
document.getElementById('submitButton').disabled = true;
hideAllMessages();
fetch(`https://api.xposedornot.com/v1/create-api-key/${token}`)
.then(response => {
if (!response.ok) {
if (response.status === 429) {
showRateLimitMessage();
} else {
showErrorMessage('Network response was not ok');
}
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
if (data.status === "success") {
document.getElementById('api_key').value = data.api_key;
showSuccessMessage();
message = '💡 You may test using this : curl -L -X POST -H "x-api-key: ' + data.api_key + '" -H "Content-Length: 0" https://api.xposedornot.com/v1/domain-breaches/'
document.getElementById('curl').innerText = message
} else {
showErrorMessage('Failed to reset API key');
}
})
.catch(() => {
showErrorMessage('An error occurred while resetting your API key. Please try again later.');
})
.finally(() => {
document.getElementById('submitText').style.display = "inline-block";
document.getElementById('submitSpinner').style.display = "none";
document.getElementById('submitButton').disabled = false;
});
}
function hideAllMessages() {
document.getElementById('rateLimitMessage').style.display = "none";
document.getElementById('successMessage').style.display = "none";
document.getElementById('errorMessage').style.display = "none";
}
</script>
</body>
</html>