PluginProbe
WebTotem Security / 2.3.25
WebTotem Security v2.3.25
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 2.2.4 All 109 releases
wt-security / includes / firewall.php

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

343 lines 20.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"><?= wtsec_locale("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 wt-waf-settings-spinner"><img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="spinner"></div>
25 <section class="wtotem-waf-settings-popup">
26 <h2 class="wtotem-waf-settings-popup__title"><?= wtsec_locale("settings") ?>
27 <div class="wtotem_title-info__info wtotem-tooltip">
28 <div class="wtotem-tooltip__content">
29 <?= wtsec_locale("tooltips.waf_settings") ?>
30 </div>
31 </div>
32 </h2>
33
34 <a class="wtotem-waf-settings-popup__configuration-link button" href="<?=wtsec_getUrl("waf-config")?>">
35 <?= wtsec_locale("advanced_options") ?></a>
36 <form action="#" class="wtotem-waf-settings-popup__form" method="post" id="wtotem-waf-settings-form">
37
38
39
40 <input type="hidden" name="action" value="waf_settings">
41 <div class="wtotem_firewall-section-menu-item">
42 <div class="wt-flex wt-flex-middle"><strong>GDN</strong><div>
43 <div class="wtotem_title-info__info wtotem-tooltip">
44 <div class="wtotem-tooltip__content">
45 <p class="wtotem-tooltip__header">GDN</p>
46 <?= wtsec_locale("tooltips.gdn") ?>
47 </div>
48 </div>
49 </div>
50 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
51 <input type="checkbox" class="onoff__input waf_settings_toggle" name="gdn" id="gdn"
52 <?= ($arguments['waf']['settings']['gdn'])? 'checked' : '' ?> />
53 <label for="gdn" class="onoff__label">
54 <span class="onoff__circle"></span>
55 </label>
56 </div>
57 </div>
58
59 <div class="wtotem_firewall-section-menu-item">
60 <div class="wt-flex wt-flex-middle"><strong><?= wtsec_locale("dos_limit") ?></strong><div>
61 <div class="wtotem_title-info__info wtotem-tooltip">
62 <div class="wtotem-tooltip__content">
63 <p class="wtotem-tooltip__header"><?= wtsec_locale("dos_limit") ?></p>
64 <?= wtsec_locale("tooltips.dos") ?>
65 </div>
66 </div>
67 </div>
68 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
69 <input type="checkbox" class="onoff__input waf_settings_toggle"
70 id="wtotem-dos" name="dosProtection"
71 <?= ($arguments['waf']['settings']['dosProtection'])? 'checked' : '' ?> />
72 <label for="wtotem-dos" class="onoff__label">
73 <span class="onoff__circle"></span>
74 </label>
75 </div>
76 </div>
77 </div>
78
79 <div class="wtotem_firewall-section-menu-item">
80 <div class="wt-flex wt-flex-middle"><strong><?= wtsec_locale("login_attempts") ?></strong><div>
81 <div class="wtotem_title-info__info wtotem-tooltip">
82 <div class="wtotem-tooltip__content">
83 <?= wtsec_locale("tooltips.login_attempts") ?>
84 </div>
85 </div>
86 </div>
87 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
88 <input type="checkbox" class="onoff__input waf_settings_toggle"
89 id="wtotem-login-attempts" name="loginAttemptsProtection"
90 <?= ($arguments['waf']['settings']['loginAttemptsProtection'])? 'checked' : '' ?> />
91 <label for="wtotem-login-attempts" class="onoff__label">
92 <span class="onoff__circle"></span>
93 </label>
94 </div>
95 </div>
96 </div>
97
98 <div id="wtotem-dos-limit" class="<?= (!$arguments['waf']['settings']['dosProtection'])? 'visually-hidden' : '' ?>">
99 <label class="wtotem-waf-settings-popup__label" for="waf-limit"><?= wtsec_locale("dos_limit_requests") ?></label>
100 <input class="wtotem-waf-settings-popup__input"
101 type="number" min="0" placeholder="Type limit" id="waf-limit" name="dosLimit"
102 <?= (!$arguments['waf']['settings']['dosProtection'])? 'disabled="disabled"' : '' ?>
103 value="<?= $arguments['waf']['settings']['dosLimit'] ?: 20000 ?>"
104 required>
105 </div>
106
107 <div id="wtotem-login-attempts-limit" class="<?= (!$arguments['waf']['settings']['loginAttemptsProtection'])? 'visually-hidden' : '' ?>">
108 <label class="wtotem-waf-settings-popup__label" for="waf-login-attempts"><?= wtsec_locale("login_attempts") ?></label>
109 <input class="wtotem-waf-settings-popup__input"
110 type="number" min="0" placeholder="Type limit" id="waf-login-attempts" name="loginAttemptsLimit"
111 <?= (!$arguments['waf']['settings']['loginAttemptsProtection'])? 'disabled="disabled"' : '' ?>
112 value="<?= $arguments['waf']['settings']['loginAttemptsLimit'] ?: 20 ?>"
113 required>
114 </div>
115 <button class="wtotem-waf-settings-popup__save button" type="submit"><?= wtsec_locale("save_settings") ?></button>
116 </form>
117 </section>
118 </div>
119 </div>
120 </div>
121 <div class="wtotem_map-wrap wt_card">
122 <div class="wtotem_chart-first">
123 <div class="wtotem_country">
124 <div class="wtotem_country__title">
125 <?= wtsec_locale("chart.country") ?>
126 </div>
127 <div class="wtotem_country__desc">
128 <?= wtsec_locale("attack_map") ?>
129 </div>
130 </div>
131 <div class="wtotem_chart__wrapper">
132
133 <div class="wtotem_chart-first__right" id="map_btn">
134 <div class="wtotem_chart-first__btn" data-days="365"><?= wtsec_locale("chart.yearly") ?></div>
135 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="31"><?= wtsec_locale("chart.monthly") ?></div>
136 <div class="wtotem_chart-first__btn" data-days="7"><?= wtsec_locale("chart.weekly") ?></div>
137 <div class="wtotem_chart-first__btn" data-days="1"><?= wtsec_locale("chart.daily") ?></div>
138 </div>
139 </div>
140 </div>
141 <!-- Карта -->
142 <div class="wtotem_map-block" id="wtotem_map_box">
143 <?php include 'components/_map_view.php';?>
144 </div>
145 </div>
146 </div>
147
148 <div class="wtotem_firewall">
149 <div class="wtotem_firewall__block">
150 <div class="wtotem_numbers wt_card">
151 <div class="wtotem_numbers__item">
152 <div class="wtotem_numbers__title">
153 <?= wtsec_locale("attacks") ?>
154 </div>
155 <div class="wtotem_numbers__figures">
156 <?= $arguments["waf"]["attacks"] ?>
157 </div>
158 </div>
159 <div class="wtotem_numbers__item">
160 <div class="wtotem_numbers__title">
161 <?= wtsec_locale("attacks_blocked") ?>
162 </div>
163 <div class="wtotem_numbers__figures">
164 <?= $arguments["waf"]["blocking"] ?>
165 </div>
166 </div>
167 <div class="wtotem_numbers__item">
168 <div class="wtotem_numbers__title">
169 <?= wtsec_locale("not_blocked") ?>
170 </div>
171 <div class="wtotem_numbers__figures">
172 <?= $arguments["waf"]["non-blocking"] ?>
173 </div>
174 </div>
175 </div>
176 <div class="wtotem_from wt_card">
177 <div class="wtotem_from__svg-wrap">
178 <svg class="wtotem_from__progress">
179 <circle
180 class="wtotem_from__circle"
181 cx="35"
182 cy="35"
183 r="28"
184 stroke-width="20"
185 stroke="rgb(135,255,222)"
186 />
187 </svg>
188 <span class="wtotem_from__percent" data-value="<?=$arguments["waf"]["countryAttacks"]['percent']?>">
189 100%
190 </span>
191 </div>
192
193 <div class="wtotem_from__info">
194 <div class="wtotem_from__title">
195 <?= wtsec_locale("chart.country") ?>
196 </div>
197 <div class="wtotem_from__country">
198 <?= ($arguments["waf"]["countryAttacks"]["country"]) ?
199 wtsec_locale("chart.attack_from_region",['region' => $arguments["waf"]["countryAttacks"]["country"]]) :
200 wtsec_locale('statuses.ok') ?>
201 </div>
202 </div>
203 </div>
204 </div>
205 </div>
206 <div class="wtotem_chart wt_card">
207 <div class="wtotem_chart-first">
208 <div class="wtotem_chart-first__left">
209 <div class="wtotem_chart-first__hack wtotem_chart-first__hack_attack" >
210 <span></span>
211 <p><?= wtsec_locale("chart.attacks") ?></p>
212 </div>
213 <div class="wtotem_chart-first__hack wtotem_chart-first__hack_blocked">
214 <span></span>
215 <p><?= wtsec_locale("chart.blocked") ?></p>
216 </div>
217 </div>
218
219 <div class="wtotem_chart-first__right chart_btn" data-box="chart_wrap" data-service="waf">
220 <div class="wtotem_chart-first__btn" data-days="365"><?= wtsec_locale("chart.yearly") ?></div>
221 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="31"><?= wtsec_locale("chart.monthly") ?></div>
222 <div class="wtotem_chart-first__btn" data-days="7"><?= wtsec_locale("chart.weekly") ?></div>
223 <div class="wtotem_chart-first__btn" data-days="1"><?= wtsec_locale("chart.daily") ?></div>
224 </div>
225 </div>
226
227
228 <?php if($arguments["waf"]["chart"] && $arguments["waf"]["chart"] != 'null'):?>
229 <div id="chart_wrap">
230 <div class="wtotem_chart__diagram" data-days="30" id="wtotem_chart_diagram">
231 <div id="line-chart" class="line-chart">
232 <div id="tooltipAttacks" class="line-chart__tooltip">
233 <span id="countAttacks"></span>
234 </div>
235 <div id="tooltipBlocked" class="line-chart__tooltip line-chart__tooltip--reverse">
236 <span id="countBlocked"></span>
237 </div>
238 </div>
239 </div>
240
241 <div class="wtotem_chart__line"></div>
242 </div>
243 <?php else:?>
244
245 <!-- No data block -->
246 <section class="wtotem_reports-no-data" style="height:300px">
247 <h2 class="visually-hidden"><?= wtsec_locale("no_data") ?></h2>
248 <p class="wtotem_reports-no-data__text">
249 <?= wtsec_locale("has_no_action_ready_yet") ?>
250 </p>
251 </section>
252
253 <?php endif; ?>
254
255 <div class="wtotem_filter__wrapper wt-margin-20">
256 <div class="wtotem_chart__calendars">
257 <div class="wtotem_calendar-icon"></div>
258 <input
259 class="flatpickr flatpickr-input wtotem_calendar"
260 type="text"
261 placeholder="<?= wtsec_locale("chart.select-date") ?>"
262 readonly="readonly"
263 id="waf_period_filter"
264 />
265 <div class="wtotem_calendar-connect">
266 -
267 </div>
268 <input
269 class="wtotem_calendar"
270 type="text"
271 placeholder="<?= wtsec_locale("chart.select-date") ?>"
272 id="secondRangeInput"
273 readonly="readonly"
274 />
275 </div>
276 </div>
277 <div class="wtotem_data">
278 <div class="wtotem_data__thead">
279 <div class="wtotem_data__tr">
280 <div
281 class="wtotem_data__th wtotem_data_width_1"
282 >
283 <?= wtsec_locale("chart.type_ip") ?>
284 </div>
285 <div
286 class="wtotem_data__th wtotem_data_width_2"
287 >
288 <?= wtsec_locale("chart.country") ?>
289 </div>
290 <div
291 class="wtotem_data__th wtotem_data_width_3"
292 >
293 <?= wtsec_locale("chart.time") ?>
294 </div>
295 <div
296 class="wtotem_data__th wtotem_data_width_4"
297 >
298 <?= wtsec_locale("chart.attack_location") ?>
299 </div>
300 <div
301 class="wtotem_data__th wtotem_data_width_6"
302 >
303 <?= wtsec_locale("chart.status") ?>
304 </div>
305 </div>
306 </div>
307 <div class="wtotem_data__tbody" id="wtotem_data_box">
308 <?php include 'components/_firewall_lazy.php'?>
309 </div>
310
311 </div>
312
313 <div class="wtotem_state__line"></div>
314
315 <div class="wtotem_state__last">
316 <div class="wtotem_state__text">
317 <?= wtsec_locale("need_more_support") ?>
318 <a target="_blank" href="https://wtotem.com/#hs-chat-open"><?= wtsec_locale("lets_talk") ?></a>
319 </div>
320
321 </div>
322 </div>
323 </div>
324 </div>
325
326 <?php if($arguments["waf"]["chart"]):?>
327 <script>
328 var waf_chart = <?=$arguments["waf"]["chart"]?>;
329 </script>
330 <?php endif;?>
331
332 <?php else:?>
333 <!-- No data block -->
334 <section class="wtotem_reports-no-data" style="height:300px" >
335 <h2 class="visually-hidden"><?= wtsec_locale("no_data") ?></h2>
336 <p class="wtotem_reports-no-data__text">
337 <?= wtsec_locale("has_no_action_ready_yet") ?>
338 </p>
339 </section>
340 <?php endif;?>
341
342
343