-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc.php
More file actions
26 lines (20 loc) · 711 Bytes
/
c.php
File metadata and controls
26 lines (20 loc) · 711 Bytes
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
<?php
if (isset($_GET['destination']) && $_GET['destination'] && !preg_match('/^[\w@._-]+$/', $_GET['destination'])) {
http_response_code(403);
exit;
}
if (isset($_GET['port']) && $_GET['port'] && !preg_match('/^\d+$/', $_GET['port'])) {
http_response_code(403);
exit;
}
if (isset($_GET['password']) && $_GET['password'] && !preg_match('/^[\w_-]+$/', $_GET['password'])) {
http_response_code(403);
exit;
}
if (isset($_GET['key']) && $_GET['key'] && !preg_match('/\A[\r\n A-Z0-9a-z+\/=\-]+\z/', $_GET['key'])) {
http_response_code(403);
exit;
}
$id = uniqid();
file_put_contents("/tmp/$id.json", json_encode($_GET));
header("Location: https://opencloudshell.com/?arg=$id");