Figure 1. The modified Google Mobile Ads codeThe miner is started as a background service once it detects that the affected device is connected to the Internet. By default, it launches the CPU miner to connect to a dynamic domain, which then redirects to an anonymous Dogecoin mining pool. By February 17, his network of mobile miners has earned him thousands of Dogecoins. After February 17, the cybercriminal changed mining pools. The malware is configured to download a file, which contains the information necessary to update the configuration of the miner. This configuration file was updated, and it now connects to the well-known WafflePool mining pool. The Bitcoins mined have been paid out (i.e., transferred to the cybercriminal's wallet) several times.
Figure 2. Coin pool configuration codeThe coin-mining apps discussed above were found outside of the Google Play store, but we have found the same behavior in apps inside the Google Play store. These apps have been downloaded by millions of users, which means that there may be many Android devices out there being used to mine cryptocurrency for cybercriminals. We detect this new malware family as ANDROIDOS_KAGECOIN.HBTB. (As of this writing, these apps are still available.)
Figure 3. Mining Apps in Google Play
Figure 4. Download count of mining appsAnalyzing the code of these apps reveal the cryptocurrency mining code inside. Unlike the other malicious apps, in these cases the mining only occurs when the device is charging, as the increased energy usage won’t be noticed as much.
Figure 5. Cryptocurrency mining codeThe same miner configuration updating logic is also present here. Analyzing the configuration file, it seems that the cybercriminal responsible is switching into mining Litecoins.
Figure 6. Configuration file, showing switch into LiteCoin miningWe believe that with thousands of affected devices, cybercriminal accumulated a great deal of Dogecoins. Reading their app description and terms and conditions on the websites of these apps, users may not know that their devices may potentially be used as mining devices due to the murky language and vague terminology. Clever as the attack is, whoever carried it out may not have thought things through. Phones do not have sufficient performance to serve as effective miners. Users will also quickly notice the odd behavior of the miners - slow charging and excessively hot phones will all be seen, making the miner's presence not particularly stealthy. Yes, they can gain money this way, but at a glacial pace. Users with phones and tablets that are suddenly charging slowly, running hot, or quickly running out of batteries may want to consider if they have been exposed to this or similar threats. Also, just because an app has been downloaded from an app store - even Google Play - does not mean it is safe. We have informed the Google Play security team about this issue.