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&lt;--&gt;IP)</th>
<th>MAPPING(IP&lt;--&gt;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--&gt;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]) &lt;&lt; 8)
  if n:
    s+= ord(data[i+1])
  while (s &gt;&gt; 16):
    s = (s &amp; 0xFFFF) + (s &gt;&gt; 16)
  s = ~s &amp; 0xffff
  return s
</code></pre>
<h6 id="step2c2bot2timesthefirst32bytesthesecond12bytes">Step 2: C2--&gt;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--&gt;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--&gt;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---&gt;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"}