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)
This commit is contained in:
DarthArgus
2017-01-08 03:08:59 -06:00
parent 9b42314f84
commit b81ee4db74

View File

@@ -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) {