NanHaiShu is a Windows JavaScript backdoor associated with Chinese state-linked cyber-espionage activity, including operations attributed to APT40 and long-running campaigns focused on maritime, defense, government, legal, and research organizations. It has been used in targeted intrusion activity against entities connected to naval and South China Sea interests, typically as part of spearphishing-led infection chains that leverage malicious documents, exploit-enabled lures, or script-based execution.
The malware uses mshta.exe as a signed proxy execution mechanism to load its components and can execute additional JScript and VBScript on compromised hosts. It establishes persistence by modifying Windows Registry Run key autostart settings. NanHaiShu performs host and network reconnaissance by collecting the current username, computer name, serial number, and proxy configuration details. It communicates with command-and-control infrastructure over DNS and can download additional files for follow-on activity.
NanHaiShu also includes defense-evasion and anti-forensic behavior. It can alter Internet Explorer settings to reduce security warnings that might expose malicious activity, and it has been observed launching scripts to delete decoy documents used during infection in order to remove evidence. Reported functionality also includes Base64 encoding of files or data. Overall, NanHaiShu is best characterized as a script-based espionage backdoor used for persistence, reconnaissance, staged payload delivery, and covert command-and-control on Windows systems.
1 distinct threat actor Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Tools Nanhaishu, Orz, SeDll, Cobalt Strike, GreenCrash, AIRBREAK, BlackCoffee, China Chopper, FUSIONBLAZE, HOMEFRY, MURKYTOP, Metasploit / Meterpreter, ScanBox, Derusbi Trojan, Derusbi, Metasploit
19 distinct techniques documented for this family, organized by ATT&CK tactic.
On September 15 and 19, 2017, Proofpoint detected and blocked spearphishing emails from this group targeting a US shipbuilding company and a US university research center with military ties.
[NanHaiShu](https://attack.mitre.org/software/S0228) executes additional VBScript code on the victim's machine.(Citation: fsecure NanHaiShu July 2016)
[NanHaiShu](https://attack.mitre.org/software/S0228) executes additional Jscript code on the victim's machine.(Citation: fsecure NanHaiShu July 2016)
The backdoor is a fairly involved script malware. Its functionality includes: Overwriting registry settings to reduce malware visibility on system
[NanHaiShu](https://attack.mitre.org/software/S0228) modifies the %regrun% Registry to point itself to an autostart mechanism.(Citation: fsecure NanHaiShu July 2016)
[NanHaiShu](https://attack.mitre.org/software/S0228) modifies the %regrun% Registry to point itself to an autostart mechanism.(Citation: fsecure NanHaiShu July 2016)
Use simple obfuscation such as base64, gzip compression, and insertion of garbage characters
[NanHaiShu](https://attack.mitre.org/software/S0228) encodes files in Base64.(Citation: fsecure NanHaiShu July 2016)
[NanHaiShu](https://attack.mitre.org/software/S0228) launches a script to delete their original decoy file to cover tracks.(Citation: fsecure NanHaiShu July 2016)
[NanHaiShu](https://attack.mitre.org/software/S0228) uses mshta.exe to load its program and files.(Citation: fsecure NanHaiShu July 2016)
The backdoor is a fairly involved script malware. Its functionality includes: Overwriting registry settings to reduce malware visibility on system
[NanHaiShu](https://attack.mitre.org/software/S0228) can change Internet Explorer settings to reduce warnings about malware activity.(Citation: Proofpoint Leviathan Oct 2017)
Bundlore 'can change browser security settings to enable extensions to be installed'; Goopy 'disable Microsoft Outlook's security policies to disable macro warnings'; NanHaiShu 'change Internet Explorer settings to reduce warnings about malware activity.'
[NanHaiShu](https://attack.mitre.org/software/S0228) can gather information about the victim proxy server.(Citation: Proofpoint Leviathan Oct 2017)
[NanHaiShu](https://attack.mitre.org/software/S0228) collects the username from the victim.(Citation: fsecure NanHaiShu July 2016)
[NanHaiShu](https://attack.mitre.org/software/S0228) can gather the victim computer name and serial number.(Citation: Proofpoint Leviathan Oct 2017)
Basic functionality includes: Registry, system, process, directory, file operations
Its functionality includes: GET request to a URL POST request to a URL
[NanHaiShu](https://attack.mitre.org/software/S0228) uses DNS for the C2 communications.(Citation: fsecure NanHaiShu July 2016)
Its functionality includes: Get proxy info
[NanHaiShu](https://attack.mitre.org/software/S0228) can download additional files from URLs.(Citation: Proofpoint Leviathan Oct 2017)
26 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.