Article Details
Scrape Timestamp (UTC): 2025-01-23 15:28:05.908
Original Article Text
Click to Toggle View
Stealthy 'Magic Packet' malware targets Juniper VPN gateways. A malicious campaign has been specifically targeting Juniper edge devices, many acting as VPN gateways, with malware dubbed J-magic that starts a reverse shell only if it detects a “magic packet” in the network traffic. The J-magic attacks appear to target organizations in the semiconductor, energy, manufacturing (marine, solar panels, heavy machinery), and IT sectors. Challenge-protected reverse shell The J-magic malware is a custom variant of the publicly available cd00r backdoor - a proof-of-concept that stays silent and passively monitors network traffic for a specific packet before opening a communication channel with the attacker. According to researchers at Black Lotus Labs, Lumen’s threat research and operations arm, the J-magic campaign was active between mid-2023 and at least mid-2024 and was orchestrated for “low-detection and long-term access.” Based on the telemetry available, the researchers say that about half of the targeted devices seemed configured as a virtual private network gateway for their organization. Similarly to cd00r, J-magic watches the TCP traffic for a packet with specific characteristics - “magic packet” - sent by the attacker. It does this by creating an eBPF filter on the interface and port specified as a command line argument when executed. Black Lotus Labs researchers say the malware checks various fields and offsets for clues indicating the right packet from a remote IP address. J-magic looks for five conditions and if a packet meets one of them, it spawns a reverse shell. However, the sender must solve a challenge before getting access to the compromised device. The remote IP receives a random, five-character alphanumeric string encrypted with a hardcoded public RSA key. If the received response is not equal to the original string, the connection closes. “We suspect that the developer has added this RSA challenge to prevent other threat actors from spraying the internet with magic packets to enumerate victims and then simply repurposing, the J-Magic agents for their own purposes” - Black Lotus Labs Although the activity shares technical similarities with the SeaSpy malware, also based on the cd00r backdoor, some differences make it difficult to establish a connection between the two campaigns. The two malware look for five different magic conditions. Furthermore, the J-magic included a certificate that was used in the second verification process that provided shell access. The researchers say that based on these findings, they have “have low confidence in the correlation [of J-magic] to the SeaSpy family.” The SeaSpy backdoor was planted on Barracuda Email Security Gateways after Chinese threat actors exploited CVE-2023-2868 as a zero-day vulnerability since at least October 2022. The threat actor behind SeaSpy, tracked internally by Mandiant as UNC4841, breached email servers of U.S. government agencies. Black Lotus Labs researchers believe that the J-magic campaign focusing on Juniper routers shows that the use of this type of malware is increasingly turning into a trend. By targeting enterprise-grade routers with “magic packet” malware, threat actors can stay undetected for longer periods as such devices are rarely power cycled, the malware resides in memory, and these devices typically lack host-based monitoring tools.
Daily Brief Summary
'J-magic' malware specifically targets Juniper edge devices used primarily as VPN gateways for critical sectors including semiconductor, energy, and manufacturing.
The malware, noticed actively from mid-2023 to at least mid-2024, operates by detecting specific network "magic packets" to initiate a challenge-protected reverse shell.
Black Lotus Labs identified J-magic as a variant of the cd00r backdoor, which silently listens to TCP traffic until activated by specific packet characteristics.
The malware implements an eBPF filter to scrutinize traffic and uses RSA encryption to safeguard against unauthorized access from third-party threat actors.
Significantly, half of the observed infected devices served as VPN gateways, showing the malware’s focus on nodes critical to organizational infrastructure.
Though similarities were found with the SeaSpy malware, researchers report low confidence in linking J-magic and SeaSpy directly.
Highlighted the growing trend of using sophisticated malware to target enterprise-grade routers to maintain persistent, undetected access.