Skip to main content
Mallory
Malware1 associated actor

NanHaiShu

Tracked since Dec 5, 2025 · Updated 3 months ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
Vulns0Associated
Actors1Associated
ATT&CK19Techniques
IOCs0Tracked
Type
Backdoor
Capabilities
ReconnaissancePersistenceDefense evasionExfiltrationPost exploitation
Delivery
Spearphishing
Platforms
Windows

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.

Is this in your environment?See whether this family's indicators match your telemetry and which of your assets are exposed to the CVEs associated with it.
Check your exposure
Threat actors

Associated threat actors

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.

View more details →
Leviathan

(Citation: Proofpoint Leviathan Oct 2017)(Citation: CISA AA21-200A APT40 July 2021)

via mitre attack structuredgithub.com
MITRE ATT&CK

Techniques & procedures

19 distinct techniques documented for this family, organized by ATT&CK tactic.

Initial Access

1 technique
T1566.001Spearphishing AttachmentEvidence1

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.

Execution

2 techniques
T1059.005Visual BasicEvidence7

[NanHaiShu](https://attack.mitre.org/software/S0228) executes additional VBScript code on the victim's machine.(Citation: fsecure NanHaiShu July 2016)

T1059.007JavaScriptEvidence7

[NanHaiShu](https://attack.mitre.org/software/S0228) executes additional Jscript code on the victim's machine.(Citation: fsecure NanHaiShu July 2016)

Persistence

2 techniques
T1112Modify RegistryEvidence1

The backdoor is a fairly involved script malware. Its functionality includes: Overwriting registry settings to reduce malware visibility on system

T1547.001Registry Run Keys / Startup FolderEvidence10

[NanHaiShu](https://attack.mitre.org/software/S0228) modifies the %regrun% Registry to point itself to an autostart mechanism.(Citation: fsecure NanHaiShu July 2016)

Privilege Escalation

1 technique
T1547.001Registry Run Keys / Startup FolderEvidence10

[NanHaiShu](https://attack.mitre.org/software/S0228) modifies the %regrun% Registry to point itself to an autostart mechanism.(Citation: fsecure NanHaiShu July 2016)

Stealth

4 techniques
T1027Obfuscated Files or InformationEvidence6

Use simple obfuscation such as base64, gzip compression, and insertion of garbage characters

T1027.013Encrypted/Encoded FileEvidence4

[NanHaiShu](https://attack.mitre.org/software/S0228) encodes files in Base64.(Citation: fsecure NanHaiShu July 2016)

T1070.004File DeletionEvidence11

[NanHaiShu](https://attack.mitre.org/software/S0228) launches a script to delete their original decoy file to cover tracks.(Citation: fsecure NanHaiShu July 2016)

T1218.005MshtaEvidence6

[NanHaiShu](https://attack.mitre.org/software/S0228) uses mshta.exe to load its program and files.(Citation: fsecure NanHaiShu July 2016)

Defense Impairment

2 techniques
T1112Modify RegistryEvidence1

The backdoor is a fairly involved script malware. Its functionality includes: Overwriting registry settings to reduce malware visibility on system

T1685Disable or Modify ToolsEvidence4

[NanHaiShu](https://attack.mitre.org/software/S0228) can change Internet Explorer settings to reduce warnings about malware activity.(Citation: Proofpoint Leviathan Oct 2017)

Discovery

5 techniques
T1012Query RegistryEvidence1

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.'

T1016System Network Configuration DiscoveryEvidence9

[NanHaiShu](https://attack.mitre.org/software/S0228) can gather information about the victim proxy server.(Citation: Proofpoint Leviathan Oct 2017)

T1033System Owner/User DiscoveryEvidence9

[NanHaiShu](https://attack.mitre.org/software/S0228) collects the username from the victim.(Citation: fsecure NanHaiShu July 2016)

T1082System Information DiscoveryEvidence14

[NanHaiShu](https://attack.mitre.org/software/S0228) can gather the victim computer name and serial number.(Citation: Proofpoint Leviathan Oct 2017)

T1083File and Directory DiscoveryEvidence1

Basic functionality includes: Registry, system, process, directory, file operations

Command and Control

4 techniques
T1071.001Web ProtocolsEvidence1

Its functionality includes: GET request to a URL POST request to a URL

T1071.004DNSEvidence4

[NanHaiShu](https://attack.mitre.org/software/S0228) uses DNS for the C2 communications.(Citation: fsecure NanHaiShu July 2016)

T1090ProxyEvidence1

Its functionality includes: Get proxy info

T1105Ingress Tool TransferEvidence6

[NanHaiShu](https://attack.mitre.org/software/S0228) can download additional files from URLs.(Citation: Proofpoint Leviathan Oct 2017)

Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets match these IOCs, which detections are missing, which campaigns to expect next, and what to do in the next 30 minutes.
IOC matchingMatch every observed IP, domain, and hash against your live telemetry.
Associated threat actors1Groups linked to this family, with evidence pinned to each claim.
Associated vulnerabilitiesCVEs linked to this family, with the reporting behind each link.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
MITRE ATT&CK mapping19Every documented technique, ranked by evidence weight.
Researcher chatterReddit, Mastodon, and CTI community discussion around this family.