-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
99 lines (89 loc) · 3.55 KB
/
index.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
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
<?php
include "config.php";
$config = include 'config.php';
if($config['username'] == '' && $config['password'] == ''){
echo '<meta http-equiv="refresh" content="0; url=install" />';
exit();
}
session_start();
if (isset($_SESSION['sec-username'])) {
$uname = $_SESSION['sec-username'];
if ($uname == $config['username']) {
echo '<meta http-equiv="refresh" content="0; url=dashboard.php" />';
exit;
}
}
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
$error = "No";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<title>Malware Scanner › Admin Panel</title>
<!-- CSS -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/admin.min.css">
<!-- Favicon -->
<link rel="shortcut icon" href="assets/img/favicon.png">
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<a href="index.php"><i class="fa fa-s"></i> Malware <strong>Scanner</strong></a>
</div>
<div class="login-box-body">
<p class="login-box-msg">Malicious Code Detector</p>
<?php
if (isset($_POST['signin'])) {
$username = $_POST['username'];
$password = hash('sha256', $_POST['password']);
if ($username == $config['username'] && $password == $config['password']) {
$_SESSION['sec-username'] = $username;
echo '<meta http-equiv="refresh" content="0;url=dashboard.php">';
} else {
echo '<br />
<div class="callout callout-danger">
<i class="fa fa-exclamation-circle"></i> The entered <strong>Username</strong> or <strong>Password</strong> is incorrect.
</div>';
$error = "Yes";
}
}
?>
<form action="" method="post">
<div class="form-group has-feedback <?php
if ($error == "Yes") {
echo 'has-error';
}
?>">
<input type="username" name="username" class="form-control" placeholder="Username" <?php
if ($error == "Yes") {
echo 'autofocus';
}
?> required>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" name="password" class="form-control" placeholder="Password" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-12">
<button type="submit" name="signin" class="btn btn-primary btn-block btn-flat btn-lg"><i class="fa fa-sign-in"></i>
Sign In</button>
</div>
</div>
</form>
</div>
</div>
<!-- Javascript -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>