Skip to content

Instantly share code, notes, and snippets.

@bishopZ
Last active December 15, 2015 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bishopZ/5277478 to your computer and use it in GitHub Desktop.
Save bishopZ/5277478 to your computer and use it in GitHub Desktop.
The Stagecoach Hack
The Stagecoach Hack was inspired by this quotation:
"Plus it was rumored that hackers for big media companies had figured out a way
to get through the defenses that were built into such systems, and run junk
advertisements in your peripheral vision (or even sprang in the fucking middle)
all the time - even when your eyes were closed. Bud knew a guy like that who'd
somehow gotten infected with a meme that ran advertisements for roach motels, in
Hindi, superimposed on the bottom right-hand corner of his visual field,
twenty-four hours a day, until the guy whacked himself."
-- Neal Stephenson, Diamond Age, pg 39
Technically, the Stagecoach Hack is based on the ability to control an HTML page
from the browser console or by injecting Javascript into the page.
Injecting a line like:
document.body.innerHTML = ''
will completely make a page disappear and the hacker could then input anything they
want onto the page. However, completely replacing the content of page would defeintely
alert the viewer that something strange has happened.
The Stagecoach Hack in jQuery:
$('body').html($('<iframe>').attr('src',window.location));
$('iframe').css({height:'100%',width:'100%'});
One could then overlay the original HTML with additional content:
$('body').append($('<h1 style="position:absolute;top:0;">').html('Yo'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment