This is the fourth part in a series of blogs. The prior blogs describe the technical details of the tools and the techniques used by the cyber gang to gain control of the infected machines.
"Catch Me If You Can" Trojan Banker Zeus Strikes Again (Part 3 of 5)
In this blog we will examine the Zeus Trojan banker process and take a further look at its control panel and the source code of its command and control server.
Zeus Trojan Banker
Once the Zeus Trojan Banker variant is downloaded and installed on the victim's machine, it attaches to system processes (Explorer.exe, ctfmon.exe) and copies itself into the "Application Data" folder of the user's personal folders. One of many registry changes made by the Trojan is adding itself to the following key:
"HKU\Software\Microsoft\Windows\CurrentVersion\Run". This allows the Trojan to run every time the PC reboots.
Figure 1: VirusTotal results 8/42 for the packed Zeus malware
Figure 2: VirusTotal results 6/42 for the Zeus malware, after unpacking UPX
The anti-virus results are low because the Trojan is easily replaced every couple of days with a new undetected variant.
The second phase of the malware involves downloading a configuration file from secondconcert.ru (22.214.171.124), hosted in Shenyang (China) according to the GeoIP database, though the core of this cyber-criminal attack operation is located in Moldova.
Figure 3: Zeus hooks on "Explorer.exe" process and accesses its C&C server
Figure 4: Zeus accesses its C&C and downloads new encrypted configuration
This botnet works in a clean and tidy fashion, which helps it stay under the radar for several months. The Zeus first accesses a server that is unrelated to the master C&C server. Moreover, the configuration file is delivered only to machines located in the U.K. to evade unnecessary traffic, and more importantly, to bypass security research analysis using techniques like sandboxing.
Figure 5: Access of "JPG" file not from the U.K.
The screenshot above describes one of the evasive techniques driven by the cybercriminal group. Accessing the configuration file from outside of the U.K. will result in a 404 "Page not found" error.
The configuration file is downloaded by the Trojan and contains a list of websites that are monitored by the bot. The bot sends cookie and credentials information that pertain to those sites. The Trojan monitors access to approximately 30 banking websites and several leading websites; it targets the most familiar banks in U.K.
Zeus in Action
The cybercriminals develop or purchase Zeus plug-ins for each bank. In order to manipulate the transactions committed by the user, the cybercriminals prefer to avoid modifying the original Web pages using the bot, so they download a JS file instead. This way, the script is more flexible and can be modified easily without "touching" the hooked code on the browser's processes. Once the user accesses one of the bank sites from the above list, two scripts are injected at the bottom of the Web page. One is taken from the C&C server, and the second one is JQuery API that is taken from the Google website ("googleapi.com") and is used for auxiliary functions.
Figure 6: Code injected to one of the bank Web pages
Figure 7: Fiddler dump, describing the browser access to the hostile server
Money Transaction Manipulation Process
Once the user intends to transfer money from one account to another, the Zeus Trojan accesses the C&C server and requests a money mule. Money mules are people who receive transfers from compromised bank accounts and forward them to the cybercriminal group. Money mules are sometimes unaware that they play part in a crime, as the "job" is described benignly as a "Financial Agent" by the cybercriminals. We identified nearly 1,500 unique names of money mules in the server logs from this attack (for all banks combined).
The APACHE log below is taken from the original malicious web server. It shows a report sent by the Zeus Trojan running on compromised machines.
Figure 8: A report snippet from the malicious web server
The data sent from the user is base64 encoded. After decoding it shows:
Figure 9: Decoded transaction information
Decoding this content uncovers further details regarding the communication between the Trojan and the C&C server. Every request transmitted by the Trojan holds a unique ID – "uuid." Along with its own ID, the Trojan sends a desired operation in the "action" field. The code above describes a request by the Trojan to receive money mule account information (that the money will be transferred to). It also sends the user's account balance to the server.
The C&C server selects the appropriate money mule based on the information from the client:
Figure 10: Server side PHP code for selecting the money mule
The code from the server, shown below, includes the algorithm that calculates how to select a money mule from the database. The script determines the minimum and maximum amounts the victim can send and that the money mule can receive. Afterwards, it picks a random amount within this range and sends it back to the calling function. The script above removes irrelevant data from the "worker" object, encodes it in JSON format and sends it back to the Trojan. It locks the money mule to ensure it won't be used at the same time by a different Trojan until the transaction is complete.
Figure 11: PHP server side code, money calculator generator.
Figure 12: Control panel, money mule tab (Worker)
The screenshot above is taken from the original control panel of the administrator. The manager adds money mules delivered by his suppliers (under "master name"), and the system pulls the money mule according to the configuration: the selected bank and the amount that can be delivered.
Figure 13: Snippet code from the downloaded JS file.
As shown by the marked code above, the process is divided into controlled steps, while the last step (step 4) is the actual transaction confirmation: "Your payment has been sent."
Figure 14: A server log entry indicating a successful transaction
The Trojan updates the C&C server with every step that is committed by the user during the money transfer. The log above shows a successful transaction manipulated by the Trojan with the name of the money mule chosen to be beneficiary of the money transfer.
Figure 15: Control panel, operation section.
The manager is able to watch all the successful transactions of each Trojan, along with the amounts that were transferred to the money mules. The system used to control this scam is not part of any known malicious pack, and it seems it was built specifically for this operation. The code on the server is updated on a daily basis.
In the next and the last blog in this series, we will show the distribution and damage which was caused by this cybercrime attack.