Banner click inside Javascript src

Discussion in 'Black Hat SEO' started by micuka, Mar 9, 2014.

  1. micuka

    micuka Newbie

    Joined:
    Dec 7, 2013
    Messages:
    2
    Likes Received:
    0
    Hi,

    I am working on a project that sends traffic to another site and simulate a banner click.
    So far I am able to send traffic(and display it as a legit traffic) to another domain using the referer spoof method posted by JohnsonDaniel.

    Now, I am facing another problem. I am trying to simulate a banner click inside a javascript src tag that I receive from the advertising company. I tried to simulate a click with JQuery using this code based on the coordinates of banner, but with no success:
    Code:
    $(document.elementFromPoint(500, 1000).click());
    The code is executed on a onclick() inside a regular img tag.
    I also tried this, which simulated a click inside the iframe of the Javascript code:
    Code:
    var banner = document.elementFromPoint(1000, 500);
    if (banner instanceof HTMLIFrameElement)
       banner = banner.contentWindow.document.elementFromPoint(50, 50);
    
    Doing this resulted in complainning that I can't click on a iframe that is on a different domain.

    Can someone please advice me how can I acomplish this?

    Best regards,
    Nicolas
     
  2. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    1,001
    you can't trigger a click event on an element inside an iframe that originates from a different domain. It's called the same-origin policy and it's essentially the cornerstone of web application security.
     
    • Thanks Thanks x 2
  3. micuka

    micuka Newbie

    Joined:
    Dec 7, 2013
    Messages:
    2
    Likes Received:
    0
    Yes, after trying that I found out about same-origin policy.