mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
fix(Core/AuthSocket): Added check for AuthFlooder (#2387)
This commit is contained in:
committed by
Stoabrogga
parent
3b67466d9c
commit
ce30c08fbc
@@ -208,6 +208,10 @@ void AuthSocket::OnRead()
|
|||||||
{
|
{
|
||||||
#define MAX_AUTH_LOGON_CHALLENGES_IN_A_ROW 3
|
#define MAX_AUTH_LOGON_CHALLENGES_IN_A_ROW 3
|
||||||
uint32 challengesInARow = 0;
|
uint32 challengesInARow = 0;
|
||||||
|
|
||||||
|
#define MAX_AUTH_GET_REALM_LIST 10
|
||||||
|
uint32 challengesInARowRealmList = 0;
|
||||||
|
|
||||||
uint8 _cmd;
|
uint8 _cmd;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -224,6 +228,15 @@ void AuthSocket::OnRead()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (_cmd == REALM_LIST) {
|
||||||
|
challengesInARowRealmList++;
|
||||||
|
if (challengesInARowRealmList == MAX_AUTH_GET_REALM_LIST)
|
||||||
|
{
|
||||||
|
sLog->outString("Got %u REALM_LIST in a row from '%s', possible ongoing DoS", challengesInARowRealmList, socket().getRemoteAddress().c_str());
|
||||||
|
socket().shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user