Security researchers have uncovered a new cyber campaign where the Njrat remote access trojan (RAT) is being used to exploit Microsoft’s Dev Tunnels service. This service, originally designed for developers to expose local services via temporary HTTPS URLs for debugging, is now being weaponized to facilitate covert command-and-control (C2) communications for the malware. By routing traffic through Microsoft’s trusted infrastructure, attackers are able to evade traditional network defenses and make the malicious activity appear as legitimate developer behavior.
The Njrat malware in this campaign transmits system metadata to the C2 server using HTTP POST requests. The data includes encoded variables like OK.HH (host URL) and OK.usb (USB propagation capability). Analysis of the malware’s configuration reveals that it uses a JSON-based structure for persistence mechanisms. This approach, which leverages the trusted domains of devtunnels.ms, enables the attackers to bypass IP/DNS reputation checks and employ TLS encryption to obscure their payloads, mimicking previous campaigns but with more sophistication due to Microsoft’s certificate authority trust.
The malware’s USB propagation module, indicated by the OK.usb variable, is particularly concerning as it allows the malware to spread laterally in air-gapped environments.
This capability enhances the malware’s ability to compromise systems even in highly isolated networks. Because Dev Tunnels traffic looks like legitimate developer activity, defenders face visibility gaps, making detection difficult.
Security teams are advised to monitor for unusual processes like devtunnel.exe paired with unsigned binaries, which could indicate misuse of the Dev Tunnels service.
To mitigate the threat, experts recommend implementing several strategies, including blocking or alerting on requests to devtunnels.ms from unauthorized environments, monitoring endpoint processes, conducting registry audits for persistence keys, and restricting Dev Tunnels access to developer VLANs. The threat is still active, with infrastructure linked to historical Njrat campaigns targeting regions in the Middle East and North Africa. Security teams should correlate indicators of compromise (IOCs) with DNS logs and endpoint process trees to detect the ongoing abuse of Microsoft’s Dev Tunnels service.