FlawedGrace
- Type
- RAT
- Capabilities
- Credential theftExfiltrationPersistencePrivilege escalationPost exploitationDefense evasionProcess injection
- Delivery
- PhishingMalspamLanding pageLure
- Platforms
- Windows
FlawedGrace, also known as GraceWire, is a full-featured Windows remote access trojan first observed in November 2017 and strongly associated with the financially motivated threat actor TA505. Written in C++ using object-oriented and multithreaded techniques, it provides remote control of compromised hosts through commands supporting file downloads and uploads, remote desktop access, password retrieval, and script execution. It can deploy additional tools through commands received from its command-and-control infrastructure, including PowerShell execution.
FlawedGrace communicates using a custom encrypted binary protocol, commonly over TCP port 443. Updated variants encrypt strings and configuration data and obfuscate API calls. Configuration and payload data can be stored encrypted in the Windows registry. Its persistence and privilege-escalation mechanisms include registry changes and abuse of print processor functionality. It can create scheduled tasks and inject payloads into legitimate Windows processes. Operators have also maintained access by hijacking a legitimate scheduled task and abusing its associated COM handler to load the RAT.
Distribution commonly involves phishing and malspam with malicious Office attachments, macro-enabled Excel documents, and links or landing pages leading to malicious downloads. FlawedGrace has been delivered as a secondary payload by ServHelper, Get2, Truebot, and the MirrorBlast delivery chain. Campaigns have targeted financial institutions, retail businesses, restaurants, and organizations across other industries in multiple regions. TA505 has used it in intrusion chains preceding CL0P ransomware deployment, providing persistent remote access for subsequent attacker operations.
Associated vulnerabilities
1 CVE Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
Associated threat actors
2 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
(Citation: Proofpoint TA505 Jan 2019)(Citation: Trend Micro TA505 June 2019)(Citation: Proofpoint TA505 October 2019)
Researchers thought EvilCorp to be linked to TrueBot due to TrueBot dropping FlawedGrace. FlawedGrace is malware that is attributed to EvilCorp.
Techniques & procedures
25 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
Ce dernier redirige la victime vers une URL d’un site légitime mais compromis.
Initial Access
4 techniques
Initial Access
Cyber threat actors have historically used malicious phishing emails as the primary delivery method of Truebot malware... users will be redirected to a malicious web domain where script files are then executed.
CL0P actors send a large volume of spear-phishing emails to employees of an organization to gain initial access.
Ces pièces jointes pouvaient notamment être des archives zip ou 7zip contenant des scripts VBS ou Javascript à faire exécuter par ses victimes, des pages HTML contenant du Javascript malveillant, ou des documents Office piégés via macros malveillantes.
Cyber threat actors are leveraging both phishing campaigns with malicious redirect hyperlinks and CVE-2022-31199 to deliver new Truebot malware variants.
Execution
4 techniques
Execution
Cyber threat actors use FlawedGrace to receive PowerShell commands over a C2 channel to deploy additional tools.
La victime est alors incitée à télécharger, ouvrir et activer les macros VBA d’un document Office, généralement Excel, contenant une charge malveillante.
The macro evaluates JScript via the ScriptControl ActiveX AddCode method.
Ce mode opératoire s’appuie exclusivement durant cette période sur de l’ingénierie sociale pour faire exécuter ses charges contenues dans des pièces jointes malveillantes... La victime est alors incitée à télécharger, ouvrir et activer les macros VBA d’un document Office. | Le but de ces documents était souvent d’exécuter via des macros des commandes msiexec sur la machine de la victime pour télécharger et exécuter un code malveillant.
Persistence
3 techniques
Persistence
After deployment by Truebot, FlawedGrace is able to modify registry ... and print spooler programs.
Some MSI packages add autorun via the CurrentVersion\Run key.
FlawedGrace manipulates these features to both escalate privilege and establish persistence.
Privilege Escalation
3 techniques
Privilege Escalation
Inject payloads into msiexec[.]exe and svchost[.]exe ... as well as load dynamic link libraries (DLLs) ... to accomplish privilege escalation.
Some MSI packages add autorun via the CurrentVersion\Run key.
FlawedGrace manipulates these features to both escalate privilege and establish persistence.
Stealth
8 techniques
Stealth
TA505 utilise un code de compression... appelé Minedoor... pour rendre ces codes malveillants plus difficiles à analyser.
TA505 uses a compression code... called Minedoor... used to compress both early stage malwares such as FlawedGrace, and final codes deployed by TA505 such as Clop or DeactivateDefender.
During FlawedGrace’s execution phase, the RAT stores encrypted payloads ... within the registry.
[FlawedGrace](https://attack.mitre.org/software/S0383) encrypts its C2 configuration files with AES in CBC mode.(Citation: Proofpoint TA505 Jan 2019)
Inject payloads into msiexec[.]exe and svchost[.]exe ... as well as load dynamic link libraries (DLLs) ... to accomplish privilege escalation.
msiexec.exe silently downloads and installs the MSI (UILevel=-2), not as a child of Excel, to break chain visibility.
Macro checks computer name == user domain and username == admin/administrator; SharePoint sign-in also filters sandboxes.
ReflectiveGnome in turn downloads more shellcode, that will then drop and detonate FlawedGrace.
Defense Impairment
1 technique
Defense Impairment
After deployment by Truebot, FlawedGrace is able to modify registry ... and print spooler programs.
Credential Access
1 technique
Credential Access
You can find the IDB for the main executable, and for the 64-bit password stealer module, here.
Discovery
1 technique
Discovery
Macro checks computer name == user domain and username == admin/administrator; SharePoint sign-in also filters sandboxes.
Command and Control
4 techniques
Command and Control
FlawedAmmyy / FlawedGrace remote access trojan (RAT) collects information and attempts to communicate with the Command and Control (C2) server.
Loaders send base64-encoded HTTP GET beacons (domain, user, OS, arch, process list) to the C2 and poll for tasking.
FlawedGrace ... can receive incoming commands ... sent over a custom binary protocol ... using port 443.
Truebot uses a second obfuscated domain to receive additional payloads.
Observables
61 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
26 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.