TLS: Reaktionen auf den ALPACA Attackvector

Vor ein paar Tagen wurde eine Cross-Protokoll-Attacke mit TLS bekannt, bei der auch bekannte OpenSource-Dienste wie Exim, Dovecot, Proftpd, Courier, Sendmail usw. usw. als „Bande“ beteiligt sind.

TLS: Reaktionen auf den ALPACA Attackvector

Wer die Attacke verstehen möchte, oder ganz genau hinsehen will, findet hier alles nötige: https://alpaca-attack.com/

Alle, die sich mit einem kleinen Beispiel begnügen können, hier ein Beispiel wie die Attacke ablaufen soll:

Angreifer baut eine Webseite.
Opfer besucht Webseite.
Angreifer erzeugt einen AJAX Request zu einer Opfer-Domain
Angreifer fügt einen oder mehrere spezielle Headerzeilen in den AJAX hinzu
Opferbrowser sendet Ajax an Zielserver
Angreifer lenkt ( als Man-in-the-Middle-Angriff ) Datenpaket auf einen anderen Dienst mit dem gleichen TLS-Zertifikat um
Dienst nimmt den HTTP Request zeilenweise an
Dienst reagiert auf die speziellen Headerzeilen

Was dann passiert hängt vom Dienst ab, der als Bande missbraucht wurde. Es sind Reflectionattacks möglich, bei dem dem Browser des Opfers über den Dienst als Bande z.b. Javascript untergejubelt werden soll, oder es in sehr speziellen Fällen Zugriffe auf den zweiten Dienst gibt ( zb. wenn die Benutzervalidierung nach IP und TLS-Cert geht ).

Das sieht dann in etwa so aus:

# nc testserver 25
220 testserver.de ESMTP Exim 4.94.2 Fri, 11 Jun 2021 09:45:34 +0200
GET / HTTP/1.1
500 unrecognized command
Host: target.domain
500 unrecognized command
HELO opfer.server
250 testserver.de Hello opfer.server [x.x.x.x]
MAIL FROM: <script>Alert()</script>
501-<script>Alert()</script>: malformed address: Alert()</script> may not follow <script>
501 Too many syntax or protocol errors

Um die markierte Zeile geht es meistens, denn wenn der Browser das Ergebnis jetzt im Context der Webseite anzeigt, dann wird das ungefilterte Javascript ausgeführt.

Bitte habt ihm Hinterkopf, das dies hier nur ein simplifiziertes Beispiel ist, um sich den Vorgang vorzustellen. In der Realität ist der Angriff ungleich komplexer, weil der Browser mitspielen muß, es einen Man-in-the-Middle-Angriff geben muß, es möglich sein muß, die Antwort im Context einer Webseite auszuführen, die nicht unter Kontrolle des Angreifer steht usw. usw. Trivial geht anders!

OpenSource-Dienste reagieren

Obwohl Dovecot als POP3/IMAP Server eigentlich gar nicht betroffen ist, hat das Dovecot Security Team um Timo Sirainen gestern bereits reagiert und angekündigt, die Fehlertoleranzgrenze zu erniedrigen und beim Vorfinden eines HTTP Headers sofort die Verbindung zu terminieren.

Auf der Eximmailingliste fand gestern eine ähnliche Diskussion statt, nur das Exim bereits lange über eine Runtime-Konfigurationsoption verfügt, die jeder Serveradmin jetzt einsetzen sollte:

smtp_max_synprot_errors = 0

In weniger als 18h kamen auf einem System ohne relevanten Mailverkehr folgende HTTP-Anfragen auf dem Mailserver zusammen:

2021-06-10 17:09:54 SMTP call from [134.122.7.20] dropped: too many syntax or protocol errors (last command was „HEAD / HTTP/1.0“, NULL)
2021-06-10 17:09:55 SMTP call from [134.122.7.20] dropped: too many syntax or protocol errors (last command was „GET /system_api.php HTTP/1.1“, NULL)
2021-06-10 17:09:56 SMTP call from [134.122.7.20] dropped: too many syntax or protocol errors (last command was „GET /c/version.js HTTP/1.1“, NULL)
2021-06-10 17:09:58 SMTP call from [134.122.7.20] dropped: too many syntax or protocol errors (last command was „GET /streaming/clients_live.php HTTP/1.1“, NULL)
2021-06-10 17:09:59 SMTP call from [134.122.7.20] dropped: too many syntax or protocol errors (last command was „GET /stalker_portal/c/version.js HTTP/1.1“, NULL)
2021-06-10 17:10:01 SMTP call from [134.122.7.20] dropped: too many syntax or protocol errors (last command was „GET /stream/live.php HTTP/1.1“, NULL)
2021-06-10 17:17:30 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „HEAD / HTTP/1.0“, NULL)
2021-06-10 17:17:31 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „GET /system_api.php HTTP/1.1“, NULL)
2021-06-10 17:17:32 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „GET /system_api.php HTTP/1.1“, NULL)
2021-06-10 17:17:34 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „GET /c/version.js HTTP/1.1“, NULL)
2021-06-10 17:17:35 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „GET /streaming/clients_live.php HTTP/1.1“, NULL)
2021-06-10 17:17:37 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „GET /stalker_portal/c/version.js HTTP/1.1“, NULL)
2021-06-10 17:17:39 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „GET /client_area/ HTTP/1.1“, NULL)
2021-06-10 17:17:40 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „GET /stalker_portal/c/ HTTP/1.1“, NULL)
2021-06-10 17:17:42 SMTP call from [138.197.154.233] dropped: too many syntax or protocol errors (last command was „GET /stream/live.php HTTP/1.1“, NULL)
2021-06-10 19:08:50 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „HEAD / HTTP/1.0“, NULL)
2021-06-10 19:08:51 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „GET /system_api.php HTTP/1.1“, NULL)
2021-06-10 19:08:51 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „GET /system_api.php HTTP/1.1“, NULL)
2021-06-10 19:08:51 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „GET /c/version.js HTTP/1.1“, NULL)
2021-06-10 19:08:52 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „GET /streaming/clients_live.php HTTP/1.1“, NULL)
2021-06-10 19:08:52 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „GET /stalker_portal/c/version.js HTTP/1.1“, NULL)
2021-06-10 19:08:53 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „GET /client_area/ HTTP/1.1“, NULL)
2021-06-10 19:08:53 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „GET /stalker_portal/c/ HTTP/1.1“, NULL)
2021-06-10 19:08:53 SMTP call from [46.101.86.104] dropped: too many syntax or protocol errors (last command was „GET /stream/live.php HTTP/1.1“, NULL)
2021-06-10 19:54:12 SMTP call from [134.122.5.182] dropped: too many syntax or protocol errors (last command was „HEAD / HTTP/1.0“, NULL)
2021-06-10 19:54:13 SMTP call from [134.122.5.182] dropped: too many syntax or protocol errors (last command was „GET /system_api.php HTTP/1.1“, NULL)
2021-06-10 19:54:14 SMTP call from [134.122.5.182] dropped: too many syntax or protocol errors (last command was „GET /c/version.js HTTP/1.1“, NULL)
2021-06-10 19:54:15 SMTP call from [134.122.5.182] dropped: too many syntax or protocol errors (last command was „GET /streaming/clients_live.php HTTP/1.1“, NULL)
2021-06-10 19:54:17 SMTP call from [134.122.5.182] dropped: too many syntax or protocol errors (last command was „GET /stalker_portal/c/version.js HTTP/1.1“, NULL)
2021-06-10 19:54:18 SMTP call from [134.122.5.182] dropped: too many syntax or protocol errors (last command was „GET /stream/live.php HTTP/1.1“, NULL)
2021-06-10 20:21:18 SMTP call from [64.225.63.33] dropped: too many syntax or protocol errors (last command was „HEAD / HTTP/1.0“, NULL)
2021-06-10 20:21:19 SMTP call from [64.225.63.33] dropped: too many syntax or protocol errors (last command was „GET /system_api.php HTTP/1.1“, NULL)
2021-06-10 20:21:20 SMTP call from [64.225.63.33] dropped: too many syntax or protocol errors (last command was „GET /c/version.js HTTP/1.1“, NULL)
2021-06-10 20:21:21 SMTP call from [64.225.63.33] dropped: too many syntax or protocol errors (last command was „GET /streaming/clients_live.php HTTP/1.1“, NULL)
2021-06-10 20:21:23 SMTP call from [64.225.63.33] dropped: too many syntax or protocol errors (last command was „GET /stalker_portal/c/version.js HTTP/1.1“, NULL)
2021-06-10 20:21:24 SMTP call from [64.225.63.33] dropped: too many syntax or protocol errors (last command was „GET /stream/live.php HTTP/1.1“, NULL)
2021-06-11 02:27:28 SMTP call from [192.241.214.95] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 02:27:30 SMTP call from [192.241.214.95] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 02:27:30 SMTP call from [192.241.214.95] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 02:27:30 SMTP call from [192.241.214.95] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 04:46:17 SMTP call from 92.118.160.1.netsystemsresearch.com [92.118.160.1] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 08:34:31 SMTP call from scanner-21.ch1.censys-scanner.com [162.142.125.128] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 08:34:36 SMTP call from scanner-21.ch1.censys-scanner.com [162.142.125.128] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 08:34:49 SMTP call from scanner-21.ch1.censys-scanner.com [162.142.125.128] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 08:34:50 SMTP call from scanner-21.ch1.censys-scanner.com [162.142.125.128] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)
2021-06-11 08:47:19 SMTP call from [45.113.70.146] dropped: too many syntax or protocol errors (last command was „GET / HTTP/1.1“, NULL)

Dies sind noch keine ALPACA Angriffe, das ist nur der alltägliche Wahnsinn mit dem man sich als Server so rumschlagen muß.

Proftpd hat bereits vorher reagiert und ist ab Version ProFTPD ≥1.3.5e stärker gegen den Angriff abgehärtet, aber noch nicht 100% immun.

Chromium und Firefox werden Ihre Browser auch abhärten, so daß es schwieriger wird, per Ajax andere Dienste zu kontaktieren. Da aber viele Firmenserver HTTP Dienste auf nicht Standardports anbieten , könnte das im Detail schwierig werden.

Verbesserungsvorschläge zur Absicherung von hauseigenen Pakete für Exim, Dovecot und Co. liegen bei Fedora/Red Hat bereits vor, müssen aber noch diskuttiert werden.

UPDATE

Wer sich die ALPACA Exploits mal ansehen will, bitte schön: https://github.com/RUB-NDS/alpaca-code/tree/master/exploits

Linux am Dienstag: Programm für den 15.6.

Ich wußte ja, früher geht immer, aber diesmal .. wow 😀 Von mir jetzt schon einmal einen recht herzlichen Dank an alle, die nächsten Dienstag Vorträge halten werden.

Linux am Dienstag: Programm für den 15.6.

Und dabei ist das nur ein Ausschnitt des Programms, wir haben noch mehr in Petto 😀

u.a. im Programm am 15.6., ab 19 Uhr:

  • Firefox 89 – Layoutupdate doch nicht so tragisch?
  • Blender Einführung – Teil 2/6 – Wir modellieren: Einen Baum
  • OpenSuse – Schwere Fehler nach Update von Leap 15.3
  • DNF – Wie man es benutzt
  • Backups mit ZFS – Teil 1/2: Einführung in ZFS
  • 30 Jahre PGP – Glückwünsche an Phil Zimmermann
  • 8.4 Milliarden – Passwort Leak 2021
  • Linux Foundation – Das Covid-Zertifikate-Netzwerk
  • Bitcoin – erstes Land erklärt Bitcoin zum Zahlungsmittel

Wie immer jeden Dienstag, ab 19 Uhr auf https://meet.cloud-foo.de/Linux .

Grobi erklärt … eine Tür.

Einleitung: Die folgende Geschichte spielt sich seit 2016 praktisch wöchentlich vor einer befreundeten Tür ab.

Grobi erklärt … eine Tür.

2016 ist das Jahr, in dem alles anfing. Bis in das besagte Jahr, wurden, zumindest in unserer Gegend, niedere Arbeiten in der Paketlieferindustrie hauptsächlich von Menschen kaukasisch-asiatischem Ursprungs durchgeführt. Dies änderte sich in 2016 als der erste Hermes Bote in sehr zerbrochenem Deutsch mitzuteilen versuchte, daß er die Klingel der Tür nicht gefunden hätte und deswegen versuchte mit einem zaghaften Klopfen auf unsere Türscheibe auf das Paket aufmerksam zu machen. Was folgte war eine kurze Nachhilfe in Sachen…

„Klingeln müssen sich nicht zwangsweise neben der Tür befinden“.

Die Jahre gingen ins Land und ein Hermes Paketbote nach dem anderen warf sein Paket vor die Tür. In einigen Fällen konnten die Abwerfer inflagranti erwischt werden, da sie sich durch leise Kratzgeräusche an der Tür verrieten. Manche klopften sogar tatsächlich gegen die Tür, nur nutzte kaum noch jemand die beiden Klingeln, also unsere oder die der besagten befreundeten Tür 🙂

Heute gipfelte die Szenerie in einer Aktion, in der ein sportlicher junger fast 2m Riese so vorsichtig die Tür gar zaghaft tätschelte, das wir das nur durch puren Zufall hören konnten, weil wir genau in dem Augenblick an der Tür vorbei kamen. Wenn man schon klopft, dann doch bitte so, daß die Bewohner das auch hören können 😉

Da ich keine Lust habe, rote Pfeile auf antiken Türen zu kleben um auf die Klingeln hinzuweisen, hier eine kleine Nachhilfe für alle Paketboten. „Grobi, würdest Du bitte?“ …

„DAS ist eine Tür…

..und DAS ist die KLINGEL!“„Hast Du alles verstanden, Frosch?“

Ja, das Modell ist etwas aus der Mode gekommen, aber hat den Vorteil stromlos zu funktionieren und sämtliche Nachbarn auf das Begehr des Paketabgebens aufmerksam zumachen, egal ob diese Nachbarn Kopfhörer tragen oder nicht 🙂 Die Türklingel dürfte bereits 90 Jahre auf dem Buckel haben, umso mehr sollte man sie achten 😀

Also liebe Paketboten von Hermes, bitte nutzt die Gerätschaften in der Tür, die funktionieren ganz sicher 😉

Übrigens: DHL Boten haben das Klingel-Finde-Problem nicht und dafür trägt die Firma Hermes ganz alleine die Verantwortung.