APT

China-linked APT Mustang Panda targets TP-Link routers with a custom firmware implant

China-linked APT group Mustang Panda employed a custom firmware implant targeting TP-Link routers in targeted attacks since January 2023.

Since January 2023, Check Point Research monitored a series of targeted attacks aimed at European foreign affairs entities that have been linked to the China-linked cyberespionage group Mustang Panda (aka Camaro Dragon, RedDelta or “Bronze President).

MustangPanda has been active since at least 2012, it targeted American and European entities such as government organizations, think tanks, NGOs, and even Catholic organizations at the Vatican. Past campaigns were focused on Asian countries, including Taiwan, Hong Kong, Mongolia, Tibet, and Myanmar. In 2022 campaigns, threat actors used European Union reports on the conflict in Ukraine and Ukrainian government reports as lures. Upon opening the reports, the infection process starts leading to the deployment of malware on the victim’s system.

In most recent attacks observed by Check Point, the threat actors employed custom firmware implant designed explicitly for TP-Link routers.

The implant includes multiple components, such as a custom backdoor dubbed “Horse Shell” that allows attackers to maintain persistence, build anonymous infrastructure and enable lateral movement into compromised networks.

The Horse Shell backdoor is inserted into the modified firmware by the attackers, due to its firmware-agnostic design, it can be used to target various firmware by different vendors.

The backdoor supports the following main functionalities:

  • Remote shell — Execution of arbitrary shell commands on the infected router
  • File transfer — Upload and download files to and from the infected router.
  • SOCKS tunneling — Relay communication between different clients.

The researchers have yet to discover the deployment method of the firmware images on the infected routers. The attackers likely gain access to the devices by exploiting known vulnerabilities or brute-forcing devices using default or weak and easily guessable passwords.

Experts believe the goal of the threat is the creation of a chain of nodes between main infections and real C2, and they do this by installing the backdoor on arbitrary devices with no particular interest, including residential and home networks.

“The TP-Link router, like many routers, has a web interface that allows its users to configure the router and manage it. One of the features of the management website provides the user with the option to manually upgrade their device’s firmware version. The web form for uploading a new firmware exists in SoftwareUpgradeRpm.htm.” This page, on the original and legitimate firmware we obtained from the official TP-Link website, is shown in the image below.” reads the report published by Check point. “However, in the modified version of the firmware we obtained, a small CSS property was inline added to the HTML form. This property, display:none, will hide the form from a user entering the page. Hiding the form, will not remove it or the feature from the HTML itself, so users can technically still manually upgrade their firmware version. Although now, it will be harder to perform the upgrade or even know that this feature exists.”

SoftwareUpgradeRpm.htm as shown in the original interface

The malicious image hides from a user the ability to flash another firmware image

The Horse Shell component communicates with its peers and server on a port specified for each of them individually. The default port for communication is 80. The component uses HTTP communication with hard-coded HTTP headers. The communications are encrypted using a custom or modified encryption scheme that is based on Substitution-Permutation Network. Horse Shell is able to communicate with numerous peers simultaneously.

The communication between infected routers relies on SOCK tunneling to obscure the origin and destination of the traffic.

The network is resilient to take down or compromise of a single in the chain because the traffic is routed through a different node in the chain.

“our discovery of the firmware-agnostic nature of the implanted components indicates that a wide range of devices and vendors may be at risk.” concludes the report.

We are in the final!

Please vote for Security Affairs (https://securityaffairs.com/) as the best European Cybersecurity Blogger Awards 2022 – VOTE FOR YOUR WINNERS
Vote for me in the sections where is reported Securityaffairs or my name Pierluigi Paganini

Please nominate Security Affairs as your favorite blog.

Nominate Pierluigi Paganini and Security Affairs here here: https://docs.google.com/forms/d/e/1FAIpQLSepvnj8b7QzMdLh7vWEDQDqohjBUsHyn3x3xRdYGCetwVy2DA/viewform

Follow me on Twitter: @securityaffairs and Facebook and Mastodon

Pierluigi Paganini

(SecurityAffairs – hacking, APT)

Pierluigi Paganini

Pierluigi Paganini is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group and Cyber G7 Group, he is also a Security Evangelist, Security Analyst and Freelance Writer. Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US. Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines. Author of the Books "The Deep Dark Web" and “Digital Virtual Currency and Bitcoin”.

Recent Posts

Google: China dominates government exploitation of zero-day vulnerabilities in 2023

Google's Threat Analysis Group (TAG) and Mandiant reported a surge in the number of actively…

2 hours ago

Google addressed 2 Chrome zero-days demonstrated at Pwn2Own 2024

Google addressed two zero-day vulnerabilities in the Chrome web browser that have been demonstrated during…

14 hours ago

INC Ransom stole 3TB of data from the National Health Service (NHS) of Scotland

The INC Ransom extortion group hacked the National Health Service (NHS) of Scotland and is threatening…

18 hours ago

CISA adds Microsoft SharePoint bug disclosed at Pwn2Own to its Known Exploited Vulnerabilities catalog

U.S. Cybersecurity and Infrastructure Security Agency (CISA) adds a Microsoft SharePoint vulnerability disclosed at the…

23 hours ago

The DDR Advantage: Real-Time Data Defense

This is the advantage of Data Detection and Response (DDR) for organizations aiming to build…

1 day ago

Finnish police linked APT31 to the 2021 parliament attack

The Finnish Police attributed the attack against the parliament that occurred in March 2021 to…

1 day ago

This website uses cookies.