1 (edited by Teelevision 2014-08-15 22:04:05)

Topic: Possible bug allowing attacker to execute rcon commands

I don't know whether this is a bug in Teeworlds but it seems likely to me.

So this happend: someone could execute console commands under my id (0) and the id of another admin (2), allowing him to kick, etc:

[53ee486d][server]: ClientID=2 rcon='kick 2'
[53ee486d][server]: you can't kick yourself
[53ee486d][server]: ClientID=0 rcon='kick 2'
[53ee486d][server]: client dropped. cid=2 addr=#removed# reason='Kicked by console'

They also seemed kind of proud about it:

[53ee4656][server]: ClientID=0 rcon='broadcast Hacked by iX::Pikotee & solala.''

I know that DNS amplification attacks work in a way where UDP packages are sent with a manipulated sender ip so that the DNS responds to that ip.

So my question is: Could someone send manipulated packages to the server this way, leading to a behaviour like explained above? Let's assume the attacker knows the ip of the admin (I think you can get someone's ip through Skype).

The server was running zCatch and I assume that that kind of a bug wasn't introduced in this mod. Also I assume that it's not the client since this would require that we both were hacked. We use modded clients, but very diffent ones.

Edit: Of course incoming packages are checked against ip and port. But they might be able to test each port.

2 (edited by Pikotee 2014-08-15 22:24:58)

Re: Possible bug allowing attacker to execute rcon commands

Hi Teelevision,

we're sry for that, it was just a test, but it worked -.-

it's not a bug and it will be fixed in 0.7.

Newer skype versions forbid direct connection by default you can enable them in settings.

But back to topic:
Our test was based on IP-Spoofing and we needed to check some stuff.

So, we got either your IP or of the other admin, we don't know exactly, and sent an rcon-cmd packet under the IP.
(wikipedia->IP-Spoofing)

So the server received the rcon cmd packet and as the packet had your ip and you were logged in as admin it executed the command.

Further we've chosen your server due to the (admin online) in server name, so it was neither revenge nor sth else.

i'm again sorry for that.

ps. don't worry we haven't touched the passwords, not took a look on them, nor were we looged in at any time into the rcon console

Greetings Pikotee

#yemDX is a known troll

3

Re: Possible bug allowing attacker to execute rcon commands

Pikotee wrote:

Hi Teelevision,

we're sry for that, it was just a test, but it worked -.-

it's not a bug and it will be fixed in 0.7.

Newer skype versions forbid direct connection by default you can enable them in settings.

But back to topic:
Our test was based on IP-Spoofing and we needed to check some stuff.

So, we got either your IP or of the other admin, we don't know exactly, and sent an rcon-cmd packet under the IP.
(wikipedia->IP-Spoofing)

So the server received the rcon cmd packet and as the packet had your ip and you were logged in as admin it executed the command.

Further we've chosen your server due to the (admin online) in server name, so it was neither revenge nor sth else.

i'm again sorry for that.

ps. don't worry we haven't touched the passwords, not took a look on them, nor were we looged in at any time into the rcon console

Greetings Pikotee

You need the port too, right? We've added some anti-IP-spoofing stuff that's still 0.6 compatible in DDNet in the last days.

4

Re: Possible bug allowing attacker to execute rcon commands

HI deen,

yes i saw that fix on your page.

but don't worry we'll find a way to circumvent your fix, so your life won't get boring

greetings Piko

#yemDX is a known troll

5

Re: Possible bug allowing attacker to execute rcon commands

The way its verificate that the IP send the command... NETMSG_GET_LAST_CMD with a token "for example current Tick" or something no?

6

Re: Possible bug allowing attacker to execute rcon commands

HMAC comes to mind.

But... what if we tried more power?

7

Re: Possible bug allowing attacker to execute rcon commands

Verification with current tick will only work for players with a ping of 20 and below, cause otherwise it will be tick+1, tick+2... due to the delay

#yemDX is a known troll

8 (edited by unsigned char* 2014-08-16 04:53:02)

Re: Possible bug allowing attacker to execute rcon commands

[CLIENT] --> CMD 'KICK 1' --> [SERVER] --> LAST_CMD 1234 --> [CLIENT] --> LAST_CMD 1234 'KICK 1' --> [SERVER] if (1234-client == 1234-server && CMD-client == CMD-server) { KICK 1 }

:\

perhaps best use long time or something like that... for not predictable token... if not the attaker can spam the LAST_CMD with the predictable token and validate the command.

For very lagged connection and run scripts can made a poll of tokens->cmd or someting like that :\

9

Re: Possible bug allowing attacker to execute rcon commands

I think heinrich made a fix for that... well, the commit was not touched for 2 years, but im sure it will be in 0.7!

How to database by FFanta: http://puu.sh/jdPVk/fa37a95ac2.png

10

Re: Possible bug allowing attacker to execute rcon commands

Pikotee wrote:

but don't worry we'll find a way to circumvent your fix, so your life won't get boring

You're so evil.

Playing Teeworlds since 2011!
"I will always be topless for you"
                  - Günther Branlutte

11

Re: Possible bug allowing attacker to execute rcon commands

the fix is already on github... since 2 years^^

#yemDX is a known troll

12

Re: Possible bug allowing attacker to execute rcon commands

Pikotee wrote:

the fix is already on github... since 2 years^^

But we can't use it since we would lose compatibility to other clients.

13

Re: Possible bug allowing attacker to execute rcon commands

deen wrote:
Pikotee wrote:

the fix is already on github... since 2 years^^

But we can't use it since we would lose compatibility to other clients.

Ofc, that's why heinrich's PR is not merged to the master branch yet.

@deen:
Pikotee is not that evil hacker as you may think, his exploits just make teeworlds-related coding much more interesting, and also improve original teeworlds. As far as I know, heinrich5991 was one of the first, who Pikotee demonstrated this "exploit" to. So, I hope he will find and report more vulnerabilities before 0.7 release smile It's also a way for development, isn't it?

14

Re: Possible bug allowing attacker to execute rcon commands

Pikotee wrote:

Further we've chosen your server due to the (admin online) in server name, so it was neither revenge nor sth else.

It would have been a good idea to tell me on the server, wouldn't it?

Because this does not look like someone who is just testing:

[53ee4656][server]: ClientID=0 rcon='broadcast Hacked by iX::Pikotee & solala.''
[53ee4731][server]: ClientID=2 rcon='broadcast Hi Teelevision'
[53ee4731][server]: ClientID=0 rcon='broadcast Hi Teelevision'
[53ee475b][server]: ClientID=2 rcon='say Le me mag Tomaten..'
[53ee475b][chat]: *** Le me mag Tomaten..
[53ee475b][server]: ClientID=0 rcon='say Le me mag Tomaten..'
[53ee475b][chat]: *** Le me mag Tomaten..
[53ee4816][server]: ClientID=2 rcon='broadcast Server got hacked, yaaay'
[53ee4816][server]: ClientID=0 rcon='broadcast Server got hacked, yaaay'
[53ee486d][server]: ClientID=2 rcon='kick 2'
[53ee486d][server]: you can't kick yourself
[53ee486d][server]: ClientID=0 rcon='kick 2'
[53ee486d][server]: client dropped. cid=2 addr=#removed# reason='Kicked by console'

So, I made a workaround for my servers. This workaround makes administration a bit more annoying, but it's an easy solution for a serious problem: https://github.com/Teelevision/zcatch/c … a94dc359b3
It just requires to enter the rcon at the beginning of each line. You can still send manipulated packages, the server still accepts them, but without rcon you can't execute anything. It would also be possible to write a client mod accordingly.
This seems to be the only solution that is compatible to all clients, does not require extern software and is not some security by obscurity rubbish.

15

Re: Possible bug allowing attacker to execute rcon commands

Shahan wrote:

Ofc, that's why heinrich's PR is not merged to the master branch yet.

No, that's not the reason, the master branch is incompatible anyway.


Teelevision wrote:

So, I made a workaround for my servers. This workaround makes administration a bit more annoying, but it's an easy solution for a serious problem: https://github.com/Teelevision/zcatch/c … a94dc359b3
It just requires to enter the rcon at the beginning of each line. You can still send manipulated packages, the server still accepts them, but without rcon you can't execute anything. It would also be possible to write a client mod accordingly.
This seems to be the only solution that is compatible to all clients, does not require extern software and is not some security by obscurity rubbish.

This is a quite good idea, I like it.

16

Re: Possible bug allowing attacker to execute rcon commands

Shahan wrote:

Pikotee is not that evil hacker as you may think, his exploits just make teeworlds-related coding much more interesting, and also improve original teeworlds.

Yes, quite interesting to watch your players all get kicked because Pikotee gave the exploit to others who happen to dislike some servers.

17

Re: Possible bug allowing attacker to execute rcon commands

This is good... force the staff to release a new version...

18

Re: Possible bug allowing attacker to execute rcon commands

unsigned char* wrote:

This is good... force the staff to release a new version...

Praise God Pikotee

Playing Teeworlds since 2011!
"I will always be topless for you"
                  - Günther Branlutte

19

Re: Possible bug allowing attacker to execute rcon commands

One question is yet unsolved: How did Pikotee get the ips/ports of both us admins? First I guessed Skype was the leak, but neither the other admin nor me have him in Skype. Even though my Skype name is easy to find, I doubt that he got the Skype name of the other admin.
Then I heard rumors, that Pikotee knows about and knows how to use a bug in the master servers that gives him every ip (and port?) of everyone fetching the server list. I find that hard to believe, but such a bug could also exist in the regular servers.
Does anyone know more about this or maybe: do you want to tell us, Pikotee?

20

Re: Possible bug allowing attacker to execute rcon commands

Telling you how this works makes your life more boring, so:

"New security feature in DDNet Client 4.7.4 opens a new network connection" (taken from ddnet.tw)

or SendServerInfo(...)

or think of what the Masterserver sends on request smile

#yemDX is a known troll

21

Re: Possible bug allowing attacker to execute rcon commands

Are you using a honey pot server?

22

Re: Possible bug allowing attacker to execute rcon commands

Teelevision wrote:

Are you using a honey pot server?

All clients request server info from all the servers in the master server's list. Randomizing the port when connecting should mitigate the attack a little (not completely though).

23

Re: Possible bug allowing attacker to execute rcon commands

Teelevision wrote:

So, I made a workaround for my servers. This workaround makes administration a bit more annoying, but it's an easy solution for a serious problem: https://github.com/Teelevision/zcatch/c … a94dc359b3
It just requires to enter the rcon at the beginning of each line. You can still send manipulated packages, the server still accepts them, but without rcon you can't execute anything. It would also be possible to write a client mod accordingly.
This seems to be the only solution that is compatible to all clients, does not require extern software and is not some security by obscurity rubbish.

I made a similar solution for DDNet server + client (will be in 4.8), so the client automatically reauthenticates before every rcon command: https://github.com/def-/ddnet/commit/2c … 5a304ff33a