-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.php
More file actions
489 lines (436 loc) · 19.2 KB
/
Copy pathapi.php
File metadata and controls
489 lines (436 loc) · 19.2 KB
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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<?php
$page = "API Manager";
include'header.php';
?>
<?php
if (isset($_POST['createKey']))
{ if ($_POST['ip'] == ''){
$ipapiss = '1.1.1.1';}
else{
$ipapiss = $_POST['ip'];
}
function generateRandomString($length = 10){
$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZa-bcdefghijklmnopqrstuvwxyz-';
$charactersLength = strlen($characters);
$randomString = '';
for($i=0;$i<$length;$i++){
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
$timeapi = ($_POST['time']);
$csrf = ($_POST['__csrf']);
if ($info["API"] != 0)
{
echo '
<script type="text/javascript">
toastr["error"]("this system is under maintenance.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}else{
if ($csrf != $_SESSION['token'])
{
echo '
<script type="text/javascript">
toastr["error"]("error token.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}else{if (empty($timeapi) || empty($ipapiss)){
echo '
<script type="text/javascript">
toastr["error"]("There\'s a lack of information, please fill in all the fields.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}else{
if ($timeapi < 30)
{
echo '
<script type="text/javascript">
toastr["error"]("The minimum accepted time is 30 seconds.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}else{
if ($timeapi > $userInfo['mbt'] +$userInf['secs'])
{
echo '
<script type="text/javascript">
toastr["error"]("You cannot create an API with more seconds than the one in your plans.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}else{
if (filter_var($ipapiss, FILTER_VALIDATE_IP) === FALSE)
{
echo '
<script type="text/javascript">
toastr["error"]("IP Address Allowed is not a valid IP.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}else{
$ipapis = htmlentities($ipapiss);
$key = generateRandomString(40);
$SQL = $odb -> prepare("INSERT INTO `apiplus` VALUES(NULL, :user, :timeapi, :ip, :apikey, UNIX_TIMESTAMP())");
$SQL -> execute(array(':user' => $_SESSION['ID'],':timeapi' => $timeapi, ':ip' => $ipapis, ':apikey' => $key));
echo '
<script type="text/javascript">
toastr["success"]("Your API has been successfully generated.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}}}}}}}
if (isset($_POST['delete']))
{
$csrf = ($_POST['__csrf']);
if ($csrf != $_SESSION['token'])
{
echo '
<script type="text/javascript">
toastr["error"]("error token.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}else{
$delete = $_POST['delete'];
$SQL = $odb -> query("DELETE FROM `apiplus` WHERE `ID` = '$delete'");
echo '
<script type="text/javascript">
toastr["success"]("API has been removed.")
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>';
}}
?>
<div class="main-content">
<div class="page-content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0 font-size-18">API Manager</h4><div class="ml-auto">
<nav aria-label="breadcrumb">
<ol class="breadcrumb m-0 p-0">
<li class="breadcrumb-item text-primary active" aria-current="page"><?php echo htmlspecialchars($info["nom"]); ?></li>
<li class="breadcrumb-item text-muted" aria-current="page">/ <?php echo htmlspecialchars($page); ?></li>
</ol>
</nav>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-header">
<div class="card-title">
Manage API
</div>
</div>
<div class="card-body">
<div class="table-responsive-lg">
<table class="table table-striped mb-0">
<thead>
<tr>
<th scope="col">Attack Duration</th>
<th scope="col">Key</th>
<th scope="col">Whitelist</th>
<th scope="col">Date</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody> <?php
$SQLGetTickets = $odb -> prepare("SELECT * FROM `apiplus` WHERE `user` = :user");
$SQLGetTickets -> execute(array(':user' => $_SESSION['ID']));
while ($getInfo = $SQLGetTickets -> fetch(PDO::FETCH_ASSOC))
{
$timeapi = $getInfo['timeapi'];
if ($getInfo['ip'] == '1.1.1.1'){
$ipa = 'Na';}
else{
$ipa = $getInfo['ip'];
}
?>
<tr><form method="POST">
<input type="hidden" id="__csrf" name="__csrf" value="<?php echo $_SESSION['token']; ?>">
<td><?php echo htmlspecialchars($getInfo['timeapi']); ?></td> <td><?php echo htmlspecialchars($getInfo['apikey']); ?></td>
<td><?php echo htmlspecialchars($ipa); ?></td>
<td><?php echo strftime("%d %B - %H:%M", $getInfo['date']); ?></td>
<td><button type="submit" title="Delete API" name="delete" value="<?php echo $getInfo['ID']; ?>" class="btn btn-danger btn-sm"><i class="bx mr-2 bx-x text"></i></button></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
<?php if ($stats -> apisst($odb) == 0) { ?>
<br>
<center><h6><i class="bx mr-2 bx-x text"></i> No data available.</h6></center> <br>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-4">
<div class="card">
<div class="card-header">
<div class="card-title">
Generate API
</div>
</div>
<form method="POST" id="GenerateAPI">
<input type="hidden" id="__csrf" name="__csrf" value="<?php echo $_SESSION['token']; ?>">
<div class="card-body">
<div class="form-group"><label for="duration">
Max Attack Duration
</label> </br><input class="form-range" step="1" min="0" max="<?php
if($userInfo['mbt'] == ""){
echo "0";
}else{
echo $userInfo['mbt'] +$userInf['secs'];
}
?>" value="0" oninput="this.form.time.value=this.value" type="range">
<input class="form-control" name="time" type="number" placeholder="Min: 30, Max: <?php
if($userInfo['mbt'] == ""){
echo "0";
}else{
echo $userInfo['mbt'] +$userInf['secs'];
}
?>
">
</div>
<div class="form-group"><label for="ip-address">IP Address Allowed</label><input class="form-control" name="ip" placeholder=""></div>
<strong>Informations :</strong>
<p>If you want to allow requests from all, keep this field empty.</p>
</div>
<div class="card-footer text-right"><button type="submit" name="createKey" class="btn btn-primary">Deploy</button></div>
</form>
</div>
</div>
<div class="col-xl-8">
<div class="card mb-3">
<div class="card-header">
<div class="card-title">
Documentation
</div>
</div>
<div class="card-body">
<div class="form-group"><label>
Layer 4 Attack
</label><input type="text" class="form-control" id="" name="" maxlength="" value="<?php echo $info["url"]; ?>start?user=<?php echo $_SESSION['ID'] ?>&api_key=&target=8.8.8.8&port=80&duration=30&method=NTP" placeholder="" onclick="this.select();document.execCommand('copy');toastr['success']('Successfully copied!', '');">
</div>
<div class="form-group"><label>
Layer 7 Attack
</label><input type="text" class="form-control" id="" name="" maxlength="" value="<?php echo $info["url"]; ?>start7?user=<?php echo $_SESSION['ID'] ?>&api_key=&address=&duration=&type7=&mode=&rate=&origin=Worldwide&host=&post=" placeholder="" onclick="this.select();document.execCommand('copy');toastr['success']('Successfully copied!', '');">
</div>
<div class="form-group"><label>
Stop Attack
</label><input type="text" class="form-control" id="" name="" maxlength="" value="<?php echo $info["url"]; ?>stop?user=<?php echo $_SESSION['ID'] ?>&api_key=&stopper=" placeholder="" onclick="this.select();document.execCommand('copy');alert('Copied');">
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title">
FAQ
</div>
</div>
<div class="card-body">
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
<button class="accordion-button fw-medium collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
What is the purpose of the API
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse" aria-labelledby="headingOne" data-bs-parent="#accordionExample" style="">
<div class="accordion-body">
<div class="text-muted">
<p>The API is that you can send attacks via a link, which allows you to use our services on your stresser<br></p>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="headingTwo">
<button class="accordion-button fw-medium collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
How to use it
</button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample" style="">
<div class="accordion-body">
<div class="text-muted">
<p>AIt is very easy to use API, above in the documentation you have links on how to start attacks and how to stop them. You can see the list of methods <a href="helpdesk">here</a></p>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="headingThree">
<button class="accordion-button fw-medium collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Contact Support
</button>
</h2>
<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
<div class="accordion-body">
<div class="text-muted">
If you need help or have any questions you can contact us at our Telegram group or contact the owner at <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1578667661735565783b7870">[email protected]</a>, dont forget to also read our support / help page which may answer your questions.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include'footer.php'; ?>
</div>
</div>
</body>
</html>