Network Security [1.13 - 1.21] ✈️ AntiVPN and AntiProxy [FREE] icon

Network Security [1.13 - 1.21] ✈️ AntiVPN and AntiProxy [FREE] -----

It seeks to add a layer of protection so that account thieves are stressed.




Actualización del Plugin: Seguridad de Networks - Soporte para Modo de Países (Whitelist/Blacklist)

Novedades:
- Soporte para Modo de Países: Ahora puedes alternar entre una lista de países permitidos (whitelist) y una lista de países bloqueados (blacklist) desde el archivo config.yml. Esto te permite controlar de manera más flexible quién puede acceder a tu servidor basado en su ubicación geográfica.

Configuración Simplificada:
Si usas el modo blacklist, se bloquearán los países en la lista country-deny.
Si usas el modo whitelist, solo se permitirá el acceso a los países en la lista country-allow.

Archivo config.yml actualizado: Aquí está el nuevo formato:
Code (YAML):
country-mode : blacklist # Alterna entre "blacklist" y "whitelist"
country-deny
: [AF, AX, AL, DZ ] # Lista de países bloqueados (solo para blacklist)
# country-allow: [US, CA, GB, FR] # Lista de países permitidos (solo para whitelist)
Plugin Update
: Network Security - Country Mode Support (Whitelist/Blacklist )
What's New:
Country Mode Support: You can now toggle between a whitelist and blacklist of countries directly from the config.yml file. This gives you greater flexibility in managing server access based on geographic location.

Simplified Configuration:
In blacklist mode, countries listed in country-deny will be blocked.
In whitelist mode, only countries listed in country-allow will be allowed access.

Updated config.yml File: Here's the new format:
Code (YAML):
country-mode : blacklist # Toggle between "blacklist" and "whitelist"
country-deny
: [AF, AX, AL, DZ ] # Blocked countries (for blacklist only)
# country-allow: [US, CA, GB, FR] # Allowed countries (for whitelist only)
----------, Jan 13, 2025

Recommended to reload the config.yml

1.PlaceholderAPI Integration:
Added 2 PlaceholderAPI variables related to the security system
- %security_country% - Returns the user's country (2-digit code)
- %security_vpn% - returns false/true if you have VPN or PROXY

2. Ban System:
Bans by Nickname and IP:
- Commands were implemented to permanently ban both by nickname and by IP. /bans <IP/Nickname> <Player> <Reason>
- When banning by IP, all players connected to that IP are disconnected.
- Ban messages can be customized from configuration files.

Temporary Ban by Nickname and IP:
- Command /bans tempban <NICK/IP> <duration> <reason> that allows players to be temporarily banned.
- The duration of the ban can be in minutes (m), hours (h), days (d) or years (y). Example: /bans tempban Anyelo120 1h Reason
The expiration time is calculated based on the command and stored in the configuration files.

Temporary Ban Messages:
- Added support for custom temporary ban messages, including the remaining time of the ban.
- When a player tries to connect and is temporarily banned, they receive a message indicating the reason for the ban and the remaining time.

Temporary Ban Verification System:
- If a temporary ban expires, it is automatically removed from the system, allowing the player to log back in.
- If the ban has not yet expired, the player is banned with the corresponding message.

Automatic Reload of the Temporary Bans File:
- Command /bans unban <NICK/IP>:
Allows you to remove a ban, whether permanent or temporary, by nickname or IP.
Once the command is executed, the ban is removed from the configuration files.
----------, Sep 4, 2024

After 2 days of use on my server, I realized that the anti-proxy system was missing something important, a whitelist to avoid excessive use of the API.

New changes:
- A whitelist.yml was implemented to add the IPs that were already allowed on the antivpn and antiproxy.

- Changes were made to the config.yml, important to update the new YML.

With these changes you improve the efficiency of the code and the API.

NEW CONFIG.YML
Code (YAML):
messages:
  ip-blocked
: "Acceso denegado: IP bloqueada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  country-blocked
: "Acceso denegado: Conexiones desde tu país no están permitidas. ¿Cree que fue un error? discord: discord.supernovamc.online"
  suspicious-activity
: "Acceso denegado: Actividad sospechosa detectada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  player-registered
: "Jugador registrado {player} desde {location}."
  login-blocked
: "Intento de inicio de sesión bloqueado para el jugador {player} desde {location}."
  api-switch
: "Cambiando a la siguiente API."
  suspicious-connection
: "ha sido agregada a la lista negra por intentos de inicio de sesión sospechosos."
  allowed-country
: "Ha pasado con exito la revisión de paises permitidos."
  ipRemove-noPermission
: "No tienes permisos para hacer eso..."
  ipRemove
: "IP eliminada correctamente de los archivos y lista negra."
  ipRemove-error
: "IP no encontrada..."
  vpn-proxy-blocked
: "El uso de VPN y PROXY esta prohibido dentro del servidor."
  no-vpn-or-proxy
: "Ha pasado correctamente el sistema antiVPN y antiPROXY."
  add-whitelist
: "IP agregada a la Whitelist."
----------, May 22, 2024

- A new antiVPN and antiPROXY system has been implemented to prevent intruders by camouflaging your IP
- New config.yml
Code (YAML):
# List of blocked countries, this will help prevent VPNs from users and thus have an IP blacklist to not use so many API requests.
# http://country.io/names.json?ref=ipinfo.io
# https://www.iplocation.net/country-codes
country-deny
: [AF, AX, AL, DZ ]

# IMPORTANT: Enter the API-KEY of the pages:
# https://ipgeolocation.io/
# https://ipinfo.io/
api-keys
:
  ipgeolocation
: API-KEY
  ipinfo
: API-KEY
  proxycheck
: API-KEY # anti-proxy and anti-vpn
 
# For the anti-proxy and anti-vpn system to work correctly it must have the
# https://proxycheck.io/ API (obligatory)
detect-vpn-proxy
: false

# Personalize the messages to your liking, if you want to use color code it is with "§"
messages
:
  ip-blocked
: "Acceso denegado: IP bloqueada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  country-blocked
: "Acceso denegado: Conexiones desde tu país no están permitidas. ¿Cree que fue un error? discord: discord.supernovamc.online"
  suspicious-activity
: "Acceso denegado: Actividad sospechosa detectada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  player-registered
: "Jugador registrado {player} desde {location}."
  login-blocked
: "Intento de inicio de sesión bloqueado para el jugador {player} desde {location}."
  api-switch
: "Cambiando a la siguiente API."
  suspicious-connection
: "ha sido agregada a la lista negra por intentos de inicio de sesión sospechosos."
  allowed-country
: "Ha pasado con exito la revisión de paises permitidos."
  ipRemove-noPermission
: "No tienes permisos para hacer eso..."
  ipRemove
: "IP eliminada correctamente de los archivos y lista negra."
  ipRemove-error
: "IP no encontrada..."
  vpn-proxy-blocked
: "El uso de VPN y PROXY esta prohibido dentro del servidor."
  no-vpn-or-proxy
: "Ha pasado correctamente el sistema antiVPN y antiPROXY."

# Permission:
# security.bypass.countryblocked - Prevent country ban review on a player.
# security.bypass.vpn-proxy - Use in case of false positives.
# security.bypass.all - Remove all protections that the addon gives to a player.
# security.command.remove - Permissions to use the command: /security remove IP

# How does this security plugin work?
# When the plugin is enabled:
# - The default configuration (config.yml) is loaded.
# - Player data is loaded from playerData.yml.
# - Load the IP cache from ipCache.yml.
# - Load the IP blacklist from blacklist.yml.
# - Load the API state from apiState.yml.
# - IP geolocation services are initialized with the API keys from config.yml.
# - Custom messages will be loaded from config.yml.
# - Plugin events are logged in Bukkit.

# When a player tries to log in (onPlayerLogin event):
# - The name and IP of the player are obtained.
# - Checks if the player's IP is blacklisted:
# - If present, access is denied with an IP blocked message and a blocked attempt is logged.
# - The country is obtained from the player's IP using cache or geolocation services:
# - If the country is blacklisted, access is denied with a country blocked message,
# The blocked attempt is logged and the IP is added to the blacklist.
# - If the player has already logged in before, it is checked if the country has changed:
# - If the country has changed, access is denied with a suspicious activity message and the blocked attempt is logged.
# - If this is the first time the player logs in, the player's country is recorded.

# When the plugin is disabled:
# - Player data is saved in playerData.yml.
# - The IP cache is saved in ipCache.yml.
# - The blacklist of IPs is saved in blacklist.yml.
# - The state of the API is saved in apiState.yml.

# Additional methods:
# - getCountryFromIP: Gets the country of an IP using cache or geolocation services.
# - switchToNextApi: Switch to the next geolocation service if the current one fails.
# - loadPlayerData / savePlayerData: Load and save player data.
# - loadIPCache / saveIPCache: Load and save the IP cache.
# - loadIPBlacklist / saveIPBlacklist: Load and save the IP blacklist.
# - loadApiState / saveApiState: Load and save the API state.
# - formatMessage: Replaces {player} and {location} markers in custom messages.
- New permission to bypass VPN or PROXY checking for possible false positives.
----------, May 20, 2024

- Two new permissions have been implemented.
- A new command has been implemented.

Permissions:
Code (YAML):
# Permission:
# security.bypass.countryblocked: Prevents checking a player's country ban.
# security.bypass.all - Removes all protections that the plugin provides to a player.
# security.command.remove - Permissions to use the command: /security remove IP
- New command "/security remove IP" Allows you to delete the IP from the blacklist.

- New Config.yml
Code (YAML):
# List of blocked countries, this will help prevent VPNs from users and thus have an IP blacklist to not use so many API requests.
# http://country.io/names.json?ref=ipinfo.io
# https://www.iplocation.net/country-codes
country-deny
: [AF, AX, AL, DZ ]

# IMPORTANT: Enter the API-KEY of the pages:
# https://ipgeolocation.io/
# https://ipinfo.io/
api-keys
:
  ipgeolocation
: API-KEY
  ipinfo
: API-KEY

# Personalize the messages to your liking, if you want to use color code it is with "§"
messages
:
  ip-blocked
: "Acceso denegado: IP bloqueada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  country-blocked
: "Acceso denegado: Conexiones desde tu país no están permitidas. ¿Cree que fue un error? discord: discord.supernovamc.online"
  suspicious-activity
: "Acceso denegado: Actividad sospechosa detectada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  player-registered
: "Jugador registrado {player} desde {location}."
  login-blocked
: "Intento de inicio de sesión bloqueado para el jugador {player} desde {location}."
  api-switch
: "Cambiando a la siguiente API."
  suspicious-connection
: "ha sido agregada a la lista negra por intentos de inicio de sesión sospechosos."
  allowed-country
: "Ha pasado con exito la revisión de paises permitidos."
  ipRemove-noPermission
: "No tienes permisos para hacer eso..."
  ipRemove
: "IP eliminada correctamente de los archivos y lista negra."
  ipRemove-error
: "IP no encontrada..."

# Permission:
# security.bypass.countryblocked - Prevent country ban review on a player.
# security.bypass.all - Remove all protections that the addon gives to a player.
# security.command.remove - Permissions to use the command: /security remove IP

# How does this security plugin work?
# When the plugin is enabled:
# - The default configuration (config.yml) is loaded.
# - Player data is loaded from playerData.yml.
# - Load the IP cache from ipCache.yml.
# - Load the IP blacklist from blacklist.yml.
# - Load the API state from apiState.yml.
# - IP geolocation services are initialized with the API keys from config.yml.
# - Custom messages will be loaded from config.yml.
# - Plugin events are logged in Bukkit.

# When a player tries to log in (onPlayerLogin event):
# - The name and IP of the player are obtained.
# - Checks if the player's IP is blacklisted:
# - If present, access is denied with an IP blocked message and a blocked attempt is logged.
# - The country is obtained from the player's IP using cache or geolocation services:
# - If the country is blacklisted, access is denied with a country blocked message,
# The blocked attempt is logged and the IP is added to the blacklist.
# - If the player has already logged in before, it is checked if the country has changed:
# - If the country has changed, access is denied with a suspicious activity message and the blocked attempt is logged.
# - If this is the first time the player logs in, the player's country is recorded.

# When the plugin is disabled:
# - Player data is saved in playerData.yml.
# - The IP cache is saved in ipCache.yml.
# - The blacklist of IPs is saved in blacklist.yml.
# - The state of the API is saved in apiState.yml.

# Additional methods:
# - getCountryFromIP: Gets the country of an IP using cache or geolocation services.
# - switchToNextApi: Switch to the next geolocation service if the current one fails.
# - loadPlayerData / savePlayerData: Load and save player data.
# - loadIPCache / saveIPCache: Load and save the IP cache.
# - loadIPBlacklist / saveIPBlacklist: Load and save the IP blacklist.
# - loadApiState / saveApiState: Load and save the API state.
# - formatMessage: Replaces {player} and {location} markers in custom messages.
----------, May 20, 2024

- Implemented a new permission to grant to players.
Permission to avoid having to go through the permitted country checker.
security.bypass.countryblocked

- New changes in config.yml
Code (YAML):
messages:
  ip-blocked
: "Acceso denegado: IP bloqueada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  country-blocked
: "Acceso denegado: Conexiones desde tu país no están permitidas. ¿Cree que fue un error? discord: discord.supernovamc.online"
  suspicious-activity
: "Acceso denegado: Actividad sospechosa detectada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  player-registered
: "Jugador registrado {player} desde {location}."
  login-blocked
: "Intento de inicio de sesión bloqueado para el jugador {player} desde {location}."
  api-switch
: "Cambiando a la siguiente API."
  suspicious-connection
: "ha sido agregada a la lista negra por intentos de inicio de sesión sospechosos."
  allowed-country
: "Ha pasado con exito la revisión de paises permitidos."
----------, May 18, 2024

- Now if a user tries to access an account which is not allowed due to the difference in country, if they try more than 3 times in a period of 5 minutes, their IP is added to the blacklist, in this way many requests to the API making it more viable in the long term.

- Changes in config.yml

Code (YAML):
# Personalize the messages to your liking, if you want to use color code it is with "§"
messages
:
  ip-blocked
: "Acceso denegado: IP bloqueada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  country-blocked
: "Acceso denegado: Conexiones desde tu país no están permitidas. ¿Cree que fue un error? discord: discord.supernovamc.online"
  suspicious-activity
: "Acceso denegado: Actividad sospechosa detectada. ¿Cree que fue un error? discord: discord.supernovamc.online"
  player-registered
: "Jugador registrado {player} desde {location}."
  login-blocked
: "Intento de inicio de sesión bloqueado para el jugador {player} desde {location}."
  api-switch
: "Cambiando a la siguiente API."
  suspicious-connection
: "ha sido agregada a la lista negra por intentos de inicio de sesión sospechosos."
----------, May 17, 2024

Resource Information
Author:
----------
Total Downloads: 596
First Release: May 17, 2024
Last Update: Jan 13, 2025
Category: ---------------
All-Time Rating:
3 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings