PluginProbe
WebTotem Security / 2.3.44
WebTotem Security v2.3.44
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.44, at includes/firewall.php

331 lines 20.9 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"><?= __( 'Firewall activity', 'wtotem' ) ?></h2>
10
11 <div class="wtotem-waf-settings">
12 <button type="button" class="wtotem-waf-settings__button wtotem-waf-settings__button--active">
13 <span class="wtotem-waf-settings__button-text"><?= __( 'Settings', 'wtotem' ) ?></span>
14 <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">
15 <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" />
16 </svg>
17 </button>
18 <div class="wtotem-waf-settings__popup">
19
20 <div class="wt-spinner d-none wt-waf-settings-spinner"><img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="spinner"></div>
21 <section class="wtotem-waf-settings-popup">
22 <h2 class="wtotem-waf-settings-popup__title"><?= __( 'Settings', 'wtotem' ) ?>
23 <div class="wtotem_title-info__info wtotem-tooltip">
24 <div class="wtotem-tooltip__content">
25 <p class="wtotem-tooltip__header"><?= __( 'Settings', 'wtotem' ) ?></p>
26 <p class="wtotem-tooltip__text"><?= __( 'Sets firewall custom rules.', 'wtotem' ) ?></p>
27 </div>
28 </div>
29 </h2>
30
31 <a class="wtotem-waf-settings-popup__configuration-link button" href="<?=wtsec_getUrl("waf-config")?>">
32 <?= __( 'Advanced options', 'wtotem' ) ?>
33 </a>
34 <form action="#" class="wtotem-waf-settings-popup__form" method="post" id="wtotem-waf-settings-form">
35
36
37
38 <input type="hidden" name="action" value="waf_settings">
39 <div class="wtotem_firewall-section-menu-item">
40 <div class="wt-flex wt-flex-middle"><strong>GDN</strong><div>
41 <div class="wtotem_title-info__info wtotem-tooltip">
42 <div class="wtotem-tooltip__content">
43 <p class="wtotem-tooltip__header">GDN</p>
44 <p class="wtotem-tooltip__text"><?= __( 'This option protects you from hackers detected on other websites connected to our global defence network.', 'wtotem' ) ?></p>
45 </div>
46 </div>
47 </div>
48 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
49 <input type="checkbox" class="onoff__input waf_settings_toggle" name="gdn" id="gdn"
50 <?= ($arguments['waf']['settings']['gdn'])? 'checked' : '' ?> />
51 <label for="gdn" class="onoff__label">
52 <span class="onoff__circle"></span>
53 </label>
54 </div>
55 </div>
56
57 <div class="wtotem_firewall-section-menu-item">
58 <div class="wt-flex wt-flex-middle"><strong><?= __( 'DoS limits', 'wtotem' ) ?></strong><div>
59 <div class="wtotem_title-info__info wtotem-tooltip">
60 <div class="wtotem-tooltip__content">
61 <p class="wtotem-tooltip__header"><?= __( 'DoS limits', 'wtotem' ) ?></p>
62 <p class="wtotem-tooltip__text"><?= __( 'Limits the number of requests per minute from an IP address.', 'wtotem' ) ?></p>
63 </div>
64 </div>
65 </div>
66 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
67 <input type="checkbox" class="onoff__input waf_settings_toggle"
68 id="wtotem-dos" name="dosProtection"
69 <?= ($arguments['waf']['settings']['dosProtection'])? 'checked' : '' ?> />
70 <label for="wtotem-dos" class="onoff__label">
71 <span class="onoff__circle"></span>
72 </label>
73 </div>
74 </div>
75 </div>
76
77 <div class="wtotem_firewall-section-menu-item">
78 <div class="wt-flex wt-flex-middle"><strong><?= __( 'Login attempts', 'wtotem' ) ?></strong><div>
79 <div class="wtotem_title-info__info wtotem-tooltip">
80 <div class="wtotem-tooltip__content">
81 <p class="wtotem-tooltip__header"><?= __( 'Login attempts', 'wtotem' ) ?></p>
82 <p class="wtotem-tooltip__text"><?= __( 'Limits the number of login attempts per minute.', 'wtotem' ) ?></p>
83 </div>
84 </div>
85 </div>
86 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
87 <input type="checkbox" class="onoff__input waf_settings_toggle"
88 id="wtotem-login-attempts" name="loginAttemptsProtection"
89 <?= ($arguments['waf']['settings']['loginAttemptsProtection'])? 'checked' : '' ?> />
90 <label for="wtotem-login-attempts" class="onoff__label">
91 <span class="onoff__circle"></span>
92 </label>
93 </div>
94 </div>
95 </div>
96
97 <div id="wtotem-dos-limit" class="<?= (!$arguments['waf']['settings']['dosProtection'])? 'visually-hidden' : '' ?>">
98 <label class="wtotem-waf-settings-popup__label" for="waf-limit"><?= __( 'DoS limits (requests per minute)', 'wtotem' ) ?></label>
99 <input class="wtotem-waf-settings-popup__input"
100 type="number" min="0" placeholder="Type limit" id="waf-limit" name="dosLimit"
101 <?= (!$arguments['waf']['settings']['dosProtection'])? 'disabled="disabled"' : '' ?>
102 value="<?= $arguments['waf']['settings']['dosLimit'] ?: 20000 ?>"
103 required>
104 </div>
105
106 <div id="wtotem-login-attempts-limit" class="<?= (!$arguments['waf']['settings']['loginAttemptsProtection'])? 'visually-hidden' : '' ?>">
107 <label class="wtotem-waf-settings-popup__label" for="waf-login-attempts"><?= __( 'Login attempts', 'wtotem' ) ?></label>
108 <input class="wtotem-waf-settings-popup__input"
109 type="number" min="0" placeholder="Type limit" id="waf-login-attempts" name="loginAttemptsLimit"
110 <?= (!$arguments['waf']['settings']['loginAttemptsProtection'])? 'disabled="disabled"' : '' ?>
111 value="<?= $arguments['waf']['settings']['loginAttemptsLimit'] ?: 20 ?>"
112 required>
113 </div>
114 <button class="wtotem-waf-settings-popup__save button" type="submit"><?= __( 'Save settings', 'wtotem' ) ?></button>
115 </form>
116 </section>
117 </div>
118 </div>
119 </div>
120 <div class="wtotem_map-wrap wt_card">
121 <div class="wtotem_chart-first">
122 <div class="wtotem_country">
123 <div class="wtotem_country__title">
124 <?= __( 'Country', 'wtotem' ) ?>
125 </div>
126 <div class="wtotem_country__desc">
127 <?= __( 'Attack map', 'wtotem' ) ?>
128 </div>
129 </div>
130 <div class="wtotem_chart__wrapper">
131
132 <div class="wtotem_chart-first__right" id="map_btn">
133 <div class="wtotem_chart-first__btn" data-days="365"><?= __( 'Yearly', 'wtotem' ) ?></div>
134 <div class="wtotem_chart-first__btn" data-days="31"><?= __( 'Monthly', 'wtotem' ) ?></div>
135 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="7"><?= __( 'Weekly', 'wtotem' ) ?></div>
136 <div class="wtotem_chart-first__btn" data-days="1"><?= __( 'Daily', 'wtotem' ) ?></div>
137 </div>
138 </div>
139 </div>
140 <!-- Карта -->
141 <div class="wtotem_map-block" id="wtotem_map_box">
142 <?php include 'components/_map_view.php';?>
143 </div>
144 </div>
145 </div>
146
147 <div class="wtotem_firewall">
148 <div class="wtotem_firewall__block">
149 <div class="wtotem_numbers wt_card">
150 <div class="wtotem_numbers__item">
151 <div class="wtotem_numbers__title">
152 <?= __( 'Attacks', 'wtotem' ) ?>
153 </div>
154 <div class="wtotem_numbers__figures">
155 <?= $arguments["waf"]["attacks"] ?>
156 </div>
157 </div>
158 <div class="wtotem_numbers__item">
159 <div class="wtotem_numbers__title">
160 <?= __( 'Blocked', 'wtotem' ) ?>
161 </div>
162 <div class="wtotem_numbers__figures">
163 <?= $arguments["waf"]["blocking"] ?>
164 </div>
165 </div>
166 <div class="wtotem_numbers__item">
167 <div class="wtotem_numbers__title">
168 <?= __( 'Not blocked', 'wtotem' ) ?>
169 </div>
170 <div class="wtotem_numbers__figures">
171 <?= $arguments["waf"]["non-blocking"] ?>
172 </div>
173 </div>
174 </div>
175 <div class="wtotem_from wt_card">
176 <div class="wtotem_from__svg-wrap">
177 <svg class="wtotem_from__progress">
178 <circle
179 class="wtotem_from__circle"
180 cx="35"
181 cy="35"
182 r="28"
183 stroke-width="20"
184 stroke="rgb(135,255,222)"
185 />
186 </svg>
187 <span class="wtotem_from__percent" data-value="<?=$arguments["waf"]["countryAttacks"]['percent']?>">
188 100%
189 </span>
190 </div>
191
192 <div class="wtotem_from__info">
193 <div class="wtotem_from__title">
194 <?= __( 'Country', 'wtotem' ) ?>
195 </div>
196 <div class="wtotem_from__country">
197 <?= ($arguments["waf"]["countryAttacks"]["country"]) ?
198 __( 'Attack from', 'wtotem' ) . ' <span>'. $arguments["waf"]["countryAttacks"]["country"].'</span>' :
199 __( 'Pending', 'wtotem' ) ?>
200 </div>
201 </div>
202 </div>
203 </div>
204 </div>
205 <div class="wtotem_chart wt_card">
206 <div class="wtotem_chart-first">
207 <div class="wtotem_chart-first__left">
208 <div class="wtotem_chart-first__hack wtotem_chart-first__hack_attack" >
209 <span></span>
210 <p><?= __( 'Attacks', 'wtotem' ) ?></p>
211 </div>
212 <div class="wtotem_chart-first__hack wtotem_chart-first__hack_blocked">
213 <span></span>
214 <p><?= __( 'Blocked', 'wtotem' ) ?></p>
215 </div>
216 </div>
217
218 <div class="wtotem_chart-first__right chart_btn" data-box="chart_wrap" data-service="waf">
219 <div class="wtotem_chart-first__btn" data-days="365"><?= __( 'Yearly', 'wtotem' ) ?></div>
220 <div class="wtotem_chart-first__btn" data-days="31"><?= __( 'Monthly', 'wtotem' ) ?></div>
221 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="7"><?= __( 'Weekly', 'wtotem' ) ?></div>
222 <div class="wtotem_chart-first__btn" data-days="1"><?= __( 'Daily', 'wtotem' ) ?></div>
223 </div>
224 </div>
225
226
227 <?php if($arguments["waf"]["chart"] && $arguments["waf"]["chart"] != 'null'):?>
228 <div id="chart_wrap">
229 <div class="wtotem_chart__diagram" data-days="7" id="wtotem_chart_diagram">
230 <div id="line-chart" class="line-chart">
231 <div id="tooltipAttacks" class="line-chart__tooltip">
232 <span id="countAttacks"></span>
233 </div>
234 <div id="tooltipBlocked" class="line-chart__tooltip line-chart__tooltip--reverse">
235 <span id="countBlocked"></span>
236 </div>
237 </div>
238 </div>
239
240 <div class="wtotem_chart__line"></div>
241 </div>
242 <?php else:?>
243
244 <!-- No data block -->
245 <section class="wtotem_reports-no-data" style="height:300px" >
246 <h2 class="visually-hidden"><?= __( 'No data', 'wtotem' ) ?></h2>
247 <p class="wtotem_reports-no-data__text">
248 <?= __( 'Has no action ready yet', 'wtotem' ) ?>
249 </p>
250 </section>
251
252 <?php endif; ?>
253
254 <?php if($arguments['waf']['edges']):?>
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="<?= __( 'Select Date', 'wtotem' ) ?>"
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="<?= __( 'Select Date', 'wtotem' ) ?>"
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 class="wtotem_data__th wtotem_data_width_1">
281 <?= __( 'Type/IP', 'wtotem' ) ?>
282 </div>
283 <div class="wtotem_data__th wtotem_data_width_2">
284 <?= __( 'Country', 'wtotem' ) ?>
285 </div>
286 <div class="wtotem_data__th wtotem_data_width_3">
287 <?= __( 'Time', 'wtotem' ) ?>
288 </div>
289 <div class="wtotem_data__th wtotem_data_width_4">
290 <?= __( 'Attack location', 'wtotem' ) ?>
291 </div>
292 <div class="wtotem_data__th wtotem_data_width_6">
293 <?= __( 'Status', 'wtotem' ) ?>
294 </div>
295 </div>
296 </div>
297 <div class="wtotem_data__tbody" id="wtotem_data_box">
298 <?php include 'components/_firewall_lazy.php'?>
299 </div>
300 </div>
301 <?php endif; ?>
302
303 <div class="wtotem_state__line"></div>
304
305 <div class="wtotem_state__last">
306 <div class="wtotem_state__text">
307 <?= __( 'Need more support?', 'wtotem' ) ?>
308 <a target="_blank" href="https://wtotem.com/#hs-chat-open"><?= __( 'Let\'s talk!', 'wtotem' ) ?></a>
309 </div>
310
311 </div>
312 </div>
313 </div>
314 </div>
315
316 <?php if($arguments["waf"]["chart"]):?>
317 <script>
318 var waf_chart = <?=$arguments["waf"]["chart"]?>;
319 </script>
320 <?php endif;?>
321
322 <?php else:?>
323 <!-- No data block -->
324 <section class="wtotem_reports-no-data" style="height:300px" >
325 <h2 class="visually-hidden"><?= __( 'No data', 'wtotem' ) ?></h2>
326 <p class="wtotem_reports-no-data__text">
327 <?= __( 'Has no action ready yet', 'wtotem' ) ?>
328 </p>
329 </section>
330 <?php endif;?>
331