Persistence and Exfiltration of Lunar Spider
An adversary is maintaining long-term access via a masqueraded .NET backdoor and exfiltrating data via Rclone over FTP to a rare external destination.
Based on research by The DFIR Report 2026-09-23 10 steps · 4 queries T1036.005 T1048.003 T1053.005 T1567.002
Brief
Why Now: Lunar Spider Intrusion Analysis 2025
The DFIR Report recently published From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion (https://thedfirreport.com/2025/09/29/from-a-single-click-how-lunar-spider-enabled-a-near-two-month-intrusion/). The report details a long-term compromise where the threat actor maintained access for nearly sixty days. This hunt focuses on identifying the custom .NET backdoor used for persistence and the subsequent data exfiltration.
Phase 1: Process Masquerading
The hunt begins by inspecting process activity for masqueraded binaries. The adversary uses filenames like lsassa.exe, lsasss.exe, or lssas.exe to mimic the legitimate Local Security Authority Subsystem Service. We specifically target these names when they execute from suspicious paths like \Users\Public\ or \ProgramData. While the name mimics a system process, its execution from a user-writable directory or as a .NET binary distinguishes it from the real lsass.exe.
Phase 2: Persistence and Exfiltration Pivots
Next, the hunt pivots to scheduled tasks. The adversary creates tasks to ensure their backdoor runs consistently. We query for tasks that reference the identified malicious file paths or names. This step confirms how the adversary survives reboots and maintains their foothold without manual intervention.
In parallel, the hunt baselines network traffic for rare outbound FTP connections. While many environments use FTP, it is rarely used to send large volumes of data to unknown external IPs from a single workstation. We use stack-counting to identify destinations seen from very few hosts that exhibit high traffic volume. We focus on port 21 traffic that originates from hosts where we also see the masqueraded binaries.
We also check script activity for Rclone usage. The adversary uses Rclone to automate the theft of sensitive data. The hunt looks for Rclone commands like sync or copy and script names such as backup_sync.ps1. Finding these scripts provides high-confidence evidence of an active exfiltration operation and often identifies the specific folders being targeted for theft.
Triage and Verdict
The final stage uses an agent to weigh the combined signals. If a host executes the masqueraded binary, has an associated scheduled task, and shows rare outbound FTP traffic, the agent marks it as malicious for immediate isolation. This multi-surface correlation ensures we do not alert on every instance of FTP traffic or every custom scheduled task.
Blind Spots and Limitations
Telemetry retention is the primary blind spot. Since the intrusion lasted two months, a standard 14-day log retention window might miss the initial persistence setup or early exfiltration events. Furthermore, the hunt relies on keyword matching in scripts. If the adversary uses PowerShell obfuscation or hex encoding to hide strings like rclone, the script-based queries will fail to trigger.
Steps
-
Masqueraded Backdoor Process Execution
Query · detection candidateIdentify the execution of the masqueraded .NET backdoor binary based on its reported filename or suspicious execution path.
reads hb_process_activitysqlSELECT device_hostname, process_name, process_path, process_cmd_line, user_name, time FROM hb_process_activity WHERE (instr(',' || '{{backdoor_names}}' || ',', ',' || LOWER(process_name) || ',') > 0 OR (LOWER(process_path) LIKE '%\\users\\public\\%' AND LOWER(process_name) LIKE '%.exe')) AND time >= datetime('now', '-{{lookback_days}} days')What a hit looks like. A process execution with a name like 'lsassa.exe' or a binary running from a public user directory. This serves as the primary lead for the persistence phase.
-
Scheduled Task Persistence
Query · enrichmentCorroborate the process lead by finding scheduled tasks configured to execute the backdoor binary.
reads hb_scheduled_jobsqlSELECT device_hostname, job_name, job_cmd_line, job_user_name, time FROM hb_scheduled_job WHERE (LOWER(job_cmd_line) LIKE '%lsassa%' OR LOWER(job_cmd_line) LIKE '%\\users\\public\\%' OR LOWER(job_cmd_line) LIKE '%\\programdata\\%') AND time >= datetime('now', '-{{lookback_days}} days')What a hit looks like. A scheduled job entry pointing to the suspected backdoor path or name, confirming long-term persistence.
-
Rare FTP Destination Baseline
Query · baselineDetect rare outbound FTP connections that might represent data exfiltration to attacker-controlled infrastructure.
reads hb_network_connectionsqlSELECT dst_endpoint_ip, COUNT(DISTINCT device_hostname) AS host_count, SUM(traffic_bytes) AS total_bytes, MIN(time) AS first_seen FROM hb_network_connection WHERE dst_endpoint_port = 21 AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY dst_endpoint_ip HAVING host_count <= 2 ORDER BY total_bytes DESCWhat a hit looks like. FTP connections to external IPs seen from very few internal hosts. High traffic volume to these rare destinations is a strong indicator of exfiltration.
-
Exfiltration Script Execution
Query · enrichmentIdentify the use of Rclone or FTP automation scripts in the environment.
reads hb_script_activitysqlSELECT device_hostname, script_name, script_content, time FROM hb_script_activity WHERE (LOWER(script_content) LIKE '%rclone%' OR instr(',' || '{{exfil_keywords}}' || ',', ',' || LOWER(script_name) || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')What a hit looks like. Script logs containing rclone commands (sync, copy) or filenames specified in the exfil_keywords parameter.
-
Triage Persistence and Theft Evidence
Agent triageWeigh the presence of masqueraded binaries, scheduled tasks, rare FTP traffic, and Rclone scripts to determine the risk per host.
-
Route Based on Intrusion Risk
DecisionRoute the hunt to immediate containment if the agent confirms malicious activity.
-
Isolate Affected Host
Response actionStop ongoing exfiltration and prevent further backdoor commands.
-
Analyst Forensic Review
Analyst taskVerify the findings and prepare for complete eviction of the threat actor.
-
Hunt Closure
Analyst taskDocument findings and archive the hunt result.
Coverage
Scenario coverage
| Stage | Covered | How, or why not |
|---|---|---|
| Custom .NET Backdoor Persistence T1053.005 |
Yes | backdoor-process-lead, persistence-tasks |
| Data Exfiltration via Rclone T1567.002 · T1048.003 |
Yes | ftp-prevalence, exfiltration-scripts |
| Tax-themed JS Downloader T1566.002 · T1204.002 |
Out of scope | Belongs to another part of the 'From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion' series. |
| Brute Ratel Loader Execution T1218.011 |
Out of scope | Belongs to another part of the 'From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion' series. |
| Host and Domain Reconnaissance T1087.002 · T1082 · T1016 · T1033 |
Out of scope | Belongs to another part of the 'From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion' series. |
| Latrodectus and BackConnect C2 T1055 · T1071.001 |
Out of scope | Belongs to another part of the 'From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion' series. |
| Answer File Credential Access T1552.001 |
Out of scope | Belongs to another part of the 'From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion' series. |
| Lateral Movement and Vulnerability Exploitation T1021.001 · T1570 · T1210 |
Out of scope | Belongs to another part of the 'From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion' series. |
Blind spots
- Needs 60-day network and script telemetry retention. A standard 14-day window misses the day-20 exfiltration event cited in the two-month intrusion report. It would answer whether exfiltration happened before the current retention window.
- Needs script deobfuscation in hb_script_activity. Simple string matching fails if the attacker uses PowerShell character replacement or hex encoding for 'rclone'. It would answer whether rclone keywords are hidden by obfuscation.
Parameters & data
Parameters
| Parameter | Type | Default | What it is |
|---|---|---|---|
backdoor_names | list[string] | lsassa.exe, lsasss.exe, lssas.exe | Filename variations for the masqueraded .NET backdoor. |
exfil_keywords | list[string] | rclone.ps1, backup_sync.ps1, upload.exe | Filenames of scripts used to automate data exfiltration. |
lookback_days | number | 14 | Days of history to examine; the original intrusion had a two-month dwell time. |
Telemetry
| Source | Category | Telemetry |
|---|---|---|
| Endpoint telemetry (hb_ surfaces) | endpoint | endpoint |
| Network telemetry | network | network |
Source
---
analysis: A static rule might flag 'lsassa.exe', but this hunt uses a baseline of
FTP traffic to find rare exfiltration destinations and correlates that activity
across scheduled tasks and script blocks, providing context for a two-month dwell
time.
blind_spots:
- id: telemetry-retention-gap
question: whether exfiltration happened before the current retention window
requires: 60-day network and script telemetry retention
risk: A standard 14-day window misses the day-20 exfiltration event cited in the
two-month intrusion report.
stage: exfiltration-rclone-ftp
- id: obfuscated-scripts
question: whether rclone keywords are hidden by obfuscation
requires: script deobfuscation in hb_script_activity
risk: Simple string matching fails if the attacker uses PowerShell character replacement
or hex encoding for 'rclone'.
stage: exfiltration-rclone-ftp
coverage:
- stage: persistence-custom-backdoor
status: covered
steps:
- backdoor-process-lead
- persistence-tasks
- stage: exfiltration-rclone-ftp
status: covered
steps:
- ftp-prevalence
- exfiltration-scripts
- reason: 'Belongs to another part of the ''From a Single Click: How Lunar Spider
Enabled a Near Two-Month Intrusion'' series.'
stage: initial-access-js-downloader
status: out_of_scope
- reason: 'Belongs to another part of the ''From a Single Click: How Lunar Spider
Enabled a Near Two-Month Intrusion'' series.'
stage: execution-brute-ratel-loader
status: out_of_scope
- reason: 'Belongs to another part of the ''From a Single Click: How Lunar Spider
Enabled a Near Two-Month Intrusion'' series.'
stage: discovery-reconnaissance-commands
status: out_of_scope
- reason: 'Belongs to another part of the ''From a Single Click: How Lunar Spider
Enabled a Near Two-Month Intrusion'' series.'
stage: c2-latrodectus-backconnect
status: out_of_scope
- reason: 'Belongs to another part of the ''From a Single Click: How Lunar Spider
Enabled a Near Two-Month Intrusion'' series.'
stage: credential-access-unattend-xml
status: out_of_scope
- reason: 'Belongs to another part of the ''From a Single Click: How Lunar Spider
Enabled a Near Two-Month Intrusion'' series.'
stage: lateral-movement-and-propagation
status: out_of_scope
guardrails:
claims: no_unsupported
evidence: citation_required
missing_data: not_benign
telemetry: untrusted
hunt:
applicability: campaign-specific
handoff: promote-to-detection
justification: The adversary maintained control for two months and exfiltrated sensitive
data via FTP. Detecting these late-stage signals provides high-assurance evidence
of data theft that simple endpoint rules may miss.
methodology: model-assisted
trigger: intel-report
hypothesis: An adversary is maintaining long-term access via a masqueraded .NET backdoor
and exfiltrating data via Rclone over FTP to a rare external destination.
labels:
- hunt
- attack.t1053.005
- attack.t1567.002
- attack.t1048.003
- attack.t1036.005
name: Persistence and Exfiltration of Lunar Spider
parameters:
backdoor_names:
default:
- lsassa.exe
- lsasss.exe
- lssas.exe
description: Filename variations for the masqueraded .NET backdoor.
from:
kind: article
observed: '2024-05-01'
ref: https://thedfirreport.com/2025/09/29/from-a-single-click-how-lunar-spider-enabled-a-near-two-month-intrusion/
type: list[string]
exfil_keywords:
default:
- rclone.ps1
- backup_sync.ps1
- upload.exe
description: Filenames of scripts used to automate data exfiltration.
from:
kind: manual
observed: '2025-01-01'
ref: common-ttp
type: list[string]
lookback_days:
default: '14'
description: Days of history to examine; the original intrusion had a two-month
dwell time.
type: number
provenance:
authors:
- name: Huntbase hunt generation
org: huntbase.io
generated:
by: huntbase-hunt-generation
from: https://thedfirreport.com/2025/09/29/from-a-single-click-how-lunar-spider-enabled-a-near-two-month-intrusion/
gates:
- dry-run
- lint
- critic
model: hb_google/gemini-3-flash-preview
rationale: The intrusion spanned two months; ensure the lookback period covers the
exfiltration phase (reported around day 20). Focus on file servers and backup servers
where large volumes of data reside.
references:
- name: "The DFIR Report \u2014 From a Single Click: How Lunar Spider Enabled a Near\
\ Two-Month Intrusion"
url: https://thedfirreport.com/2025/09/29/from-a-single-click-how-lunar-spider-enabled-a-near-two-month-intrusion/
related:
- hunt: lunar-spider-initial-access
reason: Initial access via JS and Brute Ratel loading are handled in the first hunt
of this series.
relation: out-of-scope-alternative
scenario:
stages:
- name: Tax-themed JS Downloader
observables:
- Form_W-9_Ver-i40_53b043910-86g91352u7972-6495q3.js
- 91.194.11.64/MSI.msi
- disk1.cab
slug: initial-access-js-downloader
tactic: initial-access
techniques:
- T1566.002
- T1204.002
- name: Brute Ratel Loader Execution
observables:
- rundll32.exe
- upfilles.dll
- stow
- wscadminui.dll
- wsca
slug: execution-brute-ratel-loader
tactic: execution
techniques:
- T1218.011
- name: Host and Domain Reconnaissance
observables:
- ipconfig
- systeminfo
- nltest
- whoami
- AdFind
slug: discovery-reconnaissance-commands
tactic: discovery
techniques:
- T1087.002
- T1082
- T1016
- T1033
- name: Latrodectus and BackConnect C2
observables:
- 193.168.143.196
- explorer.exe
- DLLHost.exe
- chcp 65001
slug: c2-latrodectus-backconnect
tactic: command-and-control
techniques:
- T1055
- T1071.001
- name: Answer File Credential Access
observables:
- unattend.xml
slug: credential-access-unattend-xml
tactic: credential-access
techniques:
- T1552.001
- name: Lateral Movement and Vulnerability Exploitation
observables:
- PsExec.exe
- runas
- rustscan
- CVE-2020-1472
slug: lateral-movement-and-propagation
tactic: lateral-movement
techniques:
- T1021.001
- T1570
- T1210
- name: Custom .NET Backdoor Persistence
observables:
- lsassa.exe
- lsassa&&
slug: persistence-custom-backdoor
tactic: persistence
techniques:
- T1053.005
- name: Data Exfiltration via Rclone
observables:
- rclone
- FTP
- port 21
slug: exfiltration-rclone-ftp
tactic: exfiltration
techniques:
- T1567.002
- T1048.003
summary: An intrusion attributed to Lunar Spider began with a tax-themed JavaScript
loader that deployed Latrodectus and Brute Ratel C4. The actors escalated privileges
by discovering plaintext credentials in an unattend.xml file and moved laterally
using PsExec, RDP, and the Zerologon vulnerability. Over a two-month dwell period,
they maintained persistence via custom .NET backdoors and exfiltrated data using
Rclone over FTP.
series:
index: 3
slug: from-a-single-click-how-lunar-spider-enabled-a-near-two-month-intrusion
title: 'From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion'
total: 3
severity: high
targets:
analyst:
name: Tier-2 analyst
role: analyst
endpoint:
category: endpoint
name: Endpoint telemetry (hb_ surfaces)
telemetry:
- endpoint
hunter:
agent: true
name: Hunt agent
network:
category: network
name: Network telemetry
telemetry:
- network
tlp: clear
type: investigation
---
# Persistence and Exfiltration of Lunar Spider
This hunt targets the final phases of a multi-month intrusion. It focuses on identifying a custom .NET backdoor masquerading as 'lsassa.exe' and data exfiltration patterns using Rclone and FTP. The hunt identifies persistence via scheduled tasks and uses stack-counting to isolate rare outbound FTP connections, which are then corroborated by script activity.
## backdoor-process-lead
<!-- Masqueraded Backdoor Process Execution -->
Identify the execution of the masqueraded .NET backdoor binary based on its reported filename or suspicious execution path.
```sqlite target=endpoint role=detection-candidate params=(lookback_days=lookback_days, backdoor_names=backdoor_names)
~~~yaml
expected: A process execution with a name like 'lsassa.exe' or a binary running from
a public user directory. This serves as the primary lead for the persistence phase.
reads:
- device_hostname
- process_name
- process_path
- process_cmd_line
- user_name
- time
silence: not_evidence_of_absence
source: hb_process_activity
verified: dry-run
verified_at: '2026-09-23'
~~~
SELECT device_hostname, process_name, process_path, process_cmd_line, user_name, time FROM hb_process_activity WHERE (instr(',' || '{{backdoor_names}}' || ',', ',' || LOWER(process_name) || ',') > 0 OR (LOWER(process_path) LIKE '%\\users\\public\\%' AND LOWER(process_name) LIKE '%.exe')) AND time >= datetime('now', '-{{lookback_days}} days')
```
## parallel-investigation
<!-- Parallel Investigation of Persistence and Exfiltration -->
parallel:
- → persistence-tasks
- → ftp-prevalence
- → exfiltration-scripts
join: → agent-triage
## persistence-tasks
<!-- Scheduled Task Persistence -->
Corroborate the process lead by finding scheduled tasks configured to execute the backdoor binary.
```sqlite target=endpoint role=enrichment params=(lookback_days=lookback_days)
~~~yaml
expected: A scheduled job entry pointing to the suspected backdoor path or name, confirming
long-term persistence.
reads:
- device_hostname
- job_name
- job_cmd_line
- job_user_name
- time
silence: not_evidence_of_absence
source: hb_scheduled_job
verified: dry-run
verified_at: '2026-09-23'
~~~
SELECT device_hostname, job_name, job_cmd_line, job_user_name, time FROM hb_scheduled_job WHERE (LOWER(job_cmd_line) LIKE '%lsassa%' OR LOWER(job_cmd_line) LIKE '%\\users\\public\\%' OR LOWER(job_cmd_line) LIKE '%\\programdata\\%') AND time >= datetime('now', '-{{lookback_days}} days')
```
## ftp-prevalence
<!-- Rare FTP Destination Baseline -->
Detect rare outbound FTP connections that might represent data exfiltration to attacker-controlled infrastructure.
```sqlite target=network role=baseline params=(lookback_days=lookback_days)
~~~yaml
baseline:
compare: first_seen
window: '{{lookback_days}}d'
expected: FTP connections to external IPs seen from very few internal hosts. High
traffic volume to these rare destinations is a strong indicator of exfiltration.
prevalence:
by: device_hostname
key:
- dst_endpoint_ip
rare_below: 3
reads:
- dst_endpoint_ip
- device_hostname
- traffic_bytes
- time
- dst_endpoint_port
silence: not_evidence_of_absence
source: hb_network_connection
verified: dry-run
verified_at: '2026-09-23'
~~~
SELECT dst_endpoint_ip, COUNT(DISTINCT device_hostname) AS host_count, SUM(traffic_bytes) AS total_bytes, MIN(time) AS first_seen FROM hb_network_connection WHERE dst_endpoint_port = 21 AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY dst_endpoint_ip HAVING host_count <= 2 ORDER BY total_bytes DESC
```
## exfiltration-scripts
<!-- Exfiltration Script Execution -->
Identify the use of Rclone or FTP automation scripts in the environment.
```sqlite target=endpoint role=enrichment params=(lookback_days=lookback_days, exfil_keywords=exfil_keywords)
~~~yaml
expected: Script logs containing rclone commands (sync, copy) or filenames specified
in the exfil_keywords parameter.
reads:
- device_hostname
- script_name
- script_content
- time
silence: not_evidence_of_absence
source: hb_script_activity
verified: dry-run
verified_at: '2026-09-23'
~~~
SELECT device_hostname, script_name, script_content, time FROM hb_script_activity WHERE (LOWER(script_content) LIKE '%rclone%' OR instr(',' || '{{exfil_keywords}}' || ',', ',' || LOWER(script_name) || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')
```
## agent-triage
<!-- Triage Persistence and Theft Evidence -->
```agent target=hunter
cite: required
context:
- backdoor-process-lead
- persistence-tasks
- ftp-prevalence
- exfiltration-scripts
max_iterations: 6
objective: Determine if any host shows evidence of both the custom backdoor persistence
and data exfiltration using Rclone or FTP.
success_criteria: A verdict of malicious, suspicious, or benign for each host found
in the queries.
tools:
- endpoint
- network
```
## route-on-verdict
<!-- Route Based on Intrusion Risk -->
if~: "the agent-triage verdict is malicious or suspicious for at least one host" (confidence: high, judge=hunter)
then: → contain-threat
indeterminate: → analyst-forensic-review
unavailable: → analyst-forensic-review (blind_spot: telemetry-retention-gap)
else: → close-out
## contain-threat
<!-- Isolate Affected Host -->
```action target=endpoint
~~~yaml
approval: required
~~~
Isolate the host from the network. Collect the suspected lsassa.exe binary and any identified script files for forensic analysis.
```
→ analyst-forensic-review
## analyst-forensic-review
<!-- Analyst Forensic Review -->
```manual target=analyst
Analyze the cited script contents and network traffic. Determine the volume of data exfiltrated. Validate if the 'lsassa.exe' binary is a legitimate .NET backdoor. Pivot to earlier stages of the intrusion (Latrodectus, initial access) if a compromise is confirmed.
```
→ end
## close-out
<!-- Hunt Closure -->
```manual target=analyst
Record the evidence of absence if no hits were found. If suspicious activity was found but overturned, update the parameters to reduce false positives.
```
→ end
Run it
Take this hunt into your environment.
Open it in Huntbase to run every step against your own connections, with Scout weighing the evidence and your analysts in command. Or take the open hunt.md file anywhere that reads the format.
Machine-drafted by huntbase-hunt-generation using hb_google/gemini-3-flash-preview, gated by dry-run, lint, critic, then reviewed by a person.