sysmon.py
- Type
- Backdoor
- Capabilities
- PersistencePost exploitation
- Platforms
- Linux
sysmonpy is a Python-based persistent backdoor associated with TeamPCP software supply-chain attacks affecting Trivy, Checkmarx, LiteLLM, and the Telnyx Python SDK. It targets Linux systems and provides a mechanism for downloading and executing follow-on payloads after the initial compromise. It is deployed alongside credential-stealing components but is distinct from those harvesters.
The implant waits five minutes before its first network request, then polls an attacker-controlled endpoint approximately every 50 minutes to retrieve a payload URL. It downloads the designated executable, makes it executable, and launches it as a detached process. It records the last payload URL to avoid repeatedly downloading the same payload and supports a dormant state by ignoring links to a video-sharing service.
Persistence is established through a user-level systemd service disguised as a system telemetry service. In Kubernetes environments, accompanying deployment code can use service-account permissions to enumerate nodes and create privileged pods with access to host filesystems. Where permissions allow, this mechanism installs the backdoor and its systemd persistence on cluster nodes, allowing access to survive removal of the initially compromised workload. Its distribution through compromised development packages and security tooling exposes developer systems, CI/CD environments, and Kubernetes infrastructure.
Associated threat actors
1 distinct threat actor Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
The sysmon.py persistence script is a polling backdoor. After a five-minute startup delay, it contacts https://checkmarx.zone/raw every 50 minutes looking for a new payload URL.
Techniques & procedures
42 distinct techniques documented for this family, organized by ATT&CK tactic.
Initial Access
2 techniques
Initial Access
The dropper sleeps 5 minutes, then polls the ICP blockchain-hosted C2 for a second-stage payload URL, downloads it to /tmp/pglog , and executes it.
CrowdStrike’s Engineering team traced the activity to a compromised GitHub Action named aquasecurity/trivy-action... 76 of the scanner’s 77 release tags had been retroactively poisoned via git tag repointing, replacing the legitimate entry point with a multi-stage credential stealer.
Execution
6 techniques
Execution
it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
it writes this Python script to ~/.config/systemd/user/sysmon.py
it executes a base64-encoded Python filesystem harvester signed "TeamPCP Cloud stealer"
The .pth payload in 1.82.8 executed on every Python process startup and installed a persistent backdoor (~/.config/sysmon/sysmon.py).
If the script is run on a Kubernetes container that has sufficient permissions, it will attempt to deploy a highly privileged pod and run sysmon.py within it... places a highly privileged pod in the 'namespace':'kube-system'.
Persistence
7 techniques
Persistence
it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
The dropper sleeps 5 minutes, then polls the ICP blockchain-hosted C2 for a second-stage payload URL, downloads it to /tmp/pglog , and executes it.
If absent (meaning it's running on a developer machine or standalone server, not in CI), it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
sysmon.service installed as persistent systemd user service
It is saved as sysmon.py and installs a sysmon.service systemd unit to ensure the script runs persistently across reboots.
The .pth payload in 1.82.8 executed on every Python process startup and installed a persistent backdoor (~/.config/sysmon/sysmon.py).
Privilege Escalation
7 techniques
Privilege Escalation
it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
If absent (meaning it's running on a developer machine or standalone server, not in CI), it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
sysmon.service installed as persistent systemd user service
It is saved as sysmon.py and installs a sysmon.service systemd unit to ensure the script runs persistently across reboots.
The .pth payload in 1.82.8 executed on every Python process startup and installed a persistent backdoor (~/.config/sysmon/sysmon.py).
the privileged pod escapes to the host and installs a backdoor at /host/root/.config/sysmon/sysmon.py with a systemd service for automatic restart on boot
Stealth
8 techniques
Stealth
a Base64-encoded Python script is decoded and executed... Collected data is encrypted with a randomly generated AES-256-CBC session key, and the session key is wrapped with a hardcoded 4096-bit RSA public key.
The primary exfiltration channel is an HTTPS POST to scan.aquasecurtiy[.]org — a typosquatted domain mimicking Aqua Security's legitimate aquasecurity.com... The choice of filename mimics PostgreSQL logging
sysmon.py dropped to mimic legitimate sysmon monitoring artifact
If absent (meaning it's running on a developer machine or standalone server, not in CI), it writes this Python script to ~/.config/systemd/user/sysmon.py and creates a systemd unit for persistence.
After an initial five-minute sleep (likely intended to outlast sandbox analysis timeouts), it enters a polling loop that contacts a command-and-control (C2) server approximately every 50 minutes.
the state file is dot-prefixed to stay hidden from casual directory listings. Error handling is deliberately silent throughout.
If it is run on a standard linux host, it creates hidden directories in the users home folder ~/.config/sysmon and writes the python backdoor there.
The .pth payload in 1.82.8 executed on every Python process startup and installed a persistent backdoor (~/.config/sysmon/sysmon.py).
Credential Access
7 techniques
Credential Access
On GitHub-hosted Linux runners, a Base64-encoded Python script is decoded and executed with sudo. It locates the Runner.Worker process, reads its memory maps via /proc/{PID}/maps, and scrapes raw process memory via /proc/{PID}/mem looking for GitHub Actions secrets
The runner executes whatever code the action contains, with full access to the runner's environment, secrets, and network... looking for GitHub Actions secrets — specifically JSON structures matching "name":{"value":"...","isSecret":true}.
On self-hosted runners, a different Base64-encoded Python script performs broad filesystem credential harvesting. It targets the following: SSH private keys and configs, Cloud credentials, Kubernetes configs and service account tokens, Docker registry credentials, Database credentials... .env files and API keys
On self-hosted runners, a different Base64-encoded Python script performs broad filesystem credential harvesting. It targets the following: SSH private keys and configs Cloud credentials... Kubernetes configs... Docker registry credentials... .env files and API keys... System files (/etc/passwd, /etc/shadow, shell histories)
If the script is run on a Kubernetes container that has sufficient permissions, it will attempt to deploy a highly privileged pod... The script checks to see if the file: /var/run/secrets/kubernetes.io/serviceaccount/token exists and if it does, it uses that token to query /api/v1/nodes.
It targets the following: SSH private keys and configs Cloud credentials (AWS, Google Cloud, Azure) Kubernetes configs and service account tokens Docker registry credentials Database credentials...
On self-hosted runners, a different Base64-encoded Python script performs broad filesystem credential harvesting. It targets the following: SSH private keys and configs
Discovery
6 techniques
Discovery
Stage 1: Runner Process Discovery Initially, the script enumerates process IDs (PIDs) of GitHub Actions runner processes (Runner.Worker, Runner.Listener, runsvc, run.sh)...
System Information: hostname, whoami, uname -a, ip addr, ip route
On self-hosted runners, a different Base64-encoded Python script performs broad filesystem credential harvesting. It targets the following: SSH private keys and configs... Terraform state/vars... .env files and API keys
After an initial five-minute sleep (likely intended to outlast sandbox analysis timeouts), it enters a polling loop that contacts a command-and-control (C2) server approximately every 50 minutes.
A second python script queries AWS instance Metadata endpoints (IMDSv1/v2)... and queries the Kubernetes API if local service account tokens are found.
Within 3 hours, a backdoor harvested every credential on the machine — ... Kubernetes secrets ...
Lateral Movement
1 technique
Lateral Movement
If stage 1 finds a Kubernetes service account token... it deploys a privileged pod to every node in the cluster... writes sysmon.py to /host/root/.config/sysmon/sysmon.py on the node
Collection
3 techniques
Collection
the Python filesystem harvester ... reads SSH keys, cloud credentials, Kubernetes configs, Docker credentials, .env files, terraform state, shell history, database configs, TLS private keys, and cryptocurrency wallets, walking multiple directories up to 6 levels deep
After an initial five-minute sleep... it enters a polling loop that contacts a command-and-control (C2) server approximately every 50 minutes.
The encrypted bundle (payload.enc + session.key.enc) is packaged as tpcp.tar.gz
Command and Control
3 techniques
Command and Control
Exfiltration domain models.litellm[.]cloud C2 domain checkmarx[.]zone
polls the ICP blockchain-hosted C2 for a second-stage payload URL, downloads it to /tmp/pglog, and executes it.
The malware downloads a persistence script to the host... The second-stage payload is fetched via checkmarx.zone/raw
Exfiltration
3 techniques
Exfiltration
The persistence script polls https://checkmarx.zone/raw every 50 minutes for additional payloads... while True ... time.sleep(3000)
The binary also exhibits the same credential-stealing behavior as the compromised action. It scans for credentials, bundles them, encrypts them, and then exfiltrates the data via a post request.
The primary exfiltration channel is an HTTPS POST to scan.aquasecurtiy[.]org... If the endpoint returns a non-2XX response and INPUT_GITHUB_PAT is available, the script falls back to exfiltrating through GitHub itself. It will create a public repository named tpcp-docs under the victim's GitHub account, create a timestamped release, and upload the encrypted bundle as a release asset.
Observables
21 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.