Slashdot Mirror


First Ever Malvertising Campaign Uses JavaScript To Mine Cryptocurrencies In Your Browser (bleepingcomputer.com)

An anonymous reader writes from a report via Bleeping Computer: Malware authors are using JavaScript code delivered via malvertising campaigns to mine different cryptocurrencies inside people's browsers (mostly Monero), without their knowledge. The way crooks pulled this off was by using an online advertising company that allows them to deploy ads with custom JavaScript code. The JavaScript code is a modified version of MineCrunch (also known as Web Miner), a script released in 2014 that can mine cryptocurrencies using JavaScript code executed inside the browser. Cryptocurrency mining operations are notoriously resource-intensive and tend to slow down a user's computer. To avoid raising suspicion, crooks delivered malicious ads mainly on video streaming and browser-based gaming sites (currently mostly Ukrainian and Russian sites). Both types of sites use lots of resources, and users wouldn't get suspicious when their computer slowed down while accessing the site. Furthermore, users tend to linger more on browser games and video streaming services, allowing the mining script to do its job and generate profits for the crooks.

22 of 70 comments (clear)

  1. I block all advertising on the web by Anonymous Coward · · Score: 2, Informative

    So this doesn't affect me.

  2. Got to say by Anonymous Coward · · Score: 5, Informative

    Genius.

    Despite being one of the causes of adblocker proliferation it's a nice change from the usual destructive malware in ads.

    Must admit I've never really understood why advertising companies allow advertisers to run potentially unsafe code via their network. Surely it reflects badly on them and I'm too ignorant to understand the need for custom code with an advert.

    1. Re:Got to say by AmiMoJo · · Score: 3, Insightful

      But how much currency can it mine?

      How long are ads displayed for? Probably not long in most cases. Many browsers, especially Chrome, throttle Javascript or even stop it running entirely to save energy when the user isn't interacting with the page. And Javascript isn't exactly known for its high performance when it comes to maths.

      A lot of processing will be wasted. Anything that ends before the minimum work unit that can be saved is complete is lost.

      If they are mining a popular currency the chances are Javascript running on a CPU will to too slow to earn anything significant. If they are mining a less popular currency it is now tainted by malware and unlikely to ever be worth much.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    2. Re:Got to say by Nutria · · Score: 5, Insightful

      And Javascript isn't exactly known for its high performance when it comes to maths.

      That was my first thought. People spend so much on top-tier GPUs for mining, and these guys go for JS.

      I bet the malware guys are using this as a proof-of-concept for something else.

      --
      "I don't know, therefore Aliens" Wafflebox1
    3. Re:Got to say by Cederic · · Score: 2

      But how much currency can it mine?

      Does it matter? Fuck all multiplied a couple of million times can become a chunky number. As long as it's more than the cost of the advertising (which may be near zero if it's charged by click-through) then they profit.

      How long are ads displayed for? Probably not long in most cases. Many browsers, especially Chrome, throttle Javascript or even stop it running entirely to save energy when the user isn't interacting with the page. And Javascript isn't exactly known for its high performance when it comes to maths.

      That'll be why they targeted pages that users interact with for tens of minutes (up to hours).

    4. Re:Got to say by TheRaven64 · · Score: 3, Interesting

      I've noticed that a lot of web sites now cause my browser to ask me if I trust them to run WebGL code for no obvious reason (I don't, because I've worked on GPU drivers, and there's no way I'd trust them with potentially malicious code, even if it has had some token WebGL verification). JavaScript is fairly slow, but WebGL and WebCL let JavaScript run shader code on your GPU.

      Most cryptocurrency mining is probabilistic: you only win on average by having the most compute, each step involves trying a possible solution and hopefully getting lucky. If you try enough solutions in parallel, you'll probably find the correct one before anyone else. Even if each person only gives you 30 seconds of GPU time, that's still a lot if you can infect a few million people.

      I seem to recall a browser-based game a few years ago that used this exact business model: as you play the game, it mined bitcoin in the background on your GPU, which paid for the game.

      --
      I am TheRaven on Soylent News
    5. Re:Got to say by AmiMoJo · · Score: 2

      WebGL is mostly used for tracking. The sites render some text and graphics and slight variations in your system make the result semi-unique, and combined with other factors can be used to identify your browser as your move from site to site.

      As such, I disable WebGL entirely. I also use CanvasFingerprintBlock for the same reason.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    6. Re:Got to say by geekmux · · Score: 3, Insightful

      And Javascript isn't exactly known for its high performance when it comes to maths.

      That was my first thought. People spend so much on top-tier GPUs for mining, and these guys go for JS.

      I bet the malware guys are using this as a proof-of-concept for something else.

      How many people have a JS enabled-browser installed vs. how many people have top-tier GPUs installed?

      The performance all comes down to volume. And with Bitcoin valued at over $3000, I doubt that something else needs be a motivator.

    7. Re:Got to say by nehumanuscrede · · Score: 2

      What they lack in quality, they make up for in quantity.

      "Furthermore, users tend to linger more on browser games and video streaming services, allowing the mining script to do its job and generate profits for the crooks."

      Stick this code on any porn site or any high-traffic video site and consider how many folks stop by.

    8. Re:Got to say by Nutria · · Score: 2

      The performance all comes down to volume.

      And ratios: how many JS miners do you need to equal a current (affordable) GPU card, combined with -- as AniMoJo first mentioned -- the fact that when you stop browsing, any partial work disappears. That's really a killer.

      --
      "I don't know, therefore Aliens" Wafflebox1
    9. Re:Got to say by geekmux · · Score: 2

      The performance all comes down to volume.

      And ratios: how many JS miners do you need to equal a current (affordable) GPU card, combined with -- as AniMoJo first mentioned -- the fact that when you stop browsing, any partial work disappears. That's really a killer.

      And yet can you imagine the performance if legitimate companies that offer streaming services (Netflix,YouTube, etc.) embedded JS mining as a "feature" on their sites?

      The world never stops browsing, which is why volume matters.

    10. Re:Got to say by angel'o'sphere · · Score: 3, Interesting

      Could have answered to you plus + answer ;D
      But here it fits better.

      First of all: JavaScript is since a decade no longer as slow as people think. Nearly all browsers optimize it and jit compile it to assembly.

      Secondly: http://gpu.rocks/

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    11. Re:Got to say by angel'o'sphere · · Score: 2

      Asm.js is a library that implements a simple virtual cpu and the opcodes to execute on that CPU.
      The idea is that the jit compiler can compile simple real asm instructions from that. The other idea is that language designers can compile to asm.js instructions.
      That is in no way faster than writing the code you want in standard JavaScript.

      You confused by the word "asm" in asm.js :D

      Anyway, in the long run the developers of asm.js hope that JavaScript engines will be "asm.js aware" and realize that they can treat it special and compile to a more optimized native asm, than they would compile "ordinary JavaScript"

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    12. Re:Got to say by geekmux · · Score: 3, Insightful

      I'll repeat again: when you stop browsing, any partial work disappears.

      The world never stops browsing, but people do.

      This is exactly why I mentioned streaming services. You can probably get some considerable crunching done when the word "binge" is often used to describe browser session times. Wouldn't be surprised one bit if the next YouTube/Netflix app upgrade comes with a few extra lines of JS.

      On top of that, I'll give it about another HFT micro-second before someone realizes the value of breaking up JS cryptomining assignments into 60-second chunks to try and counteract that "partial" work problem, and take advantage of this distributed mining model. Or perhaps they'll wrap this around something that is always running in the background; you've only got about 1,000 opportunities to do this with Win10 telemetry services...

  3. Re:Don't run javascript. by JaredOfEuropa · · Score: 2

    It has its uses. But it has absolutely no business being used in ads, just like other Javascript over which the site owner has no control. I wish blocking 3rd party Javascript by default was an option, but that pretty much breaks all of the Internet.

    --
    If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
  4. Let's replace adverts with this. by Anonymous Coward · · Score: 3, Interesting

    Why can't websites replace adverts with this, working for them?

    That seems like a perfect way to get micro-transactions in a website without any micro-transaction having to occur, and it scales with time spent on the website.

    1. Re:Let's replace adverts with this. by thereitis · · Score: 2

      For one thing, it will kill the user's mobile/laptop battery.

  5. Could we find a legitimate use for this idea? by 91degrees · · Score: 4, Interesting

    Micropayments have never caught on because they're a pain to deal with. People might be willing to spend some of their CPU time though. They don't object too much to doing the millions of operations required for a few seconds of video (the objection is more the annoyance of the video itself)

    I suspect CPU time is not valuable enough to make this sort of thing viable but maybe I'm wrong.

    1. Re:Could we find a legitimate use for this idea? by hord · · Score: 4, Interesting

      There are tons of distributed projects where people donate CPU time. It has value for communities of people that like to work on common computational goals. Examples are SETI, distributed.net, and folding@home. Here is Wikipedia's list:

      https://en.wikipedia.org/wiki/...

      I ran a Pentium 200MHz overclocked to 250MHz for several years straight (along with many other machines) trying to crack RC5-64 years ago. Lots of fun.

    2. Re:Could we find a legitimate use for this idea? by 91degrees · · Score: 4, Interesting

      Yup, and those are great. I approve of the aspirational ideals.

      But I'm thinking of the more commercial aspects. For example, while I have no complaints about CGI movies, I'm not going to donate my CPU time to help make one. A company might be willing to pay me a fraction of a cent for rendering a few pixels though. I don't want that fraction of a cent. I do, however, want to be able to read websites without annoying popup ads. The website owner, with thousands of impressions per page per day would like that fraction of a cent for each page.

      So the computer animation company pays the website some money to run a few seconds rendering time on my PC. I get the web-page for a negligible increase in power costs, and the computer animation company gets some pixels. Multiply that by a few hundred thousand users. They all get the information they want, the computer animation company gets several frames rendered, and the website owner gets money.

  6. Re: Crooks? by Boutzev · · Score: 5, Insightful

    If an ad runs on your computer without authorization - it uses your computer's resources too. Is that somehow different just because ads waste less resources than mining ? What about a mining script that uses less ressources than the standard video ad - would they still be crooks ?

    While I don't agree with anyone running code on a user's station without authorization, there isn't much difference between this and a common ad. Both should be illegal if you ask me. But if those guys are crooks - then what would Google Adwords be ?

  7. Shame on the ad network by cdwiegand · · Score: 3, Insightful

    What advertising network? They should be known, publicly shamed, and every website operator should know not to do business with them.

    Honestly, I wish there was a way for me to report an ad that's violating browser rules. I hate when I go to a real newspaper site that uses ads, and I get served an ad that takes over the whole window, hiding stuff behind, but there's no way for me, on my phone / tablet, to know who served the ad or report the ad placement. Makes me want to block all ads everywhere on my personal devices and networks, but THAT comes with issues because many sites and even many mobile apps refuse to function if they can't talk to the ad networks and/or Google/Adobe/etc..

    --
    . Define sqrt(x) as something really evil like (x / rand()), and bury it deep. Watch your coworkers go nuts.