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.
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.
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.
13 distinct techniques documented for this family, organized by ATT&CK tactic.
Kimsuky makes use of specially crafted phishing emails to deploy RandomQuery... The attached document is a CHM file stored in a password-protected archive.
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.
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.
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.
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.
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.
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.
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.
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.
26 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
7 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.