Reseller News

5 ways hackers hide their tracks

From trusted pentesting tools to LOLBINs, attackers abuse trusted platforms and protocols to evade security controls.

CISOs have an array of ever-improving tools to help spot and stop malicious activity: network monitoring tools, virus scanners, software composition analysis (SCA) tools, digital forensics and incident response (DFIR) solutions, and more.

But of course, cyber security is an ongoing battle between attack and defence, and the attackers continue to pose novel challenges.

Older techniques, such as steganography—the art of hiding information including malicious payloads in otherwise benign files, such as images—are evolving, leading to new possibilities. For example, recently a researcher demonstrated even Twitter wasn’t immune to steganography, and images on the platform could be abused to pack ZIP archives of up to 3MB within them.

However, in my own research, I have noticed that in addition to using obfuscation, steganography, and malware packing techniques, threat actors today frequently take advantage of legitimate services, platforms, protocols, and tools to conduct their activities. This lets them blend in with traffic or activity that may look “clean” to human analysts and machines alike.

Here are five tactics cybercriminals are using to cover their tracks today.

1 - Abusing trusted platforms that won’t raise alarms

This was a common theme seen by security professionals in 2020 that has crept into this year. From penetration testing services and tools such as Cobalt Strike and Ngrok, to established open-source code ecosystems like GitHub, to image and text sites like Imgur and Pastebin, attackers have targeted a wide array of trusted platforms in just the past few years.

Typically, Ngrok is used by ethical hackers interested in collecting data or setting up mock tunnels for inbound connections as a part of bug bounty exercises or pen-testing engagements. But malicious actors have abused Ngrok to directly install botnet malware, or connect a legitimate communications service to a maliciousserver.

In a more recent example, Xavier Mertens at SANS Institute spotted one such malware sample written in Python that contained base64-encoded code to plant a backdoor on the infected system that used Ngrok.

Because Ngrok is widely trusted, the remote attacker could connect to the infected system via an Ngrok tunnel, which will likely bypass corporate firewalls or NAT protections.

GitHub has also been abused to host malware from Octopus Scanner to Gitpaste-12. Recently, crafty attackers abused GitHub and Imgur combined using an open source PowerShell script that made it possible for them to host a simple script on GitHub that calculates Cobalt Strike payload from a benign Imgur photo.

Cobalt Strike is a popular pen-testing framework to simulate advanced real-world cyberattacks, but like any security software product, it can be misused by adversaries. Likewise, automation tools that developers rely on are not immune to being exploited.

In April, attackers abused GitHub Actions to target hundreds of repositories in an automated attack that used GitHub’s server and resources for cryptocurrency mining

These examples show why attackers find value in targeting legitimate platforms that many firewalls and security monitoring tools may not block.

2 - Upstream attacks that capitalise on a brand value, reputation or popularity

Software supply chain security concerns may have gained public attention following the recent SolarWinds breach, but these attacks have been on the rise for some time.

Whether in the form of typosquatting, brandjacking or dependency confusion (which initially came to light as a proof-of-concept research but was later abused for malicious purposes), “upstream” attacks exploit trust within known partner ecosystems and capitalise on the popularity or reputation of a brand or software component.

The attackers aim to push malicious code upstream to a trusted codebase associated with a brand, which then gets distributed downstream to the ultimate target: that brand's partners, customers, or users.

Any system that is open to everyone is also open to adversaries. So, many supply chain attacks target open-source ecosystems, some of which have lax validation in place to uphold the “open to all” principle. However, commercial organisations are also subject to these attacks.

In a recent case that some have likened to the SolarWinds incident, software testing company Codecov disclosed an attack against its Bash Uploader script that had gone undetected for over two months.

Codecov’s 29,000-plus clients include some prominent global brand names. In this attack, the uploader used by the company’s clients was altered to exfiltrate the system’s environment variables (keys, credentials, and tokens) to the attacker’s IP address.

Protecting against supply chain attacks requires action on multiple fronts. Software providers will need to step up investment in keeping their development builds safe. AI and ML-based devops solutions capable of automatically detecting and blocking suspicious software components can help prevent typosquatting, brandjacking and dependency confusion attacks.

Additionally, as more companies adopt Kubernetes or Docker containers to deploy their applications, container security solutions that have a built-in web application firewall and are capable of spotting simple misconfiguration errors early can help prevent a bigger compromise.

3 - Funnelling cryptocurrency payments via hard-to-trace methods

Darknet marketplace sellers and ransomware operators frequently deal in cryptocurrency, given its decentralised and privacy-minded design.

But, although not minted or controlled by government central banks, cryptocurrency still lacks the same level of anonymity as cash. Cyber criminals therefore find innovative ways to siphon funds between accounts.

Most recently, over US$760 million worth of Bitcoin linked to the 2016 Bitfinex hack were moved to new accounts in multiple, smaller transactions—in amounts ranging from 1 BTC to 1,200 BTC.

Cryptocurrency isn't a completely foolproof way of hiding a money trail. On the night of the 2020 U.S. Presidential election, the U.S. government emptied out a US$1 billion Bitcoin wallet which contained funds linked to the most notorious darknet marketplace, Silk Road, which itself had been shut down in 2013.

Some other cryptocurrencies like Monero (XMR) and Zcash (ZEC) have more extensive privacy-preserving abilities than Bitcoin for anonymising transactions. The back-and-forth between criminals and investigators will no doubt continue on this front as attackers keep looking for better ways to hide their tracks.

4 - Using common channels and protocols

Like trusted platforms and brands, encrypted channels, ports, and protocols used by legitimate applications provide another way for attackers to mask their footsteps. For example, HTTPS is a universally indispensable protocol for the Web today, and for that reason, port 443 (used by HTTPS/SSL) is very hard to block in a corporate environment.

However, DNS over HTTPS (DoH)—a protocol for resolving domains—also uses port 443, and has been abused by malware authors to transmit their command-and-control (C2) commands to infected systems.

There are two aspects to this problem. First, by abusing a commonly used protocol like HTTPS or DoH, attackers enjoy the same privacy benefits of end-to-end encrypted channels as legitimate users do.

Second, this poses difficulties for network administrators. Blocking DNS in any form itself poses a challenge, but now, given the DNS requests and responses are encrypted over HTTPS, it becomes a nuisance for security professionals to intercept, single out, and analyse the suspicious traffic from many HTTPS requests moving inbound and outbound through the network.

Researcher Alex Birsan, who demonstrated the dependency confusion technique to ethically hack into more than 35 big technology firms, was able to maximise his success rate by using DNS (port 53) to exfiltrate basic information. Birsan chose DNS because of the high likelihood of corporate firewalls not blocking DNS traffic, due to performance requirements and legitimate DNS uses.

5 - Using signed binaries to run obfuscated malware

The familiar concept of fileless malware using living-off-the-land binaries (LOLBINs) remains a valid evasion technique.

LOLBINs refer to legitimate, digitally signed executables, such as Windows executables signed by Microsoft, that can be misused by attackers to launch malicious code with elevated privileges, or to evade endpoint security products such as antivirus.

Last month, Microsoft shared some guidance on defensive techniques that enterprises can adopt to prevent attackers from abusing Microsoft’s Azure LOLBINs.

In another example, a recently discovered Linux and macOS malware I analysed had a perfect zero-detection rate among all leading antivirus products.

The binary did contain obfuscated code, which aided in evasion. However, further investigation also revealed the malware was built using hundreds of legitimate open-source components and conducted its malicious activities, such as gaining administrative privileges, in ways identical to how legitimate applications would do so.

While obfuscated malware, runtime packers, VM evasion, or hiding malicious payload in images are known evasive techniques used by advanced threats, their true power comes from bypassing security products, or flying under their radar.

And this is made possible when payloads are combined to some degree with trusted software components, protocols, channels, services or platforms.