AuthMe / AuthMeReloaded

The best authentication plugin for the Bukkit/Spigot API!
https://www.spigotmc.org/resources/authmereloaded.6269/
GNU General Public License v3.0
630 stars 517 forks source link

(/192.168.0.206:55814): Your country is banned from this server! #1131

Closed comonier closed 7 years ago

comonier commented 7 years ago

And its not blocked.... he is from PT any tip to unblock that player ?

Protection:

Enable some servers protection (country based login, antibot)

enableProtection: true
# Apply the protection also to registered usernames
enableProtectionRegistered: true
# Countries allowed to join the server and register. For country codes, see
# https://dev.bukkit.org/projects/authme-reloaded/pages/countries-codes
# PLEASE USE QUOTES!
countries: 
- 'BR'
- 'PT'
# Countries not allowed to join the server and register
# PLEASE USE QUOTES!
countriesBlacklist: 
- 'A1'
sgdc3 commented 7 years ago

@comonier does it work if you set "countriesBlacklist: []"?

ljacqu commented 7 years ago

If the whitelist is not empty, only the whitelist will have effect. The blacklist is only considered if the whitelist is empty.

comonier commented 7 years ago
enableProtectionRegistered: true
# Countries allowed to join the server and register. For country codes, see
# https://dev.bukkit.org/projects/authme-reloaded/pages/countries-codes
# PLEASE USE QUOTES!
countries: 
- 'BR'
- 'PT'
# Countries not allowed to join the server and register
# PLEASE USE QUOTES!
countriesBlacklist:[]
# Do we need to enable automatic antibot system?
enableAntiBot: true

got this error ERROR:

while scanning a simple key in "", line 378, column 5: countriesBlacklist:[] ^ could not found expected ':' in "", line 379, column 5:

Do we need to enable automatic ...

    ^
comonier commented 7 years ago

change to: countries:

sgdc3 commented 7 years ago

@ljacqu uh, didn't know that, it sounds strange to me that the player ip was a 192.168.0.x address :/

comonier commented 7 years ago

yes its amazing and super strange, 192.162.0 its routers, and modens default gateway... who someone from PT have this wan ip, its normally a lan gateway... but whatever its from console log. I am wanting he try to connect on the server tomorrow again... so i can check if removing all countries from blocked list will work.... you sad to me change to countriesBlacklist:[] but is doenst work so i change it to - [] on another line after countriesBlacklist:[] its good ?

comonier commented 7 years ago

https://www.quora.com/Why-IP-addresses-start-with-192-168 "If no. of users are more .Then you should take this Private class IPs.

Class B:- 172.16.0.0 =>172.31.255.255

No. of Host IP Addresses in this Class :-1,048,576;

Class C:- 192.168.0.0 =>192.168.255.255

No. of Host IP Addresses in this Class :-65,536;

So no. of host IP Addresses are minimum in class c and if no. of Hosts are less in your Private Network then c class IPs are provided.

                                       ---***---

Other all IP Addresses are Public IP Address.

If IANA provide public IP addresses to every Host,then no. of IPs will short . So they declared some IPs as Private IP Addresses . These Private IPs can be assigned to any Private Network of College,Company etc.

Like In our college all students have different Private IP Addresses.But if we want to connect other Networks then we have to use Public IP .In our college there is only one Public IP .

So, No. of Hosts in your Private Network is less than or equal to 65,536 and you are using Class C IP Address . Due to this, your IP Address start with 192.168.."

sgdc3 commented 7 years ago

@ljacqu sounds strange to me, what do you think?

ljacqu commented 7 years ago

uh, didn't know that

The whitelist means "don't allow anything besides in the whitelist," so it's the only thing that makes semantically. ;)

sounds strange to me, what do you think?

I totally missed the fact that this is a private IP... How can the GeoIP feature we use know that the private IP is physically located in PT? It doesn't. I think you need to add A1 to the whitelist, @comonier. I will add some debug statements for the country protection feature and I'll write a comment again.

ljacqu commented 7 years ago

Once it's available, logging is available in build n. 1589 at http://ci.xephi.fr/job/AuthMeReloaded/ (don't use 1588 because I messed up the log...)

Please download that JAR, and in your config.yml set logLevel: 'DEBUG'. If country protection is enabled, a debug log statement will be issued for each IP connecting to the server, outputting the country code. Then we'll know what those 192.168.. IPs are mapped to by GeoIP.

comonier commented 7 years ago

09.03 15:55:08 [Server] INFO UUID of player IuputPT is a9a3f38c-c6f7-4856-8069-48c80258730d 09.03 15:55:08 [Server] INFO Disconnecting com.mojang.authlib.GameProfile@189ab029[id=a9a3f38c-c6f7-4856-8069-48c80258730d,name=IuputPT,properties={textures=[com.mojang.authlib.properties.Property@ab7ee5c]},legacy=false] (/192.168.0.206:56994): Your country is banned from this server! 09.03 15:55:08 [Disconnect] User com.mojang.authlib.GameProfile@189ab029[id=a9a3f38c-c6f7-4856-8069-48c80258730d,name=IuputPT,properties={textures=[com.mojang.authlib.properties.Property@ab7ee5c]},legacy=false] (/192.168.0.206:56994) has disconnected, reason: Your country is banned from this server!

comonier commented 7 years ago

Protection:

Enable some servers protection (country based login, antibot)

enableProtection: true
# Apply the protection also to registered usernames
enableProtectionRegistered: true
# Countries allowed to join the server and register. For country codes, see
# https://dev.bukkit.org/projects/authme-reloaded/pages/countries-codes
# PLEASE USE QUOTES!
countries: 
- 'BR'
- 'PT'
# Countries not allowed to join the server and register
# PLEASE USE QUOTES!
countriesBlacklist:
- []
# Do we need to enable automatic antibot system?
enableAntiBot: true
comonier commented 7 years ago

each one ?

AuthMe-5.3-SNAPSHOT-legacy.jar  5.05 MB  exibir
AuthMe-5.3-SNAPSHOT-noshade.jar 618.84 KB    exibir
AuthMe-5.3-SNAPSHOT-spigot.jar  2.64 MB  exibir
comonier commented 7 years ago

[16:26:47] [User Authenticator #4/INFO]: UUID of player IuputPT is a9a3f38c-c6f7-4856-8069-48c80258730d [16:26:47] [Server thread/INFO]: [AuthMe] [DEBUG] Country code -- for 192.168.0.206 is allowed: false [16:26:47] [Server thread/INFO]: Disconnecting com.mojang.authlib.GameProfile@6d1fbf1[id=a9a3f38c-c6f7-4856-8069-48c80258730d,name=IuputPT,properties={textures=[com.mojang.authlib.properties.Property@7159dd5]},legacy=false] (/192.168.0.206:57380): O seu país está banido deste servidor

ljacqu commented 7 years ago

Thanks for the logs. In that case it probably needs to be:

countries:
- 'BR'
- 'PT'
- '--'

Edit: and hopefully you've only added the JAR you need? Either the spigot one or the legacy one. https://github.com/AuthMe/AuthMeReloaded/wiki/AuthMe-Releases-(Jenkins)

comonier commented 7 years ago

09.03 16:49:19 [Server] INFO ==========[ AuthMeReloaded ABOUT ]========== 09.03 16:49:19 [Server] INFO Version: AuthMeReloaded v5.3-SNAPSHOT (build: 1589)

09.03 16:48:28 [Server] INFO UUID of player IuputPT is a9a3f38c-c6f7-4856-8069-48c80258730d 09.03 16:48:28 [Server] INFO [DEBUG] Country code -- for 192.168.0.206 is allowed: true 09.03 16:48:29 [Connect] User IuputPT, IP 192.168.0.206 09.03 16:48:29 [Multicraft] IuputPT ran command Mensagem do Dia

Now that I've released this code '--' is not this going to free all countries to connect to my server?

ljacqu commented 7 years ago

We use GeoIP by Maxmind in the background to map IP addresses to countries. Whatever their database returns, we take and we check against the whitelist. So no, -- doesn't free all countries, it will simply allow all IP addresses for which GeoIP returns -- as country code. (That's also what we return if we couldn't download the GeoIP database.)

I think a debug command for looking up IP addresses' country code might be interesting to play around with. But here these are internal IP addresses (from the same network!)... these IP addresses are not applicable for country lookup since they're in the private range, so I guess GeoIP just returns --.

comonier commented 7 years ago

no problem, the player connect on the server and he is happy now. Ty you can close this issue.

ljacqu commented 7 years ago

Thanks for the feedback! Btw, with the build n. 1592 and above we now have /authme debug cty available to view country information and to check whether the country is blocked or not. Maybe this can be helpful in the future.

ljacqu commented 7 years ago

Adding to 5.3 milestone because of the improvements in debug logging / debug command