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 --- 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 +++ 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 @@ -95,13 +95,23 @@ + IPT_LIST_DESCRIPTION +
  • Click here to see the statistics of the prevented connections
  • ]]> +
    +
    + IPT_LIST - Stats of XT-geoip prevented connections + Filtered + SSH_LIST_DESCRIPTION +
  • Click here to see the statistics of SSH errors for non blocked access
  • ]]> +
    +
    + SSH_LIST - Stats of SSH errors not blocked by XT-geoip + SSH errors @@ -121,7 +131,7 @@ STATS_DESCRIPTION - Statistics for Xt_GeoIP
      +

      Statistics for Xt_GeoIP

      • For 3 periods : Day, Week and Month
      • Banned Ips by country sorted by number
      • Ssh errors by country sorted by number
      • @@ -130,9 +140,36 @@ + COUNTRY_LIST_DESCRIPTION + +
      • Click here to see a list of available country codes
      • +
      ]]> +
      + + + + LABEL_COUNTRY_LIST + Country codes : + + + COUNTRY_LIST + Country codes + + + + CNTRY_LIST + List + + + + END_OF_CODES + End of code list + + + SERVICE_DESCRIPTION Per service filtering for Xtables GeoIP
        -
      • If you want different filtering for certain services
      • +
      • If you want different filtering based on services

      ]]>
      @@ -144,7 +181,7 @@ PER_SERVICE_GEOIP - -> Services + Services @@ -217,5 +254,17 @@ 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. + + COUNTRIES_LIST_DESCRIPTION + + + + + + + + SERVICE_DESCRIPTION + + 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 --- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/web/functions/xt_geoip 2019-09-30 00:56:29.000000000 +0400 +++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/web/functions/xt_geoip 2019-09-30 20:07:46.000000000 +0400 @@ -97,21 +97,38 @@ id="stat_geoip" value="get_stat_geoip()"> - + + + + + COUNTRY_LIST_DESCRIPTION + + + + + + SERVICE_DESCRIPTION - + + STATS_DESCRIPTION + + IPT_LIST_DESCRIPTION + + + + SSH_LIST_DESCRIPTION + - @@ -176,19 +193,6 @@ - - SERVICE_DESCRIPTION - - - - - - - - @@ -263,10 +267,14 @@ - + + + + + - + 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 --- 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 +++ 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 @@ -489,4 +489,37 @@ return 'OK'; } + +#Subroutine to list counries codes +sub generateCodes +{ + my $self = shift; + my $q = $self->{cgi}; + + my $file = "/usr/share/xt_geoip/geoip_countries_list.txt"; + unless ( -e $file ) { + print $q->p($q->b($self->localise('INVALID_CODES_LIST'))); + return ''; + } + + print $q->h3($self->localise('COUNTRY_LIST')); + + open( XTGEOIPCODES, $file ); + print "
      \n";
      +
      +	while ()
      +	{
      +		print;
      +	}
      +
      +	close XTGEOIPCODES;
      +	print "
      \n"; + + print $q->h3($self->localise('END_OF_CODES')); + $self->wherenext('First'); + return ''; + +} + + 1; 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 --- smeserver-xt_geoip-1.0.1.old/root/usr/share/xt_geoip/geoip_countries_list.txt 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-xt_geoip-1.0.1/root/usr/share/xt_geoip/geoip_countries_list.txt 2019-09-30 00:49:21.000000000 +0400 @@ -0,0 +1,280 @@ +Abbreviated Country Code List + +A1 Anonymous Proxy +A2 Satellite Provider +AC Ascension Island +AD Andorra +AE United Arab Emirates +AERO members of the air-transport industry +AF Afghanistan +AG Antigua and Barbuda +AI Anguilla +AL Albania +AM Armenia +AN Netherlands Antilles (being phased out) +AO Angola +AQ Antarctica +AP Asia/Pacific +AR Argentina +AS American Samoa +ASIA Restricted to the Pan-Asia and Asia Pacific community +AT Austria +AU Australia +AW Aruba +AX Aland Islands +AZ Azerbaijan +BA Bosnia and Herzegovina +BB Barbados +BD Bangladesh +BE Belgium +BF Burkina Faso +BG Bulgaria +BH Bahrain +BI Burundi +BIZ Restricted for Business +BJ Benin +BL Saint Barthelemy +BM Bermuda +BN Brunei Darussalam +BO Bolivia +BQ Bonaire, Sint Eustatius and Saba +BR Brazil +BS Bahamas +BT Bhutan +BV Bouvet Island +BW Botswana +BY Belarus +BZ Belize +CA Canada +CC Cocos (Keeling) Islands +CD Congo, The Democratic Republic of the +CF Central African Republic +CG Congo +CH Switzerland +CI Cote d'Ivoire +CK Cook Islands +CL Chile +CM Cameroon +CN China +CO Colombia +COM Generic top-level domain +COOP cooperative associations +CR Costa Rica +CU Cuba +CV Cape Verde +CW CuraƧao +CX Christmas Island +CY Cyprus +CZ Czech Republic +DE Germany +DJ Djibouti +DK Denmark +DM Dominica +DO Dominican Republic +DZ Algeria +EC Ecuador +EDU Educational Institutions +EE Estonia +EG Egypt +EH Western Sahara +ER Eritrea +ES Spain +ET Ethiopia +EU European Union +FI Finland +FJ Fiji +FK Falkland Islands (Malvinas) +FM Micronesia, Federated States of +FO Faroe Islands +FR France +GA Gabon +GB United Kingdom +GD Grenada +GE Georgia +GF French Guiana +GG Guernsey +GH Ghana +GI Gibraltar +GL Greenland +GM Gambia +GN Guinea +GOV United States Government +GP Guadeloupe +GQ Equatorial Guinea +GR Greece +GS South Georgia and the South Sandwich Islands +GT Guatemala +GU Guam +GW Guinea-Bissau +GY Guyana +HK Hong Kong +HM Heard Island and McDonald Islands +HN Honduras +HR Croatia +HT Haiti +HU Hungary +ID Indonesia +IE Ireland +IL Israel +IM Isle of Man +IN India +INFO Generic top-level domain +IO British Indian Ocean Territory +IQ Iraq +IR Iran, Islamic Republic of +IS Iceland +IT Italy +JE Jersey +JM Jamaica +JO Jordan +JOBS Reserved to serve needs of the international human resource management community +JP Japan +KE Kenya +KG Kyrgyzstan +KH Cambodia +KI Kiribati +KM Comoros +KN Saint Kitts and Nevis +KP Korea, Democratic People's Republic of +KR Korea, Republic of +KW Kuwait +KY Cayman Islands +KZ Kazakhstan +LA Lao People's Democratic Republic +LB Lebanon +LC Saint Lucia +LI Liechtenstein +LK Sri Lanka +LR Liberia +LS Lesotho +LT Lithuania +LU Luxembourg +LV Latvia +LY Libyan Arab Jamahiriya +MA Morocco +MC Monaco +MD Moldova, Republic of +ME Montenegro +MF Saint Martin (French part) +MG Madagascar +MH Marshall Islands +MIL United States Military +MK Macedonia, The Former Yugoslav Republic of +ML Mali +MM Myanmar +MN Mongolia +MO Macao +MOBI consumers and providers of mobile products and services +MP Northern Mariana Islands +MQ Martinique +MR Mauritania +MS Montserrat +MT Malta +MU Mauritius +MUSEUM museums +MV Maldives +MW Malawi +MX Mexico +MY Malaysia +MZ Mozambique +NA Namibia +NAME individuals +NC New Caledonia +NE Niger +NET Generic top-level domain +NF Norfolk Island +NG Nigeria +NI Nicaragua +NL Netherlands +NO Norway +NP Nepal +NR Nauru +NU Niue +NZ New Zealand +OM Oman +ORG Generic top-level domain +PA Panama +PE Peru +PF French Polynesia +PG Papua New Guinea +PH Philippines +PK Pakistan +PL Poland +PM Saint Pierre and Miquelon +PN Pitcairn +PR Puerto Rico +PRO Restricted to credentialed professionals and related entities +PS Palestinian Territory, Occupied +PT Portugal +PW Palau +PY Paraguay +QA Qatar +RE Reunion +RO Romania +RS Serbia +RU Russian Federation +RW Rwanda +SA Saudi Arabia +SB Solomon Islands +SC Seychelles +SD Sudan +SE Sweden +SG Singapore +SH Saint Helena +SI Slovenia +SJ Svalbard and Jan Mayen +SK Slovakia +SL Sierra Leone +SM San Marino +SN Senegal +SO Somalia +SR Suriname +SS South Sudan +ST Sao Tome and Principe +SU Soviet Union (being phased out) +SV El Salvador +SX Saint Maarten (Dutch part) +SY Syrian Arab Republic +SZ Swaziland +TC Turks and Caicos Islands +TD Chad +TEL businesses and individuals to publish their contact data +TF French Southern Territories +TG Togo +TH Thailand +TJ Tajikistan +TK Tokelau +TL Timor-Leste +TM Turkmenistan +TN Tunisia +TO Tonga +TP Portuguese Timor (being phased out) +TR Turkey +TRAVEL entities whose primary area of activity is in the travel industry +TT Trinidad and Tobago +TV Tuvalu +TW Taiwan, Province of China +TZ Tanzania, United Republic of +UA Ukraine +UG Uganda +UK United Kingdom +UM United States Minor Outlying Islands +US United States +UY Uruguay +UZ Uzbekistan +VA Holy See (Vatican City State) +VC Saint Vincent and the Grenadines +VE Venezuela, Bolivarian Republic of +VG Virgin Islands, British +VI Virgin Islands, US +VN Viet Nam +VU Vanuatu +WF Wallis and Futuna +WS Samoa +XXX the adult entertainment community +YE Yemen +YT Mayotte +ZA South Africa +ZM Zambia +ZW Zimbabwe + 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 --- smeserver-xt_geoip-1.0.1.old/root/usr/share/xt_geoip/geoip_stats 2019-09-30 00:56:29.000000000 +0400 +++ smeserver-xt_geoip-1.0.1/root/usr/share/xt_geoip/geoip_stats 2019-09-30 20:29:59.000000000 +0400 @@ -12,7 +12,7 @@ LOGDIR="/var/log/sshd" CMD1='cat' CMD2=' | /usr/local/bin/tai64nlocal | grep' - CMD3=' | grep "Failed password" | sed -e "s/^.*from //" -e "s/ port.*$//" >> $RESFILE' + CMD3=' | grep -E "(Failed password|Invalid user \w+ from)" | sed -e "s/^.*from //" -e "s/ port.*$//" >> $RESFILE' ;; "ipt") PREF="ipt"