Reverse Tunneling Into NAT Home Networks

Da ich immer wieder höre, dass man hinter einem Router mit NAT ja vor direkten Angriffen geschützt sei, möchte ich heute einmal auf Know Your Enemy Lite: Proxy Threats – Socks v666 hinweisen.
Bevor ich ein paar Stellen zitiere möchte ich gleich vorweg nehmen, dass mit Firewalls, wie iptables zwar teilweise ein recht nüzlicher Schutz erreichbar ist, aber eigentlich geht es hier um die gesamte Anwendungsschicht, also müssten alle Aktivitäten über die entsprechenden Protokolle der Anwendungsschicht (siehe Internetprotokollfamilie, OSI-Modell) überwacht und kontrolliert werden.

Wenn man alle ports schließt, also alle aus- und eingehende Verbindungen für alle Protokolle verbietet, ist das System recht sicher. Nur kann man dann natürlich auch selbst nicht mehr ins Internet, oder Emails abrufen ect. und selbst wenn man sich nach der Installation nur die Sicherheitsupdates holen will, muss man schon eine Tür öffnen.
Bei entfernten Rechnern wird es unumgänglich sein, ports offen zu halten, z.B. für eine ssh-Verbindung. Hat man gar Server laufen (Web, Email, Datenbank, FTP, ….) dann müssen die jeweiligen ports ohnehin offen sein, sonst kann ja niemand zugreifen, die Emails abholen usw. Meist laufen aber noch viele andere Scripts und Programme (Statistik, Monitoring, …) und damit ergeben sich viele potentielle Schwachstellen. Eine recht sichere Möglichkeit ist es, die jeweiligen Server in einem chroot laufen zu lassen und auch für eventuell andere Benutzer einen solchen einzurichten. Ein chroot ist eine eigene Umgebung und der Dienst oder Benutzer kann aus dieser Umgebung kaum hinaus. Das heißt, wenn jemand über den FTP-Server in das System einbricht, bricht er eigentlich in eine Gefängniszelle ein und kann das übrige System nicht so leicht schädigen. Je nachdem wie man die Gefängniszelle einrichtet. Aber ohne entsprechendem Werkzeug (wget um zu verhindern, dass er sich ein rootkit holt und ohne Compiler und Interpreter, damit er keine Programme erstellen oder ausführen kann) kann er aus der Zelle, in die er eingebrochen ist nicht ausbrechen und maximal die Zelle verwüsten.

Nun zu den Zitaten:

So why are we calling these proxies … and why the name Proxy v666? In the example below we demonstrate that these malware variants implement many similar functions found in the traditional SOCKS v5 proxy control protocol. The SOCKS v5 protocol uses a header (0x0501) to identify the protocol version when initiating a TCP connection . The reverse tunnel proxy protocol specifies its own custom header of (0x9a02) and the hex string (0x029a) equals „666“ in ASCII. We can see that the criminal community maintains its own morbid sense of humor. The primary motivator for forming large networks of reverse-connect proxy bots is spam. We are seeing criminals actively using these reverse- connect proxies to relay millions of spam messages to victims around the world. …

The proxy bot will iterate through a list of ports until a connection to the controller succeeds. For instance, if port 80 was unreachable it would then attempt to connect to the following ports (in-order): 8080, 3128, 21, 22, 53, 110, 5190, 143, 119, 137, 138, 443, 530, 873, 989, 990. One can see from the list of ports the miscreants have chosen that they are taking advantage of the common practice of allowing outbound connections to popular services by port and protocol without additional inspection. However many networks and most home consumer devices don’t implement egress filtering at all and the first port (80/TCP) usually works fine.

Reverse Tunnel Proxy Malware Sample

Sample: 005e9054d4290c76db9e7971f6a10a4e
………
The sessions below depict the reverse tunnel proxy announcement/registration phase which is followed immediately by controller-initiated spam relay attempts. See Figure 1 for a visual example.

Conclusion:

Malware which utilizes connect-back (aka call-home) features poses a significant threat to networks of all sizes and shapes. Simple inbound filtering or NAT is inappropriately relied upon in many cases to „secure“ a network. The malware described in this paper is just one example of an active criminal network leveraging this technique to allow arbitrary inbound connectivity through a filtering or NAT device. The authors are aware of several other criminal networks utilizing these techniques and success breeds imitation.

Auf The Honeynet Project finden sich noch weitere, besonders für Administratoren interessante Artikel zu Schwachstellen, Sicherheitslücken und Bedrohungen in Bezug auf das Internet.

Weblinks:
Microsoft Security Bulletin MS08-067 – Critical
Security TechCenter
reversing 2k patch
************************
Anleitung zum Absichern von Debian
The Honeynet Project
Know Your Enemy enthält den Link zu stacheldraht

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert