加密货币挖矿正在杀死CI免费服务

{"type":"doc","content":[{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"由于加密货币挖矿攻击,LayerCI、GitLab、TravisCI 以及 Shippable 等等 CI 提供商都在收紧或关闭其免费服务。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"2020 年 9 月,GitLab 宣布免费 CI 产品将限制使用;两个月之后,TravisCI 也宣布对“重大滥用”采取类似的限制措施。为什么这些 CI 厂商都会限制免费 CI 产品的使用呢?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"深挖其背后原因,我们发现这些变化都与可挖矿加密货币的市值猛增有关。随着加密货币的市值从 2021 年 1 月的 1900 亿美元,激增至 2021 年 4 月的 2 万亿美元,一些企图从可挖矿加密货币获利的不良开发者将目光转向了平台提供商的免费 CI 服务。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/81\/810320123c2a3eb1f5649fd44bbb90d1.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"加密货币市值激增"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"加密货币矿工如何在 LayerCI 平台“薅羊毛”?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在 LayerCI 平台,开发者可以通过创建每个分支的预览环境并自动运行端到端测试来构建全栈网站。由于之前,开发者可以在 LayerCI 的服务器上运行任意代码,因此经常有人违反 LayerCI 服务条款来挖掘加密货币。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"用户名为“ testronan”的开发者,是 Flask 的狂热用户,他们几乎每一个小时就会提交一次 GitHub 存储库:testronan \/ MyFirstRepository-Flask。高产的程序员一般都会确保他们的代码能够得到良好的测试,因此我们发现他的存储库包含了五个不同的 CI 服务:TravisCI,CircleCI,GitHub Actions,Wercker 和 LayerCI。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"仔细观察他的 CI 任务,我们发现这些 CI 任务看似是在运行 shell 脚本,实际运行的却是“listen.sh”,一个将复杂的 NodeJS 脚本和一些看似随机数结合在一起的 shell 脚本:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"perl"},"content":[{"type":"text","text":"(sleep 10; echo 4; sleep 2; echo \"tex.webd\";sleep 2; echo 7; sleep 1; echo 1; sleep 1; echo \"exit\"; sleep 2) | stdbuf -oL npm run commands\n\"; sleep 2) | stdbuf -oL npm run commandsundefined\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"拨开迷雾,我们发现 MyFirstRepository-Flask 与 Flask 或 Web 服务器无关,它是将 WebDollars 发送到匿名地址的加密货币挖掘脚本。这些数字对应 WebDollar 的 NodeJS 实现的安装选项。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"该存储库不是直接攻击 GitHub,而是滥用 GitHub action 的“ cron”功能来每小时创建一个新提交,并在其他四个 CI 提供程序上挖掘 WebDollars。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"接收这些 coin 的两个钱包地址是:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.webdscan.io\/address\/WEBD%24gBJhmuwat3kvP2@%EF%BC%85232E4K2zXX967grh9L43%EF%BC%8524","title":"","type":null},"content":[{"type":"text","text":"https:\/\/www.webdscan.io\/address\/WEBD%24gBJhmuwat3kvP2@%232E4K2zXX967grh9L43%24"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.webdscan.io\/address\/WEBD%24gCszFRxzuMDbyNXnCXszoB2aIMSuV9kgbb%24","title":"","type":null},"content":[{"type":"text","text":"https:\/\/www.webdscan.io\/address\/WEBD%24gCszFRxzuMDbyNXnCXszoB2aIMSuV9kgbb%24"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"利用浏览器自动化来挖矿"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“ vippro99”开发者的做法就没有“testronan”那么巧妙,数十个存储库几乎大部分都与加密货币或浏览器自动化有关。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"nodejs-monney 存储库包含了各种脚本,可以通过 Google 流行的 puppeteer 项目启动 chrome 实例。他的逻辑很简单,如果直接在 CI 中挖掘加密货币是很容易被检测到的,而浏览器自动化是 CI 中常见的功能,刚好可以用它来掩盖。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"typescript"},"content":[{"type":"text","text":"puppeteer.launch({ headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox', '--window-size=500,500', '--user-agent=Mozilla\/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/89.0.4389.90 Safari\/537.36' ] }).then(async browser => {\n console.log('-- Running chrome!!');\n const page = await browser.newPage();\n await page.goto('https:\/\/vippro99.github.io\/-meocoder-nodejs-tool\/index.html');\n page.on('console', (msg) => console.log(msg.text()));\n await page.waitForTimeout(((Math.floor(Math.random() * 6) + 52) * 60) * 1000);\n await browser.close();\n})\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"据悉,该账户目前正在攻击 JFrog 的 Shippable CI 服务。我们在 Shippable 官网看到这样一则通知:“Your Shippable service will expire on May 3rd, 2021.”不知道这个决定是否与加密货币挖矿有关。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“ vippro99”提供的信息表明他们是在越南, 以 Monero 的当前价格,加密货币矿工在 Shippable 上的每个实例每月可以获得 2.5 美元,只需要维护 60 个并发实例就可以与该国的全职薪资相当。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"加密货币和 CI 服务商是如何应对“薅羊毛”的?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"针对以上这些花样百出的“薅羊毛”操作,加密货币和 CI 服务商是如何应对的呢?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"最近,以太坊(Ethereum)宣布计划完全禁用基于计算的挖矿来获取新以太坊的方式,完全转向 proof-of-stake (POS) validation model。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"而 CI 服务商的解决办法基本都是收紧或者关闭免费服务。2020 年 10 月 1 日开始,GitLab.com 免费层上每个顶级组(或个人命名空间)的 CI \/ CD 使用时长减少到每月 400 分钟,超出部分会以每 1000 分钟 10 美元的价格收费,开发者也可以自己升级到付费基本;2020 年 11 月 1 日开始,TravisCI 重新制定了定价规则,对于拥有 1、2、或 5 个并发计划的构建定价不变,基于 macOS 构建者的需要额外购买附加组件,同时也发布了新的基于使用情况的定价规则。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"参考链接:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https:\/\/layerci.com\/blog\/crypto-miners-are-killing-free-ci\/"}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章