2/ AsyncRAT is a popular Trojan executed at the end of an infection chain on target computers.
@hpsecurity ([2],[3]) and @Trellix ([4]) have both reported in recent reports that TAs have been deploying AsyncRAT.
3/ Since the source code of AsyncRAT is publicly available [1], we can obtain a copy to investigate and build detection capabilities for this RAT.
4/ Three default ports are already populated within the builder, where we can assemble a client (6606, 7707, 8808).
Additionally, the C2 address can be stated, which the client should connect to after a successful infection. It's possible to store the C2 address on Pastebin.
5/ In the analysis of almost 500 AsyncRAT samples from MalwareBazaar (@abuse_ch), the top three ports for the C2 were indeed 6606, 7707, and 8808!
That means that many TAs didn't bother to change the default port within the builder ☝️
Screenshot from [5].
6/ Also, all samples available on Bazaar used a C2 port higher than 1024.
This Information is helpful for targeted hunts within the firewall logs (connections to IP addresses to the Internet on high-ports - beware: may return many hits).
7/ In the builder, you can specify if a persistence should be set up or not.
If the field is checked, we can choose a filename and select the directory where the payload will be saved (per default, only two directories are available).
8/ AsyncRAT uses a mutex to detect already infected systems.
The prefix of the mutex "AsyncMutex_" was also mentioned in @hpsecurity's tweet[6], which again indicates that attackers accept the defaults (which is good for us defenders!).
9/ Interestingly, we can "clone" the information about the binary from another binary for blending in.
In the example, I took the information from the legitimate PingCastleCloud binary - the builder then uses the same information for the malicious binary.
10/ We can also force an obfuscation of the .NET code to slower down reverse engineering.
11/ Our sample built this way comes straight to a VT score of 48 - anything but unknown, which is also shown by the various YARA hits.
12/ After running this newly built sample (in the various reports and tweets referenced so far, AsyncRAT is run at the end of an entire infection chain) on our lab machine, we see that our infected machine has reported back to the controller.
13/ AsyncRAT now has various functions built-in that can be used to further extend the initial access, for example, "Password Recovery".
If the function "Password Recovery" is selected, we see in the logs that a DLL (Recovery.dll) was sent to the client.
14/ Also, when using other plugins, AsyncRAT sends specific files (dll's) to the client.
With the MTF-Hunt, we search for the plugin-names on our infected client and find the plugins directly placed under C:\.
All other plugins are stored in this directory (we see the filenames visible in the log (RemoteDesktop.dll, etc.)).
16/ To get a list of all plugins available within AsyncRAT, browse to the public GitHub repo.
17/ The LimeLogger plugin for recording keyboard strokes works fine, recording all keystrokes on our test machine.
18/ Using Velociraptor's Mutants-Hunt and the string "AsyncMutex_", we can also find AsyncRAT infected machines.
19/ AsyncRAT distinguishes between two types of persistence ([7]).
Either the installer is run with admin privileges, in which case a Scheduled Task is created, or a new entry in the Run Key as an unprivileged user. Below is the relevant code.
20/ In the first example, the sample was installed as an unprivileged user, resulting in a new run key.
21/ The THOR APT scanner matches the AsyncRAT samples based on the Rule "Reversed String" - the run key within the code used for persistence ([7]).
Probably noisier than stealthier 🤔
22/ Below is the newly created Scheduled Task (installation with admin rights) - the executable is again placed in AppData\Roaming (one of the two options in the builder).
23/ By the way, AsyncRAT also can show a UAC prompt to the user to get admin rights.
In my tests, this feature worked well. After confirming the UAC prompt, AsyncRAT had admin rights on the machine.
24/ Sifting through the code, there would be more detection possibilities and keywords to hunt and create alarms.
But with the few indicators presented in this thread, we can hunt for AsyncRAT infections pretty effectively.
A few thoughts on the topics mentioned in the talk 🧵:
1⃣MFA, Password Spraying, Common Passwords
2⃣RDP Shadowing
3⃣MFA spamming
4⃣Password in Shares
5⃣GPP
6⃣Sam the admin
2/ 1⃣ A popular initial vector they often use is Citrix without MFA.
This is also a classic from our IR cases, where either the password was found out with password spraying (the user used a weak password), or the user was phished beforehand.
3/ MFA is a MUST for any remote access.
If Azure AD is used, Azure Active Directory Password Protection could be used, which checks the password from the user against a global blocklist or a configurable blocklist [2] (this is done when the user changes the password).
2/ The same procedure was described in detail by @SophosLabs before [1]:
3/ "64-bit Windows computers have a mechanism called driver signature enforcement which means that Windows only allows drivers to be loaded that has been properly signed by both the manufacturer and Microsoft.
1/ "PDQ Deploy is a software deployment tool that allows system administrators to silently install almost any application or patch to multiple Windows computers simultaneously." [1]
We have investigated a ransomware case where the TA used PDQ to carry out the encryption. 🧵
2/ I guess we are late to the party 😂
@SecurityAura has already handled various cases involving PDQ Deploy in November 2021:
3/ PDQ Deploy comes with different license models, but with the free license, simple packages can be deployed, and the attacker can conveniently select the targets for deployment, including the entire AD.
1/ Although Windows logs the creation of new services in the SYSTEM event log (Event ID 7045 - New Service was installed), attackers often delete these logs.
But we can use the Windows Firewall event logs for #ThreatHunting new installations (of backdoors) 🧵