-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmalware-test.php
154 lines (142 loc) · 7.29 KB
/
malware-test.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
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
<?php
require './getQuestions.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Malware Repository | Malware Test</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css">
<link rel="stylesheet" href="./assets/fonts/ionicons.min.css">
<link rel="manifest" href="./manifest.json"/>
<link rel="stylesheet" href="assets/css/Footer-Dark.css">
<style>
body{
color: black;
}
.card-1 {
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}
.card-1:hover {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
.card-2 {
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
.card-3 {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.card-4 {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
.card-5 {
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}
.navbar{
background-color: #282D32;
}
</style>
</head>
<body class="bg-gradient-dark">
<nav class="navbar navbar-light text-light navbar-expand-md sticky-top card-2">
<div class="container-fluid" style="padding: 5px"><a href="javascript:void(0)" class = "text-light" onclick="window.history.back();" style="margin-right: 20px"><i class="fas fa-arrow-left"></i></a>
<a class="navbar-brand text-light" href="./?page=home" style="position: fixed; left: 80px;">Malware Repository</a>
<?php require './account.manager.php';?>
</div>
</nav>
<div class="container">
<button class="btn btn-success" onclick="calculateWeight()" style="bottom:10px; right:10px; position: fixed; z-index: 100">Submit And Finish
</button>
<a class="btn btn-danger" href="./?page=home" style="bottom:10px; left:10px; position: fixed; z-index: 100">Cancel and
Quit</a>
<div class="row">
<div class="row justify-content-center" id ="questions-apply-here">
<div class="col-md-6 col-lg-6 col-xl-6" style="margin: 20px">
<div class="card card-3" style="position: relative;">
<div class="card-body">
<h4 class="card-title">Please answer the following to help us identify your problem</h4>
<p class="card-text">To clearly identify what problem you are experiencing, please answer
the following questions, you can press the submit button anytime you feel you have answered
enough or get tired of answering the questions. <br><b>Please note:</b> The more the answers you answer,
the more the accurate the results will be.
</p>
<small class="small text-info">Last Modified: <?php echo $modifiedlast?></small>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" role="dialog" tabindex="-1" id="Results">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">The Results are in:</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div>
<div class="modal-body">
</div>
<div class="modal-footer"><button class="btn btn-info" type="button" data-dismiss="modal">Close</button></div>
</div>
</div>
</div>
</div><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.min.js"></script>
<script src="assets/js/bs-init.js"></script>
<script src="assets/js/jspdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
<script src="./manup.js"></script>
<script src="assets/js/theme.js"></script>
<script src="./assets/js/malware_engine.js"></script>
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
const print=(reportType)=>{
window.open("./reports.php?report-type=" + reportType,"_self");
}
let weight = {
}
let formGotten = <?php echo $json_values; ?>;
for(let i =1; i<=formGotten.totalQuestions;i++){
document.querySelector("#questions-apply-here").innerHTML+='<div class="col-md-6 col-lg-6 col-xl-6" style="margin: 20px">'+
'<div class="card card-3" style="position: relative;">'+
'<div class="card-body">'+
'<h4 class="card-title">'+i+'. '+formGotten["question"+i].question+'</h4><p class="card-text">'+
'<div class="form-check"><input type="radio" class="form-check-input" onchange="addWeight('+i+','+formGotten["question"+i].answer1Weight+')" id="formCheck-1" value="'+formGotten["question"+i].answer1Weight+'" name="question'+i+'" /><label class="form-check-label" for="formCheck-1">'+formGotten["question"+i].answer1+'</label></div>'+
'<div class="form-check"><input type="radio" class="form-check-input" onchange="addWeight('+i+','+formGotten["question"+i].answer2Weight+')" id="formCheck-2" value="'+formGotten["question"+i].answer2Weight+'" name="question'+i+'" /><label class="form-check-label" for="formCheck-2">'+formGotten["question"+i].answer2+'</label></div>'+
'</p></div></div></div>';
}
let addWeight =(questionid,weightgot)=>{
weight[questionid]=weightgot;
}
let calculateWeight = ()=>{
let total =0;
let questionsTotal = 0;
let zero_alert="";
document.querySelector('.modal-body').innerHTML="";
for (x in weight) {
total = weight[x]+total;
questionsTotal++;
}
let percentage = (total/questionsTotal)*100;
percentage = percentage.toFixed(2);
$("#Results").modal({backdrop: "static"});
if(questionsTotal==0){
zero_alert =" We cannot determine if your device is infected with malware or not.";
}
else{
if(percentage>=50){
zero_alert ="<br><br> Your device is <br><h1 class='text-danger'><b>"+percentage+"</b>%</h1>most likely infected with malware. This means it is most likely a malware infection or an exploit on your devices";
}
if(percentage<50){
zero_alert ="<br><br> Your device is <br><h1 class='text-success'><b>"+percentage+"</b>%</h1>most likely infected with malware. This means it might just be a hardware issue.";
}
}
$(".modal-body").append("<p>You have answered: <b>"+questionsTotal+"</b> questions."+zero_alert);
}
</script>
</body>