PluginProbe
WebTotem Security / 2.3.11
WebTotem Security v2.3.11
3.0.2 3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 All 110 releases
wt-security / includes / firewall.php

firewall.php in WebTotem Security 2.3.11, at includes/firewall.php

321 lines 19.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php defined('ABSPATH') or die("Protected By WT!");?>
2 <?php if(!empty($arguments)): ?>
3 <div class="wtotem_content">
4
5
6 <div class="wtotem_container">
7 <div class="wtotem_map">
8 <div class="wtotem_map__first section-header-mb">
9 <h2 class="title"><?= wtsec_locale("firewall_activity") ?></h2>
10 <!-- <div class="wtotem_print">-->
11 <!-- <div class="wtotem_print__img"></div>-->
12 <!-- <div class="wtotem_print__label">Print PDF</div>-->
13 <!-- </div>-->
14
15 <div class="wtotem-waf-settings">
16 <button type="button" class="wtotem-waf-settings__button wtotem-waf-settings__button--active">
17 <span class="wtotem-waf-settings__button-text">Settings</span>
18 <svg class="wtotem-waf-settings__button-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
19 <path fill-rule="evenodd" clip-rule="evenodd" d="M13.6015 9.05337C13.84 9.18004 14.0239 9.38004 14.1534 9.58004C14.4055 9.99337 14.385 10.5 14.1398 10.9467L13.6628 11.7467C13.4108 12.1734 12.9407 12.44 12.4569 12.44C12.2185 12.44 11.9528 12.3734 11.7347 12.24C11.5576 12.1267 11.3532 12.0867 11.1352 12.0867C10.4607 12.0867 9.89522 12.64 9.87479 13.3C9.87479 14.0667 9.24798 14.6667 8.46448 14.6667H7.53791C6.7476 14.6667 6.1208 14.0667 6.1208 13.3C6.10717 12.64 5.54169 12.0867 4.86719 12.0867C4.64236 12.0867 4.43797 12.1267 4.26765 12.24C4.04963 12.3734 3.77711 12.44 3.54546 12.44C3.05492 12.44 2.58482 12.1734 2.33274 11.7467L1.86264 10.9467C1.61056 10.5134 1.59693 9.99337 1.84901 9.58004C1.95802 9.38004 2.16241 9.18004 2.39406 9.05337C2.58482 8.96004 2.70746 8.80671 2.82328 8.62671C3.16393 8.05337 2.95954 7.30004 2.38043 6.96004C1.70594 6.58004 1.48792 5.73337 1.87627 5.07337L2.33274 4.28671C2.7279 3.62671 3.57271 3.39337 4.25402 3.78004C4.84675 4.10004 5.61663 3.88671 5.9641 3.32004C6.0731 3.13337 6.13442 2.93337 6.1208 2.73337C6.10717 2.47337 6.18211 2.22671 6.31156 2.02671C6.56364 1.61337 7.02012 1.34671 7.51747 1.33337H8.47811C8.98228 1.33337 9.43875 1.61337 9.69083 2.02671C9.81347 2.22671 9.89522 2.47337 9.87479 2.73337C9.86116 2.93337 9.92248 3.13337 10.0315 3.32004C10.379 3.88671 11.1488 4.10004 11.7484 3.78004C12.4229 3.39337 13.2745 3.62671 13.6628 4.28671L14.1193 5.07337C14.5145 5.73337 14.2965 6.58004 13.6151 6.96004C13.036 7.30004 12.8316 8.05337 13.1791 8.62671C13.2881 8.80671 13.4108 8.96004 13.6015 9.05337ZM6.0731 8.00669C6.0731 9.05336 6.93835 9.88669 8.008 9.88669C9.07765 9.88669 9.92247 9.05336 9.92247 8.00669C9.92247 6.96002 9.07765 6.12002 8.008 6.12002C6.93835 6.12002 6.0731 6.96002 6.0731 8.00669Z" fill="#3D50DF" />
20 </svg>
21 </button>
22 <div class="wtotem-waf-settings__popup">
23
24 <div class="wt-spinner d-none"><img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="spinner"></div>
25 <section class="wtotem-waf-settings-popup">
26 <h2 class="wtotem-waf-settings-popup__title">Settings
27 <div class="wtotem_title-info__info wtotem-tooltip">
28 <div class="wtotem-tooltip__content">
29 <p class="wtotem-tooltip__header">Settings</p>
30 <p class="wtotem-tooltip__text">Sets firewall custom rules.</p>
31 </div>
32 </div>
33 </h2>
34 <form action="#" class="wtotem-waf-settings-popup__form" method="post" id="wtotem-waf-settings-form">
35
36 <input type="hidden" name="action" value="waf_settings">
37 <div class="wtotem_firewall-section-menu-item">
38 <div class="wt-flex wt-flex-middle"><strong>GDN</strong><div>
39 <div class="wtotem_title-info__info wtotem-tooltip">
40 <div class="wtotem-tooltip__content">
41 <p class="wtotem-tooltip__header">GDN</p>
42 <p class="wtotem-tooltip__text">This option protects you from hackers detected on other websites connected to our global defence network.</p>
43 </div>
44 </div>
45 </div>
46 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
47 <input type="checkbox" class="onoff__input waf_settings_toggle" name="gdn" id="gdn" <?= ($arguments['waf']['settings']['gdn'])? 'checked' : '' ?> />
48 <label for="gdn" class="onoff__label">
49 <span class="onoff__circle"></span>
50 </label>
51 </div>
52 </div>
53
54 <div class="wtotem_firewall-section-menu-item">
55 <div class="wt-flex wt-flex-middle"><strong>DoS limits</strong><div>
56 <div class="wtotem_title-info__info wtotem-tooltip">
57 <div class="wtotem-tooltip__content">
58 <p class="wtotem-tooltip__header">DoS limits</p>
59 <p class="wtotem-tooltip__text">Limits the number of requests per minute from an IP address.</p>
60 </div>
61 </div>
62 </div>
63 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
64 <input type="checkbox" class="onoff__input waf_settings_toggle" id="wtotem-dos" name="dosProtection" <?= ($arguments['waf']['settings']['dosProtection'])? 'checked' : '' ?> />
65 <label for="wtotem-dos" class="onoff__label">
66 <span class="onoff__circle"></span>
67 </label>
68 </div>
69 </div>
70 </div>
71
72 <div class="wtotem_firewall-section-menu-item">
73 <div class="wt-flex wt-flex-middle"><strong>Login attempts</strong><div>
74 <div class="wtotem_title-info__info wtotem-tooltip">
75 <div class="wtotem-tooltip__content">
76 <p class="wtotem-tooltip__header">Login attempts</p>
77 <p class="wtotem-tooltip__text">Limits the number of login attempts per minute.</p>
78 </div>
79 </div>
80 </div>
81 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
82 <input type="checkbox" class="onoff__input waf_settings_toggle" id="wtotem-login-attempts" name="loginAttemptsProtection" <?= ($arguments['waf']['settings']['loginAttemptsProtection'])? 'checked' : '' ?> />
83 <label for="wtotem-login-attempts" class="onoff__label">
84 <span class="onoff__circle"></span>
85 </label>
86 </div>
87 </div>
88 </div>
89
90 <div id="wtotem-dos-limit" class="<?= (!$arguments['waf']['settings']['dosProtection'])? 'visually-hidden' : '' ?>">
91 <label class="wtotem-waf-settings-popup__label" for="waf-limit">DoS limits (requests per minute)</label>
92 <input class="wtotem-waf-settings-popup__input" type="number" min="0" placeholder="Type limit" id="waf-limit" name="dosLimit" <?= (!$arguments['waf']['settings']['dosProtection'])? 'disabled="disabled"' : '' ?> value="<?= $arguments['waf']['settings']['dosLimit'] ?: 20000 ?>" required>
93 </div>
94
95 <div id="wtotem-login-attempts-limit" class="<?= (!$arguments['waf']['settings']['loginAttemptsProtection'])? 'visually-hidden' : '' ?>">
96 <label class="wtotem-waf-settings-popup__label" for="waf-login-attempts">Login attempts</label>
97 <input class="wtotem-waf-settings-popup__input" type="number" min="0" placeholder="Type limit" id="waf-login-attempts" name="loginAttemptsLimit" <?= (!$arguments['waf']['settings']['loginAttemptsProtection'])? 'disabled="disabled"' : '' ?> value="<?= $arguments['waf']['settings']['loginAttemptsLimit'] ?: 20 ?>" required>
98 </div>
99 <button class="wtotem-waf-settings-popup__save button" type="submit">Save settings</button>
100 </form>
101 </section>
102 </div>
103 </div>
104 </div>
105 <div class="wtotem_map-wrap wt_card">
106 <div class="wtotem_chart-first">
107 <div class="wtotem_country">
108 <div class="wtotem_country__title">
109 <?= wtsec_locale("chart.country") ?>
110 </div>
111 <div class="wtotem_country__desc">
112 <?= wtsec_locale("attack_map") ?>
113 </div>
114 </div>
115 <div class="wtotem_chart__wrapper">
116
117 <div class="wtotem_chart-first__right" id="map_btn">
118 <div class="wtotem_chart-first__btn" data-days="365"><?= wtsec_locale("chart.yearly") ?></div>
119 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="31"><?= wtsec_locale("chart.monthly") ?></div>
120 <div class="wtotem_chart-first__btn" data-days="7"><?= wtsec_locale("chart.weekly") ?></div>
121 <div class="wtotem_chart-first__btn" data-days="1"><?= wtsec_locale("chart.daily") ?></div>
122 </div>
123 </div>
124 </div>
125 <!-- Карта -->
126 <div class="wtotem_map-block" id="wtotem_map_box">
127 <?php include 'components/_map_view.php';?>
128 </div>
129 </div>
130 </div>
131
132 <div class="wtotem_firewall">
133 <div class="wtotem_firewall__block">
134 <div class="wtotem_numbers wt_card">
135 <div class="wtotem_numbers__item">
136 <div class="wtotem_numbers__title">
137 <?= wtsec_locale("attacks") ?>
138 </div>
139 <div class="wtotem_numbers__figures">
140 <?= $arguments["waf"]["attacks"] ?>
141 </div>
142 </div>
143 <div class="wtotem_numbers__item">
144 <div class="wtotem_numbers__title">
145 <?= wtsec_locale("attacks_blocked") ?>
146 </div>
147 <div class="wtotem_numbers__figures">
148 <?= $arguments["waf"]["blocking"] ?>
149 </div>
150 </div>
151 <div class="wtotem_numbers__item">
152 <div class="wtotem_numbers__title">
153 <?= wtsec_locale("not_blocked") ?>
154 </div>
155 <div class="wtotem_numbers__figures">
156 <?= $arguments["waf"]["non-blocking"] ?>
157 </div>
158 </div>
159 </div>
160 <div class="wtotem_from wt_card">
161 <div class="wtotem_from__svg-wrap">
162 <svg class="wtotem_from__progress">
163 <circle
164 class="wtotem_from__circle"
165 cx="35"
166 cy="35"
167 r="28"
168 stroke-width="20"
169 stroke="rgb(135,255,222)"
170 />
171 </svg>
172 <span class="wtotem_from__percent" data-value="<?=$arguments["waf"]["countryAttacks"]['percent']?>">
173 100%
174 </span>
175 </div>
176
177 <div class="wtotem_from__info">
178 <div class="wtotem_from__title">
179 <?= wtsec_locale("chart.country") ?>
180 </div>
181 <div class="wtotem_from__country">
182 <?= ($arguments["waf"]["countryAttacks"]["country"]) ?
183 wtsec_locale("chart.attack_from_region",['region' => $arguments["waf"]["countryAttacks"]["country"]]) :
184 wtsec_locale('statuses.ok') ?>
185 </div>
186 </div>
187 </div>
188 </div>
189 </div>
190 <div class="wtotem_chart wt_card">
191 <div class="wtotem_chart-first">
192 <div class="wtotem_chart-first__left">
193 <div class="wtotem_chart-first__hack wtotem_chart-first__hack_attack" >
194 <span></span>
195 <p><?= wtsec_locale("chart.attacks") ?></p>
196 </div>
197 <div class="wtotem_chart-first__hack wtotem_chart-first__hack_blocked">
198 <span></span>
199 <p><?= wtsec_locale("chart.blocked") ?></p>
200 </div>
201 </div>
202
203 <div class="wtotem_chart-first__right chart_btn" data-box="chart_wrap" data-service="waf">
204 <div class="wtotem_chart-first__btn" data-days="365"><?= wtsec_locale("chart.yearly") ?></div>
205 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="31"><?= wtsec_locale("chart.monthly") ?></div>
206 <div class="wtotem_chart-first__btn" data-days="7"><?= wtsec_locale("chart.weekly") ?></div>
207 <div class="wtotem_chart-first__btn" data-days="1"><?= wtsec_locale("chart.daily") ?></div>
208 </div>
209 </div>
210
211
212 <?php if($arguments["waf"]["chart"] && $arguments["waf"]["chart"] != 'null'):?>
213 <div id="chart_wrap">
214 <div class="wtotem_chart__diagram" data-days="30" id="wtotem_chart_diagram">
215 <div id="line-chart" class="line-chart">
216 <div id="tooltipAttacks" class="line-chart__tooltip">
217 <span id="countAttacks"></span>
218 </div>
219 <div id="tooltipBlocked" class="line-chart__tooltip">
220 <span id="countBlocked"></span>
221 </div>
222 </div>
223 </div>
224
225 <div class="wtotem_chart__line"></div>
226 </div>
227 <?php else:?>
228
229 <!-- No data block -->
230 <section class="wtotem_reports-no-data" style="height:300px">
231 <h2 class="visually-hidden"><?= wtsec_locale("no_data") ?></h2>
232 <p class="wtotem_reports-no-data__text">
233 <?= wtsec_locale("has_no_action_ready_yet") ?>
234 </p>
235 </section>
236
237 <?php endif; ?>
238
239 <div class="wtotem_filter__wrapper wt-margin-20">
240 <div class="wtotem_chart__calendars">
241 <div class="wtotem_calendar-icon"></div>
242 <input
243 class="flatpickr flatpickr-input wtotem_calendar"
244 type="text"
245 placeholder="<?= wtsec_locale("chart.select-date") ?>"
246 readonly="readonly"
247 id="waf_period_filter"
248 />
249 <div class="wtotem_calendar-connect">
250 -
251 </div>
252 <input
253 class="wtotem_calendar"
254 type="text"
255 placeholder="<?= wtsec_locale("chart.select-date") ?>"
256 id="secondRangeInput"
257 readonly="readonly"
258 />
259 </div>
260 </div>
261 <div class="wtotem_data">
262 <div class="wtotem_data__thead">
263 <div class="wtotem_data__tr">
264 <div
265 class="wtotem_data__th wtotem_data_width_1"
266 >
267 <?= wtsec_locale("chart.type_ip") ?>
268 </div>
269 <div
270 class="wtotem_data__th wtotem_data_width_2"
271 >
272 <?= wtsec_locale("chart.country") ?>
273 </div>
274 <div
275 class="wtotem_data__th wtotem_data_width_3"
276 >
277 <?= wtsec_locale("chart.time") ?>
278 </div>
279 <div
280 class="wtotem_data__th wtotem_data_width_4"
281 >
282 <?= wtsec_locale("chart.attack_location") ?>
283 </div>
284 <div
285 class="wtotem_data__th wtotem_data_width_6"
286 >
287 <?= wtsec_locale("chart.status") ?>
288 </div>
289 </div>
290 </div>
291 <div class="wtotem_data__tbody" id="wtotem_data_box">
292 <?php include 'components/_firewall_lazy.php'?>
293 </div>
294
295 </div>
296
297 <div class="wtotem_state__line"></div>
298
299 <div class="wtotem_state__last">
300 <div class="wtotem_state__text">
301 <?= wtsec_locale("need_more_support") ?>
302 <a target="_blank" href="https://wtotem.com/#hs-chat-open"><?= wtsec_locale("lets_talk") ?></a>
303 </div>
304
305 </div>
306 </div>
307 </div>
308 </div>
309
310 <?php if($arguments["waf"]["chart"]):?>
311 <script>
312 var waf_chart = <?=$arguments["waf"]["chart"]?>;
313 </script>
314 <?php endif;?>
315
316 <?php else:?>
317
318 <?php endif;?>
319
320
321