1 |
diff -urN smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip |
2 |
--- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip 2019-09-30 00:56:29.000000000 +0400 |
3 |
+++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip 2019-09-30 18:56:39.000000000 +0400 |
4 |
@@ -95,13 +95,23 @@ |
5 |
</entry> |
6 |
|
7 |
<entry> |
8 |
+ <base>IPT_LIST_DESCRIPTION</base> |
9 |
+ <trans><![CDATA[<ul><li>Click here to see the statistics of the prevented connections</li></ul> ]]> |
10 |
+ </trans> |
11 |
+ </entry> |
12 |
+ <entry> |
13 |
<base>IPT_LIST</base> |
14 |
- <trans>Stats of XT-geoip prevented connections</trans> |
15 |
+ <trans>Filtered</trans> |
16 |
</entry> |
17 |
|
18 |
<entry> |
19 |
+ <base>SSH_LIST_DESCRIPTION</base> |
20 |
+ <trans><![CDATA[<ul><li>Click here to see the statistics of SSH errors for non blocked access</li></ul> ]]> |
21 |
+ </trans> |
22 |
+ </entry> |
23 |
+ <entry> |
24 |
<base>SSH_LIST</base> |
25 |
- <trans>Stats of SSH errors not blocked by XT-geoip</trans> |
26 |
+ <trans>SSH errors</trans> |
27 |
</entry> |
28 |
|
29 |
<entry> |
30 |
@@ -121,7 +131,7 @@ |
31 |
|
32 |
<entry> |
33 |
<base>STATS_DESCRIPTION</base> |
34 |
- <trans><![CDATA[ <h3>Statistics for Xt_GeoIP</h3><ul> |
35 |
+ <trans><![CDATA[<HR class="sme-copyrightbar"> <h3>Statistics for Xt_GeoIP</h3><ul> |
36 |
<li>For 3 periods : Day, Week and Month</li> |
37 |
<li>Banned Ips by country sorted by number</li> |
38 |
<li>Ssh errors by country sorted by number</li> |
39 |
@@ -130,9 +140,36 @@ |
40 |
</entry> |
41 |
|
42 |
<entry> |
43 |
+ <base>COUNTRY_LIST_DESCRIPTION</base> |
44 |
+ <trans><![CDATA[<ul> |
45 |
+ <li>Click here to see a <b>list of available country codes</b></li> |
46 |
+ </ul> ]]> |
47 |
+ </trans> |
48 |
+ </entry> |
49 |
+ |
50 |
+ <entry> |
51 |
+ <base>LABEL_COUNTRY_LIST</base> |
52 |
+ <trans>Country codes : </trans> |
53 |
+ </entry> |
54 |
+ <entry> |
55 |
+ <base>COUNTRY_LIST</base> |
56 |
+ <trans>Country codes</trans> |
57 |
+ </entry> |
58 |
+ |
59 |
+ <entry> |
60 |
+ <base>CNTRY_LIST</base> |
61 |
+ <trans>List</trans> |
62 |
+ </entry> |
63 |
+ |
64 |
+ <entry> |
65 |
+ <base>END_OF_CODES</base> |
66 |
+ <trans>End of code list</trans> |
67 |
+ </entry> |
68 |
+ |
69 |
+ <entry> |
70 |
<base>SERVICE_DESCRIPTION</base> |
71 |
<trans><![CDATA[ <h2> Per service filtering for Xtables GeoIP</h2><ul> |
72 |
- <li>If you want different filtering for certain services</li> |
73 |
+ <li>If you want different filtering based on services</li> |
74 |
</ul><p><i></i></p> ]]> |
75 |
</trans> |
76 |
</entry> |
77 |
@@ -144,7 +181,7 @@ |
78 |
|
79 |
<entry> |
80 |
<base>PER_SERVICE_GEOIP</base> |
81 |
- <trans>-> Services</trans> |
82 |
+ <trans>Services</trans> |
83 |
</entry> |
84 |
|
85 |
<entry> |
86 |
@@ -217,5 +254,17 @@ |
87 |
<trans>Choose if you want to have the general filter to apply to all incoming connections or if you do not want to filter ports already defined with a specific service rule. This would allow you to have a service less restricted than the general rule if you enable this.</trans> |
88 |
</entry> |
89 |
|
90 |
+ <field type="literal" id="countries_list_label" value=""> |
91 |
+ <description>COUNTRIES_LIST_DESCRIPTION</description> |
92 |
+ </field> |
93 |
+ <subroutine src="print_custom_button('COUNTRIES_LIST', 'Codes')"/> |
94 |
+ |
95 |
+ |
96 |
+ <subroutine src="print_button('NEXT')" /> |
97 |
+ |
98 |
+ <field type="literal" id="service_label" value=""> |
99 |
+ <description>SERVICE_DESCRIPTION</description> |
100 |
+ </field> |
101 |
+ <subroutine src="print_custom_button('PER_SERVICE_GEOIP', 'Service', '')"/> |
102 |
|
103 |
</lexicon> |
104 |
diff -urN smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.0.1/root/etc/e-smith/web/functions/xt_geoip |
105 |
--- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/web/functions/xt_geoip 2019-09-30 00:56:29.000000000 +0400 |
106 |
+++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/web/functions/xt_geoip 2019-09-30 20:07:46.000000000 +0400 |
107 |
@@ -97,21 +97,38 @@ |
108 |
id="stat_geoip" |
109 |
value="get_stat_geoip()"> |
110 |
<label> </label> |
111 |
- </field> |
112 |
+ </field> |
113 |
+ |
114 |
+ |
115 |
+ <field type="literal" id="country_list_label" value=""> |
116 |
+ <description>COUNTRY_LIST_DESCRIPTION</description> |
117 |
+ </field> |
118 |
+ <subroutine src="print_custom_button('CNTRY_LIST', 'Codes')"/> |
119 |
+ |
120 |
+ |
121 |
+ <subroutine src="print_button('NEXT')" /> |
122 |
+ |
123 |
|
124 |
<field type="literal" id="service_label" value=""> |
125 |
<description>SERVICE_DESCRIPTION</description> |
126 |
</field> |
127 |
- <subroutine src="print_custom_button('PER_SERVICE_GEOIP', 'Service', '')"/> |
128 |
+ <subroutine src="print_service_table()" /> |
129 |
+ |
130 |
|
131 |
<field type="literal" id="stats_label" value=""> |
132 |
<description>STATS_DESCRIPTION</description> |
133 |
</field> |
134 |
|
135 |
+ <field type="literal" id="ipt_list_label" value=""> |
136 |
+ <description>IPT_LIST_DESCRIPTION</description> |
137 |
+ </field> |
138 |
<subroutine src="print_custom_button('IPT_LIST', 'Stats', 'ipt')"/> |
139 |
+ |
140 |
+ <field type="literal" id="ssh_list_label" value=""> |
141 |
+ <description>SSH_LIST_DESCRIPTION</description> |
142 |
+ </field> |
143 |
<subroutine src="print_custom_button('SSH_LIST', 'Stats', 'ssh')"/> |
144 |
|
145 |
- <subroutine src="print_button('NEXT')" /> |
146 |
</page> |
147 |
|
148 |
|
149 |
@@ -176,19 +193,6 @@ |
150 |
</page> |
151 |
|
152 |
|
153 |
- <page name="Service" pre-event="print_status_message()" post-event="wherenext('First')"> |
154 |
- <description>SERVICE_DESCRIPTION</description> |
155 |
- <field |
156 |
- type="literal" |
157 |
- id="badcountries" |
158 |
- value="get_badcountries(1)"> |
159 |
- <label>LABEL_BADCOUNTRIES_STATUS</label> |
160 |
- </field> |
161 |
- <subroutine src="print_service_table()" /> |
162 |
- <subroutine src="print_button('NEXT')"/> |
163 |
- </page> |
164 |
- |
165 |
- |
166 |
|
167 |
<page name="SrvModify" pre-event="turn_off_buttons()" post-event="modify_serv()"> |
168 |
|
169 |
@@ -263,10 +267,14 @@ |
170 |
</page> |
171 |
|
172 |
|
173 |
- <page name="Stats" pre-event="generateStats" post-event="wherenext('First')"> |
174 |
+ <page name="Stats" pre-event="generateStats" post-event="wherenext('First')"> |
175 |
+ </page> |
176 |
+ |
177 |
+ |
178 |
+ <page name="Codes" pre-event="generateCodes" post-event="wherenext('First')"> |
179 |
<subroutine src="print_button('NEXT')"/> |
180 |
</page> |
181 |
|
182 |
|
183 |
- |
184 |
+ |
185 |
</form> |
186 |
diff -urN smeserver-xt_geoip-1.0.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm smeserver-xt_geoip-1.0.1/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm |
187 |
--- smeserver-xt_geoip-1.0.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm 2019-09-30 00:56:29.000000000 +0400 |
188 |
+++ smeserver-xt_geoip-1.0.1/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm 2019-09-30 20:07:28.000000000 +0400 |
189 |
@@ -489,4 +489,37 @@ |
190 |
return 'OK'; |
191 |
} |
192 |
|
193 |
+ |
194 |
+#Subroutine to list counries codes |
195 |
+sub generateCodes |
196 |
+{ |
197 |
+ my $self = shift; |
198 |
+ my $q = $self->{cgi}; |
199 |
+ |
200 |
+ my $file = "/usr/share/xt_geoip/geoip_countries_list.txt"; |
201 |
+ unless ( -e $file ) { |
202 |
+ print $q->p($q->b($self->localise('INVALID_CODES_LIST'))); |
203 |
+ return ''; |
204 |
+ } |
205 |
+ |
206 |
+ print $q->h3($self->localise('COUNTRY_LIST')); |
207 |
+ |
208 |
+ open( XTGEOIPCODES, $file ); |
209 |
+ print "<pre>\n"; |
210 |
+ |
211 |
+ while (<XTGEOIPCODES>) |
212 |
+ { |
213 |
+ print; |
214 |
+ } |
215 |
+ |
216 |
+ close XTGEOIPCODES; |
217 |
+ print "</pre>\n"; |
218 |
+ |
219 |
+ print $q->h3($self->localise('END_OF_CODES')); |
220 |
+ $self->wherenext('First'); |
221 |
+ return ''; |
222 |
+ |
223 |
+} |
224 |
+ |
225 |
+ |
226 |
1; |
227 |
diff -urN smeserver-xt_geoip-1.0.1.old/root/usr/share/xt_geoip/geoip_countries_list.txt smeserver-xt_geoip-1.0.1/root/usr/share/xt_geoip/geoip_countries_list.txt |
228 |
--- smeserver-xt_geoip-1.0.1.old/root/usr/share/xt_geoip/geoip_countries_list.txt 1970-01-01 04:00:00.000000000 +0400 |
229 |
+++ smeserver-xt_geoip-1.0.1/root/usr/share/xt_geoip/geoip_countries_list.txt 2019-09-30 00:49:21.000000000 +0400 |
230 |
@@ -0,0 +1,280 @@ |
231 |
+Abbreviated Country Code List |
232 |
+ |
233 |
+A1 Anonymous Proxy |
234 |
+A2 Satellite Provider |
235 |
+AC Ascension Island |
236 |
+AD Andorra |
237 |
+AE United Arab Emirates |
238 |
+AERO members of the air-transport industry |
239 |
+AF Afghanistan |
240 |
+AG Antigua and Barbuda |
241 |
+AI Anguilla |
242 |
+AL Albania |
243 |
+AM Armenia |
244 |
+AN Netherlands Antilles (being phased out) |
245 |
+AO Angola |
246 |
+AQ Antarctica |
247 |
+AP Asia/Pacific |
248 |
+AR Argentina |
249 |
+AS American Samoa |
250 |
+ASIA Restricted to the Pan-Asia and Asia Pacific community |
251 |
+AT Austria |
252 |
+AU Australia |
253 |
+AW Aruba |
254 |
+AX Aland Islands |
255 |
+AZ Azerbaijan |
256 |
+BA Bosnia and Herzegovina |
257 |
+BB Barbados |
258 |
+BD Bangladesh |
259 |
+BE Belgium |
260 |
+BF Burkina Faso |
261 |
+BG Bulgaria |
262 |
+BH Bahrain |
263 |
+BI Burundi |
264 |
+BIZ Restricted for Business |
265 |
+BJ Benin |
266 |
+BL Saint Barthelemy |
267 |
+BM Bermuda |
268 |
+BN Brunei Darussalam |
269 |
+BO Bolivia |
270 |
+BQ Bonaire, Sint Eustatius and Saba |
271 |
+BR Brazil |
272 |
+BS Bahamas |
273 |
+BT Bhutan |
274 |
+BV Bouvet Island |
275 |
+BW Botswana |
276 |
+BY Belarus |
277 |
+BZ Belize |
278 |
+CA Canada |
279 |
+CC Cocos (Keeling) Islands |
280 |
+CD Congo, The Democratic Republic of the |
281 |
+CF Central African Republic |
282 |
+CG Congo |
283 |
+CH Switzerland |
284 |
+CI Cote d'Ivoire |
285 |
+CK Cook Islands |
286 |
+CL Chile |
287 |
+CM Cameroon |
288 |
+CN China |
289 |
+CO Colombia |
290 |
+COM Generic top-level domain |
291 |
+COOP cooperative associations |
292 |
+CR Costa Rica |
293 |
+CU Cuba |
294 |
+CV Cape Verde |
295 |
+CW CuraƧao |
296 |
+CX Christmas Island |
297 |
+CY Cyprus |
298 |
+CZ Czech Republic |
299 |
+DE Germany |
300 |
+DJ Djibouti |
301 |
+DK Denmark |
302 |
+DM Dominica |
303 |
+DO Dominican Republic |
304 |
+DZ Algeria |
305 |
+EC Ecuador |
306 |
+EDU Educational Institutions |
307 |
+EE Estonia |
308 |
+EG Egypt |
309 |
+EH Western Sahara |
310 |
+ER Eritrea |
311 |
+ES Spain |
312 |
+ET Ethiopia |
313 |
+EU European Union |
314 |
+FI Finland |
315 |
+FJ Fiji |
316 |
+FK Falkland Islands (Malvinas) |
317 |
+FM Micronesia, Federated States of |
318 |
+FO Faroe Islands |
319 |
+FR France |
320 |
+GA Gabon |
321 |
+GB United Kingdom |
322 |
+GD Grenada |
323 |
+GE Georgia |
324 |
+GF French Guiana |
325 |
+GG Guernsey |
326 |
+GH Ghana |
327 |
+GI Gibraltar |
328 |
+GL Greenland |
329 |
+GM Gambia |
330 |
+GN Guinea |
331 |
+GOV United States Government |
332 |
+GP Guadeloupe |
333 |
+GQ Equatorial Guinea |
334 |
+GR Greece |
335 |
+GS South Georgia and the South Sandwich Islands |
336 |
+GT Guatemala |
337 |
+GU Guam |
338 |
+GW Guinea-Bissau |
339 |
+GY Guyana |
340 |
+HK Hong Kong |
341 |
+HM Heard Island and McDonald Islands |
342 |
+HN Honduras |
343 |
+HR Croatia |
344 |
+HT Haiti |
345 |
+HU Hungary |
346 |
+ID Indonesia |
347 |
+IE Ireland |
348 |
+IL Israel |
349 |
+IM Isle of Man |
350 |
+IN India |
351 |
+INFO Generic top-level domain |
352 |
+IO British Indian Ocean Territory |
353 |
+IQ Iraq |
354 |
+IR Iran, Islamic Republic of |
355 |
+IS Iceland |
356 |
+IT Italy |
357 |
+JE Jersey |
358 |
+JM Jamaica |
359 |
+JO Jordan |
360 |
+JOBS Reserved to serve needs of the international human resource management community |
361 |
+JP Japan |
362 |
+KE Kenya |
363 |
+KG Kyrgyzstan |
364 |
+KH Cambodia |
365 |
+KI Kiribati |
366 |
+KM Comoros |
367 |
+KN Saint Kitts and Nevis |
368 |
+KP Korea, Democratic People's Republic of |
369 |
+KR Korea, Republic of |
370 |
+KW Kuwait |
371 |
+KY Cayman Islands |
372 |
+KZ Kazakhstan |
373 |
+LA Lao People's Democratic Republic |
374 |
+LB Lebanon |
375 |
+LC Saint Lucia |
376 |
+LI Liechtenstein |
377 |
+LK Sri Lanka |
378 |
+LR Liberia |
379 |
+LS Lesotho |
380 |
+LT Lithuania |
381 |
+LU Luxembourg |
382 |
+LV Latvia |
383 |
+LY Libyan Arab Jamahiriya |
384 |
+MA Morocco |
385 |
+MC Monaco |
386 |
+MD Moldova, Republic of |
387 |
+ME Montenegro |
388 |
+MF Saint Martin (French part) |
389 |
+MG Madagascar |
390 |
+MH Marshall Islands |
391 |
+MIL United States Military |
392 |
+MK Macedonia, The Former Yugoslav Republic of |
393 |
+ML Mali |
394 |
+MM Myanmar |
395 |
+MN Mongolia |
396 |
+MO Macao |
397 |
+MOBI consumers and providers of mobile products and services |
398 |
+MP Northern Mariana Islands |
399 |
+MQ Martinique |
400 |
+MR Mauritania |
401 |
+MS Montserrat |
402 |
+MT Malta |
403 |
+MU Mauritius |
404 |
+MUSEUM museums |
405 |
+MV Maldives |
406 |
+MW Malawi |
407 |
+MX Mexico |
408 |
+MY Malaysia |
409 |
+MZ Mozambique |
410 |
+NA Namibia |
411 |
+NAME individuals |
412 |
+NC New Caledonia |
413 |
+NE Niger |
414 |
+NET Generic top-level domain |
415 |
+NF Norfolk Island |
416 |
+NG Nigeria |
417 |
+NI Nicaragua |
418 |
+NL Netherlands |
419 |
+NO Norway |
420 |
+NP Nepal |
421 |
+NR Nauru |
422 |
+NU Niue |
423 |
+NZ New Zealand |
424 |
+OM Oman |
425 |
+ORG Generic top-level domain |
426 |
+PA Panama |
427 |
+PE Peru |
428 |
+PF French Polynesia |
429 |
+PG Papua New Guinea |
430 |
+PH Philippines |
431 |
+PK Pakistan |
432 |
+PL Poland |
433 |
+PM Saint Pierre and Miquelon |
434 |
+PN Pitcairn |
435 |
+PR Puerto Rico |
436 |
+PRO Restricted to credentialed professionals and related entities |
437 |
+PS Palestinian Territory, Occupied |
438 |
+PT Portugal |
439 |
+PW Palau |
440 |
+PY Paraguay |
441 |
+QA Qatar |
442 |
+RE Reunion |
443 |
+RO Romania |
444 |
+RS Serbia |
445 |
+RU Russian Federation |
446 |
+RW Rwanda |
447 |
+SA Saudi Arabia |
448 |
+SB Solomon Islands |
449 |
+SC Seychelles |
450 |
+SD Sudan |
451 |
+SE Sweden |
452 |
+SG Singapore |
453 |
+SH Saint Helena |
454 |
+SI Slovenia |
455 |
+SJ Svalbard and Jan Mayen |
456 |
+SK Slovakia |
457 |
+SL Sierra Leone |
458 |
+SM San Marino |
459 |
+SN Senegal |
460 |
+SO Somalia |
461 |
+SR Suriname |
462 |
+SS South Sudan |
463 |
+ST Sao Tome and Principe |
464 |
+SU Soviet Union (being phased out) |
465 |
+SV El Salvador |
466 |
+SX Saint Maarten (Dutch part) |
467 |
+SY Syrian Arab Republic |
468 |
+SZ Swaziland |
469 |
+TC Turks and Caicos Islands |
470 |
+TD Chad |
471 |
+TEL businesses and individuals to publish their contact data |
472 |
+TF French Southern Territories |
473 |
+TG Togo |
474 |
+TH Thailand |
475 |
+TJ Tajikistan |
476 |
+TK Tokelau |
477 |
+TL Timor-Leste |
478 |
+TM Turkmenistan |
479 |
+TN Tunisia |
480 |
+TO Tonga |
481 |
+TP Portuguese Timor (being phased out) |
482 |
+TR Turkey |
483 |
+TRAVEL entities whose primary area of activity is in the travel industry |
484 |
+TT Trinidad and Tobago |
485 |
+TV Tuvalu |
486 |
+TW Taiwan, Province of China |
487 |
+TZ Tanzania, United Republic of |
488 |
+UA Ukraine |
489 |
+UG Uganda |
490 |
+UK United Kingdom |
491 |
+UM United States Minor Outlying Islands |
492 |
+US United States |
493 |
+UY Uruguay |
494 |
+UZ Uzbekistan |
495 |
+VA Holy See (Vatican City State) |
496 |
+VC Saint Vincent and the Grenadines |
497 |
+VE Venezuela, Bolivarian Republic of |
498 |
+VG Virgin Islands, British |
499 |
+VI Virgin Islands, US |
500 |
+VN Viet Nam |
501 |
+VU Vanuatu |
502 |
+WF Wallis and Futuna |
503 |
+WS Samoa |
504 |
+XXX the adult entertainment community |
505 |
+YE Yemen |
506 |
+YT Mayotte |
507 |
+ZA South Africa |
508 |
+ZM Zambia |
509 |
+ZW Zimbabwe |
510 |
+ |
511 |
diff -urN smeserver-xt_geoip-1.0.1.old/root/usr/share/xt_geoip/geoip_stats smeserver-xt_geoip-1.0.1/root/usr/share/xt_geoip/geoip_stats |
512 |
--- smeserver-xt_geoip-1.0.1.old/root/usr/share/xt_geoip/geoip_stats 2019-09-30 00:56:29.000000000 +0400 |
513 |
+++ smeserver-xt_geoip-1.0.1/root/usr/share/xt_geoip/geoip_stats 2019-09-30 20:29:59.000000000 +0400 |
514 |
@@ -12,7 +12,7 @@ |
515 |
LOGDIR="/var/log/sshd" |
516 |
CMD1='cat' |
517 |
CMD2=' | /usr/local/bin/tai64nlocal | grep' |
518 |
- CMD3=' | grep "Failed password" | sed -e "s/^.*from //" -e "s/ port.*$//" >> $RESFILE' |
519 |
+ CMD3=' | grep -E "(Failed password|Invalid user \w+ from)" | sed -e "s/^.*from //" -e "s/ port.*$//" >> $RESFILE' |
520 |
;; |
521 |
"ipt") |
522 |
PREF="ipt" |