Hundreds of Developer SSH Keys Stolen Through GitHub by Malicious NPM Packages

Two harmful packages, known as warbeast2000 and kodiak2k, were detected on the npm package registry. These packages were discovered to exploit GitHub as a storage system for Base64-encrypted SSH keys, which were stolen from the developer systems where they were installed. These modules were made available at the beginning of the month and were downloaded 412 and 1,281 times respectively before npm removed them.

Jan 23, 2024 - 13:00
  Source
 0  36
Hundreds of Developer SSH Keys Stolen Through GitHub by Malicious NPM Packages

Two malicious packages discovered on the npm package registry have been found to leverage GitHub to store Base64-encrypted SSH keys stolen from developer systems on which they were installed.

The modules named warbeast2000 and kodiak2k were published at the start of the month, attracting 412 and 1,281 downloads before they were taken down by the npm maintainers. The most recent downloads occurred on January 21, 2024.

Software supply chain security firm ReversingLabs, which made the discovery, said there were eight different versions of warbeast2000 and more than 30 versions of kodiak2k.

Both the modules are designed to run a postinstall script after installation, which is designed to retrieve and execute two different JavaScript files.

While warbeast2000 attempts to access the private SSH key, kodiak2k is designed to look for a key named "meow," raising the possibility that the threat actor likely used a placeholder name during the early stages of the development.

"This second stage malicious script reads the private SSH key stored in the id_rsa file located in the /.ssh directory," security researcher Lucija Valentić said. "It then uploaded the Base64-encoded key to an attacker-controlled GitHub repository."

Subsequent versions of kodiak2k were found to execute a script found in an archived GitHub project hosting the Empire post-exploitation framework. The script is capable of launching the Mimikatz hacking tool to dump credentials from process memory.

"The campaign is just the latest example of cybercriminals and malicious actors using open source package managers and related infrastructure to support malicious software supply chain campaigns that target development organizations and end-user organizations," Valentić said.