RandomQuery
- Type
- Infostealer
- Capabilities
- KeyloggingReconnaissanceExfiltrationPersistence
- Delivery
- SpearphishingLure
- Platforms
- Windows
RandomQuery is a Windows information-stealing malware family used by the North Korean cyberespionage group Kimsuky. Its capabilities vary by variant: some capture keystrokes, while an entirely VBScript-based variant focuses on host reconnaissance and information exfiltration. The reconnaissance variant collects computer, operating system, processor, and memory information through Windows Management Instrumentation, enumerates files and subdirectories in common user and application folders, and gathers running processes and session identifiers. It Base64-encodes collected information and exfiltrates it through HTTP POST requests. Associated deployment chains establish persistence through a Windows startup registry entry.
RandomQuery has been delivered through targeted phishing emails containing password-protected archives with malicious compiled HTML Help attachments. These attachments execute scripts that retrieve the malware. Such campaigns have targeted North Korea-focused information services, human rights activists, and organizations supporting North Korean defectors, using reconnaissance to support subsequent targeted attacks. RandomQuery keyloggers have also been deployed during the later stages of Kimsuky's Larva-24005 operation against South Korean software, energy, and financial organizations. That operation used BlueKeep exploitation and malicious email attachments exploiting Microsoft Office Equation Editor vulnerabilities for initial compromise; remote-access tools were deployed separately before the keylogging stage.
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.
Techniques & procedures
13 distinct techniques documented for this family, organized by ATT&CK tactic.
Initial Access
1 technique
Initial Access
Kimsuky makes use of specially crafted phishing emails to deploy RandomQuery... The attached document is a CHM file stored in a password-protected archive.
Execution
2 techniques
Execution
Decodes the file using the certutil utility, creating a VB script, and then stores the script in a separate file... The VB script issues a HTTP GET request to a C2 server URL...
The attached document is a CHM file stored in a password-protected archive... the CHM file contains a malicious Shortcut object that activates on the Click event.
Persistence
2 techniques
Persistence
The RandomQuery variant... configures the Internet Explorer browser by editing registry values under HKCU\Software\Microsoft\Internet Explorer\Main... RandomQuery also sets the registry value HKCU\Software\Microsoft\Edge\IEToEdge\RedirectionMode to 0.
Establishes persistence by editing the HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run registry key, such that the newly created VB script is executed at system startup.
Privilege Escalation
1 technique
Privilege Escalation
Establishes persistence by editing the HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run registry key, such that the newly created VB script is executed at system startup.
Stealth
2 techniques
Stealth
Kimsuky distributes RandomQuery using Microsoft Compiled HTML Help (CHM) files... the CHM file contains a malicious Shortcut object that activates on the Click event.
Decodes the file using the certutil utility, creating a VB script, and then stores the script in a separate file, such as %USERPROFILE%\Links\mini.vbs.
Defense Impairment
1 technique
Defense Impairment
The RandomQuery variant... configures the Internet Explorer browser by editing registry values under HKCU\Software\Microsoft\Internet Explorer\Main... RandomQuery also sets the registry value HKCU\Software\Microsoft\Edge\IEToEdge\RedirectionMode to 0.
Discovery
3 techniques
Discovery
RandomQuery also enumerates the process and session IDs of running processes using the Win32_Process WMI class.
The malware first gathers system and hardware information using the Win32_ComputerSystem, Win32_OperatingSystem, and Win32_Processor WMI classes, such as: computer name, processor speed, OS version, and the amount of physical memory available to the system.
RandomQuery then enumerates subdirectories and files within particular directories... Desktop... Documents... Favorites... Recent... Program Files... Program Files (x86)... and %USERPROFILE%\Downloads.
Command and Control
2 techniques
Command and Control
The VB script issues a HTTP GET request to a C2 server URL... To exfiltrate the gathered information, RandomQuery... constructs and issues an HTTP POST request containing the information to a C2 server URL.
To exfiltrate the gathered information, RandomQuery first Base64-encodes it, and then constructs and issues an HTTP POST request containing the information to a C2 server URL.
Exfiltration
1 technique
Exfiltration
To exfiltrate the gathered information, RandomQuery first Base64-encodes it, and then constructs and issues an HTTP POST request containing the information to a C2 server URL.
Observables
26 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
7 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.