April 26, 2017 By Larry Loeb 2 min read

Security researchers found a remote access Trojan (RAT) that has been hiding for nearly two years. It uses novel techniques to do its malfeasance: Malicious macros in Excel documents will compile embedded C Sharp (C#) source code into an executable file that actually downloads the RAT.

Starting With the Carp Downloader

Palo Alto Networks named Carp Downloader as the malicious document payload in question. The name stems from how its originators make use of a specific technique of compiling and executing embedded C# — or C shARP.

Carp generates two paths, and one is to a randomly named executable and C# file in the %APPDATA%\\Microsoft folder. Next, it base64-decodes the embedded C# source code in the Carp Downloader and writes it to the previously generated C# file path. The payload then downloads a file on port 443. In a final routine, it will decrypt and run the downloaded file using AES-128.

The Trojan has survived undetected for so long due to a low instance of infections. The researchers found only 27 total samples extending to December 2015.

About the Remote Access Trojan

Researchers named the RAT Cardinal, based on internal notations that were contained within the Microsoft .NET Framework executables. When launched, Cardinal checks the current working directory. If it doesn’t find what it expects, there is an installation routine or two.

Once installed, it attempts to inject itself into a process. It will attempt to use an installed executable for the newly spawned process, selecting from a list that includes cvtres.exe, vbc.exe, AppLaunch.exe, csc.exe, RegSvs.exe and RegAsm.exe.

Cardinal RAT will then parse the current configuration and try to connect to the command-and-control (C&C) server. There are two pieces of data that will be sent here: First is a DWORD that specifies the data length, and the second is the data itself, which is transmitted and hidden.

The RAT will use its own scheme to encrypt the data. First, it leverages a series of XOR and addition operations, followed by decompression using the ZLIB library. This transmittal method is the way the RAT’s stolen files would be exfiltrated.

A Major Threat

SecurityWeek said the RAT collects victim information, updates itself and manipulates settings, becomes a reverse proxy, executes commands and even uninstalls itself. Additionally, it can obtain and launch new files, keylog, take screen shots and erase browser cookies.

Ultimately, RAT is a major problem if it hits. So far, the low known incidence of this specific remote access Trojan has kept it on the back burner. But given how it uses a novel method in the downloader’s construction, security professionals must expect other cybercriminals to take advantage of this same technique as they develop new malware.

More from

What we can learn from the best collegiate cyber defenders

3 min read - This year marked the 19th season of the National Collegiate Cyber Defense Competition (NCCDC). For those unfamiliar, CCDC is a competition that puts student teams in charge of managing IT for a fictitious company as the network is undergoing a fundamental transformation. This year the challenge involved a common scenario: a merger. Ten finalist teams were tasked with managing IT infrastructure during this migrational period and, as an added bonus, the networks were simultaneously attacked by a group of red…

A spotlight on Akira ransomware from X-Force Incident Response and Threat Intelligence

7 min read - This article was made possible thanks to contributions from Aaron Gdanski.IBM X-Force Incident Response and Threat Intelligence teams have investigated several Akira ransomware attacks since this threat actor group emerged in March 2023. This blog will share X-Force’s unique perspective on Akira gained while observing the threat actors behind this ransomware, including commands used to deploy the ransomware, active exploitation of CVE-2023-20269 and analysis of the ransomware binary.The Akira ransomware group has gained notoriety in the current cybersecurity landscape, underscored…

New proposed federal data privacy law suggests big changes

3 min read - After years of work and unsuccessful attempts at legislation, a draft of a federal data privacy law was recently released. The United States House Committee on Energy and Commerce released the American Privacy Rights Act on April 7, 2024. Several issues stood in the way of passing legislation in the past, such as whether states could issue tougher rules and if individuals could sue companies for privacy violations. With the American Privacy Rights Act of 2024, the U.S. government established…

Topic updates

Get email updates and stay ahead of the latest threats to the security landscape, thought leadership and research.
Subscribe today