{"id":2072,"date":"2024-09-25T11:19:18","date_gmt":"2024-09-25T11:19:18","guid":{"rendered":"https:\/\/xdr-mdr.lmntrix.com\/main_web\/?p=2072"},"modified":"2025-07-29T03:17:48","modified_gmt":"2025-07-29T03:17:48","slug":"analysis-of-apt19-campaign","status":"publish","type":"post","link":"https:\/\/lmntrix.com\/blog\/analysis-of-apt19-campaign\/","title":{"rendered":"Analysis of APT19 Campaign"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"886\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/post-featured-img-1024x886.webp\" alt=\"APT19 Call Graph - Taking over a windows service\" class=\"wp-image-2073\"\/><\/figure>\n\n\n\n<p>APT19 is a threat group based out of China, they have targeted a variety of industries, including defense, finance, energy, pharmaceutical, telecommunications, high tech, education, manufacturing, and legal services. In 2014, APT19 was responsible for the Forbes.com breach. APT19 threat group was able to chain together two zero day vulnerabilities, one against Adobe\u2019s Flash Player and one against Microsoft\u2019s Internet Explorer, to compromise the popular news website in late 2014.<\/p>\n\n\n\n<p>In 2017, a phishing campaign was used by the APT19 threat group to target seven law and investment firms. The APT19 threat group made use of obfuscated PowerShell macros embedded within Word documents generated by Empire. Some analysts track APT19 and Deep Panda as the same group owing to the overlap in toolkit and code re-use, but it is unclear from public sources, if these two groups are the same.<\/p>\n\n\n\n<p><strong>Targets:<\/strong> North America, Australia<\/p>\n\n\n\n<p><strong>Motivation:<\/strong> Intelligence \/ Espionage Operations<\/p>\n\n\n\n<p><strong>Toolkit:<\/strong> Derusbi Backdoor, Poison Ivy, Empire framework and Cobalt Strike (payload)<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Static Analysis of APT19 Campaign<\/strong><\/h3>\n\n\n\n<p>Sample Information<\/p>\n\n\n\n<p>SHA256 : DE33DFCE8143F9F929ABDA910632F7536FFA809603EC027A4193D5E57880B292<\/p>\n\n\n\n<p>Filetype : DLL<\/p>\n\n\n\n<p>Attack&nbsp;&nbsp;&nbsp; : Chinese APT19 attack<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p>It is possibly compiled in Microsoft Visual C++<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"516\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/00_APT19_MSVC_Compiled-1-1024x516-1.webp\" alt=\"\" class=\"wp-image-2074\"\/><\/figure>\n\n\n\n<p>File we are analyzing with ref: APT19 is a DLL file,<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"170\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/01_APT19_DLL_File-1024x170-1.webp\" alt=\"\" class=\"wp-image-2075\"\/><\/figure>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p>Interesting Strings we observed during analysis are given below,<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/02_APT19-Int-Strings-1024x478-1.webp\" alt=\"\" class=\"wp-image-2076\"\/><\/figure>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p>Malicious process uses the GetTickCount API call to compute a random string consisting of 3 characters,<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"582\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/03_APT19_GetTickCount-1024x582-1.webp\" alt=\"\" class=\"wp-image-2077\"\/><\/figure>\n\n\n\n<p>APT19 creates a DLL file called qlr.dll using CreateFileA,<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"591\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/04_APT19_QLR_DLL-CreateFileA-1024x591-1.webp\" alt=\"\" class=\"wp-image-2078\"\/><\/figure>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p>Next, it deletes the file\/directory using RemoveDirectoryA,<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"507\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/05_APT19_RemoveDirectory-1024x507-1.webp\" alt=\"\" class=\"wp-image-2079\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>User Impersonation<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"487\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/06_APT19_Impersonate-User-1024x487-1.webp\" alt=\"\" class=\"wp-image-2080\"\/><\/figure>\n\n\n\n<p>Here&#8217;s how the APT19 malware impersonates the logged on user,<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It determines the Process ID. Next it inherits the process handle and opens the process.<\/li>\n\n\n\n<li>It determines process privilege using GetTokenInformation.<\/li>\n\n\n\n<li>Subsequently, the malware elevates the token using parameter 0x14.<\/li>\n\n\n\n<li>To learn more visit https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/securitybaseapi\/nf-securitybaseapi-impersonateloggedonuser<\/li>\n<\/ul>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p>The malware then creates a new service named WinHelpSrv using CreateServiceA, as shown below,<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"564\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/07_APT19_WinHelpSrv_ProcCreated-1024x564-1.webp\" alt=\"\" class=\"wp-image-2081\"\/><\/figure>\n\n\n\n<p>WinHelpSrv is made persistent by adding a registry key under HKEY_CURRENT_USER &#8220;\\&#8221;C:\\Windows\\SysWOW64\\rundll32.exe\\&#8221;&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"627\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/08_APT19_WinHelpSrv_RegEntries-1024x627-1.webp\" alt=\"\" class=\"wp-image-2082\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"375\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/09_APT19_WinHelp_RegScreen-1024x375-1.webp\" alt=\"\" class=\"wp-image-2083\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Common Anti Debugging Techniques<\/strong><\/h3>\n\n\n\n<p>The malware employs a couple of well-known anti-analysis measures, including comparing the executable image path to rundll32.exe and checking for the presence of a debugger (IsDebuggerPresent). These methods enable the software to use ExitProcess to terminate itself and ensures that a threat researcher cannot execute the file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"572\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/APT19-Anti-Debug-1024x572-1.webp\" alt=\"\" class=\"wp-image-2092\"\/><\/figure>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Dynamic Analysis of APT19 Campaign<\/strong><\/h3>\n\n\n\n<p><strong>Infection Chain<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"396\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/11-15.webp\" alt=\"\" class=\"wp-image-2085\"\/><\/figure>\n\n\n\n<p>By using spam campaigns with attachments as its initial infection vectors, the APT19 malware infects the victim machine (EML). Typically, it includes RTF documents from Microsoft Office that have macro content. This time, they linked with the intended object via an external URL. Thus, the victim must perform their necessary tasks by hand. Once finished, it will carry out the action on objectives.<\/p>\n\n\n\n<p><strong>Sample Information:<br><\/strong>Sample&nbsp;&nbsp; : 76e7ce4ab6d520f0717bb0dea8ff6973e1f7c6ea39f7138a5eb5d5483fd21e21<br>File-Type: RTF<br>Category: Exploit CVE-2017-0199<br>Attack&nbsp;&nbsp;&nbsp;&nbsp; : Chinese APT19 attack<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"297\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/11_APT19-Sample-Info-1024x297-1.webp\" alt=\"\" class=\"wp-image-2084\"\/><\/figure>\n\n\n\n<p><strong>Technical Analysis of RTF:<br><\/strong>Rich Text Format (RTF) is a file format that controls how texts are formatted. It is made up of groups, control words, control symbols, and unformatted text. They are used by RTF readers to enable a specific format for the text display. RTF files can include additional information such as font style, formatting, graphics, and more in addition to plain text, which is not possible with regular text files. Since many applications support them, they are excellent for cross-platform document sharing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"414\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/12_APT19-Technical-Analysis1-1024x414-1.webp\" alt=\"\" class=\"wp-image-2086\"\/><\/figure>\n\n\n\n<p>The document features a pop-up window asking the user whether they wish to update because it contains links to other files. What this means is that this document may open or include another embedded document within an RTF file, but the user is unaware that the document was silently installed in a hidden folder.<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p><strong>On Opening the Linked Data<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"451\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/13_APT19-Technical-Analysis2-1024x451-1.webp\" alt=\"\" class=\"wp-image-2087\"\/><\/figure>\n\n\n\n<p>Once linked, the user has access to the document. However, they are unaware that the object is linked to an external unknown or hidden document.<\/p>\n\n\n\n<p><strong>Actual file content:<br><\/strong>Rich Text Format (RTF) files are typically used by threat actors&nbsp;to store exploits that target flaws in Microsoft Office and other software.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"526\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/14_APT19-Actual-File-Content-1024x526-1.webp\" alt=\"\" class=\"wp-image-2088\"\/><\/figure>\n\n\n\n<p><strong>HTTP Request:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"229\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/15_APT19-HTTP-Request1-1024x229-1.webp\" alt=\"\" class=\"wp-image-2089\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"523\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/16_APT19-HTTP-Request2-1024x523-1.webp\" alt=\"\" class=\"wp-image-2090\"\/><\/figure>\n\n\n\n<p>When the RTF file is opened, the macro runs a payload that was extracted to the user&#8217;s TEMP directory. Although the executable files are deleted when the Word instance is closed, the RTF files created by the macro in the temp directory could remain and be used as a host indicator during triage or response activities. APT19 sends a&nbsp;HTTP request to ensure that the target&nbsp;system has internet access (or is&nbsp;active) before proceeding with the&nbsp;attack.<\/p>\n\n\n\n<p><strong>Malicious Actions Performed<\/strong>,<\/p>\n\n\n\n<p>APT19 used a watering hole attack on specified domain to compromise the targets.<\/p>\n\n\n\n<p>APT19&nbsp;concealed&nbsp;PowerShell&nbsp;code,&nbsp;possibly&nbsp;from&nbsp;the&nbsp;Empire&nbsp;framework&nbsp;-W&nbsp;Hidden&nbsp;by&nbsp;setting&nbsp;the&nbsp;Window-Style&nbsp;parameter&nbsp;to&nbsp;hidden,&nbsp;and&nbsp;launched&nbsp;a&nbsp;HTTP&nbsp;malware&nbsp;variant&nbsp;and&nbsp;a&nbsp;Port&nbsp;22&nbsp;malware&nbsp;variant&nbsp;using&nbsp;a&nbsp;legitimate&nbsp;executable&nbsp;that&nbsp;loaded&nbsp;the&nbsp;malicious&nbsp;DLL.<\/p>\n\n\n\n<p><strong>General Mitigation measures&nbsp;to&nbsp;prevent APT19<\/strong>,<\/p>\n\n\n\n<p>If you do not trust the resource, do not open any attachments from external users.<br>Do not open any URLs from unknown senders.<br>Protect exposed web applications with web application firewalls, and close unnecessary firewall ports for the network and individual devices.<br>Use strong passwords and make Multi Factor Authentication, an organization wide habit<br>Maintain effective Endpoint Detection &amp; Response applications such as (antivirus, EDR) and NDR, monitor your e-mails, and secure your email servers, when in doubt, opt for a compromise assesment to truly know the security posture of your network.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Indicators of Compromise \u2013 IOC to detect APT19 Attack<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>SHA256<\/td><\/tr><tr><td>76e7ce4ab6d520f0717bb0dea8ff6973e1f7c6ea39f7138a5eb5d5483fd21e21<\/td><\/tr><tr><td>68205817faa46e7217c4a624b8c316c7ffce5775f3afe703f90c039fd1817076<\/td><\/tr><tr><td>01f3d36e17d60fc9a15014c50f373917b52b0b2214acf03798f21df94911f562<\/td><\/tr><tr><td>660cc12c20eda8f6ded1f718c6bdfc04b49a50e0077fb60c5e599e061f6ea0f9<\/td><\/tr><tr><td>545e4242eef69954dde30e547a070b276458b874a8ad8f521ffb30f4590ba6c5<\/td><\/tr><tr><td>d54b720511091c47a46b69ba5ef86d49dc3570f89206c8984beae53274d04145<\/td><\/tr><tr><td>4f544e8756373520e98ed12b921ea7e05a93cf0152405ef3ac65133f7c8660a1<\/td><\/tr><tr><td>0f6ea6af97edfafe33d0506bdf06443e05063815088ed7db302c54b6e8d26bf2<\/td><\/tr><tr><td>9011380f1a01314d06bf0af030dc9017b63089c115fce0d1bca69610318e017b<\/td><\/tr><tr><td>c56900f2454bb99d8fd41b72f6e4ceb9506018c650bc55a21dd395af0f6c849e<\/td><\/tr><tr><td>bd1d090cdf03216acf14b63c14ae1d77bb404f4cbbeefa83476c8ad69da33abe<\/td><\/tr><tr><td>aad51dc7d7dc75acb6529b5b56fd11075a779e2cf31a35af6b1e2b7af07f8dcd<\/td><\/tr><tr><td>6cd9d6d2a12e7685a7be49ae9d74711e5ce9e0e0442b775bea4a8ab6b6daa758<\/td><\/tr><tr><td>a4bb89cf05e78be24852c60fb39e39a83bb2c3da732b734ff09902e776d1e0cc<\/td><\/tr><tr><td>d9a0331ad039f45f847de28f03f0a676b295a201aa9bfd285949e326c6bf76bb<\/td><\/tr><tr><td>ec22e09730bd3ad539494ad67bb7c1d9e90d8da455d5f59427b5ebc610872fca<\/td><\/tr><tr><td>b7f7948a0b20370719628196382c5411cb5e10de22dc2785aa8ed110a98bf5f6<\/td><\/tr><tr><td>5c3a3771b7f5545469fa1f34bb19a4e41e5401b774c2c7ec10e3301400cf6027<\/td><\/tr><tr><td>18fd49a43d48331fd8063a4f5c40f26aebcfd5e473a36b157ac75a5a2587017f<\/td><\/tr><tr><td>572af23e8b39462e13c498fda6c8a33eb5e71517430867382d3f0b25da94886e<\/td><\/tr><tr><td>432960ff01678dbb0c031797a19f6bd00345cad8a06f1d671e0c152429442e52<\/td><\/tr><tr><td>ff5d8c92cdb853c4c7f7a6db775043626f376e37bf4352b009654bc48d7458ef<\/td><\/tr><tr><td>cd1a9ae4a3968643a6fb41b36b67838d952dac83ad63c63ce4ad3c672fac31b8<\/td><\/tr><tr><td>023e3270a88183958db7e49602227b010c6e75d9874f4d950ce7f5d3c356186f<\/td><\/tr><tr><td>c94bd7e24f227bf8fd6aadf643f7bfcf8269c235397248587f62cdd312d022c3<\/td><\/tr><tr><td>e458afd353ca233062f54efbaee7130dba3b26edc48d2abfbaa42d9fa26e4be2<\/td><\/tr><tr><td>67730f05990a640d2c683be532447f7cd525e9f2ec24dcedac45a56d309c6462<\/td><\/tr><tr><td>61a6d8c1e9ff2a1d6e171af64646b3d621f58d4fb2f8c7a1612a1be988de6cae<\/td><\/tr><tr><td>5cb20922b57f49768105b4700d58718595a6f371d11219cabb67a25a4e2b516d<\/td><\/tr><tr><td>b7fe639178efce76fb21bf29fa7909582c2dfe40e602994f9f046a5604ce24f1<\/td><\/tr><tr><td>be05deaf61e674469c268671d72ed3326d55a6f06fe9a18da68592689fa4b9be<\/td><\/tr><tr><td>88315e270faa82146bd3d612c14d500c0daaaf7cc6d5c4feb1136cd08cc54bf1<\/td><\/tr><tr><td>52061b89eea6713279a56c1d0075b94c2dbda96772592271b9200c81a0941426<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">MITRE ATT&amp;CK Mapping for APT19<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"463\" src=\"https:\/\/lmntrix.com\/blog\/wp-content\/uploads\/2024\/09\/17_APT19-MITRE-Mapping-1024x463-1.webp\" alt=\"\" class=\"wp-image-2091\" style=\"width:840px;height:auto\"\/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>APT19 is a threat group based out of China, they have targeted a variety of industries, including defense, finance, energy, pharmaceutical, telecommunications, high tech, education, manufacturing, and legal services. In 2014, APT19 was responsible for the Forbes.com breach. APT19 threat group was able to chain together two zero day vulnerabilities, one against Adobe&rsquo;s Flash Player [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2073,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-2072","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-labs"],"_links":{"self":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts\/2072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/comments?post=2072"}],"version-history":[{"count":3,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts\/2072\/revisions"}],"predecessor-version":[{"id":4202,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/posts\/2072\/revisions\/4202"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/media\/2073"}],"wp:attachment":[{"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/media?parent=2072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/categories?post=2072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lmntrix.com\/blog\/wp-json\/wp\/v2\/tags?post=2072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}