Coder Social home page Coder Social logo

fezb0y1 / browser-cryptominer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from craciuncezar/browser-cryptominer

0.0 0.0 0.0 41.83 MB

๐Ÿช™ Web crypto miner client implemented using wasm and web workers. Use the CPU of the website visitors to mine monero.

Home Page: https://browser-crypto.herokuapp.com/

License: Apache License 2.0

JavaScript 61.65% TypeScript 24.90% CSS 2.27% HTML 11.10% Procfile 0.08%

browser-cryptominer's Introduction

Browser cryptominer

Browser monero crypto miner client implementation using wasm and web workers

DISCLAIMER: The demo app below will perform hash computations in order to mine cryptocurrency on my behalf, but the script is throttled so that it does not affect your device. There is no virus, and the script is ephemeral; once you leave the page, it stops working. This repository should only be used for educational purposes.

Live demo here

coin

Deploy

About

This project was one of several demonstrations I gave for my cybersecurity dissertation paper, "Browser-based fileless malware: cryptojacking and botnets." What you're looking at is a web-based crypto miner implementation.

The web client is using a wasm compiled version of cryptonight, the hashing algorithm used by monero. The reason for using this algorithm is that it is designed to rely on CPU power rather than GPU power, making it more efficient on the web. The hashing algorithm was compiled to wasm from C using emscripten and can be found in the /public directory; cn.js is a js wrapper around the binary file cn.wasm which contains the hashing function.

In order to not block the main/ui thread this app is using web workers, in theory this app should span a number of web workers equal to the number of logical processors available to run threads on the user's computer. Each web worker then is comunicating with the main thread that keeps a web socket connection to a monero mining pool (moneroocean). The connection to the mining pool is beeing proxied through a light node server, the reason behind this is to avoid detection from ad blockers or antiviruses which can block server requests to the wss://webminer.moneroocean.stream/ address.

The script files are obfuscated on the build process, this can be done on a cron job as well, this can assure that antiviruses can't banlist the file hash. There are also many ways of distributing this sort of malicious scripts one way beeing through an Iframe ad.

DISCLAIMER 2: This is a proof of concept, please don't use this for malicious purposes. There are obviously point of failures for this web app, such as the address to the proxy server that can be banned, there is also more performant ways of mining crypto on the web if thats what you are going for.

Learn more

I shared more on this topic at this page with a simple demonstration on how you can hide the malicious script behind an iframe.

Other cool resource on the same topic:

browser-cryptominer's People

Contributors

craciuncezar avatar 3kh0 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.