Skip to content

Instantly share code, notes, and snippets.

@TheMeinerLP
Last active February 6, 2024 00:36
Show Gist options
  • Save TheMeinerLP/0ef4921ac91a6775d7cd3a0a6e50c476 to your computer and use it in GitHub Desktop.
Save TheMeinerLP/0ef4921ac91a6775d7cd3a0a6e50c476 to your computer and use it in GitHub Desktop.

Zu mir

Hallo zusammen, mein name ist TheMeinerLP aka Phillipp. Ich besschäftige mich nun seit 8 Jahre Aktiv mit Minecraft und bin seit mehren Jahren auch tätig als Normaler Entwickler.

Intro

Hier bitte intro Musik einfügen

Seit etwa September 2022 geht ein Virus in Form von Plugins in der Minecraft Szene umher. PaperMC hat aktiv schon darauf aufmerksam gemacht. Dazu hat ein anderer Blogger schon probiert, diesen Virus zu analysieren. Gerne würde ich hier in dieser Toilet paper einmal meine Erfahrung teilen und wie ich den Virus bis zu einem bestimmten Teil zurückverfolgt habe. Dabei geht ein großer Dank an @GiantTreeLP, der mir bei der Analyse von ByteCode geholfen hat.

Aber nun erstmal von vorne.

06.05.2023 - CloudNet Discord

Als @GiantTreeLP und ich an diesem Abend gemütlich LoL gespielt haben, haben wir im CloudNet Support Nutzer gesehen, die dringend Hilfe benötigen. Dabei hat man gesehen, dass der Nutzer einen Log hochlädt, mit folgendem Inhalt: image Wie man hier schon sieht ist hier eine obfuscated Klasse namens Updater.a unterwegs und damit begann mein Interesse. Ein weiteres CloudNet Teammitglied hat darauf dem Nutzer ein Link zukommen lassen mit dem Malware Announcement von PaperMC Darauf hin habe ich gefragt, ob der Nutzer mir diese Jar Datei zukommen lassen kann... Leider war das nicht möglich. Durch einen Kommentar unter dem Post von Paper ist mir wie oben erwähnt der Blog von Jemanden aufgefallen. Er hatte die gleiche Idee wie ich: Schauen, was der Virus macht. Über diesen Blog war es mir an diesem Abend gelungen, eine infizierte Variante zu bekommen.

Da ich in den folgenden Tagen Prüfungen hatte, ließ ich diese Jar Datei erstmal ruhen.

10.05.2023-11.05.2023 - Ein weitere Abend mit LoL oder doch eher ByteCode lesen

Gemütlich an dem Abend haben wir LoL gespielt, Richtung 22-23 Uhr habe ich durch Zufall ein Weg gefunden mit dem ByteCodeViewer von Knoloch die Hälfte des Codes wieder leserlich zu machen. Dazu habe ich im Decompiler einfach den Decompiler auf JADX gesetzt. image Und Zack konnten wir 60-90% sinnvoll wieder lesen.

So nun zum Eingemachten. Ich schaute im Schnellverfahren, wo die Main Klasse von dem Updater Virus ist und fand das hier: image

Dazu wurde im Klassen Kopf folgende Variablen definiert image

Sehr auffällig sind die Pfade sowie die zwei Addressen.

Spoiler Warning Beide Adressen sind bereits seit dem 11.05.2023 nicht mehr erreichbar. Durch eine WHOIS abfrage konnten wir die DNS Server ausfindig machen und die IP Adressen trotzdem ausfindig machen.

Als Nächstes haben GiantTreeLP und ich uns die Methoden lang gehangelt und sind dann in einer Klasse a gelandet. Klasse a lädt beim ersten Aufruf in einem Static Block erstmal ein key.crt datei in einem SSL Context für Netty.

Danach wird die Methode a aufgerufen und die erstellte InetSocketAddress wird übergeben. Jetzt kommt es zu dem interessanten Teil! image

Methode a erstellt 2 Referenzen in einer Liste, die später zu Consumer gewandelt werden. Beide Methoden machen was "relativ" Besonderes.

image image

Das eine ist eine Simple Write Methode, die antwortet für ein Ping Packet. Und eine weitere Methode, die etwas viel mehr kann. Die zweite Methode hat den Sinn, verschieden Angriffe zu starten.

Bevor das alles passiert wird aber viel anderen Code noch ausgeführt: image Dabei sollte man den unteren Teil mit b() beachten.

Dieser Teil lädt eine Jar Datei herunter und führt diese aus. image Dazu aber später mehr.

Was macht das teil noch ?

Neben angriffen, installiert sich der Virus in das System um auch wirklich bei jeden neustart auch wieder am start zu sein. Beim installieren im System ist auch intressant, es kann mehr als nur Linux. Der Virus setzt sich im Windows Edge Updater für den Start fest. image

Dazu hört er gerne darauf was für sachen du im Clipboard hast. Und wenn es eine Cryptowährung ist, dann wirst du sie jetzt los. Folgender Code

image

Entschlüsselt eine Plain IP und verbindet sich auf einem Service der immer eine Wallet Addresse zurück gibt. Anscheinend soll damit die Aktuelle Empfänger Addresse mit dem des Angreiffers ausgetauscht werden.

Was ist in der qqqqqqqqqqq jar datei ?

Die qqqq jar datei beinhaltet verschiedene code stellen wo auch wieder sachen gemacht werden. Leider reicht mein Know How nicht dazu aus den code wiederherszutellen. So viel kann ich aber sagen, der Obfusicator der verwendet wir ist der Skidfuscator. Ein möglicher ansatz das wieder rückwärtszumachen, total übertrieben von mir, im einsatz von einer KI die ByteCode in Generische Methoden Namen übersetzen kann.

Hier ein kleiner ausschnitt wie der Source Code unleserlich ist:
image image

Wie man an Screenshot 2 sehen kann. Werden UTF-8 zeichen verwendet für Klassen wie Package namen. Wenn ich nun den Procyon decompiler verwende bekommt man sourcecode. Aber sehr sehr unleserlich:

image

Was nun ?

Gerne kann man mich über Twitter(TheMeinerLP) Kontaktieren. Dazu sind alle files hier angehängt in einer Zip Datei mit einem Passwort(Siehe unten). In der ZIP ist auch eine Readme mit allen IPs wie Domains die ich bis jetzt gefunden haben.


DISCLAIMER

Ich habe alle JAR Files wie IPs aufgeschrieben und Festgehalten.
Ich habe diesen Virus anhand der Angriffs möglichkeiten und Humor "HelloFromTheOtherSide" genannt. Dazu ist das hier ein Draft und WIP.

Zip/Datei File Passwort: AdQA043BBXN6JrC683bt8hiB8VHh1e2QEs7itAkXGRcH6kMeRe

About me

Hello everyone, my name is TheMeinerLP aka Phillipp. I've been actively involved with Minecraft for 8 years now and have also been a normal developer for several years.

Intro

Please insert intro music here

Since around September 2022, a virus in the form of plugins has been going around the Minecraft scene. PaperMC has already actively drawn attention to it. In addition, another blogger has already tried to analyze this virus. I would like to share here in this Toilet paper once my experience and how I traced the virus to a certain part. Here, a big thanks goes to @GiantTreeLP who helped me in analyzing ByteCode.

But now let's start from the beginning.

06.05.2023 - CloudNet Discord

As @GiantTreeLP and I were comfortably playing LoL this evening, we saw users on CloudNet Support in urgent need of help. It was seen that the user uploads a log with the following content:
image As you can see there is an obfuscated class called Updater.a running here and that started my interest. Another CloudNet team member then sent the user a link with the malware announcement from PaperMC After that I asked if the user can send me this jar file.... Unfortunately this was not possible. Through a comment under Paper's post, as mentioned above, someone's blog caught my eye. He had the same idea as me: see what the virus does. Via this blog I had managed to get an infected variant that evening.

Since I had exams in the following days, I let this Jar file rest for now.

10.05.2023-11.05.2023 - Another evening with LoL or rather reading ByteCode

Comfortably in the evening we have played LoL, towards 22-23 o'clock I have found by chance a way with the ByteCodeViewer from Knoloch to make half of the code readable again. To do this, I simply set the decompiler to JADX in the decompiler.

image
And bang we could read 60-90% meaningfully again.

So now for the nitty gritty. I took a quick look where the main class of the updater virus is and found this: image

For this purpose, the following variables were defined in the class header image

Very noticeable are the paths as well as the two addresses.

Spoiler Warning Both addresses are no longer accessible since 11.05.2023. Through a WHOIS query we were able to locate the DNS servers and find the IP addresses anyway.

Next, GiantTreeLP and I navigated our way through the methods and ended up in a class a. Class a loads a key.crt file in a SSL context for Netty on the first call in a static block.

After that the method a is called and the created InetSocketAddress is passed. Now it comes to the interesting part! image

Method a creates 2 references in a list, which are later converted to consumer. Both methods do something "relatively" special.

image image

One is a simple write method that responds for a ping packet. And another method that can do something much more. The second method has the sense to start different attacks.

Before all this happens, however, a lot of other code is executed: image You should note the lower part with b().

This part downloads a jar file and executes it. image But more about that later.

What else does the part do ?

In addition to attacks, the virus installs itself in the system to be really at every reboot also back at the start. When installing in the system is also interesting, it can do more than just Linux. The virus sets itself in the Windows Edge Updater for the start.
image

In addition, it likes to listen to what kind of things you have in the clipboard. And if it's a cryptocurrency, get rid of it now. The following code

image

Decrypts a plain IP and connects to a service that always returns a wallet address. Apparently, this is to exchange the current recipient address with that of the attacker.

What is in the qqqqqqqq jar file ?

The qqqq jar file contains several code places where things are done again. Unfortunately my know how is not enough to restore the code.
This much I can say, the obfusicator we use is the Skidfuscator. A possible approach to do this backwards again, totally exaggerated by me, in the use of an AI that can translate ByteCode into generic method names.

Here is a small excerpt of how the source code is unreadable:
image image

As you can see in screenshot 2. UTF-8 characters are used for classes like package names. If I now use the Procyon decompiler I get sourcecode. But very very unreadable:

image

What now ?

You are welcome to contact me via Twitter(TheMeinerLP). For this all files attached here are in a zip file with a password (see below). In the ZIP is also a readme with all IPs like domains that I have found so far.


DISCLAIMER

I have written down all JAR files like IPs and kept them.
I named this virus "HelloFromTheOtherSide" based on the attack possibilities and humor. This is a draft and WIP.

Zip/File Password: AdQA043BBXN6JrC683bt8hiB8VHh1e2QEs7itAkXGRcH6kMeRe

@Janmm14
Copy link

Janmm14 commented Jun 7, 2023

@HellishBro The qqqqqqqqq jar file has already been analyzed. It is a credentials and session cookie stealing jar. Very malicious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment