Posts: 3,002
Threads: 86
Joined: Jul 2010
Reputation:
0
I noticed that some guy is attempting to hack into my rcon by bruteforce. The log is spammed with rcon login attempts. I want to make a protection script. I need that IP remembered, if he attempts 3 times per second and failes, the IP should be banned for 30 seconds. After that unbanned. Can someone help me with this?
Posts: 691
Threads: 96
Joined: Jan 2012
Reputation:
0
public OnRconLoginAttempt(ip[], password[], success) you could create a variable that goes down every time they enter the wrong password, if it gets to 0, ip ban them. If someone is trying to hack you, i wouldn't unban them after 30 seconds if I were you though
Posts: 190
Threads: 60
Joined: Dec 2012
Reputation:
0
if you set there banned variable to 1 (true) then they stay banned... but you could set a timer which then sets the variable back to 0, unbanning them... wouldn't that work?
Posts: 1,733
Threads: 20
Joined: Nov 2010
Reputation:
0
If someone tries to hack your Rcon password by spamming your server with login attempts and using brute-force, why unban them at all?
They probably have a script running to try to hack your password.
If you ban them upon the third attempt, their script would not be able to login for 30 seconds.
When they get unbanned again 30 seconds later, they'll just get banned again after 3 attempts because they won't stop.
Their script might have some built-in security to catch if they got a connection for every attempt.
If they got banned and then unbanned, they might start over where they left off, and finally, after a few thousand bans/unbans, they'll still hack your rcon password, allowing them to login properly with the hacked password and mess up your server (they could ban all players using rcon).
They could even have such code in their script/program to ban all players which are logged in.
Or send a "rcon exit" command to your server every 5 seconds, to shutdown your server every time you start it up again.
Hackers should get permanent bans. Period.
Unbanning them after 30 seconds is the same as saying: "you can now continue your hacking attempts".
Rcon brute-force hacking is only used to get your rcon password, nothing more.
Once they have it, be ready for some unusual stuff to happen like described above.
Using the 30-second delay between every 3 attempts will only take them longer to find the password, but they'll get it eventually.
Your log will be spammed as before, it only takes longer to fill up as fast.
Any regular player on your server wouldn't do this, so they won't be affected.