From 9e2da1bd72eda46cfa2f9378afcaf66bc33028d7 Mon Sep 17 00:00:00 2001 From: ratkosrb Date: Thu, 5 Aug 2021 08:55:17 +0300 Subject: [PATCH] Add packet logging option to movement anticheat. You can parse the logs with https://github.com/ratkosrb/wowpacketparser/tree/classic --- src/game/Anticheat/Anticheat.h | 5 +- .../MovementAnticheat/MovementAnticheat.cpp | 49 ++++++++- .../MovementAnticheat/MovementAnticheat.h | 6 ++ src/game/CMakeLists.txt | 2 + src/game/Movement/MovementPacketSender.cpp | 8 +- src/game/Objects/Object.cpp | 4 + src/game/Objects/Player.cpp | 2 + src/game/Protocol/Opcodes.h | 99 +++++++++++++++++++ src/game/SniffFile.cpp | 75 ++++++++++++++ src/game/SniffFile.h | 56 +++++++++++ src/game/World.cpp | 1 + src/game/World.h | 1 + src/game/WorldSession.cpp | 3 + src/mangosd/mangosd.conf.dist.in | 10 +- 14 files changed, 312 insertions(+), 9 deletions(-) create mode 100644 src/game/SniffFile.cpp create mode 100644 src/game/SniffFile.h diff --git a/src/game/Anticheat/Anticheat.h b/src/game/Anticheat/Anticheat.h index 1010223bf..6ebef4bd5 100644 --- a/src/game/Anticheat/Anticheat.h +++ b/src/game/Anticheat/Anticheat.h @@ -116,8 +116,9 @@ public: movementInfo - new movement info that was just received opcode - the packet we are checking */ - bool HandlePositionTests(Player* pPlayer, MovementInfo& movementInfo, uint16 opcode) { return true; } - bool HandleFlagTests(Player* pPlayer, MovementInfo& movementInfo, uint16 opcode) { return true; } + bool HandlePositionTests(Player* /*pPlayer*/, MovementInfo& /*movementInfo*/, uint16 /*opcode*/) { return true; } + bool HandleFlagTests(Player* /*pPlayer*/, MovementInfo& /*movementInfo*/, uint16 /*opcode*/) { return true; } + void LogMovementPacket(bool /*isClientPacket*/, WorldPacket& /*packet*/) {} }; #endif diff --git a/src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp b/src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp index 3065cd578..b7b24caad 100644 --- a/src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp +++ b/src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp @@ -11,6 +11,7 @@ #include "World.h" #include "MovementPacketSender.h" #include "Geometry.h" +#include "AccountMgr.h" using namespace Geometry; @@ -132,6 +133,14 @@ uint32 MovementAnticheat::Finalize(std::stringstream& reason) me->GetMapId(), m_clientDesync, m_overspeedDistance, reason.rdbuf()->in_avail() ? reason.str().c_str() : ""); } + if ((result & (CHEAT_ACTION_KICK | CHEAT_ACTION_BAN_ACCOUNT | CHEAT_ACTION_BAN_IP_ACCOUNT)) && !m_packetLog.empty()) + { + AddMessageToPacketLog("End of packet log. Penalty: " + std::to_string(result) + ", Detected cheats: " + reason.str()); + std::string fileName = "movement_log_" + m_session->GetUsername() + "_" + std::to_string(time(nullptr)) + ".pkt"; + SniffFile packetDump(fileName.c_str()); + packetDump.WriteToFile(m_packetLog); + } + // Reset to zero tick counts m_cheatOccuranceTick.fill(0); @@ -145,12 +154,28 @@ void MovementAnticheat::AddCheats(uint32 cheats, uint32 count) if (!cheats) return; - if (sWorld.getConfig(CONFIG_BOOL_AC_MOVEMENT_NOTIFY_CHEATERS)) + if (sWorld.getConfig(CONFIG_UINT32_AC_MOVEMENT_PACKET_LOG_SIZE) || + (sWorld.getConfig(CONFIG_BOOL_AC_MOVEMENT_NOTIFY_CHEATERS) && m_session->GetPlayer())) { + std::string cheatNames; for (uint32 i = 0; i < CHEATS_COUNT; ++i) { - if ((cheats & (1 << i)) && m_session->GetPlayer()) - ChatHandler(m_session->GetPlayer()).PSendSysMessage("[AntiCheat] Cheat : %s", GetMovementCheatName(CheatType(i))); + if (cheats & (1 << i)) + { + if (!cheatNames.empty()) + cheatNames += ", "; + cheatNames += GetMovementCheatName(CheatType(i)); + } + } + + if (!cheatNames.empty()) + { + if (sWorld.getConfig(CONFIG_BOOL_AC_MOVEMENT_NOTIFY_CHEATERS)) + ChatHandler(m_session->GetPlayer()).PSendSysMessage("[AntiCheat] Detected cheats: %s", cheatNames.c_str()); + + // Print detected cheats in place inside packet log. + if (sWorld.getConfig(CONFIG_UINT32_AC_MOVEMENT_PACKET_LOG_SIZE)) + AddMessageToPacketLog("Detected cheats: " + cheatNames); } } @@ -226,6 +251,24 @@ uint32 MovementAnticheat::ComputeCheatAction(std::stringstream& reason) return action; } +void MovementAnticheat::AddMessageToPacketLog(std::string message) +{ + WorldPacket data(SMSG_NOTIFICATION, message.size() + 1); + data << message; + LogMovementPacket(false, data); +} + +void MovementAnticheat::LogMovementPacket(bool isClientPacket, WorldPacket& packet) +{ + if (uint32 maxLogSize = sWorld.getConfig(CONFIG_UINT32_AC_MOVEMENT_PACKET_LOG_SIZE)) + { + if (m_packetLog.size() >= maxLogSize) + m_packetLog.pop_front(); + + m_packetLog.push_back(LoggedPacket(isClientPacket, packet)); + } +} + void MovementAnticheat::HandleCommand(ChatHandler* handler) const { handler->PSendSysMessage("MaxSpaceDesync=%f", m_maxOverspeedDistance); diff --git a/src/game/Anticheat/MovementAnticheat/MovementAnticheat.h b/src/game/Anticheat/MovementAnticheat/MovementAnticheat.h index 2f73750f7..66b250029 100644 --- a/src/game/Anticheat/MovementAnticheat/MovementAnticheat.h +++ b/src/game/Anticheat/MovementAnticheat/MovementAnticheat.h @@ -4,9 +4,11 @@ #include "Common.h" #include "UnitDefines.h" #include "Anticheat.h" +#include "SniffFile.h" #include #include +#include enum CheatType { @@ -69,6 +71,7 @@ class MovementAnticheat // Public methods called from the movement handler upon received a packet. bool HandlePositionTests(Player* pPlayer, MovementInfo& movementInfo, uint16 opcode); bool HandleFlagTests(Player* pPlayer, MovementInfo& movementInfo, uint16 opcode); + void LogMovementPacket(bool isClientPacket, WorldPacket& packet); bool IsInKnockBack() const { return m_knockBack; } @@ -90,6 +93,8 @@ private: uint32 CheckSpeedHack(MovementInfo const& movementInfo, uint16 opcode); uint32 CheckTimeDesync(MovementInfo const& movementInfo); + void AddMessageToPacketLog(std::string message); + MovementInfo& GetLastMovementInfo(); MovementInfo const& GetLastMovementInfo() const; UnitMoveType GetMoveTypeForMovementInfo(MovementInfo const& movementInfo) const; @@ -115,6 +120,7 @@ private: uint32 m_updateCheckTimer = 0; std::array m_cheatOccuranceTick = {}; // gets reset every anticheat update tick std::array m_cheatOccuranceTotal = {}; // gets reset when total treshold is reached + std::deque m_packetLog; }; #endif diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 3c65a0957..2b1d07a55 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -40,6 +40,7 @@ set (game_SRCS QuestDef.cpp ReputationMgr.cpp ScriptMgr.cpp + SniffFile.cpp SocialMgr.cpp StatSystem.cpp UnitAuraProcHandler.cpp @@ -243,6 +244,7 @@ set (game_SRCS ScriptedGossip.h ScriptMgr.h SharedDefines.h + SniffFile.h SocialMgr.h UnitEvents.h Weather.h diff --git a/src/game/Movement/MovementPacketSender.cpp b/src/game/Movement/MovementPacketSender.cpp index b85d79b81..153f11a92 100644 --- a/src/game/Movement/MovementPacketSender.cpp +++ b/src/game/Movement/MovementPacketSender.cpp @@ -80,6 +80,7 @@ void MovementPacketSender::SendSpeedChangeToController(Unit* unit, Player* mover #endif data << float(pendingChange.newValue); + mover->GetCheatData()->LogMovementPacket(false, data); mover->GetSession()->SendPacket(&data); } @@ -174,6 +175,7 @@ void MovementPacketSender::SendTeleportToController(Unit* unit, float x, float y #endif data << mi; + mover->GetCheatData()->LogMovementPacket(false, data); mover->GetSession()->SendPacket(&data); } @@ -231,7 +233,8 @@ void MovementPacketSender::SendKnockBackToController(Unit* unit, float vcos, flo data << float(vcos); // x direction data << float(vsin); // y direction data << float(speedXY); // Horizontal speed - data << float(speedZ); // Z Movement speed (vertical) + data << float(speedZ); // Z Movement speed (vertical) + mover->GetCheatData()->LogMovementPacket(false, data); mover->GetSession()->SendPacket(&data); } @@ -317,7 +320,8 @@ void MovementPacketSender::SendMovementFlagChangeToController(Unit* unit, Player #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_9_4 data << pendingChange.movementCounter; #endif - + + mover->GetCheatData()->LogMovementPacket(false, data); mover->GetSession()->SendPacket(&data); } diff --git a/src/game/Objects/Object.cpp b/src/game/Objects/Object.cpp index 6ad55ecd2..e16835819 100644 --- a/src/game/Objects/Object.cpp +++ b/src/game/Objects/Object.cpp @@ -47,6 +47,7 @@ #include "ZoneScriptMgr.h" #include "InstanceData.h" #include "Chat.h" +#include "Anticheat.h" #include "packet_builder.h" #include "MovementBroadcaster.h" @@ -2020,6 +2021,9 @@ void WorldObject::SendObjectMessageToSet(WorldPacket* data, bool self, WorldObje void WorldObject::SendMovementMessageToSet(WorldPacket data, bool self, WorldObject const* except) { + if (self && !except && IsPlayer()) + static_cast(this)->GetCheatData()->LogMovementPacket(false, data); + if (!IsPlayer() || !sWorld.GetBroadcaster()->IsEnabled()) SendObjectMessageToSet(&data, true, except); else diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index c4230aadb..526d65a55 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -2401,6 +2401,7 @@ bool Player::ExecuteTeleportFar(ScheduledTeleportData* data) data << uint32(m_transport->GetEntry()); data << uint32(GetMapId()); } + GetCheatData()->LogMovementPacket(false, data); GetSession()->SendPacket(&data); } @@ -19864,6 +19865,7 @@ void Player::SetClientControl(Unit* target, uint8 allowMove) WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, target->GetPackGUID().size() + 1); data << target->GetPackGUID(); data << uint8(allowMove); + GetCheatData()->LogMovementPacket(false, data); GetSession()->SendPacket(&data); #endif } diff --git a/src/game/Protocol/Opcodes.h b/src/game/Protocol/Opcodes.h index 8d89d1134..40d569e37 100644 --- a/src/game/Protocol/Opcodes.h +++ b/src/game/Protocol/Opcodes.h @@ -114,5 +114,104 @@ inline char const* LookupOpcodeName(uint16 id) return op->name; return "Received unknown opcode, it's more than max!"; } + +inline bool IsMovementOpcode(uint16 id) +{ + switch (id) + { + case CMSG_WORLD_TELEPORT: + case CMSG_TELEPORT_TO_UNIT: + case CMSG_REPOP_REQUEST: + case CMSG_RESURRECT_RESPONSE: + case CMSG_RECLAIM_CORPSE: + case MSG_MOVE_START_FORWARD: + case MSG_MOVE_START_BACKWARD: + case MSG_MOVE_STOP: + case MSG_MOVE_START_STRAFE_LEFT: + case MSG_MOVE_START_STRAFE_RIGHT: + case MSG_MOVE_STOP_STRAFE: + case MSG_MOVE_JUMP: + case MSG_MOVE_START_TURN_LEFT: + case MSG_MOVE_START_TURN_RIGHT: + case MSG_MOVE_STOP_TURN: + case MSG_MOVE_START_PITCH_UP: + case MSG_MOVE_START_PITCH_DOWN: + case MSG_MOVE_STOP_PITCH: + case MSG_MOVE_SET_RUN_MODE: + case MSG_MOVE_SET_WALK_MODE: + case MSG_MOVE_TOGGLE_LOGGING: + case MSG_MOVE_TELEPORT: + case MSG_MOVE_TELEPORT_CHEAT: + case MSG_MOVE_TELEPORT_ACK: + case MSG_MOVE_TOGGLE_FALL_LOGGING: + case MSG_MOVE_FALL_LAND: + case MSG_MOVE_START_SWIM: + case MSG_MOVE_STOP_SWIM: + case MSG_MOVE_SET_RUN_SPEED_CHEAT: + case MSG_MOVE_SET_RUN_SPEED: + case MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT: + case MSG_MOVE_SET_RUN_BACK_SPEED: + case MSG_MOVE_SET_WALK_SPEED_CHEAT: + case MSG_MOVE_SET_WALK_SPEED: + case MSG_MOVE_SET_SWIM_SPEED_CHEAT: + case MSG_MOVE_SET_SWIM_SPEED: + case MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT: + case MSG_MOVE_SET_SWIM_BACK_SPEED: + case MSG_MOVE_SET_ALL_SPEED_CHEAT: + case MSG_MOVE_SET_TURN_RATE_CHEAT: + case MSG_MOVE_SET_TURN_RATE: + case MSG_MOVE_TOGGLE_COLLISION_CHEAT: + case MSG_MOVE_SET_FACING: + case MSG_MOVE_SET_PITCH: + case MSG_MOVE_WORLDPORT_ACK: + case SMSG_MOVE_WATER_WALK: + case SMSG_MOVE_LAND_WALK: + case MSG_MOVE_SET_RAW_POSITION_ACK: + case CMSG_MOVE_SET_RAW_POSITION: + case CMSG_FORCE_RUN_SPEED_CHANGE_ACK: + case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK: + case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK: + case CMSG_FORCE_MOVE_ROOT_ACK: + case CMSG_FORCE_MOVE_UNROOT_ACK: + case MSG_MOVE_ROOT: + case MSG_MOVE_UNROOT: + case MSG_MOVE_HEARTBEAT: + case SMSG_MOVE_KNOCK_BACK: + case CMSG_MOVE_KNOCK_BACK_ACK: + case MSG_MOVE_KNOCK_BACK: + case SMSG_MOVE_FEATHER_FALL: + case SMSG_MOVE_NORMAL_FALL: + case SMSG_MOVE_SET_HOVER: + case SMSG_MOVE_UNSET_HOVER: + case CMSG_MOVE_HOVER_ACK: + case MSG_MOVE_HOVER: + case MSG_MOVE_TOGGLE_GRAVITY_CHEAT: + case MSG_MOVE_FEATHER_FALL: + case MSG_MOVE_WATER_WALK: + case CMSG_MOVE_SPLINE_DONE: + case CMSG_MOVE_FALL_RESET: + case CMSG_MOVE_TIME_SKIPPED: + case CMSG_MOVE_FEATHER_FALL_ACK: + case CMSG_MOVE_WATER_WALK_ACK: + case CMSG_SET_ACTIVE_MOVER: + case CMSG_MOVE_NOT_ACTIVE_MOVER: + case CMSG_MOVE_START_SWIM_CHEAT: + case CMSG_MOVE_STOP_SWIM_CHEAT: + case CMSG_FORCE_WALK_SPEED_CHANGE_ACK: + case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: + case CMSG_FORCE_TURN_RATE_CHANGE_ACK: +#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4 + case MSG_MOVE_TIME_SKIPPED: + case SMSG_MOVE_SET_FLIGHT: + case SMSG_MOVE_UNSET_FLIGHT: + case CMSG_MOVE_FLIGHT_ACK: + case MSG_MOVE_START_SWIM_CHEAT: + case MSG_MOVE_STOP_SWIM_CHEAT: +#endif + return true; + } + return false; +} + #endif /// @} diff --git a/src/game/SniffFile.cpp b/src/game/SniffFile.cpp new file mode 100644 index 000000000..d576c11a6 --- /dev/null +++ b/src/game/SniffFile.cpp @@ -0,0 +1,75 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "SniffFile.h" + +SniffFile::SniffFile(FILE* pFile) : m_file(pFile) +{ + MANGOS_ASSERT(m_file); +} + +SniffFile::SniffFile(char const* fileName) +{ + m_file = fopen(fileName, "wb"); + MANGOS_ASSERT(m_file); +} + +SniffFile::~SniffFile() +{ + if (m_file) + fclose(m_file); +} + +void SniffFile::WriteHeader(FILE* pFile) +{ + // Write header + fwrite("PKT", 1, 3, pFile); + uint16 sniffVersion = 0x201; + fwrite(&sniffVersion, sizeof(uint16), 1, pFile); + uint16 gameBuild = SUPPORTED_CLIENT_BUILD; + fwrite(&gameBuild, sizeof(uint16), 1, pFile); + uint8 zero = 0; + for (int i = 0; i < 40; i++) + fwrite(&zero, 1, 1, pFile); +} + +void SniffFile::WritePacket(FILE* pFile, LoggedPacket const& packet) +{ + uint8 direction = packet.isClientPacket ? 0x00 : 0xff; + fwrite(&direction, 1, 1, pFile); + uint32 unixTime = packet.timestamp; + fwrite(&unixTime, sizeof(uint32), 1, pFile); + uint32 msTime = packet.data.GetPacketTime(); + fwrite(&msTime, sizeof(uint32), 1, pFile); + + if (packet.isClientPacket) + { + uint32 packetSize = packet.data.size() + sizeof(uint32); + fwrite(&packetSize, sizeof(uint32), 1, pFile); + uint32 opcode = packet.data.GetOpcode();; + fwrite(&opcode, sizeof(uint32), 1, pFile); + } + else + { + uint32 packetSize = packet.data.size() + sizeof(uint16); + fwrite(&packetSize, sizeof(uint32), 1, pFile); + uint16 opcode = packet.data.GetOpcode();; + fwrite(&opcode, sizeof(uint16), 1, pFile); + } + + if (packet.data.size()) + fwrite(packet.data.contents(), sizeof(uint8), packet.data.size(), pFile); +} \ No newline at end of file diff --git a/src/game/SniffFile.h b/src/game/SniffFile.h new file mode 100644 index 000000000..4fdb37e33 --- /dev/null +++ b/src/game/SniffFile.h @@ -0,0 +1,56 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _SNIFF_FILE_H +#define _SNIFF_FILE_H + +#include "Common.h" +#include "WorldPacket.h" + +struct LoggedPacket +{ + LoggedPacket(bool isClientPacket_, WorldPacket& packet) : isClientPacket(isClientPacket_), data(packet), timestamp(time(nullptr)) + { + if (!isClientPacket && !data.GetPacketTime()) + data.FillPacketTime(WorldTimer::getMSTime()); + } + bool isClientPacket; + time_t timestamp; + WorldPacket data; +}; + +class SniffFile +{ +public: + SniffFile(FILE* pFile); + SniffFile(char const* fileName); + ~SniffFile(); + + static void WriteHeader(FILE* pFile); + static void WritePacket(FILE* pFile, LoggedPacket const& packet); + + template < template < class ... > class Container, class ... Args > + void WriteToFile(Container const& container) + { + WriteHeader(m_file); + for (auto const itr : container) + WritePacket(m_file, itr); + } +private: + FILE* m_file; +}; + +#endif diff --git a/src/game/World.cpp b/src/game/World.cpp index 436aeb6d2..c956a9bf3 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1026,6 +1026,7 @@ void World::LoadConfigSettings(bool reload) setConfig(CONFIG_BOOL_AC_MOVEMENT_NOTIFY_CHEATERS, "Anticheat.NotifyCheaters", false); setConfig(CONFIG_UINT32_AC_MOVEMENT_BAN_DURATION, "Anticheat.BanDuration", 86400); setConfig(CONFIG_BOOL_AC_MOVEMENT_LOG_DATA, "Anticheat.LogData", false); + setConfig(CONFIG_UINT32_AC_MOVEMENT_PACKET_LOG_SIZE, "Anticheat.PacketLogSize", 100); setConfig(CONFIG_INT32_AC_ANTICHEAT_MAX_ALLOWED_DESYNC, "Anticheat.MaxAllowedDesync", 0); setConfig(CONFIG_BOOL_AC_MOVEMENT_CHEAT_REVERSE_TIME_ENABLED, "Anticheat.ReverseTime.Enable", true); setConfig(CONFIG_UINT32_AC_MOVEMENT_CHEAT_REVERSE_TIME_THRESHOLD, "Anticheat.ReverseTime.Threshold", 1); diff --git a/src/game/World.h b/src/game/World.h index 54acfe384..be49a45d3 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -262,6 +262,7 @@ enum eConfigUInt32Values CONFIG_UINT32_WAR_EFFORT_AUTOCOMPLETE_PERIOD, CONFIG_UINT32_ACCOUNT_CONCURRENT_AUCTION_LIMIT, CONFIG_UINT32_BANLIST_RELOAD_TIMER, + CONFIG_UINT32_AC_MOVEMENT_PACKET_LOG_SIZE, CONFIG_UINT32_AC_MOVEMENT_BAN_DURATION, CONFIG_UINT32_AC_MOVEMENT_CHEAT_REVERSE_TIME_THRESHOLD, CONFIG_UINT32_AC_MOVEMENT_CHEAT_REVERSE_TIME_PENALTY, diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index bb3b4d491..13bb4b46a 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -239,6 +239,9 @@ void WorldSession::SendPacket(WorldPacket const* packet) /// Add an incoming packet to the queue void WorldSession::QueuePacket(WorldPacket* newPacket) { + if (_player && IsMovementOpcode(newPacket->GetOpcode())) + GetCheatData()->LogMovementPacket(true, *newPacket); + OpcodeHandler const& opHandle = opcodeTable[newPacket->GetOpcode()]; if (opHandle.packetProcessing >= PACKET_PROCESS_MAX_TYPE) { diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index a915f4423..a4fe91c25 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -1544,8 +1544,7 @@ Warden.ModuleDir = "warden_modules" # 1 - (Enabled) # # Anticheat.BanDuration -# Description: Time (in seconds) an account will be banned if Penalty is set -# to ban. +# Description: Time (in seconds) an account will be banned if Penalty is set to ban. # Default: 86400 - (24 hours) # 0 - (Permanent ban) # @@ -1554,6 +1553,12 @@ Warden.ModuleDir = "warden_modules" # Default: 0 - (Disabled) # 1 - (Enabled) # +# Anticheat.PacketLogSize +# Description: How many previous movement packets to dump to file upon detection resulting in kick or ban. +# File is saved in pkt format that can be parsed with WowPacketParser. +# Default: 100 +# 0 - (Disabled) +# # Anticheat.MaxAllowedDesync # Description: Client time desynchronization allowed when doing movement extrapolation. # Default: 0 @@ -2017,6 +2022,7 @@ Anticheat.PlayersOnly = 1 Anticheat.NotifyCheaters = 0 Anticheat.BanDuration = 86400 Anticheat.LogData = 0 +Anticheat.PacketLogSize = 100 Anticheat.MaxAllowedDesync = 0 Anticheat.ReverseTime.Enable = 1 Anticheat.ReverseTime.Threshold = 1