Mostpoint-of-sale (PoS) threats follow a common process: dump, scrape, store, exfiltrate.FastPOS (initially detected by Trend Micro as TSPY_FASTPOS.SMZTDA) was different with the way it removed a middleman and went straight from stealing credit card data to directly exfiltrating them to its command and control (C&C) servers.
FastPOS was true to its moniker—pilfer data as fast as possible, as much as it can, even at the expense of stealth. The malware is areflection of how PoS threats, though no longer novel, areincreasingly used against businesses and their customers. As such, FastPOS’s update does not come as a surprise—in time for the oncoming retail season to boot.
The samples we analyzed were compiled during the second week of September, and feedback from our Smart Protection Network confirmed that they are already deployed against small-medium businesses. FastPOS’s developer also seemed to have wasted no time validating his code by confirming its functionality in a full infection. It only took about a month from when its C&C domain was registered (mid-August) to the launch of its new campaign, making it faster than their previous operation in 2015.
Modular and Architecture-Aware
We were able to detect FastPOS’s update (TSPY_FASTPOS.A) when we monitored an unusual network connection in one of the endpoints of a company based in North America. The format and keywords, ‘cdosys’ and ‘comdlg64,’ as well as the use of HTTP GET instead of HTTP POST , and the use of a simple HTTP User Agent string (Firefox) for data exfiltration were the initial giveaways.
Figure 1. FastPOS using HTTP GET to exfiltrate data
FastPOS’s first incarnation was multithreaded, having one process for each functionality—keylogging, RAM scraping, and self-updating. In its latest iteration, the malware makes use of different components hidden in its resource instead of writing everything in one file.
The components FastPOS’s new version is sporting are:
Serv32.exe – creates and monitors a mailslot and sends its contents to the C&C server
Kl32.exe – keylogger component (32-bit)
Kl64.exe – keylogger component (64-bit)
Proc32.exe – RAM scraper (32-bit)
Proc64.exe – RAM scraper (64-bit)
Of note are separate components for 32-bit and 64-bit systems. While both are stored in its resource, only the appropriate component will be copied to the Windows folder and executed. Kl32.exe / Kl64.exe are renamed to kbd.exe , and proc32.exe / proc64.exe to servproc.exe , possibly to make it easier to reference the files without needing to constantly check the affected system’s architecture.
A Well-Oiled Machine?
How do the components make the entire system work? The main file extracts all components and passes control to the main service ( serv32.exe ). The main service creates and monitors a central communication medium and directly sends all received information to the C&C server. The keylogger components ( Kl32.exe/Kl64.exe ) hook the keyboard then communicate with the main service to send logged keystrokes to the C&C server. The RAM scraper modules monitor processes and scan for credit card track data, which are then sent to the main service.
Figure 2. How FastPOS’s components work
Stolen information is now stowed in mailslots , a mechanism for applications to store and retrieve messages. The use of mailslots to evade AV detection isn’t new. LogPOS (TSPY_POSMAIL.A), which emerged last March 2015 , was one of the first POS malware to utilize this technique. Since mailslots are memory-residing temporary files, it enables attackers to save information about the infected system without leaving traces of a physical file.
Modules that Steal Together, Stay Together
The developer’s approach to updating his malware is significant. Modular malware such as FastPOS can be harder to detect as some of the components can be programmed not to work without another. Others such as FastPOS’s do not depend on other components and can be self-executed, but only if the arguments for them are known.
Uncovering a component doesn’t guarantee others can be found either. For instance, FastPOS’s main service and RAM scraper can be seen running as a service, making them easier to remove. However, the keylogger component can be harder to notice as its code is injected into explorer.exe ’s process memory.