forked from interference-security/empire-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
restart-api-server.php
55 lines (54 loc) · 1.9 KB
/
restart-api-server.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
// include files
require_once("includes/check-authorize.php");
require_once("includes/functions.php");
$empire_restart = "";
$arr_result = restart_api_server($sess_ip, $sess_port, $sess_token);
if(!empty($arr_result))
{
if(array_key_exists("success", $arr_result))
{
$temp_resp = $arr_result["success"];
if($temp_resp == true)
header("Location: logout.php");
elseif($temp_resp == false)
$empire_restart = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> Failed to restart Empire REST API Server.</div>";
else
$empire_restart = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> ".htmlentities($temp_resp)."</div>";
}
elseif(array_key_exists("error", $arr_result))
{
$error_resp = ucfirst(htmlentities($arr_result["error"]));
$empire_restart = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> $error_resp</div>";
}
else
{
$empire_restart = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> Unexpected response</div>";
}
}
else
{
$empire_restart = "<div class='alert alert-danger'><span class='glyphicon glyphicon-remove'></span> Unexpected response</div>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Empire: Restart API Server</title>
<?php @require_once("includes/head-section.php"); ?>
</head>
<body>
<div class="container">
<?php @require_once("includes/navbar.php"); ?>
<br>
<div class="panel-group">
<div class="panel panel-primary">
<div class="panel-heading">Restart Empire REST API Server</div>
<div class="panel-body"><?php echo $empire_restart; ?>
</div>
</div>
</div><br>
</div>
<?php @require_once("includes/footer.php"); ?>
</body>
</html>