XMPP Service Operators - 2021-04-30


  1. Wiktor

    moparisthebest, didn't see SRV in the linked draft so how is the port discovery being done in QUIC?

  2. jonas’

    how is port discovery done in TCP?

  3. jonas’

    moparisthebest, are you confuslating QUIC and HTTP/3 there?

  4. christian

    nmap?

  5. jonas’

    christian, no offense, but I’d really appreciate it if you could read more than the last two lines of backlog before replying. Thanks! :)

  6. christian

    jonas’: today are only two.

  7. jonas’

    christian, maybe use a client with MUC-MAM support then

  8. jonas’

    or check the logs online at https://logs.xmpp.org/operators/ if that’s not an option

  9. jonas’

    re-winding the conversation context of the past day is exhasutign

  10. jonas’

    re-winding the conversation context of the past day is exhausting

  11. christian

    jonas’: okay. Sorry for disturbing.

  12. jonas’

    christian, thanks!

  13. kahlb

    Are there actually ddos attacks using STUN services as a reflector or only the theoretical possibility? I've never seen one an there are way "better" opportunities.

  14. Ge0rG

    kahlb: there are actual attacks

  15. kahlb

    Are there any resources about it? Analysis? I'm really interested.

  16. christian

    there are some script kiddies who discovered "ping -f" and some security guys who feel important :)))

  17. jonas’

    kahlb, tcpdump -enni any port 3478 ;)

  18. kahlb

    jonas’, the theoretical possibility is out of question. But is there a real danger, like booter services actually doing this? I see no reason why they should as long as there are so many highly efficient reflectors out there.

  19. kahlb

    on my system there is no suspicios traffic. Exploiting a reflectro always requires a scan in advance, so maybe i'm safe. But in ddos traffic from larger attacks I've seen lately I never saw anything stun related

  20. tom

    Is that what these are: » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:57 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974814: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:58 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:59 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:59 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:59 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » Apr 30 00:45:59 web turnserver: 974815: session 001000000000133270: realm <> user <>: incoming packet BINDING processed, success » (END) »

  21. tom

    It's creating like a gigabyte of logs per day

  22. christian

    I am no logging at all stun.

  23. kahlb

    jonas’, Okay, but that's rather ddosing yourself rather than anybody else. What is the target of the attack?

  24. kahlb

    s/ddosing/dosing

  25. jonas’

    tom, yess, that looks relevant

  26. jonas’

    kahlb, we don’t know what the goal is.

  27. jonas’

    just that it is happening in practice

  28. tom

    Is there a way to actually filter this

  29. tom

    Because i'm not going to do security by obscurity by changing port numbers

  30. tom

    If there's some way to definitively tell what is attack traffic and what's not

  31. tom

    Either an nftables rule or some kind of logging+fail2ban I'm all for that and will implement fixes

  32. tom

    Otherwise I don't really care

  33. tom

    Who is being ddosed anyways?

  34. kahlb

    jonas’, the target of a reflector attack is alway the (spoofed) source ip, so you shoud see it in your tcpdump. If it's alway the same, just filter it.

  35. tom

    Techniclly you can reflection attack someone with TCP RST

  36. tom

    What am I to do, stop sending TCP resets?

  37. jonas’

    kahlb, been there it’s not that easy

  38. tom

    Btw, I'm showing 52.113.61.170 being attacked

  39. tom

    Which is Microsoft Corporation

  40. ralphm

    Like Azure hosting?

  41. tom

    I'm not really in a rush to do any favors to a corporation who I spent the last 2/3 decades protesting the war against open standards and protocols

  42. tom

    *their

  43. tom

    Or a corporation who patent trolls

  44. jonas’

    ralphm, I don’t know if azure is a separate AS, the whois of that IP only points at MSFT :/

  45. jonas’

    I also wish I knew

  46. tom

    Or is a member of the PRISM mass surveillance program

  47. tom

    You all remember skype? Or internet explorer

  48. Licaon_Kter

    tcpdump says continously :( ``` 07:55:21.376197 In MAC ethertype IPv4 (0x0800), length 64: SOMEIP.3479 > MYLANIP.3478: UDP, length 20 07:55:21.377734 Out MAC ethertype IPv4 (0x0800), length 96: MYLANIP.3478 > SOMEIP.3479: UDP, length 52 ``` ...have I got the disease?

  49. tom

    Or outlook blocking your mail server

  50. jonas’

    Licaon_Kter, likely

  51. jonas’

    though, that looks more fun

  52. Licaon_Kter

    tom: saw the same IP too iirc

  53. jonas’

    because it’s source port 3479

  54. kahlb

    52.113.61.170 is MS Azure.

  55. Licaon_Kter

    Now it's 137.74.0.162

  56. jonas’

    kahlb, how do you know?

  57. jonas’

    Licaon_Kter, hm, OVH, haven’t seen that yet.

  58. Licaon_Kter

    Some reverse ip online tools yielded nothing, but one mentined ns1.azure though

  59. ralphm

    You can download the IP ranges Azure uses

  60. Licaon_Kter

    Now it stopped...

  61. kahlb

    137.74.0.162 is a TS3 Server. Actually a potential target for DDoS

  62. Licaon_Kter

    .162 used port 9987

  63. Licaon_Kter

    And...it's back .162:9987

  64. ralphm

    kahlb: so it may be part of a botnet

  65. Ge0rG

    I've changed the STUN/TURN port to a random one two weeks ago, and I'm still receiving ingress traffic on 3478

  66. Licaon_Kter

    20 in 52 out means >2x

  67. tom

    Yeah just got that change to

  68. tom

    137.74.0.162

  69. tom

    It's weird that the sourceport is always the same

  70. tom

    9987

  71. tom

    They are hitting my server with 9987 as well

  72. jonas’

    ralphm, I don’t think that the .162 is the true source

  73. Licaon_Kter

    Looks like I'll change the port then, daaaammit

  74. jonas’

    Licaon_Kter, tcpdump does not count IP headers, you have to add 44 bytes to that IIRC.

  75. tom

    No it's not that just the attack target

  76. jonas’

    Licaon_Kter, tcpdump does not count IP and UDP headers, you have to add 44 bytes to that IIRC.

  77. kahlb

    Ge0rG, because the attackers only scan once or every few months. They don't get an idea if your IP is still a usable reflector, only if they scan again.

  78. tom

    This happens because ISPs don't implement BCP38, so you can spoof the ip address of anybody

  79. jonas’

    Licaon_Kter, tcpdump does not count IP and UDP headers, you have to add ~44 bytes~ 28 bytes(?)

  80. jonas’

    kahlb, we changed ports >2w back.

  81. jonas’

    IIRC.

  82. tom

    redacted.3478 > 137.74.0.162.9987: [bad udp cksum 0x979f -> 0x4ff1!] UDP, length 108

  83. tom

    Hey

  84. tom

    Half these packets have bad checksums too

  85. jonas’

    tom, that’s not ral

  86. jonas’

    tom, that’s not real

  87. tom

    Whoever the ddoser is they aren't very skilled

  88. kahlb

    Here is some really good literature for those who want to dig in: https://christian-rossow.de/publications/amplification-ndss2014.pdf

  89. jonas’

    that is the packet your server sends, and depending on offloading settings, checksums are not correct (yet) when tcpdump sees tem

  90. tom

    Bad checksums and using the same source port continuously

  91. jonas’

    so you are "sending" a bad checksum in that line, not them

  92. kahlb

    Rossow has a few more publications about it, all are worth reading.

  93. tom

    The only problem is, there's a bug in linux's nft where it blocks some needed ipv6 multicast if you enable bogon filtering

  94. tom

    Oh my bad your right

  95. tom

    That's my packet

  96. tom

    Hey it stopped

  97. tom

    Did it stop for anyone else as well ?

  98. christian

    Isn't dnssec making the spoofing harder?

  99. kahlb

    christian, no, dns has nothing to do with this.

  100. tom

    The problem is ISPs are too lazy to implement https://tools.ietf.org/html/bcp38 on their core router

  101. tom

    Which makes ip spoofing impossible

  102. tom

    Oh, they are back

  103. Licaon_Kter

    > Did it stop for anyone else as well ? It's on and off Changed ports so it's quiet for now That being said, it means all A/V is now forced through TURN, right?

  104. Licaon_Kter

    > Did it stop for anyone else as well ? It's on and off Changed ports so it's quiet for now 215 to the rescue

  105. tom

    Here's an idea

  106. tom

    Log every binding request along with a timestamp and auto-ban ips that do over 120 binding requests /minute

  107. tom

    I can't think if a scenario where there would be that many binding requests from the same ip per minute

  108. tom

    *of

  109. tom

    What do you think?

  110. tom

    Now if i can see how to configure coturn to log the info

  111. Holger

    `verbose`

  112. Ge0rG

    tom: this approach has a problem where the attackers will still see your server as a reflector on their scans, and then still abuse you.

  113. tom

    Sure some packets will sneak through, but they can't use your server for very long

  114. tom

    At least

  115. tom

    They'd have to keep changing source ips

  116. jonas’

    tom, 120 / minute is hard to measure.

  117. tom

    Fail2ban could do that

  118. jonas’

    that’s 2/second

  119. tom

    Which they are exceeding

  120. tom

    I'm showing ~15/second

  121. jonas’

    problem with 2/second is, a legitimate call can produce that

  122. jonas’

    also, gentle reminder that this is a public place and the attacker(s) may be listening in

  123. jonas’

    be careful which countermeasures and details you share publicly

  124. tom

    » problem with 2/second is, a legitimate call can produce that 2 binding requests per second for 1 minute?

  125. tom

    That's why i said per minute not per second

  126. jonas’

    no, not for one minute. just saying that measuring this correctly is fun

  127. tom

    Ok

  128. tom

    I just want to say that coturn's configuration file options and syntax is terrible

  129. tom

    Wish there was a better turn server I could use

  130. jonas’

    eturnal? :)

  131. jonas’

    also, run your coturn with --prod to shave 20 bytes off the response :)

  132. tom

    I'll check that out

  133. kahlb

    The best thing would be: identify the scanner IP and blacklist it. Additionally take some of the countermeasures you just mentioned. As long as the scanner IP doesn't change it'd stop considering your system as vulnerable and the attacks would stop. But it's difficult to find these IPs. Best: Find systems *without* stun, search their firewall logs for UDP attempts on port 3478 and look wher they're coming from, since that can't be legit traffic. Hopefully there aren't so many, when in doubt just block em all. Maybe we should consider a public blacklist, though that could lead to countermeasures from attackers.

  134. tom

    kahlb: idk

  135. tom

    Trying to stop scanning on the internet seems like a fool's errand

  136. kahlb

    you can't stop scanning. But you can stop your system being identified as a reflector. At least up to some point.

  137. tom

    » --secure-stun » Require authentication of the STUN Binding request. By default, the clients are allowed anonymous access to the STUN Binding functionality. »

  138. Martin

    Makes it worse as the reply gets larger afaik.

  139. croax

    When media session between 2 contacts on different servers, does each contact use its own STUN/TURN or only caller one?

  140. tom

    Ge0rG: jonas’ you should definitely turn on secure-turn first

  141. tom

    That way, all your legit users of your turn server will be differentiated from ddos spoof users

  142. tom

    Then it will be much easier to instead of block on n binding requests per minute, block on n 401 UNAUTHORIZEDs per minute

  143. Holger

    croax, both might or might not be used. It doesn't depend on who is the caller.

  144. tom

    However, coturn has an absolute garbage logging syntax where things will need to be matched on multiple lines

  145. Holger

    tom, I'm slightly biased but do believe eturnal's logging is way better.

  146. Holger

    And config 🙂

  147. tom

    Thanks. I will be checking that out, I just can't change turn/stun servers today

  148. Holger

    tom, main downside I see is, no official distro packages (yet).

  149. Holger

    croax, basically if your client isn't reachable directly by your peer, your TURN server is used.

  150. Holger

    croax, so if neither your nor your peer's client is directly reachable, both TURN servers are used.

  151. croax

    Holger: thanks for clarification.

  152. jonas’

    tom, except that this is about STUN, not TURN

  153. tom

    jonas’: still applicable

  154. jonas’

    tom, question is: is the Not Authorized reply even larger? (IIRC the answer is "yes")

  155. jonas’

    and as I understand the curent state of STUN/TURN/WebRTC affairs (and as we discussed yesterday), (legitimate) clients *have to* first fail authentication before they can authenticate because of challenge/response nonsense

  156. Holger

    Yes.

  157. Holger

    First auth step is to receive an UNAUTHORIZED response from the server.

  158. Holger

    tom: > --secure-stun Do you use that? I would've been unsure whether e.g. libwebrtc copes with that.

  159. tom

    It does

  160. tom

    Nextcloud works with that too

  161. Holger

    Interesting. (I wonder what the point is though.)

  162. jonas’

    more traffic, of course

  163. tom

    Do you wanna test it yourself?

  164. tom

    Send some p2p file transfer with jingle

  165. Holger

    I asked a random guy on the Internet specifically because I've always been too lazy to test myself :-P

  166. Holger

    Because I didn't see any point anyway. Until we had that short-term-auth idea yesterday: If libwebrtc supports short-term _and_ has a code path for authenticated STUN, maybe things would just work. Maybe.

  167. jonas’

    and we get the STUN servers to STFU on authentication failure.

  168. jonas’

    or maybe it doesn’t matter anymore then because the proper request packet is already large enough

  169. Holger

    I'd be way more afraid of submitting libwebrtc patches than of patching STUN servers.

  170. jonas’

    worth a shot I guess

  171. tom

    Good

  172. jonas’

    except that it needs someone to write the code

  173. Holger

    I mean the Coturn guy is quite responsive, but who knows how easy it is to convince Google to merge some functionality eveyone else considers outdated.

  174. jonas’

    Holger, did you already talk to coturn about short-term-auth?

  175. jonas’

    I mean worst case we have to go through IETF to convince folks

  176. Holger

    jonas': No I didn't talk to him but I mean you could look at the old code for the short-term-auth support, and I guess an option to drop other traffic is trivial.

  177. jonas’

    question is why it was removed

  178. jonas’

    if they would be interested in readding it

  179. Holger

    As I said nobody uses it.

  180. jonas’

    is that why it was dropped or is that your guess why it was dropped?

  181. Holger

    But Coturn is a bloated monster, I doubt he'll strongly oppose re-adding it if you use it.

  182. Holger

    My guess.

  183. jonas’

    :)

  184. Holger

    Why else would it be dropped.

  185. jonas’

    undisclosed security issue; impossibility to integrate with the remaining architecture; ...

  186. Holger

    I could add it to eturnal, you post an issue that Coturn is missing that feature in comparison and he'll add the code himself :-)

  187. Holger

    Nah.

  188. Holger

    And I don't think you need the IETF for a `drop-other-traffic` option.

  189. jonas’

    but for a PoC we can easily go ahead with just eturnal

  190. Holger

    Yes. I'm just trying to explain why I think the real question is whether libwebrtc supports it.

  191. Holger

    https://webrtc.googlesource.com/src/

  192. Holger

    I'll have a look

  193. jonas’

    -EATWORK, otherwise I’d look too

  194. Holger

    I keep re-cloning that into /tmp once every three months. Because this is the very last time I'm interested in it ...

  195. jonas’

    I think you need to accept your fate that you’re now a webrtc person ;)

  196. Holger

    Doesn't look like libwebrtc supports short-term.

  197. tom

    Ah yes

  198. tom

    Goolag Korporation

  199. jonas’

    Holger, any clue how a client using libwebrtc would indicate to it that it is supposed to use short term instead of long term?

  200. jonas’

    could libwebrtc just *try* short term and then fall back to long term based on the response to short term, or does that not work in stun?

  201. Holger

    And now I remember that the TURN RFC has strong language towards long-term auth. (I had a discussion on whether to interpret it as long-term being mandatory last year or so. Why didn't I remember any of that yesterday? My brain is useless.)

  202. Holger

    The idea as per the STUN RFC is that client and server know what auth mechanism to expect before-hand. I.e. I'd imagine the libwebrtc user (Conversations) to specify a "do short-term" flag.

  203. Holger

    You obviously can't signal the desired mechanism without adding a round-trip, which is precisely the thing we'd like to avoid.

  204. Holger

    From the TURN RFC: ``` The server MUST require that the request be authenticated. This authentication MUST be done using the long-term credential mechanism of [RFC5389] unless the client and server agree to use another mechanism through some procedure outside the scope of this document. ```

  205. Holger

    So there *is* a bit of room for an out-of-scope procedure :-)

  206. Holger

    ``` [RFC5389] specifies an authentication mechanism called the long-term credential mechanism. TURN servers and clients MUST implement this mechanism. The server MUST demand that all requests from the client be authenticated using this mechanism, or that a equally strong or stronger mechanism for client authentication is used. ```

  207. Holger

    Those sentences won't make it easier to convince Google I guess ...

  208. Holger

    Maybe just change ports, call it a day, and spend your time on MIX :-P

  209. Holger

    I'm not _that_ concerned about the actual problem, but it _is_ a little annoying how the specs basically have exactly the thing that would make sense for our use case. And generally for the WebRTC use case.

  210. jonas’

    yeah

  211. jonas’

    annoying

  212. jonas’

    > Why didn't I remember any of that yesterday? page faults take a while to service also in human brains ;)

  213. moparisthebest

    That RFC text is odd no? "You MUST do X, unless you don't want to"

  214. moparisthebest

    Sounds like a SHOULD

  215. croax

    There _must_ be an auth mechanism. Long-term or equivalent/stronger. But no weaker/none. _Should_ would allow _none_ AFAIK

  216. Holger

    The first of my above two quotes doesn't contain the "stronger" part though.

  217. Holger

    Which makes no sense for a protocol spec anyway.

  218. Holger

    And saying "client and server can agree on breaking the spec in arbitrary ways" is stating the obvious.

  219. Holger

    So effectively this does work like a proper MUST. A TURN client can assume the TURN server to support long-term auth, no need to check/negotiate that in any way.

  220. rob

    Just scored colloquy.ca 🤓 now I have a generic donation for friends

  221. octagon

    Hmm, I changed my port yesterday but am still seeing many requests a second to 3478

  222. menel

    That's because of what what someone else postet > because the attackers only scan once or every few months. They don't get an idea if your IP is still a usable reflector, only if they scan again.

  223. menel

    Until you are out of every list they collected it will continue

  224. menel

    So now you are doing your part in diluting the attack 😀

  225. menel

    Wasting resources of the attackers

  226. moparisthebest

    so with normal STUN usage is it request> response > request > response ? or just a single request > response ?

  227. Licaon_Kter

    I don't see why they can't request continously...

  228. moparisthebest

    Licaon_Kter, because if the protocol expects a second response, you can identify clients that don't do this and ignore them (preventing spoofing)

  229. jonas’

    moparisthebest, with *un*authenticated *STUN*, it is request > response; with authenticated STUN it is request > response > request > response.

  230. jonas’

    but AIUI authenticated STUN response on missing auth is (a) required for legitimate clients to work and (b) larger.

  231. rob

    Just scored colloquy.ca 🤓 now I have a generic domain for friends

  232. octagon

    slightly offtopic: loading a large ipset on fedora/rh causes each cidr insert to be checked against the selinux policy and not completely inserted. a list with a few thousand cidr's quickly ends up using 20+GB of ram. anyone have any insight about htis?

  233. octagon

    the same script works on debian, and only uses <200MB ram

  234. moparisthebest

    at least that has an easy solution: turn off selinux

  235. moparisthebest runs