Upstyle Backdoor (LetsDefend)

November 05, 2025 · Brandon Love · Tags: letsdefend-writeup, blue-team, letsdefendio, cybersecurity

Originally published on Medium: https://medium.com/@brandonlove2150/upstyle-backdoor-letsdefend-7513e41cd145?source=rss-024d132ba4b7——2

Today, I took on another challenge from LetsDefend.

Today, I took on another challenge from LetsDefend. This challenge focused on exploiting Palo Alto firewalls using CVE–2024–3400 in early 2024. UPSTYLE is a Python-based backdoor and has only been observed in relation to this exploitation activity, which involved attempted installation on compromised devices by the threat actor UTA0218.

Mitre ATT&CK

This is a breakdown from MITRE of the backdoor attack and its execution process.

Background

Upstyle Backdoor

Help us to analyze specifically targeting a backdoor known as UPSTYLE and its relation to CVEs (Common Vulnerabilities and Exposures) that affect Palo Alto Networks’ products.

File Location: C:\Users\LetsDefend\Desktop\ChallengeFile\sample.zip

File Password: infected

Walkthrough

The first step in this challenge is to navigate to the ChallengeFile folder and unzip the sample.zip folder to review its contents. The password is infected, like LetsDefend provided.

Challenge File

To find the answers to this challenge, the Python script should be examined using Notepad++.

Python Script

Python Script 2

Script Analysis

Let’s break down this script by line, question by question.

Q1 — def check():

Q2 — systempth = “/usr/lib/python3.6/site-packages/system.pth”

Q3 — css_path = “/var/appweb/…”

Q4 — os.unlink(“/opt/pancfg/mgmt/licenses/PA_VM*”)

Q5 — signal.signal(signal.SIGTERM, stop)

Q6 — def protect():

Q7 — SHELL_PATTERN = “img\(([A-Za-z0-9+/=]+)\)”

Q8 — /var/log/pan/sslvpn_ngx_error.log

Summary of Script

This is a persistence + C2 Python backdoor designed for network appliances (likely Palo Alto GlobalProtect VPNs).
It maintains access by embedding itself in Python libraries, reads incoming base64-encoded commands from log files, executes them, and resists removal.

Summary — Upstyle Backdoor (LetsDefend)

In this LetsDefend challenge, I analyzed the UPSTYLE Python backdoor associated with the exploitation of Palo Alto devices (CVE-2024–3400) and activity attributed to threat actor UTA0218. The delivered sample is a multi-component backdoor that establishes persistent execution by writing to Python’s site-packages (/usr/lib/python3.6/site-packages/system.pth), installs self-protection to restore itself if removed, and provides a stealthy command-and-control (C2) channel by scanning appliance logs (e.g., /var/log/pan/sslvpn_ngx_error.log) for img(…) patterns containing base64 payloads. It also tampers with device-specific files (e.g., deleting /opt/pancfg/mgmt/licenses/PA_VM*), suggesting targeted disruption of Palo Alto GlobalProtect/PAN-OS environments. The code decodes and executes hidden commands, uses signal handlers to survive termination, and can inject or modify web portal files to persist or conceal activity. Overall, UPSTYLE is a resilient, targeted backdoor that combines persistence, covert command and control (C2) via log injection, and destructive or disruptive actions against firewall/VPN infrastructure.

Originally published on Medium: https://medium.com/@brandonlove2150/upstyle-backdoor-letsdefend-7513e41cd145?source=rss-024d132ba4b7------2

letsdefend-writeupblue-teamletsdefendiocybersecurity
Batch Downloader(LetsDefend)
SOC235 — Atlassian Confluence Broken Access Control 0-Day CVE-2023–22515 (LetsDefend)