Bitsquatting: One Bit Flip to Rule Them All
This talk demonstrates the practical application of bitsquatting, a technique where attackers register domain names that are a single bit flip away from legitimate, high-traffic domains to intercept DNS requests. The researchers show how this technique can be used to capture sensitive data, including OAuth tokens and credentials, by setting up catch-all email and web servers on the squatted domains. The presentation highlights the risks of relying on DNS for security and provides a custom tool, 'Certainly', to automate the identification and exploitation of these bit-flip opportunities. The talk concludes with a call for further research into the correlation between cosmic rays and DRAM errors, as well as the need for better defensive measures like certificate pinning.
Bitsquatting: How One Bit Flip Can Compromise Your Entire Auth Flow
TLDR: Bitsquatting exploits hardware-level DRAM errors to intercept DNS requests by registering domains that differ from high-traffic targets by a single bit. This research demonstrates how attackers can capture sensitive data like OAuth tokens and credentials by setting up catch-all infrastructure on these squatted domains. Pentesters should integrate these techniques into their reconnaissance phases to identify potential interception points in client-side traffic.
Hardware reliability is a myth we tell ourselves to sleep better at night. We assume that when a CPU writes a value to memory, it stays there until we tell it otherwise. But cosmic rays, faulty hardware, and thermal fluctuations don't care about our assumptions. They cause bit flips in DRAM, and when those flips happen in the context of a DNS request, the results are catastrophic for security.
The research presented at Black Hat 2024 on bitsquatting isn't just a theoretical exercise in hardware instability. It is a practical, high-impact attack vector that turns the infrastructure of the internet against itself. By identifying domains that are a single bit flip away from major services, an attacker can effectively "catch" traffic that was never intended for them.
The Mechanics of the Flip
At its core, bitsquatting relies on the fact that domain names are just strings of bytes. If a client machine experiences a bit flip while resolving a domain, the resulting DNS query might point to a completely different, attacker-controlled server.
Consider the domain wordpress.com. In binary, a single bit flip in the character 'w' can transform the request into gordpress.com. If an attacker registers gordpress.com, they can set up a catch-all DNS and web server to intercept any traffic that "accidentally" arrives there due to a memory error on the client side.
The researchers behind this work released a tool called Certainly, which is designed to automate the identification and exploitation of these opportunities. It functions as a multi-domain authoritative DNS server that handles the heavy lifting of issuing on-the-fly X.509 certificates. This is critical because modern browsers and applications will immediately terminate a connection if the TLS handshake fails. By generating valid certificates for the squatted domains in real-time, the attacker ensures the client application remains oblivious to the interception.
From Interception to Credential Theft
Capturing the DNS request is only the first step. The real value lies in what happens next. By configuring the squatted domain to act as a proxy or a sinkhole, an attacker can collect a massive volume of data.
During their research, the team observed millions of DNS requests and thousands of HTTPS requests hitting their infrastructure. The data included sensitive OAuth tokens, session cookies, and even cleartext credentials. When a client application attempts to perform an OAuth dance, it might inadvertently send the authorization code or token to the squatted domain.
If you are performing a red team engagement, you can use bf-lookup to identify which of your target's subdomains are susceptible to bitsquatting. The tool calculates all possible bit-flip variations of a given domain and checks their availability. If you find a high-traffic domain that is available, you have a perfect, low-noise channel for data exfiltration or credential harvesting.
The Defensive Reality
Defending against bitsquatting is notoriously difficult because the issue originates at the hardware level, outside the control of the application developer. However, the research points toward a few necessary mitigations.
The most effective defense is strict Certificate Pinning, which ensures that the client application only communicates with a server presenting a specific, pre-defined certificate. If an attacker tries to intercept the connection with a dynamically generated certificate, the pinning check will fail, and the connection will be dropped.
Additionally, developers should move away from relying on standard DNS resolution for sensitive internal traffic. Using hardcoded IP addresses or authenticated DNS-over-HTTPS (DoH) can reduce the window of opportunity for an attacker to spoof the resolution process.
What Comes Next
This research serves as a stark reminder that our security models often ignore the physical reality of the hardware running our code. We spend our time auditing application logic and network protocols, yet we leave the door wide open for environmental factors to bypass our controls entirely.
If you are a researcher, the next step is to move beyond simple observation. We need more data on the correlation between cosmic radiation, DRAM quality, and the frequency of these bit flips in production environments. If you are a pentester, start looking at your target's infrastructure through the lens of bit-level manipulation. The next time you see a strange, intermittent connection failure during a test, don't just dismiss it as a network glitch. It might be the first sign that you have found a path to the target's most sensitive data.
The tools are out there. The infrastructure is cheap. The only thing left is to see how many more "accidental" domains are waiting to be claimed.
Vulnerability Classes
Attack Techniques
OWASP Categories
All Tags
Up Next From This Conference
Similar Talks

Kill List: Hacking an Assassination Site on the Dark Web

Hacking Millions of Modems




