From b81ee4db741380a04e9932c1818da18d569926b7 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Sun, 8 Jan 2017 03:08:59 -0600 Subject: [PATCH] kick assholes who try to send unauthorized controller messages; log them to a special HackAttempts channel (note: add to logservertargets and we'll get a nice log with ip addys we can autoban with fail2ban) --- engine/server/library/serverGame/src/shared/core/Client.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/server/library/serverGame/src/shared/core/Client.cpp b/engine/server/library/serverGame/src/shared/core/Client.cpp index 75edac337..da8c0e16c 100755 --- a/engine/server/library/serverGame/src/shared/core/Client.cpp +++ b/engine/server/library/serverGame/src/shared/core/Client.cpp @@ -947,7 +947,11 @@ void Client::receiveClientMessage(const GameNetworkMessage &message) { } } else { // log as a likely hack - LOG("CustomerService", ("UnauthorizedControllerMessage: Player %s sent an unauthorized controller message %d for object %s.", PlayerObject::getAccountDescription(getCharacterObjectId()).c_str(), o.getMessage(), o.getNetworkId().getValueString().c_str())); + LOG("HackAttempts", ("Unauthorized Controller Message: Player %s at %s sent an unauthorized controller message %d for object %s", PlayerObject::getAccountDescription(getCharacterObjectId()).c_str(), getIpAddress().c_str(), o.getMessage(), o.getNetworkId().getValueString().c_str())); + + KickPlayer const kickMessage(m_characterObjectId, "Hack Attempt"); + GameServer::getInstance().sendToConnectionServers(kickMessage); + GameServer::getInstance().dropClient(m_characterObjectId); } if (!appended) {