• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ I'm under attack (CPU goes up) - I will paypal donate to find a solution

pchtz

Member
Joined
Mar 10, 2019
Messages
13
Reaction score
15
Location
Chile
Hello Otlanders,

Since more than a year I run an Otserver with 200+ online players.
If you are familiarized with Amazon Web Services, I Host the server in a r5.large instance (Ubuntu 18.04). It's RL Map, Tibia 11.9
Server characteristics:
  • 2 vCPU of Intel Xeon Platinum 8000 series processor (Skylake-SP or Cascade Lake) with a sustained all core Turbo CPU clock speed of up to 3.1 GHz
  • 16 GB RAM

I'm running an older version of the "OTX" project (mattyx14/otxserver (https://github.com/mattyx14/otxserver)).

The thing is that since yesterday the CPU is coming to 100% intermittently. Normally the CPU goes from 20-40%. I'm pretty sure it's some kind of a new attack. And of course players are facing 2~6k ms because of the CPU peaks.
Here it is a perf screenshot and top screenshot during the CPU peak:

top.jpg

perf.jpg
There is nothing weird in the TFS server log (classic login and logout only).

I Think the perf output is key to find out what is being stressed. ¿Maybe a regex call?
These lines does not seem good:
std::__detail::_Executor<char const*, std::allocator<std::__cxx11::sub_match<char const*> >, std::__cxx11::regex_traits<char>, true>::_M_dfs
std::vector<std::__detail::_State<char>, std::allocator<std::__detail::_State<char> > >::eek:perator[]


Thank you

[Edit]:
I Also noticed that when i'm under the attack, otservlist.org cannot list my server. They think I'm offline. Maybe the attack has something related to the status query protocol
 
Last edited:
Solution
If it involves regex, the problem is probably in the houses.

update this part in houses.cpp void AccessList::parseList(const std::string& list)
C:
        if (at_pos != std::string::npos) {
            if (at_pos == 0) {
                addGuild(line.substr(1));
            } else {
                addGuildRank(line.substr(0, at_pos - 1), line.substr(at_pos + 1));
            }
        } else if (line.find("!") != std::string::npos || line.find("*") != std::string::npos || line.find("?") != std::string::npos) {
        //    addExpression(line); temporary solution
        } else {
            addPlayer(line);
        }
If it involves regex, the problem is probably in the houses.

update this part in houses.cpp void AccessList::parseList(const std::string& list)
C:
        if (at_pos != std::string::npos) {
            if (at_pos == 0) {
                addGuild(line.substr(1));
            } else {
                addGuildRank(line.substr(0, at_pos - 1), line.substr(at_pos + 1));
            }
        } else if (line.find("!") != std::string::npos || line.find("*") != std::string::npos || line.find("?") != std::string::npos) {
        //    addExpression(line); temporary solution
        } else {
            addPlayer(line);
        }
 
Solution
If it involves regex, the problem is probably in the houses.

update this part in houses.cpp void AccessList::parseList(const std::string& list)
C:
        if (at_pos != std::string::npos) {
            if (at_pos == 0) {
                addGuild(line.substr(1));
            } else {
                addGuildRank(line.substr(0, at_pos - 1), line.substr(at_pos + 1));
            }
        } else if (line.find("!") != std::string::npos || line.find("*") != std::string::npos || line.find("?") != std::string::npos) {
        //    addExpression(line); temporary solution
        } else {
            addPlayer(line);
        }
I will try your solution. However, how can you explain that the issue started suddenly?
Someone started messing with houses you think? The server has been online for more than a year.
 
I will try your solution. However, how can you explain that the issue started suddenly?
Someone started messing with houses you think? The server has been online for more than a year.

That issue was recently posted on the tfs repository, so people that follow the repository learned about that issue recently and can "abuse" it in different servers
 
how can i check if my server have this bug? my code have a difference that Lyu have posted, and i can put * - / + , . / all symbols in houses list
 
how can i check if my server have this bug? my code have a difference that Lyu have posted, and i can put * - / + , . / all symbols in houses list

 
Lyu and Mr. Greyshade, please send me your PayPal emails. I will transfer you a few bucks as soon the fix is confirmed (by tommorrow)

Thank you!

That issue was recently posted on the tfs repository, so people that follow the repository learned about that issue recently and can "abuse" it in different servers
If it involves regex, the problem is probably in the houses.

update this part in houses.cpp void AccessList::parseList(const std::string& list)
C:
        if (at_pos != std::string::npos) {
            if (at_pos == 0) {
                addGuild(line.substr(1));
            } else {
                addGuildRank(line.substr(0, at_pos - 1), line.substr(at_pos + 1));
            }
        } else if (line.find("!") != std::string::npos || line.find("*") != std::string::npos || line.find("?") != std::string::npos) {
        //    addExpression(line); temporary solution
        } else {
            addPlayer(line);
        }
 
Back
Top