Quickjack: How Clickjacking Attacks Work Under the Hood
Hook
The most dangerous click you'll ever make might be one you intended—just not on the website you thought you were clicking.
Context
Clickjacking, also known as UI redressing, has plagued web security since its public disclosure in 2008. The attack is deceptively simple: overlay an invisible iframe containing a legitimate site over attacker-controlled content, trick users into clicking what they think is a harmless button, and capture those clicks for malicious purposes. Early clickjacking attacks required tedious manual positioning of iframes and careful social engineering to align victim clicks with specific targets like "Delete Account" or "Authorize Payment" buttons.
Quickjack emerged from security researcher Samy Kamkar's work to demystify these attacks by creating a point-and-click interface that makes sophisticated clickjacking and frame slicing accessible to security researchers, penetration testers, and developers who need to understand the threat model. Rather than wrestling with CSS opacity values and iframe positioning logic, Quickjack provides a visual builder that generates production-ready attack payloads. While modern browsers and security headers have significantly mitigated these vulnerabilities, understanding Quickjack's internals remains valuable for anyone building or securing web applications—particularly when dealing with legacy systems or embedded content scenarios where frame protection might be deliberately disabled.
Technical Insight
Quickjack's architecture reveals three particularly clever technical solutions to challenges that make clickjacking difficult to execute manually. The first and most ingenious is its cross-origin click detection mechanism. Since JavaScript can't monitor click events inside a cross-origin iframe (the same-origin policy prevents this), Quickjack instead monitors for window blur events—the moment when focus leaves the parent window:
window.addEventListener('blur', function() {
// Window lost focus, likely because user clicked the iframe
clickDetected = true;
logClickAttempt(lastMouseX, lastMouseY);
// Optional: redirect or modify page state
if (attackConfig.redirectOnClick) {
setTimeout(function() {
window.location = attackConfig.redirectURL;
}, attackConfig.delay);
}
});
This blur-based detection is brilliant because it sidesteps same-origin restrictions entirely. When a user clicks inside the iframe, focus shifts from the parent window to the iframe, triggering the blur event. Combined with continuous mouse position tracking, Quickjack knows exactly where the user intended to click and can log it, trigger subsequent attack phases, or redirect the victim. This technique works even when the attacker has zero access to the iframe's internal DOM or events.
The second architectural insight is Quickjack's dynamic iframe positioning system. Rather than statically placing an iframe and hoping users click the right spot, Quickjack implements a mouse tracking system that continuously repositions the iframe to follow the cursor:
var targetIframe = document.getElementById('attack-frame');
var offsetX = 200; // Position button 200px from cursor
var offsetY = 50;
document.addEventListener('mousemove', function(e) {
// Position iframe so target element appears under cursor
targetIframe.style.left = (e.pageX - offsetX) + 'px';
targetIframe.style.top = (e.pageY - offsetY) + 'px';
});
The offset values are configured through Quickjack's GUI, where you visually identify the target element you want users to click (like a "Delete Account" button), and Quickjack calculates the necessary offsets to position that element precisely under the cursor. This dynamic approach dramatically increases attack success rates because the attacker doesn't need to predict where users will click—the vulnerable button literally follows their mouse everywhere on the page.
Quickjack's third key innovation is frame slicing for sophisticated social engineering. Traditional clickjacking overlays entire pages, which can appear suspicious. Frame slicing extracts small portions of a target site to create convincing composite attacks. The tool allows you to specify exact pixel coordinates to display, effectively cutting out a slice of the iframe:
<div style="width: 300px; height: 50px; overflow: hidden; position: relative;">
<iframe
src="https://targetsite.com/profile"
style="position: absolute;
width: 1200px;
height: 800px;
left: -450px;
top: -120px;
opacity: 1;"
scrolling="no">
</iframe>
</div>
By using negative positioning and a cropped container, this technique displays only a specific region of the iframe—perhaps just the user's name from their profile page. An attacker could combine this slice with their own content: "Welcome back, [User's Real Name from sliced iframe]! Click here to claim your reward!" The appearance of knowing the victim's name (extracted live from another site they're logged into) creates a powerful social engineering vector that makes the attack page appear legitimate.
Quickjack also includes frame-busting evasion techniques, though these are largely defeated in modern browsers. Historical frame-busting JavaScript looked like if (top !== self) { top.location = self.location; }, attempting to break out of iframes. Quickjack would counter with the sandbox attribute (<iframe sandbox="allow-forms allow-scripts">) which prevents navigation of the top-level window, or by using the deprecated security="restricted" attribute in older IE versions. While these evasions no longer work reliably, they illustrate the cat-and-mouse game between attackers and defenders that ultimately led to X-Frame-Options and CSP frame-ancestors headers.
The tool generates complete, deployable HTML payloads with optional features like referrer scrubbing (using <meta name="referrer" content="no-referrer"> to hide the attack page origin), double-iframe techniques to bypass certain protections, and configurable opacity levels for testing versus production attacks. For security researchers, Quickjack provides an interactive laboratory for understanding how these techniques compose into effective attacks.
Gotcha
The harsh reality is that Quickjack's practical effectiveness against modern websites is severely limited. The X-Frame-Options header (DENY or SAMEORIGIN) and the more flexible Content Security Policy frame-ancestors directive have become standard security practices, and any properly configured site will refuse to load inside an iframe entirely. When you attempt to frame a protected site, browsers simply won't render it—you'll get a blank iframe, and the attack fails before it starts. Major platforms like Facebook, Google, banking sites, and most professionally developed web applications implement these headers by default.
Additionally, browser vendors have patched the frame-busting evasion techniques that Quickjack relies on. The sandbox attribute, for instance, now has nuanced behaviors that make it less useful for attackers, and modern browser security models include specific protections against UI redressing attacks. Even the blur-based click detection, while still functional, becomes less reliable with newer browser features like tab isolation and process-per-site architectures. Testing Quickjack against a random selection of Alexa top 100 sites would likely result in 90%+ failure rates simply due to standard security headers.
This doesn't render Quickjack worthless—it remains valuable for testing legacy applications, internal tools that may have deliberately disabled frame protection for legitimate embedding purposes, or as an educational resource for understanding attack mechanics. But anyone expecting to use it as a practical penetration testing tool against contemporary targets will be disappointed. The tool is essentially frozen in time, representing a snapshot of web security circa 2013-2015, before protective headers became ubiquitous.
Verdict
Use if: You're conducting security training or need to demonstrate clickjacking vulnerabilities to stakeholders who respond better to visual demonstrations than theoretical explanations. Quickjack excels at creating convincing proof-of-concept attacks for legacy applications without proper frame protection, and it's invaluable for understanding the historical evolution of web security defenses. It's also useful if you're auditing internal tools or embedded widget scenarios where X-Frame-Options might be intentionally permissive. Skip if: You need current penetration testing tools for assessing modern web applications, as the overwhelming majority of properly configured sites will resist these attacks entirely through standard security headers. Also skip if you're looking for maintained, actively developed security tools—Quickjack hasn't seen significant updates and represents techniques that browsers and frameworks now defend against by default. For contemporary security work, invest time in understanding CSP bypasses, modern XSS vectors, or authentication flaws that remain relevant today.