Attack Flow
The attackers began with network reconnaissance, obtaining information about the domain (users, domain controllers) and continued with lateral movement and privilege escalation. In addition to the use of WMIExec, SMBExec from the same toolset (Impacket), along with, of course, the offensive features of their signature backdoor, BADHATCH.
The BADHATCH loader was deployed using PowerShell scripts downloaded from the 104.168.237[.]21 IP address
using the legitimate sslip.io service. It was used during the reconnaissance, lateral movement, privilege escalation
and possibly impact stages.
There were multiple attempts to deploy the Sardonic backdoor on domain controllers in order to continue with
privilege escalation and lateral movement, but the malicious command lines were blocked.
Persistence
Deployment of this backdoor begins by running the Sardonic loader. First, a PowerShell script named “sldr.ps1” (SHA256 edfd3ae4def3ddffb37bad3424eb73c17e156ba5f63fd1d651df2f5b8e34a6c7) is copied to the victim machine and executed.
This was performed manually by the attackers, rather than being installed at one point as part of an automated loader process.
This script contains two base-64 strings, corresponding to two additional PowerShell scripts: the first is an RC4-encrypted second stage, and the second one implements the decryption algorithm for the former.
In an improvement from earlier loaders used by FIN8, the decryption key “B4a0f3AE251b7689CFdDe1” is not included in the sample, but is given as a command-line argument.
.NET loader and downloader shellcode
This stage consists of a .NET assembly that contains a piece of shellcode, compressed using GZip and RC4-encrypted, using the key “CA0ac8F6655244d2E10e7819BD337bf9”, which is contained in the binary.
Since the shellcode is both self-modifying and contains a self-inject feature, an unmodified copy of itself is required.
It is prepended by a null-terminated “4BMARC2WKL” marker and copied in the same buffer, immediately before the
copy that is executed.
The second copy of the shellcode is executed from the beginning, using the Marshal.GetDelegateForFunctionPointer method.
Sardonic backdoor
The Sardonic backdoor is written in C++ and has the same C&C servers as the downloader shellcode (“api-cdn[.]net”, “git-api[.]com”, “api-cdnw5[.]net”), and talks over port 443 as well.
It can obtain information about the system, execute commands, and has a plugin system that can load specially made DLLs and execute their functions.
Research groups believe that more than one person developed this project, as there are some differences in code style and level of use of the C++ standard library between functions.