Tinkering with CryptoMining

If you are in SecOps, you probably have seen the threat of CryptoMiners running on compromised hosts. This article may not be for you, but if you would like to dive deeper inside of the working of crypto-mining you will find a few resources here to get you started.

For the example I use the Moonlander 2 ASIC USB stick as you can pick one up form Amazon for as little as $50 as of March 2020, and it has all the features needed to work with a Raspberry PI. It allows to mine LTC (Litecoin.org).

sudo apt-get install -y build-essential git autoconf automake libtool pkg-config libcurl4-openssl-dev libudev-dev libusb-1.0-0-dev libncurses5-dev raspberrypi-kernel-headers
cd
mkdir miners
cd miners
sudo unzip Linux_3.x.x_4.x.x_VCP_Driver_Source.zip
cd Linux_3.x.x_4.x.x_VCP_Driver_Source
make
sudo cp -a cp210x.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial

Another example is the GekkoScience Bitcoin SHA256 Stick Miner, which lets you test how to mine BTC (bitcoin.org). 

I use the Raspberry PI, as it is a very low cost environment you can build with your children at a very young age. You can do a lot more with it then just teaching about Bitcoin, Blockchain, and mining.

The resources below have all the documentation necessary to get started.

The Moonlander device tends to lock up after a successful run with bfgminerand the miner isn’t detected on successive runs with the status message: 

------------------------------------------
NO DEVICES FOUND: Press 'M' and '+' to add
------------------------------------------

The solution is to remove the driver (cp120x) and unplug / plug back in the USB stick:

  1. sudo rmmod cp120x
  2. unplug USB stick
  3. wait 10 seconds
  4. plug USB stick back in
  5. check if the driver is re-registered by running lsmod | grep usb the output should look like
    usbserial XXXXX X cp210x

Resources

Raspberry Pi 4 on Amazon

Olimex

Moonlander 2 USB Stick ASIC on Amazon

Moonlander 2 USB Stick getting started instructions

Moonlander  ASIC setup on linux

VCP kernel drivers

GekkoScience Bitcoin Miner Setup on Linux / Raspberry Pi

GekkoScience Termius R606 Miner Setup

Raspberry PI dependencies for building kernel modules

ASIC Miner Valuation estimations

US made ASIC miner

Best GPUs for mining ETH

 

Interested? Click here to contact us for a free consultation →