Threat Research

TeamPCP Compromises Microsoft’s DurableTask PyPI Package to Deploy Multi-Stage Credential Theft Malware

Executive Summary:

Our analysis identified three malicious versions (1.4.1, 1.4.2, and 1.4.3) of Microsoft’s DurableTask Python package published on PyPI. The compromised packages contained malicious code embedded within multiple __init__.py files, enabling automatic execution whenever the package was imported. By leveraging a trusted open-source package, the attackers gained an effective distribution mechanism capable of targeting developer workstations, cloud environments, and CI/CD ecosystems.

The embedded code downloads and executes a second-stage payload, rope.pyz, from attacker-controlled infrastructure. Analysis of the payload revealed a sophisticated and modular credential harvesting framework designed to collect sensitive information from a wide range of enterprise technologies, including AWS, Azure, Google Cloud Platform (GCP), GitHub, Kubernetes, HashiCorp Vault, and popular password managers. The malware also harvests locally stored secrets such as SSH keys, Docker credentials, environment files, VPN configurations, and authentication tokens.

Beyond credential theft, the malware incorporates multiple capabilities intended to maintain access and increase operational resilience. These include Systemd-based persistence, environment and geolocation checks, encrypted command-and-control (C2) discovery through the FIRESCALE mechanism, and multiple exfiltration fallback channels. Our analysis also identified geo-targeted destructive functionality capable of deleting files on systems that match specific regional criteria, significantly increasing the potential impact of compromise.

Analysis of the campaign infrastructure revealed that the secondary command-and-control (C2) domain, t.m-kosche[.]com, overlaps with infrastructure previously associated with TeamPCP’s Mini Shai-Hulud campaign. The same threat actor has been linked to several high-profile software supply chain compromises targeting organizations and open-source projects throughout 2026, including TanStack, Mistral AI, LiteLLM, and AntV. Based on the observed infrastructure overlap, malware functionality, and tradecraft similarities, we assess with high confidence that the DurableTask compromise is part of the broader TeamPCP supply chain operation.

The breadth of credential sources targeted by the malware indicates a strong focus on gaining access to cloud infrastructure, development environments, source code repositories, and privileged secrets. The compromise of DurableTask represents another significant addition to TeamPCP’s rapidly expanding supply chain campaign and demonstrates the continued effectiveness of abusing trusted software ecosystems to achieve large-scale credential theft and downstream compromise.

In this report, we examine the infection chain, persistence mechanisms, credential collection modules, command-and-control infrastructure, exfiltration techniques, and detection opportunities associated with the malicious DurableTask packages, providing defenders with the technical insights needed to identify and respond to potential compromise.

Fig 1 : Malicious package was later removed by PyPI

Fig 1 : Malicious package was later removed by PyPI

Fig 2 : Malware Setup contains url belongs to TeamPCP

Fig 2 : Malware Setup contains url belongs to TeamPCP

Fig 3 : Collector Module

Fig 3 : Collector Module

Research Overview

As part of our threat research efforts, we analyzed the malicious DurableTask package versions published on PyPI and performed a detailed examination of the associated second-stage payload (rope.pyz). Our investigation focused on execution flow, persistence mechanisms, credential theft capabilities, command-and-control communications, and exfiltration behavior.

The findings presented in this report are based on static analysis of the malicious package contents and the retrieved payload components.

Key Findings

Affected Versions

  • DurableTask 1.4.1
  • DurableTask 1.4.2
  • DurableTask 1.4.3

Key Capabilities

  • Multi-stage malware delivery
  • Systemd-based persistence
  • GitHub token theft
  • Cloud credential harvesting
  • Kubernetes secret collection
  • Vault token theft
  • Password manager credential extraction
  • Multi-channel data exfiltration
  • Geo-targeted destructive functionality

Primary Targets

  • AWS environments
  • Azure environments
  • Google Cloud environments
  • GitHub accounts
  • Kubernetes clusters
  • HashiCorp Vault deployments
  • Developer workstations

Attack Overview

The attack begins when a victim installs one of the compromised DurableTask package versions.

The attackers modified multiple package initialization files (__init__.py) to ensure malicious code execution whenever the package is imported. Upon execution, the malicious code retrieves a second-stage payload (rope.pyz) from attacker-controlled infrastructure and launches it locally.

The second-stage payload performs environment validation checks, establishes persistence, collects credentials from multiple sources, and exfiltrates the harvested data using several fallback mechanisms.

Attack Chain

  1. Installation of malicious DurableTask package
  2. Execution of modified __init__py
  3. Download of rope.pyz
  4. Environment and geolocation checks
  5. Systemd persistence creation
  6. Credential collection
  7. Exfiltration to attacker-controlled infrastructure
  8. GitHub-based fallback communication

Stage 1: Initial Payload Delivery

The malicious package contains injected code within multiple initialization files:

  • durabletask/entities/__init__.py
  • durabletask/extensions/__init__.py
  • durabletask/payload/__init__.py
  • durabletask/extensions/azure_blob_payloads/__init__.py
  • durabletask/__init__.py

When imported, the malicious code downloads a second-stage payload from:

  • hxxps://check.git-service[.]com/rope.pyz

The payload is written to:

  • /tmp/managed.pyz

and subsequently executed using Python.

By embedding the malicious code within initialization files, the attackers ensure execution occurs automatically during normal package usage without requiring user interaction.

Fig 4 : Stage 1 payload _init_.py

Fig 4 : Stage 1 payload _init_.py

Stage 2: Environment Validation

The downloaded payload performs several checks before proceeding with execution.

Analysis of the __main__.py module shows validation logic that evaluates:

  • Operating system type
  • System language settings
  • CPU availability

Systems matching predefined exclusion criteria are prevented from continuing execution. Such checks are commonly used to avoid execution in analyst environments, automated sandboxes, or specific geographic regions.

Fig 5 : Checking System,Language and CPU count

Fig 5 : Checking System,Language and CPU count

Fig 6 : _main_.py launching entrypoint module

Fig 6 : _main_.py launching entrypoint module

Persistence and Geolocation Logic

Systemd-Based Persistence

The malware establishes persistence through Systemd service creation.

The persistence logic determines whether the process is running under a privileged account and generates appropriate service definitions to ensure execution following system reboot.

This mechanism provides long-term access to compromised systems.

Fig 7 : Python deployment and Persistence mechanism

Fig 7 : Python deployment and Persistence mechanism

Geolocation Checks

The malware performs additional checks using:

  • LANG
  • LC_ALL
  • LC_MESSAGES
  • System timezone information

The code specifically evaluates indicators associated with Israel and Iran.

Fig 8 : Checking if Israel System

Fig 8 : Checking if Israel System

Destructive Functionality

Our analysis identified destructive logic capable of deleting files from systems that match specific regional conditions.

While the primary objective of the malware appears to be credential theft, the inclusion of destructive capabilities significantly increases the potential impact of compromise.

Organizations operating in affected regions should consider this functionality when assessing exposure and incident response requirements.

Fig 9 : Geo Targeted destruction

Fig 9 : Geo Targeted destruction

GitHub Token Theft and Abuse

The malware searches harvested data for GitHub Personal Access Tokens (PATs), including patterns such as:

  • ghp_
  • github_pat_

Recovered tokens are used to authenticate directly to the GitHub API.

Our analysis shows the malware can create repositories under victim-owned GitHub accounts, providing attackers with an alternative mechanism for data storage, communication, or operational persistence.

Fig 10 : Github token theft and public repository creation

Fig 10 : Github token theft and public repository creation

Fig 11 : Displays Github Repository created

Fig 11 : Displays Github Repository created

FIRESCALE Fallback Mechanism

The malware implements a resilient command-and-control discovery mechanism referred to internally as FIRESCALE.

Rather than relying exclusively on hardcoded infrastructure, the malware searches GitHub commit messages containing specially formatted FIRESCALE markers. These markers contain Base64-encoded and cryptographically signed infrastructure information.

After validating the embedded signature using a hardcoded public key, the malware extracts a trusted fallback command-and-control address.

This design allows attackers to rotate infrastructure while maintaining communication with infected systems.

Fig 12 : FIRESCALE Fallback

Fig 12 : FIRESCALE Fallback

Data Exfiltration

Collected information is converted into JSON format and transmitted to attacker-controlled infrastructure using HTTP POST requests.

The malware implements multiple fallback mechanisms to maximize exfiltration reliability. If the primary communication channel becomes unavailable, the malware attempts alternate destinations, including GitHub-based methods.

Fig 13 : Sending JSON Data to a Remote Server via HTTP POST

Fig 13 : Sending JSON Data to a Remote Server via HTTP POST

Credential Harvesting Framework

The malware contains a modular collection framework designed to aggregate credentials from multiple enterprise platforms and development environments.

The collection process prioritizes exfiltration through:

  1. Primary C2 infrastructure
  2. Secondary infrastructure
  3. FIRESCALE-discovered infrastructure
  4. GitHub-based fallback channels

Fig 14 : Credential Aggregator

Fig 14 : Credential Aggregator

Here Credential aggregator is checking and requesting for Early quarantine URL from config.py, if response is 200 then reads and decodes the payload. Decoded payload then it will send to roulette.collect

Fig 15 : Collecting Credential from all sources

Fig 15 : Collecting Credential from all sources

Fig 16 : Credential aggregator completed

Fig 16 : Credential aggregator completed

Cloud Credential Collection

The malware contains dedicated modules targeting cloud infrastructure credentials and authentication tokens across AWS, Azure, and Google Cloud environments. The collected credentials can provide attackers with direct access to cloud resources, management interfaces, and sensitive workloads.

AWS Credential Theft

AWS Instance Metadata Service (IMDS) Collection

The malware attempts to retrieve temporary credentials from AWS EC2 Instance Metadata Service (IMDS). When an IAM role is attached to an EC2 instance, the malware can obtain:

  • Access Key IDs
  • Secret Access Keys
  • Session Tokens

Compromising these credentials allows attackers to authenticate as the instance role and access AWS resources according to assigned permissions.

Fig 17 : AWS Credentials

Fig 17 : AWS Credentials

AWS Profile and Configuration Harvesting

Beyond IMDS, the malware searches local AWS configuration and credential files to extract:

  • Named profiles
  • Access keys
  • Secret keys
  • Session tokens
  • Region information

These credentials may provide broader access than instance roles and enable lateral movement across AWS environments.

Fig 18 : Profiles and Regions

Fig 18 : Profiles and Regions

AWS Systems Manager Enumeration

The malware contains functionality for interacting with AWS Systems Manager (SSM). Analysis shows it constructs authenticated requests to regional SSM endpoints and processes returned responses.

This capability may allow attackers to enumerate managed systems or leverage compromised credentials for additional reconnaissance.

Fig 19 : AWS System Manager (SSM)

Fig 19 : AWS System Manager (SSM)

Consolidated AWS Credential Collection

The malware aggregates discovered AWS credentials and profile information into a centralized structure for subsequent exfiltration.

Fig 20 : Collection of Profile names, Access key id, secret key, tokens

Fig 20 : Collection of Profile names, Access key id, secret key, tokens

Password Manager Credential Theft

The malware specifically targets password managers commonly used by developers and administrators, including:

  • 1Password
  • Bitwarden
  • Pass
  • Gopass

Successful compromise of these platforms may expose credentials beyond the initially infected system.

Environment and History File Discovery

The malware searches environment variables and shell history files for password-related artifacts.

Fig 21 : Discovering Password from Environments and History files

Fig 21 : Discovering Password from Environments and History files

Password Manager Unlock Attempts

The malware attempts to leverage available CLI tools to unlock password vaults and recover stored secrets.

Fig 22 : Unlocking password manager Bitwarden and onepassword

Fig 22 : Unlocking password manager Bitwarden and onepassword

Fig 23 : Unlocking gpg password manager

Fig 23 : Unlocking gpg password manager

Password Extraction

Recovered credentials are aggregated and prepared for exfiltration.

Fig 24 : Password extraction from gopass

Fig 24 : Password extraction from gopass

Fig 25 : Password extraction from onepassword

Fig 25 : Password extraction from onepassword

Fig 26 : Password extraction from botwarden

Fig 26 : Password extraction from botwarden

Azure Credential Theft

Azure Token Collection

The malware collects Azure authentication artifacts from:

  • Azure CLI cache
  • Environment variables
  • Azure Instance Metadata Service

These tokens may allow attackers to access Azure subscriptions and resources.

Fig 27 : Azure Access tokens

Fig 27 : Azure Access tokens

Azure Subscription and Key Vault Enumeration

The malware attempts to identify:

  • Azure subscriptions
  • Key Vault instances
  • Stored secrets

Successful collection may expose sensitive credentials, certificates, and application secrets.

Fig 28 : Subscription ID, Key Vaults and Secrets of key vaults

Fig 28 : Subscription ID, Key Vaults and Secrets of key vaults

Consolidated Azure Credential Collection

Collected Azure tokens and associated metadata are aggregated for exfiltration.

Fig 29 : Collection of all azure tokens

Fig 29 : Collection of all azure tokens

Google Cloud Credential Theft

The malware targets Google Cloud credentials from:

  • GOOGLE_APPLICATION_CREDENTIALS
  • Application Default Credentials (ADC)
  • Google Cloud metadata services

Recovered access tokens may provide direct access to cloud workloads and services.

Fig 30 : Tokens from Google cloud platforms

Fig 30 : Tokens from Google cloud platforms

Kubernetes Secret Collection

The malware attempts to collect Kubernetes secrets through multiple access methods:

  • kubectl
  • kubeconfig files
  • In-cluster service accounts

The code also contains logic suggesting potential access to additional pods and cluster resources.

Compromise of Kubernetes secrets may expose application credentials, service account tokens, certificates, and cloud access keys.

Fig 31 : Kubernetes secrets

Fig 31 : Kubernetes secrets

Filesystem-Based Credential Collection

The malware consolidates sensitive information from numerous local sources, including:

  • SSH keys
  • Docker credentials
  • GitHub configuration files
  • Environment files
  • VPN configurations

This module acts as a centralized collector for locally stored secrets.

Fig 32 : Filesystem

Fig 32 : Filesystem

Fig 33 : Central Collector

Fig 33 : Central Collector

HashiCorp Vault Credential Theft

The malware attempts to retrieve Vault authentication tokens through multiple methods:

  • Environment variables
  • Local token files
  • AppRole credentials
  • Vault CLI

Successful compromise may provide access to centrally managed enterprise secrets.

Fig 34 : Vault Authentication Tokens

Fig 34 : Vault Authentication Tokens

It attempts to obtain a Vault authentication token from environment variables, local token files, AppRole credentials, or the Vault CLI.

Indicators of Compromise (IOCs)

Affected Package Versions

Package Version
DurableTask 1.4.1
DurableTask 1.4.2
DurableTask 1.4.3

Malicious Domains

  • git-service.com
  • m-kosche.com

Malicious URLs

  • hxxps://check.git-service.com/rope.pyz
  • hxxps://t.m-kosche.com/rope.pyz
  • hxxps://check.git-service.com/v1/models
  • hxxps://check.git-service.com/api/public/version

File Artifacts

Artifact Description
/tmp/managed.pyz Downloaded second-stage payload executed by the compromised package

SHA256 Hashes

File SHA256
__init__.py. 219c72d7955b6e1341e527bfca83d29d91feac6ae192529ec8798aa5325e4618
rope.pyz 069ac1dc7f7649b76bc72a11ac700f373804bfd81dab7e561157b703999f44ce

 

MITRE ATT&CK Mapping

Technique ATT&CK ID
Supply Chain Compromise T1195
Ingress Tool Transfer T1105
Systemd Service Persistence T1543.002
Credentials from Password Stores T1555
Credentials in Files T1552.001
Steal Application Access Token T1528
System Location Discovery T1614
Exfiltration Over C2 Channel T1041
Data Destruction T1485

Detection Opportunities

Endpoint Detection

Monitor for:

  • Python execution from /tmp
  • Creation of new Systemd service files
  • Execution of cloud administration tools by Python processes
  • Access to cloud metadata services

Network Detection

Monitor communications involving:

  • git-service[.]com
  • m-kosche[.]com

Investigate outbound HTTP POST requests containing large JSON payloads originating from developer systems.

Threat Hunting Opportunities

Hunt for:

  • New Systemd service creation
  • GitHub repository creation events
  • Cloud metadata access from developer workstations
  • Enumeration of cloud credentials
  • Unauthorized access to Kubernetes secrets

How Gurucul Can Help

SIEM Correlation

Gurucul SIEM can correlate package installation activity, Python execution, cloud credential access, persistence creation, and outbound communications to identify potentially compromised systems.

UEBA

Behavioral analytics can identify anomalous access to cloud resources, GitHub repositories, Kubernetes environments, and Vault deployments originating from developer workstations.

IOC Monitoring

Known domains, URLs, hashes, and infrastructure indicators associated with the campaign can be continuously monitored to identify compromise activity.

Threat Hunting

Threat hunters can proactively search for persistence artifacts, credential harvesting behavior, GitHub token abuse, and suspicious cloud administration activity.

Incident Investigation

Gurucul can correlate process, network, authentication, and cloud telemetry to reconstruct the attack chain and assess the scope of credential exposure.

Conclusion

Our investigation of the malicious DurableTask packages revealed a sophisticated multi-stage supply chain attack targeting cloud-native and developer-centric environments. Beyond credential theft, the malware incorporates persistence mechanisms, multi-cloud credential collection, GitHub token abuse, Kubernetes and Vault targeting, resilient command-and-control discovery, and geo-targeted destructive functionality.

The breadth of credential sources targeted by the malware indicates a strong focus on gaining access to cloud infrastructure, development environments, and privileged secrets. Organizations that installed the affected package versions should conduct a thorough compromise assessment, rotate exposed credentials, and review access to cloud, GitHub, Kubernetes, and Vault environments.

This incident highlights the continued risk posed by software supply chain attacks and reinforces the need for dependency monitoring, package validation, and continuous detection capabilities across developer ecosystems.

Contributors:

 

Abhishek Samdole

Abhishek Samdole

Rudra Pratap

Rudra Pratap

Advanced cyber security analytics platform visualizing real-time threat intelligence, network vulnerabilities, and data breach prevention metrics on an interactive dashboard for proactive risk management and incident response