Key findings
- PNG is a transport shell; chunk structure, size relationships and follow-on activity provide context.
- The modular architecture separates anti-VM, injection and persistence.
- The official extractor is reproducibly pinned but not universal for newer variants.
Review snapshot, method and evidence
- Snapshot
- Artefact: hijackloader_config_extractor.py · SHA-256 9649fb2daa95…
- Scope
- Current module and evasion analysis plus an official older IDAT extractor treated as separate evidence snapshots.
- Method
- Original architecture reconstruction from the pinned source snapshot
- Evidence
- Official extractor pinned locally by file hash and revision.
What we derived from this evidence set.
HijackLoader changes modules and camouflage faster than static family labels can keep up. The extractor provides the fixed point: container logic and iDAT handling can be reviewed at a pinned revision.
- Artefact
- hijackloader_config_extractor.py
- SHA-256
9649fb2daa9521361eeabe4fe15d32a24333b1be1db06ab31d3523e3e41b6310- Revision
aa8b55c63411a0ec691b4023cfdf6a81e48e1641- Analysis basis
- Official extractor pinned locally by file hash and revision.
Scope, snapshot and evidence boundary
Current module and evasion analysis plus an official older IDAT extractor treated as separate evidence snapshots. The bounded question is: which architecture and behaviour claims does this specific evidence set support, and which remain attributable only to the source?
Files and checksums
- threatlabz-tools/hijackloader/hijackloader_config_extractor.py
9649fb2daa9521361eeabe4fe15d32a24333b1be1db06ab31d3523e3e41b6310Official IDAT extractor, read statically.
Visual overview & analysis model
Carrier file → Follow-on payload
The analysis path for this report. Every node shows what is supported, where detection can start and where the claim stops.
Carrier file
The documented loader flow begins with a prepared carrier file.
Join file format, origin and launch process.
Bound to primary researchiDAT structure
Payload components reside in a nested image-data structure.
Correlate unusual chunk structure and parser access.
Bound to primary researchDecoding
The documented stages reconstruct additional modules in memory.
Review memory writes and protection changes as a sequence.
Bound to primary researchModule hand-off
The loader transfers control to a separate module.
Capture jump target, thread start and module boundaries.
Bound to primary researchFollow-on payload
The identity of a follow-on payload must be evidenced per campaign.
Do not present loader telemetry as payload detection.
Bounded or unresolvedConfiguration fingerprint
Review pivots derived from the report — not a live configuration or universal family indicator.
Defensive artefacts
Source, validation and limits accompany every rule.
YARAOpen rule +
rule Windows_Loader_HijackLoader_IDAT_Candidate {
meta:
author = "Ruhrdigital Studio"
scope = "synthetic container hunt; not family attribution"
strings:
$embedded_idat = { 49 44 41 54 C6 A5 79 EA }
condition:
uint16(0) == 0x5a4d and filesize < 30MB and $embedded_idat
}SigmaOpen rule +
title: HijackLoader scheduled-task branch candidate
status: experimental
logsource:
product: windows
category: process_creation
detection:
selection:
Image|endswith: '\\schtasks.exe'
CommandLine|contains|all:
- '/create'
- '/sc'
- 'onlogon'
condition: selection
falsepositives:
- Legitimate administrative or software activity with the same isolated pattern
level: mediumKQLOpen rule +
DeviceProcessEvents
| where Timestamp > ago(30d)
| where FileName =~ "schtasks.exe" and ProcessCommandLine has_all ("/create", "onlogon")
| where InitiatingProcessFolderPath has "\\AppData\\"
| project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessSHA256What is supported — and what is missing
Primary sources, statically inspectable code and runtime observations carry different evidentiary weight. The map keeps those layers separate; missing first-party observation is not replaced by plausibility.
Evidence chain and open runtime gap
The map separates primary source, reproducible source snapshots and runtime evidence not collected here.
A file reference does not establish runtime behaviour. Recorded processing is not a new execution.
Evidence
Traceable source with an explicit sample gap.
Primary source
Published analysis or pinned upstream snapshot.
- Primary source → hijackloader_config_extractor.pytechnically cross-checked · Verified reference
File, commit and SHA-256 were pinned.
hijackloader_config_extractor.py
Locally hash-bound source snapshot, read statically only.
- File
- threatlabz-tools/hijackloader/hijackloader_config_extractor.py
- SHA-256
- 9649fb2daa9521361eeabe4fe15d32a24333b1be1db06ab31d3523e3e41b6310
- Location
- 1-142
- Primary source → hijackloader_config_extractor.pytechnically cross-checked · Verified reference
File, commit and SHA-256 were pinned.
- hijackloader_config_extractor.py → No local malware sampleruntime unresolved · Unresolved
The review remains static or source-bound.
No local malware sample
No first-party runtime, C2 or campaign telemetry.
- hijackloader_config_extractor.py → No local malware sampleruntime unresolved · Unresolved
The review remains static or source-bound.
Limit: A published observation is not an independent reproduction.
Entry and delivery chain
The older documented path hides encrypted stages in PNG IDAT chunks; newer variants can place data in pixel structures. A carrier image therefore does not prove benign content, but an unusual PNG alone does not establish the loader.
Architecture and data flow
The public extractor reads chunk lengths, reassembles the encrypted second stage, applies an XOR key and decompresses with LZNT1. The loader itself divides work across modules such as ANTIVM, MUTEX, CUSTOMINJECT and persistence modules. Format and module snapshots must be versioned separately.
Original code as architecture evidence
The short excerpt shows only the structure discussed in this chapter. It is not executed and does not contain a complete operational implementation.
Complete public offline analysis tool from the source snapshot already pinned in the report. The displayed code reads or decodes artefacts; publishing it does not prove we executed it on a malware sample.
Show file hash
SHA-256 9649fb2daa9521361eeabe4fe15d32a24333b1be1db06ab31d3523e3e41b6310import struct, lznt1, sys
import argparse
def findOffset(file, searchByte, Startoffset):
resultOffset = file.index(searchByte, Startoffset +1)
return resultOffset
def decryptPayload(file, xorKey, payloadSize):
while payloadSize % 4 != 0 :
payloadSize =payloadSize -1
for i in range(0, payloadSize, 4):
file.seek(i)
data = file.read(4)
data = struct.unpack('<I', data)[0]
data = data ^ xorKey
data = struct.pack('<I', data)
file.seek(i)
file.write(data)
def processfile(malware_file):
checkFlag = 0
with open(malware_file, "rb") as input_file:
input_file.seek(0)
file = input_file.read()
offset = 0
try:
resultOffsetNextByte = file.index(b'\x49\x44\x41\x54\xC6\xA5\x79\xEA', offset + 1)
print("Found HijackLoader PNG image")
checkFlag = 1
except ValueError:
print('Could not find PNG with correct HijackLoader header')
sys.exit(1)
if checkFlag == 1:
input_file.seek(resultOffsetNextByte - 4)
size = input_file.read(4)
size = struct.unpack('>I', size)[0]
configDataCheck1 = input_file.read(4)
configDataCheck1 = struct.unpack('<I', configDataCheck1)[0]
configDataCheck2 = input_file.read(4)
configDataCheck2 = struct.unpack('<I', configDataCheck2)[0]
configDataCheck3 = input_file.read(4)
xorKey = struct.unpack('<I', configDataCheck3)[0]
Size1 = input_file.read(4)
Size1 = struct.unpack('<I', Size1)[0]
print("Total size: "+hex(Size1))
currentSize = 0
size = size - 0x10
with open(r"secondstage.bin", "ab+") as output_file:
while Size1 > currentSize + size:
idat = input_file.read(4)
payload_encrypted = input_file.read(size)
output_file.write(payload_encrypted)
currentSize = currentSize + size
currentSize = currentSize & 0xFFFFFFFF
resultOffsetNextByte = findOffset(file, b'\x49\x44\x41\x54', resultOffsetNextByte+1)
input_file.seek(resultOffsetNextByte - 4 )
size = input_file.read(4)
size = struct.unpack('>I', size)[0]
size = size & 0xFFFFFFFF
remainingSize = Size1 - currentSize
input_file.seek(resultOffsetNextByte)
idat = input_file.read(4)
payload_encrypted = input_file.read(remainingSize)
output_file.write(payload_encrypted)
print("[+] Encypted second stage written to disk")
with open(r"secondstage.bin", "rb+") as operation_file:
payloadSize = Size1
decryptPayload(operation_file, xorKey, payloadSize)
print("[+] Second stage successfully decrypted")
with open(r"secondstage.bin", "rb+") as operation_file:
readBytes = operation_file.read()
decompressedData = lznt1.decompress(readBytes)
with open(r"secondstage_decompressed.bin", "wb") as last_file:
last_file.write(decompressedData)
print("[+] Second stage decompressed")
with open(r"secondstage_decompressed.bin", "rb+") as last_file:
last_file.seek(0xf4)
dll = ''.join(iter(lambda: last_file.read(1).decode('ascii'), '\x00'))
print("DLL to perform module stomping: "+dll)
last_file.seek(0x90)
folderName = ''.join(iter(lambda: last_file.read(1).decode('ascii'), '\x00'))
print("Process which is created to perform next stage injection: "+folderName)
last_file.seek(8)
offset = last_file.read(4)
offset = struct.unpack('<I', offset )[0]
offset = offset + 0x3DD
comparisonOffset = offset + 0xee4
last_file.seek(comparisonOffset)
compoffset = last_file.read(4)
compoffset = struct.unpack('<I', compoffset )[0]
i = 0
while True:
if compoffset <= i:
break
muler= i * 0x84
tempoffset = offset + 0x10de + muler + 6 * i
last_file.seek(tempoffset)
moduleName = ''.join(iter(lambda: last_file.read(1).decode('ascii'), '\x00'))
muler= i * 0x84
sizeoffset = offset + 0x1164 + muler + i * 6
last_file.seek(sizeoffset)
tsize = last_file.read(4)
tsize2 = struct.unpack('<I', tsize )[0]
muler= i * 0x84
sizeoffset = offset + 0x1160 + muler + i * 6
last_file.seek(sizeoffset)
tsize = last_file.read(4)
tsize = struct.unpack('<I', tsize )[0]
address = offset + 0xee4 + tsize
last_file.seek(address)
injected_payload = last_file.read(tsize2)
with open(moduleName+".bin", "ab+") as inj_file:
inj_file.write(injected_payload)
print("[+] "+moduleName+" module written to disk")
i= i + 1
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file_path', help="Path to HijackLoader sample containing Embedded PNG", type=str, required=True)
args = parser.parse_args()
malware_file = f"{args.file_path}"
malware_file = str(malware_file)
processfile(malware_file)
if __name__ == '__main__':
main()
Original source-file lines. Choose a note to highlight its range.
MIT · Source & license notice
Pinned public source ↗MIT License Copyright (c) 2022 Zscaler ThreatLabz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Analysis resistance and persistence
ThreatLabz describes Heaven’s-Gate-style transitions, direct x64 syscalls and forged EBP stack frames to obscure the origin of sensitive calls. Anti-VM checks and process blocklists add further friction; none is unique in isolation.
Capabilities, objective and impact
HijackLoader is primarily a delivery and execution platform. Observed follow-on payloads vary, so a loader finding must not automatically inherit properties or attribution from the later payload.
Telemetry plan and evidence chain
Defensible detection links image-container anomalies with LZNT1/XOR reconstruction, module metadata, unusual syscall stacks and new scheduled-task persistence. The model below covers only the persistence branch and requires environmental baselines. A defensible investigation preserves process GUID and full ancestry, user and session, command line, signer and hash state, file and registry changes, DNS/connection destinations and follow-on access to sensitive data in one timeline. Temporal proximity is an evidence parameter, not mere visualization. Missing sensor coverage is marked per stage so that an unseen event is not falsely treated as an event that did not occur.
Detection engineering and countertesting
Defensible detection links image-container anomalies with LZNT1/XOR reconstruction, module metadata, unusual syscall stacks and new scheduled-task persistence. The model below covers only the persistence branch and requires environmental baselines. The following model is deliberately narrow, not engine-validated and must be tested against legitimate administration and software paths.
title: HijackLoader scheduled-task branch candidate
status: experimental
logsource:
product: windows
category: process_creation
detection:
selection:
Image|endswith: '\\schtasks.exe'
CommandLine|contains|all:
- '/create'
- '/sc'
- 'onlogon'
condition: selection
falsepositives:
- Legitimate administrative or software activity with the same isolated pattern
level: medium
Line numbers refer to this excerpt. Choose a note to highlight its range.
Alternative hypotheses and negative tests
Before assigning the family, each signal used by the model is tested independently against software deployment, administration tools, installers, browser or backup software and known internal scripts. At least one structural anchor and one temporally consistent behaviour chain must align. The extractor represents the older IDAT path and does not establish decoding of every pixel variant. Without a sample, modules, injection and persistence were not executed. A negative countercheck rejects only the tested hypothesis; it is not a general all-clear.
Attribution and variant risk
The extractor represents the older IDAT path and does not establish decoding of every pixel variant. Without a sample, modules, injection and persistence were not executed.
Final assessment
The review provides a defensible architecture and detection baseline for the named snapshot. It is not proof of current activity, complete variant coverage or a specific operator.
Review limits
- No independent sample, runtime, C2 or campaign verification.
- The extractor represents the older IDAT path and does not establish decoding of every pixel variant. Without a sample, modules, injection and persistence were not executed.
- Defensive models were not validated with a target engine.
Sources & context
These sources provide evidence and further context. Our observations, reconstructions and other authors’ results are distinguished in the relevant analysis section.
ThreatLabz — New HijackLoader evasion tactics ↗ThreatLabz — HijackLoader extractor ↗Conclusion
Conclusion: structure before signature
The greatest defensive value comes from connecting entry, internal architecture, persistence, impact and telemetry. Individual names, hashes or IOCs remain supporting evidence, not the conclusion.
Next steps
- Test models against synthetic positives and legitimate negatives.
- Rebind version and evidence snapshot with every update.
- Extend runtime claims only after first-party, lawfully available telemetry.
Current module and evasion analysis plus an official older IDAT extractor treated as separate evidence snapshots.
