SSH is a network protocol that provides a secure connection between two machines, enabling data communication and remote command execution. SSH machine identities, also known as SSH keys, are used to secure remote connections and automate processes, for example controlling workloads running in cloud computing environments, VPN connections and connected IoT devices, giving privileged access to organizations’ most critical systems, including servers and databases. This makes them highly valuable to attackers. A single SSH key can be used to gain undetected root access to critical systems and data, enabling an attacker to do anything from circumventing security controls to injecting fraudulent data, subverting encryption software, or installing persistent malware.
Venafi’s researchers analysed samples of several high-profile malware campaigns to detect where SSH capabilities are being used. In most cases, the malware added the attacker’s SSH key to a list of authorized key files on the victim’s machine, meaning their machine would trust the key, enabling the attacker to remain persistent on it. In other cases, the malware was able to brute force weak SSH authentication and gain access to the target, access credentials and host information to laterally move across the network and infect further machines.
Some examples of successful malware campaigns that leveraged SSH machine identities from 2019 include:
“SSH keys can be potent weapons in the wrong hands,” commented Yana Blachman, threat intelligence specialist at Venafi. “But until recently, only the most sophisticated, well-financed hacking groups had this kind of capability. Now, we’re seeing a ‘trickle-down’ effect, where SSH capabilities are becoming commoditized. What makes this “commoditization” so worrying is that if an attacker is able to backdoor a potentially interesting target, they may monetize this access and sell it through dedicated channels to more sophisticated and sponsored attackers, such as nation state threats for the purpose of cyberespionage or cyberwarfare. We have seen this with the TrickBot cybercrime gang which was found to be selling a ‘bot-as-a-service’, together with a full toolset, to North-Korean-sponsored group Lazarus for both monetization and cyberespionage.”
The best defence organizations have against SSH abuse is to ensure they have complete visibility and intelligence over every authorized SSH key in the enterprise and out to the cloud. As this research shows, attackers not only abuse existing machine identities, they may also insert their own malicious SSH machine identities into target environments; so, it’s not just the known keys, but all keys that must be discovered and analysed. However, organizations routinely overlook the importance of Machine Identity Protection for SSH keys. SSH keys are rarely part of organisation’s security strategies. And, because they never expire, many organizations have no way of knowing which SSH keys are being used for a specific action or task. In fact, recent research shows that only ten per cent of organizations believe they have a complete and accurate intelligence over all SSH machine identities, raising the risk that SSH keys will be misused or stolen.
“SSH keys can dramatically increase attackers’ ability to cause harm, so any malware that allows them to leverage SSH capabilities should be a real concern to organizations,” added Blachman. “As these capabilities become increasingly accessible, it’s vital that organizations get their houses in order. The only way to defend against these attacks is to have visibility and intelligence on how SSH machine identities are being used, so that malicious actors can be detected faster. To do this, organizations must improve Machine Identity Protection for SSH keys and equip themselves to take complete control over every single SSH machine identity they rely on in order to identify signs of compromise.”