[Mal Series #7] C# Quasar RAT
It is a Remote Access Trojan (RAT) named Quasar which is written in C#. In this sample it comes with the obfuscated loader that will dump out the first stager which will download/spawn the real payload from the c2 server.
Let’s scroll through it to find any interesting Windows API in it.
VirtualProtect found in it.
From here, we will know that the stager will load the DLL dynamically and call the required functions to unload itself.
Then, load the malware in your favourite debugger (e.g. x64) and put breakpoint on some common malware used Windows API (e.g.
It will first allocate the stager shellcode inside the memory. Once the first part of the shellcode landed on the memory section, it will loads the rest of it dynamically during the runtime to complete the code construction. In the meantime, it was found that the shellcode stores Windows API in base64 form.
It will spawn a new process (AddInProcess.exe if Winx64, AddInProcess if Winx32) to inject the its final payload into its memory section by using process hollowing technique.
Here is the Windows API used to dump the payload.
SetThreadContextto redirect the remote process to run the malicious thread.
The injected payload is in RWX section of the remote process which commonly found in other malware.
After that, drop the file into dnSpy for static analysis.
The Final C# Quasar RAT Payload!!!
The RAT will connects to 88[.]99[.]51[.]65:2012 with buildId “slovarik”.
Before anything get started, it has a Anti-VM check.
Then, it will gather the system information as shown in the picture below.
The screenshot below shows the item list that will be 👁 steal 👁 by the RAT from the system.
Click Here for more info about what the RAT steals.
Locate the geolocation of the system by using ip-api.com.
In order to get a Public Address IP, ipify has been abuse and assuming integrate with the RAT server or any malicious infrastructure (hide its Private IP).
Note: ipify itself is a clean site. That mostly use for developement purpose
Download the hex bytes from the URL below and save it into %TEMP% folder as Update.exe (not sure what it does as it has been taken down during the analysis)
Finally, all the stolen crendtials will send throught this websocket with the IP mentioned in the beginning. 👨💻
Annddddd. Self terminate the process and clearing the client setting
Similar sample report.
PE-bear (builds only). Contribute to hasherezade/pe-bear-releases development by creating an account on GitHub.
dnSpy is a debugger and .NET assembly editor. You can use it to edit and debug assemblies even if you don't have any…
This repository contains the source code for ipify, one of the largest and most popular IP address API services on the…