deepMiner —— 本质上类似coinhive,也是后端开启nodejs连接矿池,默认的连接门罗币矿池
1 2 3 4 5 6 7 8 9 | { "lhost": "localhost", "lport": 7777, "domain": "domain.com", "pool": "pool.supportxmr.com:3333", "addr": "41ynfGBUDbGJYYzz2jgSPG5mHrHJL4iMXEKh9EX6RfEiM9JuqHP66vuS2tRjYehJ3eRSt7FfoTdeVBfbvZ7Tesu1LKxioRU", "pass": "x", "cryp": false } |
这个是默认的nodejs后台配置,可以看到是xmr挖矿!!!
deepMiner
- deepMiner (idea like coinhive.js) By evil7@deePwn
- Working on XMR(Monero) and ETN(Electroneum) personal wallet
- Eazy way mining in browsers & Nice payback than Ad-inject
- Goodbye Coinhive. You opened a new view for Web-Object + Blockchains.
Supports
- And All coins who follow
cryptoNight
/cryptoNight v7 & v8 / cryptoNight R
&& pool connect inJSONRPC2
- Some coins used cryptoNote https://cryptonote.org/coins/ (example: Monero / Electroneum /Sumokoin / Aeon ...)
- The whitebook:
cryptoNight.txt
andcryptoNight.md
. Come from: https://cryptonote.org/standards/ - Technology: https://cryptonote.org/inside/
Usage
Add some javascript and write like this :
<script src="https://your_domain.com/lib/deepMiner.min.js"></script>
<script>
var miner = new deepMiner.Init('miner_name');
miner.start();
</script>
Testing notes
As now say. we only can have 25H/s maybe in the browsers (i7-4GHz/16G-RAM) because the cryptonight R updated.
And that's why people called "hardless to mining" in browsers.
And it's why the Coinhive choose closed too.
But by the way. If you can have 100USER/24H always online or running a online vedio website with 5k or 1M users and staying over 1h?
Maybe you can get a nice payback more than 1$ every day. (25H/s/day/100Users = 1$ now).
So as you see. you can just do learn JS something with this repo. Or do another develping with it. Or do build a fee system more than Ad injection.
Development
cd deepMiner && npm install && npm start
all wasm source files in cryptonight-wasm
server.js for srv side (webSocket<>tcpSocket)
web/lib/
|__ worker.js the worker to create hash job
|__ deepMiner.js the main of all should add in web
| (used `npm i -g minify` and running `minify deepMiner.js > deepMiner.min.js` if min file you need)
|__ cryptonight.js/.wasm come from emcc building. if in dev you can checking and rebuilding from folder: cryptonight-wasm
Install
curl https://raw.githubusercontent.com/deepwn/deepMiner/master/install.sh > install.sh
sudo sh install.sh
lib request: *nodejs
/ *npm
/ ?nginx
useful pakages: forever
ssl support: https://certbot.eff.org/ / https://acme.sh/
OS tested on: ubuntu(debian)
API Document (come from Coinhive and have some rebuild on it)
- Not Support ASMJS in this master release
You can use events in your page, to handling the HTML with mining status.
<script>
// Listen on events
miner.on('found', function() { /* Hash found */ })
miner.on('accepted', function() { /* Hash accepted */ })
// Update stats once per second
setInterval(function() {
var hashesPerSecond = miner.getHashesPerSecond();
var totalHashes = miner.getTotalHashes();
var acceptedHashes = miner.getAcceptedHashes();
console.table({
"hashesPerSecond":hashesPerSecond,
"totalHashes":totalHashes,
"acceptedHashes":acceptedHashes});
// Output to HTML elements...
}, 1000);
</script>
new deepMiner.Init( [site, options] )
site : New a miner, that you can add a siteID / nameID or some string for Identify.
options : threads / throttle
E.g.:
var miner = new deepMiner.Init(document.location.host, {
autoThreads: true
});
miner.start();
.start( [mode] )
mode: deepMiner.IF_EXCLUSIVE_TAB / deepMiner.FORCE_EXCLUSIVE_TAB / deepMiner.FORCE_MULTI_TAB
E.g.:
miner.start(deepMiner.IF_EXCLUSIVE_TAB);
.stop( )
Stop mining and disconnect from the pool.
.isRunning( )
Returns true|false whether the miner is currently running: connected to the pool and has working threads.
.isMobile( )
Returns true|false whether the user is using a phone or tablet device. You can use this to only start the miner on laptops and PCs.
.hasWASMSupport( )
Returns true|false whether the Browser supports WebAssembly. If WASM is not supported, the miner will automatically use the slower asm.js version. Consider displaying a warning message to the user to update their browser.
.getNumThreads( )
Returns the current number of threads. Note that this will report the configured number of threads, even if the miner is not yet started.
.setNumThreads( numThreads )
Set the desired number of threads. Min: 1. Typically you shouldn't go any higher than maybe 8 or 16 threads even if your users have all new AMD Threadripper CPUs.
.getThrottle( )
Returns the current throttle value.
.setThrottle( throttle )
Set the fraction of time that threads should be idle. A value of 0 means no throttling (i.e. full speed), a value of 0.5 means that threads will stay idle 50% of the time, with 0.8 they will stay idle 80% of the time.
.getHashesPerSecond( )
Returns the total number of hashes per second for all threads combined. Note that each thread typically updates this only once per second.
.getTotalHashes( [interpolate] )
Returns the total number of hashes this miner has solved. Note that this number is typically updated only once per second.
.getAcceptedHashes( )
Returns the number of hashes that have been accepted by the pool. Also see the accepted event.
.on( event, callback(params) { } )
Specify a callback for an event.
event | description |
---|---|
optin | The user took action on the opt-in screen (AuthedMine only). The params.status is either "accepted" or "canceled". See below for an example. |
open | The connection to our mining pool was opened. Usually happens shortly after miner.start() was called. |
authed | The miner successfully authed with the mining pool and the siteKey was verified. Usually happens right after open. In case the miner was constructed with CoinHive.Token, a token name was received from the pool. |
close | The connection to the pool was closed. Usually happens when miner.stop() was called or the CoinHive.Token miner reached its goal. |
error | An error occured. In case of a connection error, the miner will automatically try to reconnect to the pool. |
job | A new mining job was received from the pool. |
found | A hash meeting the pool's was found and will be send to the pool. |
accepted | A hash that was sent to the pool was accepted. |
WASM sources
All sources in folder cryptonight-wasm.
You need install Emscripten first, and run ./build.sh
to make this wasm file up.
the build.sh
will help you build it and copy the new one to ./web/lib
.
How to Update
Just cd to /srv/deepMiner
run git pull
Don't forget backup your config.json
at first.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
2021-07-20 linux Capabiltiy 示例——以前只有root和普通用户两种权限,root的权限太大了,现在有了cap,可以细分让某持续有单个权限而非所有特权,见下示例
2021-07-20 MineMeld ——一个IoC情报整合和分享工具,里面有一些专门做情报生产的组织,你只要订阅就可以了
2021-07-20 威胁情报的“结构化”“可机读”—TAXII标准,感觉这东西好水啊,没有STIX好用
2020-07-20 基于威胁情报的攻击组织画像与溯源——样本中提取PDB开发路径,进而关注到“neeru”等一些有特殊意义的用户名,然后去社交网站上找人名,关联黑客论坛作者信息,邮件等
2020-07-20 一种应用于网络安全领域的用户画像方法——查友商专利可以到 https://www.tianyancha.com/spatent/29951690-5ac1
2020-07-20 手把手教你做用户画像——标签数据开发:用户画像工程化的重点模块,包含统计类、规则类、挖掘类、流式计算类标签的开发,标签相关数据可存储在Hive、MySQL、HBase、Elasticsearch等数据库中
2020-07-20 腾讯用户画像——如何为QQ画像和代理IP画像