|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @copyright Copyright (c) 2018 Matthias Held <[email protected]> |
|
5
|
|
|
* @author Matthias Held <[email protected]> |
|
6
|
|
|
* @license GNU AGPL version 3 or any later version |
|
7
|
|
|
* |
|
8
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
9
|
|
|
* it under the terms of the GNU Affero General Public License as |
|
10
|
|
|
* published by the Free Software Foundation, either version 3 of the |
|
11
|
|
|
* License, or (at your option) any later version. |
|
12
|
|
|
* |
|
13
|
|
|
* This program is distributed in the hope that it will be useful, |
|
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16
|
|
|
* GNU Affero General Public License for more details. |
|
17
|
|
|
* |
|
18
|
|
|
* You should have received a copy of the GNU Affero General Public License |
|
19
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
namespace OCA\RansomwareDetection\Analyzer; |
|
23
|
|
|
|
|
24
|
|
|
class EntropyFunnellingResult implements \JsonSerializable |
|
25
|
|
|
{ |
|
26
|
|
|
/** @var float */ |
|
27
|
|
|
protected $medianWritten; |
|
28
|
|
|
|
|
29
|
|
|
/** @var float */ |
|
30
|
|
|
protected $medianDeleted; |
|
31
|
|
|
|
|
32
|
|
|
/** @var float */ |
|
33
|
|
|
protected $rangeOfEntropyWritten; |
|
34
|
|
|
|
|
35
|
|
|
/** @var float */ |
|
36
|
|
|
protected $rangeOfEntropyDeleted; |
|
37
|
|
|
|
|
38
|
|
|
/** @var float */ |
|
39
|
|
|
protected $rangeOfStandardDeviationWritten; |
|
40
|
|
|
|
|
41
|
|
|
/** @var float */ |
|
42
|
|
|
protected $rangeOfStandardDeviationDeleted; |
|
43
|
|
|
|
|
44
|
|
|
/** @var int */ |
|
45
|
|
|
protected $entropyFunnelling; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @param float $medianWritten |
|
49
|
|
|
* @param float $medianDeleted |
|
50
|
|
|
* @param float $rangeOfEntropyWritten |
|
51
|
|
|
* @param float $rangeOfEntropyDeleted |
|
52
|
|
|
* @param float $rangeOfStandardDeviationWritten |
|
53
|
|
|
* @param float $rangeOfStandardDeviationDeleted |
|
54
|
|
|
* @param int $entropyFunnelling |
|
55
|
|
|
*/ |
|
56
|
|
|
public function __construct( |
|
57
|
|
|
$medianWritten, |
|
58
|
|
|
$medianDeleted, |
|
59
|
|
|
$rangeOfEntropyWritten, |
|
60
|
|
|
$rangeOfEntropyDeleted, |
|
61
|
|
|
$rangeOfStandardDeviationWritten, |
|
62
|
|
|
$rangeOfStandardDeviationDeleted, |
|
63
|
|
|
$entropyFunnelling |
|
64
|
|
|
) { |
|
65
|
|
|
$this->medianWritten = $medianWritten; |
|
66
|
|
|
$this->medianDeleted = $medianDeleted; |
|
67
|
|
|
$this->rangeOfEntropyWritten = $rangeOfEntropyWritten; |
|
68
|
|
|
$this->rangeOfEntropyDeleted = $rangeOfEntropyDeleted; |
|
69
|
|
|
$this->rangeOfStandardDeviationWritten = $rangeOfStandardDeviationWritten; |
|
70
|
|
|
$this->$rangeOfStandardDeviationDeleted = $rangeOfStandardDeviationDeleted; |
|
71
|
|
|
$this->entropyFunnelling = $entropyFunnelling; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
public function getMedianWritten() |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->medianWritten; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public function setMedianWritten($medianWritten) |
|
80
|
|
|
{ |
|
81
|
|
|
$this->medianWritten = $medianWritten; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function getMedianDeleted() |
|
85
|
|
|
{ |
|
86
|
|
|
return $this->medianDeleted; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
public function setMedianDeleted($medianDeleted) |
|
90
|
|
|
{ |
|
91
|
|
|
$this->medianDeleted = $medianDeleted; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function getRangeOfEntropyWritten() |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->rangeOfEntropyWritten; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
public function setRangeOfEntropyWritten($rangeOfEntropyWritten) |
|
100
|
|
|
{ |
|
101
|
|
|
$this->rangeOfEntropyWritten = $rangeOfEntropyWritten; |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
public function getRangeOfEntropyDeleted() |
|
105
|
|
|
{ |
|
106
|
|
|
return $this->rangeOfEntropyDeleted; |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
public function setRangeOfEntropyDeleted($rangeOfEntropyDeleted) |
|
110
|
|
|
{ |
|
111
|
|
|
$this->rangeOfEntropyDeleted = $rangeOfEntropyDeleted; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
public function getRangeOfStandardDeviationWritten() |
|
115
|
|
|
{ |
|
116
|
|
|
return $this->rangeOfStandardDeviationWritten; |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
public function setRangeOfStandardDeviationWritten($rangeOfStandardDeviationWritten) |
|
120
|
|
|
{ |
|
121
|
|
|
$this->rangeOfStandardDeviationWritten = $rangeOfStandardDeviationWritten; |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
public function getRangeOfStandardDeviationDeleted() |
|
125
|
|
|
{ |
|
126
|
|
|
return $this->rangeOfStandardDeviationDeleted; |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
public function setRangeOfStandardDeviationDeleted($rangeOfStandardDeviationDeleted) |
|
130
|
|
|
{ |
|
131
|
|
|
$this->rangeOfStandardDeviationDeleted = $rangeOfStandardDeviationDeleted; |
|
132
|
|
|
} |
|
133
|
|
|
|
|
134
|
|
|
public function getEntropyFunnelling() |
|
135
|
|
|
{ |
|
136
|
|
|
return $this->entropyFunnelling; |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
public function setEntropyFunnelling($entropyFunnelling) |
|
140
|
|
|
{ |
|
141
|
|
|
$this->entropyFunnelling = $entropyFunnelling; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
public function jsonSerialize() |
|
145
|
|
|
{ |
|
146
|
|
|
return get_object_vars($this); |
|
147
|
|
|
} |
|
148
|
|
|
} |
|
149
|
|
|
|