Code Monkey home page Code Monkey logo

coinjack's Introduction

CoinJack - Extension to HiJack/control the CoinHive web miner

Please Read: You are not going to get rich off of using this. Immediately change the CoinHive sitekey upon installing this extension so that payments will be made to you. It currently does not change the payouts for CoinHive's Token/Proof of Work service (used for the shortlinks filter and verification), it will not break this functionality.

Get it

Chrome Extension Firefox Extension

Currently working on porting to Opera

What is this?

This is a browser extension that allows you to HiJack and control the miners that are being used by websites in place of ads. At the moment it only supports hijacking the CoinHive web miner. You can enter in your own CoinHive key, which will replace the site's key, and any mining done will be accredited to your CoinHive account, instead of the site you are visiting. It provides a simple UI that allows you to see if and which pages are using the CoinHive mining software and how well they are mining for you, and lets you start/stop them.

CoinJack Screenshot

How to use

Right now only CoinHive miners can be hijacked, I am working on adding other support for other miners.

First, go over to CoinHive.com and make an account. Then go to your Settings > Site & Api Keys, create a site, and then copy the Public Key and place into the textbox on the extension popup page (click the CoinJack extension button in your toolbar). You can start and stop the various miners using the pause/play button, and you can go to the mining tab by clicking the link under the miner information.

How it works

I experimented with a few different options, but this is how it ended up.

When a page request's CoinHive's mining script, coinhive.min.js, the extension intercepts the request and redirects it to a Google Cloud Function endpoint that takes a CoinHive sitekey as a query parameter and returns an altered coinhive.min.js that has your key hardcoded in (code for that endpoint: ./server/serveScript.js). Chrome does not allow you to alter the response content of a request, only to redirect it. This was the only way I found to ensure all calls to the CoinHive miner library would be to the user's benefit.

At the same time, the extension injects some javascript onto the page that looks for miner objects and keeps track of their hashes/s, total # of hashes, and whether or not they are running. Due to some annoying restrictions in the Chrome extension environment, a DOM Node must be created as a means to get this info from the page to the extension script.

ToDo

  • Add support to control other miners
  • Add support for other browsers
    • Opera
    • Firefox - can directly edit script response in FF

coinjack's People

Contributors

hans-strudle avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.