JS Noise-Payload Reassignment Eval
What It Does
A hand-rolled JavaScript/JScript obfuscation technique that hides a real payload inside a massive repetitive noise string, then extracts it via sequential variable-reassignment statements and executes it via the Function constructor. The noise string is a fixed-length base pattern (2,000–3,000 bytes) repeated dozens or hundreds of times with small random insertions between repetitions. The extraction layer uses a target variable (e.g., yielding=[];) followed by N statements of the form target['key']='char';, where each statement adds one character to the payload. The final payload is passed to Function(''+target['key1']+target['key2']+...+ '',0,false).
Detection / Fingerprint
- File size: Typically 500 KB–2 MB for a script file (legitimate JS files >1 MB are rare).
- Single very long line:
fileutility reports "ASCII text, with very long lines (65536), with no line terminators". - Repetitive base noise string: A 2,000–3,000 byte alphabetic string appears 50–200 times. This is the strongest clustering fingerprint.
- Sequential property assignments: A variable is declared as an empty array/object, then dozens of
var['key']='char';statements follow. - Single
Functionkeyword: Only oneFunctioncall in the entire file, near the end, with a string argument. - No commercial obfuscator signatures: No base64 decoder, no
charCodeAt/fromCharCodedispatcher, no control-flow flattening.
Implementation Patterns Observed
Noise-Payload Reassignment Pattern (first observed)
Sample c83b7d57 uses a 2,411-byte base noise string repeated 196 times with random insertions, 62 sequential yielding['key']='char'; assignments, and a single Function constructor call. The extracted payload is 62 characters — a base64-like string encoding the real dropper logic. ^[/intel/analyses/c83b7d57a3f534ffd3ac6a8765c99fe1072f6615baf37542c12bb273681ccc91.html]
Comparison to Related Techniques
| Technique | Key Difference | Family |
|---|---|---|
js-dictionary-char-lookup-obfuscation |
Uses a large object literal with natural-language keys mapping to characters; payload assembled via dictionary lookup | unclassified-js-webdav-dropper |
js-custom-noise-obfuscation |
Uses Unicode noise padding and split-string arrays with comma-separated character blocks | unclassified-js-dropper 404356dbc85c |
js-noise-payload-reassignment-eval |
Uses sequential target['key']='char'; assignments on an array-like object; no dictionary literal |
unclassified-js-noise-base64-eval-dropper |
Reproduce on Your Own VMs
- Generate a 2,500-byte random lowercase string as the base noise.
- Base64-encode your real JScript payload.
- For each character in the base64 string, generate a random 50–120 character key.
- Build the carrier:
<noise_string><random_insertion_1><noise_string>... yielding=[]; yielding['key1']='c1'; yielding['key2']='c2'; ... Function(''+yielding['key1']+yielding['key2']+...+ '',0,false); - Intersperse noise between each assignment.
- Save as
.jsand run through your static pipeline. Verifyfilereports "very long lines" andstringsshows only noise.
Defensive Countermeasures
- Size heuristic: Alert on script files >500 KB.
- Repetition detection: Compute LZ77 compression ratio or use ssdeep — high repetition produces low-complexity hashes.
- Regex for
yielding=[];or similar patterns: Search for\w+\s*=\s*\[\]\s*;followed by repeated\w+\['[^']+'\]\s*=\s*'.'\s*;. - Monitor WScript/CScript execution: Any
.jsfile >500 KB spawningpowershell.exeorcmd.exeis suspicious.
Pages Where Observed
- unclassified-js-noise-base64-eval-dropper — Sample
c83b7d57(first observed)