TSCookie
- Type
- Backdoor
- Capabilities
- Credential theftProcess injectionReconnaissanceDefense evasionExfiltrationPost exploitation
- Delivery
- Spearphishing
- Platforms
- WindowsLinux
TSCookie is a malware family used by the BlackTech threat group, also known as HUAPI, with variants targeting Windows and Linux. It combines payload-loading functionality with credential theft, host reconnaissance, and remote-control capabilities. BlackTech has distributed Windows variants through malicious Excel documents containing VBA macros, including campaigns observed in 2018 and 2020.
On Windows, TSCookie can decrypt, load, and execute DLL payloads and their resources, inject code into Windows service-host, desktop-shell, and browser processes, enumerate running processes, and identify the infected host's IP address. It can steal passwords saved in Internet Explorer, Microsoft Edge, Firefox, and Chrome. Windows variants support HTTP, HTTPS, and a custom communication protocol, encrypt network communications with RC4, and can use ICMP to receive destination-server information.
The Linux variant, known as ELF_TSCookie, shares substantial code with the Windows version but uses a smaller configuration and supports only a custom communication protocol. It incorporates built-in functionality rather than relying on downloaded modules, allowing operators to execute arbitrary shell commands, launch a remote shell, list and manipulate files, and upload or download files. Both platform variants use RC4 to encrypt payloads. A May 2019 update corrected a Windows configuration-decoding bug and an associated problem that prevented reliable reconnection to command-and-control infrastructure.
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
3 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Adversary Profile: HUAPI ... Malware: TSCOOKIE, KIVARS, CAPGELD, DBGPRINT
Uncover ELF version of PLEAD / TSCookie by JPCERT ... TSCookie and BUSYICE shared their C&C server in April 2021
Techniques & procedures
32 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
A sophisticated hacking group tied to the government of China is exploiting routers in attacks on a variety of organizations... The group specifically targets “branch routers” — smaller appliances used at more remote branch offices to connect to a corporate headquarters.
Initial Access
3 techniques
Initial Access
Around May 2022, JPCERT/CC confirmed an attack activity against Japanese organizations that exploited F5 BIG-IP vulnerability (CVE-2022-1388).
Spearphishing email / BlackTech sends an email to the target, spoofing the address of a legitimate company. Delivery / Malicious Excel document
"reports on the social media about malicious emails purporting to be from Ministry of Education... This email contains a URL leading to a malware called 'TSCookie'."
Execution
6 techniques
Execution
Several entries refer generically to command-line interfaces, shell commands, scripting engines, or script execution without always specifying the exact interpreter.
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to execute shell commands on the infected host.(Citation: JPCert TSCookie March 2018)
The Linux version has the following functions by default... Execute arbitrary shell command ... Table C: Commands Value Contents 0x7200AC03 Launch remote shell ... 0x7200AC04 Send a command to remote shell ... 0x7200AC10 Execute command
VBA macros / Macros concatenate a decimal-encoded array and decode it to a PE payload, then drop it in the Startup folder.
[TSCookie](https://attack.mitre.org/software/S0436) has been executed via malicious links embedded in e-mails spoofing the Ministries of Education, Culture, Sports, Science and Technology of Japan.(Citation: JPCert TSCookie March 2018)
The Excel file is protected with a password, and asks the user to “Enable content” to view the page.
Persistence
1 technique
Persistence
Specifically, upon gaining an initial foothold into a target network and gaining administrator access to network edge devices, BlackTech cyber actors often modify the firmware to hide their activity across the edge devices to further maintain persistence in the network.
Privilege Escalation
1 technique
Privilege Escalation
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to inject code into the svchost.exe, iexplorer.exe, explorer.exe, and default browser processes.(Citation: JPCert BlackTech Malware September 2019)
Stealth
5 techniques
Stealth
The payload itself is RC4-encrypted in both versions... Up to offset 0x1C, the contents are encrypted with the RC4 key and random data in the configuration.
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to inject code into the svchost.exe, iexplorer.exe, explorer.exe, and default browser processes.(Citation: JPCert BlackTech Malware September 2019)
Table C: Commands ... 0x7200AC16 Delete file
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to decrypt, load, and execute a DLL and its resources.(Citation: JPCert TSCookie March 2018)
"Downloaded modules only runs on memory." / "the DLL file is loaded and executed on memory."
Defense Impairment
1 technique
Defense Impairment
Specifically, upon gaining an initial foothold into a target network and gaining administrator access to network edge devices, BlackTech cyber actors often modify the firmware to hide their activity across the edge devices to further maintain persistence in the network.
Credential Access
4 techniques
Credential Access
Agent Tesla can gather credentials from a number of browsers... APT33 has used a variety of publicly available tools like LaZagne to gather credentials... TrickBot can obtain passwords stored in files from web browsers such as Chrome, Firefox, Internet Explorer, and Microsoft Edge... SELECT action_url, username_value, password_value FROM logins; CryptUnprotectData
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to steal saved passwords from the Internet Explorer, Edge, Firefox, and Chrome browsers.(Citation: JPCert TSCookie March 2018)
Specifically, upon gaining an initial foothold into a target network and gaining administrator access to network edge devices, BlackTech cyber actors often modify the firmware to hide their activity across the edge devices to further maintain persistence in the network.
BlackTech steals digital certificates from D-Link and other TW tech organisations
Discovery
3 techniques
Discovery
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to identify the IP of the infected host.(Citation: JPCert TSCookie March 2018)
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to list processes on the infected host.(Citation: JPCert TSCookie March 2018)
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to discover drive information on the infected host.(Citation: JPCert TSCookie March 2018)
Command and Control
10 techniques
Command and Control
For encryption, RC4 is still used, but the key is generated differently.
This update has also fixed the issue where the malware fails to reconnect to a C&C server for a few days.
[TSCookie](https://attack.mitre.org/software/S0436) can multiple protocols including HTTP and HTTPS in communication with command and control (C2) servers.(Citation: JPCert BlackTech Malware September 2019)(Citation: JPCert TSCookie March 2018)
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to proxy communications with command and control (C2) servers.(Citation: JPCert BlackTech Malware September 2019)
"APT41 used a tool called CLASSFON to covertly proxy network communications." / "BADCALL functions as a proxy server between the victim and C2 server." / "Sandworm Team's BCS-server tool can create an internal proxy server to redirect traffic..."
[TSCookie](https://attack.mitre.org/software/S0436) can use ICMP to receive information on the destination server.(Citation: JPCert BlackTech Malware September 2019)
[TSCookie](https://attack.mitre.org/software/S0436) has the ability to upload and download files to and from the infected host.(Citation: JPCert TSCookie March 2018)
Appendix B: List of C&C servers www.google.com.dns-report.com microsoft.com.appstore.dynamicdns.co.uk cartview.viamisoftware.com
The content is a catalog of malware and threat groups that encrypt command-and-control communications using algorithms such as DES, AES, RC4, XOR, Blowfish, RSA, Camellia, RC2, RC6, and custom ciphers.
[TSCookie](https://attack.mitre.org/software/S0436) has encrypted network communications with RC4.(Citation: JPCert TSCookie March 2018)
Observables
74 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
48 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.