Page 1 of 1

IP blacklist

Posted: 06 Feb 2024, 19:21
by moccha
Hello,

I have methods to detect login abuse with LoginAssistantComponent. I would like to add the attacker's IP address automatically to the server IP blacklist or to the "Banned Ip Address" section.

I can't use banUser because when the user is logging in I can only access the LoginData which doesn't has a user value even though I know what the IP is using session.getAddress. Is there or will there be a way to add banned IPs automatically from server code? Maybe I can do it somehow with getBannedUserManager?

Re: IP blacklist

Posted: 07 Feb 2024, 08:19
by Lapo
Hi,
there isn't a way to ban users at login time because, as you mentioned, a User object doesn't exist yet.
You could listen for the USER_JOIN_ZONE event and ban the player at that time, since you do get a User object with that event.

Cheers

Re: IP blacklist

Posted: 07 Feb 2024, 17:57
by moccha
ok thank you. I made it work by setting session var isMarkedForEvicton in the pre-login function and on the login event like you suggested check for the flag and then ban user.

I want to let you team know that most website documentation leads to an error page, in bing and google searches. Ex - https://docs2x.smartfoxserver.com/api-d ... ssion.html

I see this message - Drat! We could not find the page you have requested. and it says my https connection is not secure as well. please put a priority on fixing this because it may scare new customers.

Re: IP blacklist

Posted: 07 Feb 2024, 18:11
by Lapo
Thanks, we're going to deploy an SSL cert. for the doc website soon to fix the problem.
Cheers