In a recent IR case, the TA created persistences with #QakBot on almost every system in the network.
If only individual systems in the network were forensically examined, one or more infected systems would undoubtedly be missed.
🧵
2/ By examing the network connections made by the clients & servers with a forensic agent, it is apparent that QakBot has made a process injection into the following two processes:
3/ The analysis of the network connections gives us active C2 addresses that we can use for additional hunting inside the network (and in the FW logs).
4/ Persistence via Scheduled Tasks
QakBot has created various tasks on the systems with the following naming scheme (names are random, the following are two examples):
8/ Again, the key, the path in the user home and the DLL are random, which makes generic hunting more difficult.
9/ With the @velocidex Velociraptor Hunt Windows.Search.FileFinder, we can easily search for DLLs in different paths.
10/ The attackers have installed one (or both) of the two persistences presented above on almost every system in the compromised network.
We must be very thorough, find all infected systems and persistences, and kick the attackers off the network in a coordinated eradication.
11/ An overlooked persistence could result in the (easy) re-entry of the attacker into the network.
This case is an example of the fact that every system must be examined carefully in the case of an IR, otherwise backdoors or infections will not be found.
Good luck 🍀
• • •
Missing some Tweet in this thread? You can try to
force a refresh
/2 The TA used the leaked credentials from an employee of the company to connect to the internal network via Citrix Netscaler.
Using the Velociraptor @velocidex Hunt Windows.EventLogs.RDPAuth, we first gather logon data from the systems in our network. Below the description.
3/ Although the hunt says in the description "Best use of this artifact is to collect RDP and Authentication events around a timeframe of interest" this Velo-Search can also be used wonderfully for generic hunting.
AnyDesk
Splashtop
Atera
TeamViewer
SupRemo
ScreenConnect
Remote Utilities
After breaching a network, attackers install, besides the obvious backdoors, other (legitimate) remote desktop products that can be used to re-enter the network. 🧵
2/ The list above is not exhaustive, but defenders and incident responders must make sure that the installed remote desktop products were installed by the customer and not by an attacker.
3/ Especially in the case of an IR investigation, it is imperative to hunt for these products in the network.
But also proactively during a compromise assessment - the credentials for the remote solution could also have been leaked on a private PC (-> if possible, use MFA).
1/ @CISAgov published the 2021 Top Routinely Exploited Vulnerabilities.
We also had another IR case not too long ago where the attackers connected via Forti-VPN where the credentials for that account were in the big credentials leak - in 2022! 🤯
The credentials were (potentially) obtained from systems that remained unpatched against CVE-2018-13379 at the time of the actor's scan. Even if the devices have since been patched, they remain vulnerable if the passwords are not reset. 🚨
3/ Actually, this should have been done a loooooong time ago, but companies should check (or have checked) whether credentials from their users are present in this leak.
And (or) change all users' passwords if necessary, together with a review of the VPN configuration.
2/ exiftool works very well to find out the path and command line arguments of the malicious LNK file:
3/ The analyzed sample from @Netskope calls PowerShell directly. However, in our sample, cmd.exe is called first, then PowerShell with a base64 encoded command argument.