{"id":168594,"date":"2023-05-09T10:50:12","date_gmt":"2023-05-09T17:50:12","guid":{"rendered":"https:\/\/www.mcafee.com\/blogs\/?p=168594"},"modified":"2023-07-11T11:07:02","modified_gmt":"2023-07-11T18:07:02","slug":"guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader","status":"publish","type":"post","link":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/","title":{"rendered":"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader"},"content":{"rendered":"<p>Authored by: <span class=\"NormalTextRun SpellingErrorV2Themed SCXW238051202 BCX0\">Anandeshwar<\/span> <span class=\"NormalTextRun SCXW238051202 BCX0\">Unnikrishnan<\/span><\/p>\n<h2><span class=\"TextRun MacChromeBold SCXW62780346 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW62780346 BCX0\">Stage <\/span><span class=\"NormalTextRun SCXW62780346 BCX0\">1:<\/span> <span class=\"NormalTextRun SpellingErrorV2Themed SCXW62780346 BCX0\">GULoader<\/span><span class=\"NormalTextRun SCXW62780346 BCX0\"> Shellcode Deployment<\/span><\/span><span class=\"EOP SCXW62780346 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">In recent GULoader campaigns, we are seeing a rise in NSIS-based installers delivered via E-mail as malspam that use plugin libraries to execute the GU shellcode on the victim system. The NSIS scriptable installer is a highly efficient software packaging utility. The installer behavior is dictated by an NSIS script and users can extend the functionality of the packager by adding custom libraries (dll) known as NSIS plugins. Since its inception, adversaries have abused the utility to deliver malware.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">NSIS stands for Nullsoft Scriptable Installer. NSIS installer files are self-contained archives enabling malware authors to include malicious assets along with junk data. The junk data is used as Anti-AV \/ AV Evasion technique. The image below shows the structure of an NSIS GULoader staging executable archive.<\/span><\/p>\n<p><span data-contrast=\"auto\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-168595\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture1.png\" alt=\"\" width=\"423\" height=\"243\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture1.png 353w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture1-300x173.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture1-205x118.png 205w\" sizes=\"auto, (max-width: 423px) 100vw, 423px\" \/><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span data-contrast=\"auto\"><span class=\"TextRun SCXW164624732 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW164624732 BCX0\">The NSIS script<\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">,<\/span><span class=\"NormalTextRun SCXW164624732 BCX0\"> which is a file found in the archive<\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">, <\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">has a file extension <\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">\u201c<\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">.<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW164624732 BCX0\">nsi<\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">\u201d<\/span><span class=\"NormalTextRun SCXW164624732 BCX0\"> as shown in the image above. The deployment <\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">strategy employed by the threat actor can be <\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">studied by analyzing the NSIS script commands provided in the script file.<\/span><span class=\"NormalTextRun SCXW164624732 BCX0\"> The image shown below is an oversimplified view of the whole shellcode staging process<\/span><span class=\"NormalTextRun SCXW164624732 BCX0\">.<\/span><\/span><span class=\"EOP SCXW164624732 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/span><\/p>\n<p><span data-contrast=\"auto\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168609\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture2.png\" alt=\"\" width=\"974\" height=\"410\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture2.png 974w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture2-300x126.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture2-768x323.png 768w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture2-205x86.png 205w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\"><span class=\"TextRun SCXW146917552 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW146917552 BCX0\">The<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\"> file that holds the encoded <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW146917552 BCX0\">GULoader<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\"> shellcode is dropped on to victim\u2019s disc based on the script configuration along with other data.<\/span> <span class=\"NormalTextRun SCXW146917552 BCX0\">Junk is appended at the beginning of the encoded shellcode. <\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">The encoding style varies from sample to sample. But <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW146917552 BCX0\">in all most<\/span> <span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW146917552 BCX0\">all the<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\"> cases, <\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">it\u2019s<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\"> a simple XOR encoding<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">.<\/span> <span class=\"NormalTextRun SCXW146917552 BCX0\">As mentioned before<\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange SCXW146917552 BCX0\"><span class=\"TextRun SCXW146917552 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW146917552 BCX0\">,<\/span><\/span><\/span><span class=\"TextRun SCXW146917552 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW146917552 BCX0\"> the shellcode is appended to junk data, because of <\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">this, <\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">an <\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">offset is<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\"> used to retrieve <\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">encoded <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW146917552 BCX0\">GULoader<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\"> shellcode<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">. In the image<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">, the<\/span> <span class=\"NormalTextRun SpellingErrorV2Themed SCXW146917552 BCX0\">FileSeek<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\"> NSIS command is used to do proper offsetting. <\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">Some samples have unprotected <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW146917552 BCX0\">GULoader<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\"> shellcode appended to junk data<\/span><span class=\"NormalTextRun SCXW146917552 BCX0\">.<\/span><\/span><span class=\"EOP SCXW146917552 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/span><\/p>\n<p><span data-contrast=\"auto\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-168623\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture3.png\" alt=\"\" width=\"703\" height=\"150\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture3.png 623w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture3-300x64.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture3-205x44.png 205w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span data-contrast=\"auto\"><span class=\"TextRun SCXW212934758 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW212934758 BCX0\">A plugin used by the NSIS installer is nothing but a DLL <\/span><span class=\"NormalTextRun SCXW212934758 BCX0\">which gets loaded by the installer program at runtime and invokes functions exported by the library<\/span><span class=\"NormalTextRun SCXW212934758 BCX0\">.\u00a0<\/span> <span class=\"NormalTextRun SCXW212934758 BCX0\">Two DLL files are dropped in user\u2019s TEMP directory, in all analyzed samples one DLL has <\/span><span class=\"NormalTextRun SCXW212934758 BCX0\">a consistent name of system.dll and name of the other one varies.\u00a0<\/span><\/span><span class=\"EOP SCXW212934758 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><span class=\"NormalTextRun SCXW165084293 BCX0\">The system.dll <\/span><span class=\"NormalTextRun SCXW165084293 BCX0\">is responsible for<\/span> <span class=\"NormalTextRun SCXW165084293 BCX0\">allocating<\/span><span class=\"NormalTextRun SCXW165084293 BCX0\"> memory for the shellcode and <\/span><span class=\"NormalTextRun SCXW165084293 BCX0\">its execution.<\/span> <span class=\"NormalTextRun SCXW165084293 BCX0\">The following <\/span><span class=\"NormalTextRun SCXW165084293 BCX0\">image shows <\/span><span class=\"NormalTextRun SCXW165084293 BCX0\">how the <\/span><span class=\"NormalTextRun SCXW165084293 BCX0\">NSIS <\/span><span class=\"NormalTextRun SCXW165084293 BCX0\">script calls functions in plugin <\/span><span class=\"NormalTextRun SCXW165084293 BCX0\">libraries.<\/span><\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-168637\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture4.png\" alt=\"\" width=\"526\" height=\"186\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture4.png 503w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture4-300x106.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture4-205x73.png 205w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><span class=\"TextRun SCXW52035578 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW52035578 BCX0\">The system.dll has<\/span><span class=\"NormalTextRun SCXW52035578 BCX0\"> the<\/span><span class=\"NormalTextRun SCXW52035578 BCX0\"> following exports as shown <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW52035578 BCX0\">the in<\/span><span class=\"NormalTextRun SCXW52035578 BCX0\"> the image below. The <\/span><span class=\"NormalTextRun SCXW52035578 BCX0\">function named <\/span><span class=\"NormalTextRun SCXW52035578 BCX0\">\u201cCall\u201d <\/span><span class=\"NormalTextRun SCXW52035578 BCX0\">is being used to deploy the shellcode on victim\u2019s system<\/span><span class=\"NormalTextRun SCXW52035578 BCX0\">.<\/span><\/span><span class=\"EOP SCXW52035578 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-168651\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture5.png\" alt=\"\" width=\"586\" height=\"215\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture5.png 466w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture5-300x110.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture5-205x75.png 205w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The Call function exported by system.dll resolves following functions dynamically and execute them to deploy the shellcode.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">CreateFile \u2013 To read the shellcode dumped on to disk by the installer. As part of installer set up, all the files seen in the installer archive earlier are dumped on to disk in new directory created in C:\\ drive.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">VirtualAlloc \u2013 To hold the shellcode in the RWX memory.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">SetFilePointer \u2013 To seek the exact position of the shellcode in the dumped file.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">ReadFile \u2013 To read the shellcode.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">EnumResourceTypesA \u2013 Execution via callback mechanism. The second parameter is of the type ENUMRESTYPEPROCA which is simply a pointer to a callback routine. The address where the shellcode is allocated in the memory is passed as the second argument to this API leading to execution of the shellcode. Callback functions parameters are good resources for indirect execution of the code.\u00a0\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h2><strong><span class=\"TextRun MacChromeBold SCXW105377889 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW105377889 BCX0\">Vectored Exception Handling in <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SpellingErrorHighlight SCXW105377889 BCX0\">GULoader<\/span><\/span><span class=\"EOP SCXW105377889 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/strong><\/h2>\n<p><span data-contrast=\"auto\">The implementation of the exception handling by the Operating System provides an opportunity for the adversary to take over execution flow. The Vectored Exception Handling on Windows provides the user with ability to register custom exception handler, which is simply a code logic that gets executed at the event of an exception. The interesting thing about handling exceptions is that the way in which the system resumes its normal execution flow of the program after the event of exception. Adversaries exploit this mechanism and take ownership of the execution flow. Malware can divert the flow to the code which is under its control when the exception occurs. Normally it is employed by the malware to achieve following goals:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Hooking<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"3\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Covert code execution and anti-analysis<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">The GuLoader employs the VEH mainly for obfuscating the execution flow and to slow down the analysis. This section will cover the internals of Vectored exception handling on Windows and investigates how GUloader is abusing the VEH mechanism to thwart any analysis efforts.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">The Vectored Exception Handling (VEH) is an extension of Structured Exception Handling (SEH) with which we can add a vectored exception handler which will be called despite of our position in a call frame, simply put VEH is not frame-based.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">VEH is abused by malware, either to manipulate the control flow or covertly execute user functions.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Windows provides AddVectoredExceptionHandler Win32 API to add custom exception handlers. The function signature is shown below.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168665\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture6.png\" alt=\"\" width=\"624\" height=\"143\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture6.png 624w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture6-300x69.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture6-205x47.png 205w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/p>\n<p><span class=\"TextRun SCXW71582920 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW71582920 BCX0\">The Handler routine <\/span><span class=\"NormalTextRun SCXW71582920 BCX0\">is<\/span><span class=\"NormalTextRun SCXW71582920 BCX0\"> of the<\/span><span class=\"NormalTextRun SCXW71582920 BCX0\"> type PVECTORED_EXCEPTION_HANDLER. <\/span><span class=\"NormalTextRun SCXW71582920 BCX0\">Further checking the <\/span><span class=\"NormalTextRun SCXW71582920 BCX0\">documentation,<\/span><span class=\"NormalTextRun SCXW71582920 BCX0\"> we can see the handler function takes <\/span><span class=\"NormalTextRun SCXW71582920 BCX0\">a pointer to _E<\/span><span class=\"NormalTextRun SCXW71582920 BCX0\">XCEPTION<\/span><span class=\"NormalTextRun SCXW71582920 BCX0\">_POINTERS type<\/span><span class=\"NormalTextRun SCXW71582920 BCX0\"> as its input<\/span><span class=\"NormalTextRun SCXW71582920 BCX0\"> as shown in the image below.<\/span><\/span><span class=\"EOP SCXW71582920 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168679\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture7.png\" alt=\"\" width=\"624\" height=\"173\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture7.png 624w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture7-300x83.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture7-205x57.png 205w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"TextRun SCXW232189612 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW232189612 BCX0\">The <\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">_<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">EXCEPTION<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">_POINTERS type holds two important <\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">structures<\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange SCXW232189612 BCX0\"><span class=\"TextRun SCXW232189612 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW232189612 BCX0\">;<\/span><\/span><\/span><span class=\"TextRun SCXW232189612 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW232189612 BCX0\"> PEXCEPTION_RECORD and PCONTEXT<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">. PEXCEPTION_RECORD <\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">contains<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\"> all the information related t<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">o <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW232189612 BCX0\">exception<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\"> raised by the system like exception code <\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">etc.<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\"> and <\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">PCONTEXT structure hold<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">s<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\"> CPU register<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\"> (like RIP\/EIP<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">, debug registers <\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">etc.<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">)<\/span><span class=\"NormalTextRun SCXW232189612 BCX0\"> values or state of the thread <\/span><span class=\"NormalTextRun SCXW232189612 BCX0\">captured when exception occurred.<\/span><\/span><span class=\"EOP SCXW232189612 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168693\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture8.png\" alt=\"\" width=\"624\" height=\"137\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture8.png 624w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture8-300x66.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture8-205x45.png 205w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">This means the exception handler can access both ExceptionRecord and ContextRecord. Here from within the handler one can tamper with the data stored in the ContextRecord, thus manipulating EIP\/RIP to control the execution flow when user application resumes from exception handling.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0 \u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">There is one interesting thing about exception handling, the execution to the application is given back via NtContinue native routine. Exception dispatch routines call the handler and when handler returns to dispatcher, it passes the ContextRecord to the NtContinue and execution is resumed from the EIP\/RIP in the record. On a side note, this is an oversimplified explanation of the whole exception handling process.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Vectored Handler in GULoader<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">GULoader registers a vectored exception handler via RtlAddVectoredExceptionHandler native routine.\u00a0 The below image shows the control flow of the handler code. Interestingly most of the code blocks present here are junk added to thwart the analysis efforts.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168707\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture9.png\" alt=\"\" width=\"612\" height=\"527\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture9.png 612w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture9-300x258.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture9-150x129.png 150w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The GULoader\u2019s handler implementation is as follows (disregarding the junk code).<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Reads ExceptionInfo passed to the handler by the system.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Reads the ExceptionCode from ExceptionRecord structure.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Checks the value of ExceptionCode field against the computed exception codes for STATUS_ACCESS_VIOLATION, STATUS_BREAKPOINT and STATUS_SINGLESTEP.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Based on the exception code, malware takes a branch and executes code that modifies the EIP.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168721\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture10.png\" alt=\"\" width=\"776\" height=\"449\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture10.png 776w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture10-300x174.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture10-768x444.png 768w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture10-205x119.png 205w\" sizes=\"auto, (max-width: 776px) 100vw, 776px\" \/>\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span data-contrast=\"auto\">The GULoader sets the trap flag to trigger single stepping intentionally to detect analysis. The handler code gets executed as discussed before, a block of code is executed based on the exception code. If the exception is single stepping, status code is 0x80000004, following actions take place:<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The GULoader reads the ContextRecord and retrieves EIP value of the thread.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">\u00a0Increments the current EIP by 2 and reads the one byte from there.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Performs an XOR on the one-byte data fetched from step before and a static value. The static value changes with samples. In our sample value is 0x1A.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The XOR\u2019ed value is then added to the EIP fetched from the ContextRecord.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Finally, the modified EIP value from prior step is saved in the ContextRecord and returns the control back to the system(dispatcher).<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The malware has the same logic for the access violation exception.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168735\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture11.png\" alt=\"\" width=\"779\" height=\"438\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture11.png 779w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture11-300x169.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture11-768x432.png 768w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture11-205x115.png 205w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">When the shellcode is executed without debugger, INT3 instruction invokes the vectored exception handler routine, with an exception of EXCEPTION_BREAKPOINT, handler computes EIP by incrementing the EIP by 1 and fetching the data from incremented location. Later XORing the fetched data with a constant in our case 0x1A. The result is added to current EIP value. The logic implemented for handling INT3 exceptions also scan the program code for 0xCC instructions put by the researchers. If 0xCC are found that are placed by researchers then EIP is not calculated properly.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168749\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture12.png\" alt=\"\" width=\"779\" height=\"209\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture12.png 779w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture12-300x80.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture12-768x206.png 768w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture12-205x55.png 205w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span data-contrast=\"auto\">EIP Calculation Logic Summary<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<table data-tablestyle=\"MsoTableGrid\" data-tablelook=\"1184\" aria-rowcount=\"2\">\n<tbody>\n<tr aria-rowindex=\"1\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">Trigger via interrupt instruction (INT3)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">eip=((ReadByte(eip+1)^0x1A)+eip)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"2\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">Trigger via Single Stepping(PUSHFD\/POPFD)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">eip=((ReadByte(eip+2)^0x1A)+eip)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span data-contrast=\"auto\">*The value 0x1A changes with samples<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Detecting Abnormal Execution Flow via VEH<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The shellcode is structured in such a way that the malware can detect abnormal execution flow by the order in which exception occurred at runtime. The pushfd\/popfd instructions are followed by the code that when executed throws STATUS_ACCESS_VIOLATION. When program is executed normally, the execution will not reach the code that follows the pushfd\/popfd instruction block, thus raising only STATUS_SINGLESTEP. When accidently stepped over the pushfd\/popfd block in debugger, the STATUS_SINGLESTEP is not thrown at the debugger as it suppreses this because the debugger is already single stepping through the code, this is detected by the handler logic when we encounter code that follows the pushfd\/popfd instruction block wich throws a STATUS_ACCESS_VIOLATION. Now it runs into a nested exception situation (the access violation followed by suppressed single stepping exception via trap). Because of this, whenever an access violation occurs, the handler routine checks for nested exception information in _EXCEPTION_POINTERS structure as discussed in the beginning.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Below image shows this the carefully laid out code to detect analysis.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168763\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture13.png\" alt=\"\" width=\"652\" height=\"341\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture13.png 652w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture13-300x157.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture13-205x107.png 205w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><span data-contrast=\"auto\">The Egg hunting: VEH Assisted Runtime Padding<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">One interesting feature seen in GULoader shellcode in the wild is runtime padding. Runtime padding is an evasive behavior to beat automated scanners and other security checks employed at runtime. It delays the malicious activities performed by the malware on the target system.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The egg value in the analyzed sample is 0xAE74B61.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">It initiates a search for this value in its own data segment of the shellcode.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Don\u2019t forget the fact that this is implemented via VEH handler. This search itself adds 0.3 million of VEH iteration on top of regular VEH control manipulation employed in the code.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">The loader ends this search when it retrieves the address location of the egg value. To make sure the value is not being manipulated by any means by the researcher, it performs two additional checks to validate the egg location.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">If the check fails, the search continues. The process of retrieving the location of the egg is shown in the image below.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168950\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture14.png\" alt=\"\" width=\"611\" height=\"410\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture14.png 611w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture14-300x201.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture14-192x129.png 192w\" sizes=\"auto, (max-width: 611px) 100vw, 611px\" \/><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"6\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">As mentioned above, the validity of the egg location is checked by retrieving byte values from two offsets: one is 4 bytes away from the egg location and the value is 0xB8. The other is at 9 bytes from the egg location and the value is 0xC3. This check needs to be passed for the loader to proceed to the next stage of infection. Core malware activities are performed after this runtime padding loop.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><span data-contrast=\"auto\">The following images show the egg location validity checks performed by GULoader. The values 0xB8 and 0xC3 are checked by using proper offsets from the egg location.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168964\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture15.png\" alt=\"\" width=\"396\" height=\"235\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture15.png 396w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture15-300x178.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture15-205x122.png 205w\" sizes=\"auto, (max-width: 396px) 100vw, 396px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168978\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture16.png\" alt=\"\" width=\"433\" height=\"182\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture16.png 433w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture16-300x126.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture16-205x86.png 205w\" sizes=\"auto, (max-width: 433px) 100vw, 433px\" \/><\/p>\n<h2><span data-contrast=\"auto\">Stage 2: Environment Check and Code Injection\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">In the second stage of the infection chain, the GULoader performs anti-analysis and code injection. Major anti-analysis vectors are listed below. After making sure that shellcode is not running in a sandbox, it proceeds to conduct code injection into a newly spawned process where stage 3 is initiated to download and deploy actual payload. This payload can be either commodity stealer or RAT.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"auto\">Anti-analysis Techniques\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Employs runtime padding as discussed before.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Scans whole process memory for analysis tool specific strings<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Uses DJB2 hashing for string checks and dynamic API address resolution<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">Strings are decoded at runtime<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Checks if qemu is installed on the system by checking the installation path:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">C:\\\\Program Files\\\\qqa\\\\qqa.exe<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Patches the following APIs:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">DbgUIRemoteBreakIn<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">The function\u2019s prologue is patched with ExitProcess call<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">LdrLoadDll<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">The initial bytes are patched with instruction \u201cmov edi edi\u201d<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">DbgBreakPoint<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Patches with instruction nop<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Clears hooks placed in ntdll.dll by security products or researcher for the analysis.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Window Enumeration via EnumWindows<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Hides the shellcode thread from the debugger via ZwSetInformationThread by passing 0x11 (ThreadHideFromDebugger)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Device driver enumeration via EnumDeviceDrivers andGetDeviceDriverBaseNameA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Installed software enumeration via MsiEnumProductsA and MsiGetProductInfoA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">System service enumeration via OpenSCManagerA and EnumServiceStatusA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Checks use of debugging ports by passing ProcessDebugPort (0x7) class to NtQueryInformationProcess<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Use of CPUID and RDTSC instructions to detect virtual environments and instrumentation.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h3><span data-contrast=\"auto\">Anti-dump Protection<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Whenever GULoader invokes a Win32 api, the call is sandwiched between two XOR loops as shown in the image below.\u00a0 The loop prior to the call encoded the active shellcode region where the call is taking place to prevent the memory from getting dumped by the security products based on event monitoring or api calls. Following the call, the shellcode region is decoded again back to normal and resumes execution. The XOR key used is a word present in the shellcode itself.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-168993\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture17.png\" alt=\"\" width=\"303\" height=\"510\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture17.png 303w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture17-178x300.png 178w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture17-77x129.png 77w\" sizes=\"auto, (max-width: 303px) 100vw, 303px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><b><span data-contrast=\"auto\">String Decoding\u00a0<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">This section covers the process undertaken by the GUloader to decode the strings at the runtime.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The NtAllocateVirtualMemory is called to allocate a buffer to hold the encoded bytes.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">The encoded bytes are computed by performing various arithmetic and logical operations on static values embedded as operands of assembly instructions. Below image shows the recovery of encoded bytes via various mathematical and logical operations. The EAX points to memory buffer, where computed encoded values get stored.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169007\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture18.png\" alt=\"\" width=\"700\" height=\"116\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture18.png 700w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture18-300x50.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture18-205x34.png 205w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"TextRun SCXW64485225 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW64485225 BCX0\">The first byte\/word is reserved to hold the size of the <\/span><span class=\"NormalTextRun SCXW64485225 BCX0\">encoded bytes. Below shows a 12 byte long encoded data being <\/span><span class=\"NormalTextRun SCXW64485225 BCX0\">written to memory.<\/span><\/span><span class=\"EOP SCXW64485225 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169021\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture19.png\" alt=\"\" width=\"524\" height=\"56\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture19.png 524w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture19-300x32.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture19-205x22.png 205w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/p>\n<p><span class=\"TextRun SCXW73501649 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW73501649 BCX0\">Later, the first <\/span><span class=\"NormalTextRun SCXW73501649 BCX0\">word<\/span><span class=\"NormalTextRun SCXW73501649 BCX0\"> gets replaced by the first <\/span><span class=\"NormalTextRun SCXW73501649 BCX0\">word<\/span><span class=\"NormalTextRun SCXW73501649 BCX0\"> of the actual encoded data<\/span><span class=\"NormalTextRun SCXW73501649 BCX0\">.<\/span><span class=\"NormalTextRun SCXW73501649 BCX0\"> Below image shows the buffer after replacing the first word.<\/span><\/span><span class=\"EOP SCXW73501649 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169035\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture20.png\" alt=\"\" width=\"541\" height=\"56\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture20.png 541w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture20-300x31.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture20-205x21.png 205w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/p>\n<p><span class=\"TextRun SCXW11894859 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW11894859 BCX0\">The encoded data is fully <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">recovered<\/span> <span class=\"NormalTextRun SCXW11894859 BCX0\">now,<\/span><span class=\"NormalTextRun SCXW11894859 BCX0\"> and <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">malware <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">proceeds<\/span><span class=\"NormalTextRun SCXW11894859 BCX0\"> to decode <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">it. For decoding the <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">simple<\/span><span class=\"NormalTextRun SCXW11894859 BCX0\"> XOR is <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">employed<\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">,<\/span><span class=\"NormalTextRun SCXW11894859 BCX0\"> and key is present in the <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">shellcode. The assembly routine that does the decoding is shown <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">in <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">the <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">image below. <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">Each byte in the buffer is <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">XORed with <\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">the key<\/span><span class=\"NormalTextRun SCXW11894859 BCX0\">.<\/span><\/span><span class=\"EOP SCXW11894859 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169063\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture21.png\" alt=\"\" width=\"383\" height=\"293\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture21.png 383w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture21-300x230.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture21-169x129.png 169w\" sizes=\"auto, (max-width: 383px) 100vw, 383px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"TextRun SCXW25287652 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW25287652 BCX0\">The result of the XOR operation is written to same memory buffer that holds the encoded data. <\/span><span class=\"NormalTextRun SCXW25287652 BCX0\">A final<\/span><span class=\"NormalTextRun SCXW25287652 BCX0\"> view of the memory buffer with decoded data is shown below.<\/span><\/span><span class=\"EOP SCXW25287652 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169077\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture22.png\" alt=\"\" width=\"545\" height=\"56\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture22.png 545w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture22-300x31.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture22-205x21.png 205w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/p>\n<p><span class=\"TextRun SCXW183007480 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW183007480 BCX0\">The image shows the <\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">decoding<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\"> the string \u201cpsapi.dll<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">\u201d,<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\"> later this <\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">string<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\"> is used in fetching the address<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">es<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\"> of <\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">various functions <\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">to employ <\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">anti-<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">analysis<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">.<\/span><span class=\"NormalTextRun SCXW183007480 BCX0\">\u00a0<\/span><\/span><span class=\"EOP SCXW183007480 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:720,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span data-contrast=\"auto\">The stage 2 culminates in code injection, to be specific GULoader employs a variation of the process hollowing technique, where a benign process is spawned in a suspended state by the malware stager process and proceeds to overwrite the original content present in the suspended process with malicious content, later the state of the thread in the suspended process is changed by modifying processor register values like EIP and finally the process resumes its execution. By controlling EIP, malware can now direct the control flow in the spawned process to a desired code location. After a successful hollowing, the malware code will be running under the cover of a legit application.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The variation of hollowing technique employed by the GULoader doesn\u2019t replace the file contents, but instead injects the same shellcode and maps the memory in the suspended process. Interestingly<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\"> GULoader employs an additional technique if the hollowing attempt fails. More details are covered in the following section.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Listed below Win32 native APIs are dynamically resolved at runtime to perform the code injection.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">NtCreateSection<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">ZwMapViewOfSection<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">NtWriteVirtualMemory<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">ZwGetContetThread<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">NtSetContextThread<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">NtResumeThread<\/span> \u00a0<span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h3><span data-contrast=\"auto\">Overview of Code Injection<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Initially image \u201c%windir%\\Microsoft.NET\\Framework\\version on 32-bit systems\\&lt;version&gt;\\CasPol.exe\u201d is spawned in suspended mode via CreateProcessInternalW native API.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">The Gu loader retrieves a handle to the file <\/span><i><span data-contrast=\"auto\">\u201cC:\\Windows\\SysWOW64\\iertutil.dll\u201d<\/span><\/i><span data-contrast=\"auto\"> which is used in section creation. The section object created via <\/span><i><span data-contrast=\"auto\">NtCreateSection<\/span><\/i><span data-contrast=\"auto\"> will be backed by iertutil.dll.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">This behavior is mainly to avoid suspicion, a section object which is not backed by any file may draw unwanted attention from security systems.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">The next phase in the code injection is the mapping of the view created on the section backed by the iertutil.dll into the spawned CasPol.exe process. Once the view is successfully mapped to the process, malware can inject the shellcode in the mapped memory and resume the process thus initiating stage 3. The native api ZwMapViewOfSection is used to perform this task. Following the execution of the above API, the malware checks the result of the function call against the below listed error statuses.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">C0000018 (STATUS_CONFLICTING_ADDRESS)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">C0000220 (STATUS_MAPPED_ALIGNMENT)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">40000003 (STATUS_IMAGE_NOT_AT_BASE).<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">If the mapping is unsuccessful and status code returned by ZwMapViewOfSection matches with any of the code mentioned above, it has a backup plan.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">The GuLoader calls NtAllocateVirtualMemory by directly calling the system call stub which is normally found in ntdll.dll library to bypass EDR\/AV hooks. The memory is allocated in the remote CasPol.exe process with an RWX memory protection. Following image shows the direct use of NtAllocateVirtualMemory system call.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-169091\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture23.png\" alt=\"\" width=\"325\" height=\"88\" \/><\/p>\n<p><span class=\"TextRun SCXW6075616 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW6075616 BCX0\">After <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">memory allocation<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">, <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">it <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">writes itself<\/span> <span class=\"NormalTextRun SCXW6075616 BCX0\">into remote process <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">via <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">NtWriteVirtualMemory<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\"> as discussed above<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">.<\/span> <span class=\"NormalTextRun SCXW6075616 BCX0\">GULoader<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\"> shellcode<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">s<\/span> <span class=\"NormalTextRun SCXW6075616 BCX0\">taken from the <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">field <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">are bigger in <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">size<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">,<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\"> samples<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\"> taken for this analysis are all greater than 20 mb<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">. In <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">samples analyzed<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">, the <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">buffer size <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">allocated<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\"> to hold the shellcode is 2<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">950000 bytes.<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\"> The below image shows the <\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">GuLoader<\/span> <span class=\"NormalTextRun SCXW6075616 BCX0\">shellcode in the memory<\/span><span class=\"NormalTextRun SCXW6075616 BCX0\">.<\/span><\/span><span class=\"EOP SCXW6075616 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169105\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture24.png\" alt=\"\" width=\"537\" height=\"291\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture24.png 537w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture24-300x163.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture24-205x111.png 205w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><span data-contrast=\"auto\">Misleading Entry point<\/span> <span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The GULoader is highly evasive in nature, if abnormal execution flow is detected with help of employed anti-analysis vectors, the EIP and EBX fields of thread context structure (of CasPol.exe process) will be overwritten with a decoy address, which is required for the stage 3 of malware execution. The location ebp+4 is used to hold the entry point despite of the fact whether program is being debugged or not.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">The Gu loader uses ZwGetContextThread and NtSetContextThread routines to accomplish modification of the thread state. The CONTEXT structure is retrieved via ZwGetContextThread, the value [ebp+14C] is used as the entry point address. The current EIP value held in the EIP field in the context structure of the thread will be changed to a recalculated address based on value at ebp+4. Below image shows the RVA calculation.\u00a0 The base address of the executing shellcode (stage 2) is subtracted from the virtual address [ebp+4] to obtain RVA.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-169119\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture25.png\" alt=\"\" width=\"366\" height=\"256\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture25.png 280w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture25-184x129.png 184w\" sizes=\"auto, (max-width: 366px) 100vw, 366px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"TextRun SCXW128254857 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW128254857 BCX0\">The RVA is added to the <\/span><span class=\"NormalTextRun SCXW128254857 BCX0\">base address of the <\/span><span class=\"NormalTextRun SCXW128254857 BCX0\">newly <\/span><span class=\"NormalTextRun SCXW128254857 BCX0\">allocated<\/span><span class=\"NormalTextRun SCXW128254857 BCX0\"> memory in the CasPol.exe process to obtain new VA which can be used in the remote process.<\/span><span class=\"NormalTextRun SCXW128254857 BCX0\"> The new VA is written into <\/span><span class=\"NormalTextRun SCXW128254857 BCX0\">EIP and EBX field in the thread context structure<\/span><span class=\"NormalTextRun SCXW128254857 BCX0\"> of the CasPol.exe process<\/span> <span class=\"NormalTextRun SCXW128254857 BCX0\">retrieved via <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW128254857 BCX0\">ZwGetContextThread<\/span><span class=\"NormalTextRun SCXW128254857 BCX0\">. <\/span><span class=\"NormalTextRun SCXW128254857 BCX0\">Below image shows the modified context structure <\/span><span class=\"NormalTextRun SCXW128254857 BCX0\">and value of EIP.\u00a0<\/span><\/span><span class=\"EOP SCXW128254857 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169133\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture26.png\" alt=\"\" width=\"780\" height=\"165\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture26.png 780w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture26-300x63.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture26-768x162.png 768w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture26-205x43.png 205w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/p>\n<p><span class=\"TextRun SCXW222731315 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW222731315 BCX0\">Finally,<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\"> by calling <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW222731315 BCX0\">ZwSetContextThread<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">, the <\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">change<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">s<\/span> <span class=\"NormalTextRun SCXW222731315 BCX0\">made to the CONTEXT structure <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW222731315 BCX0\">is<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\"> committed <\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">in the target thread of CasPol<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">.exe process.<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\"> The thread is resumed by calling <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SpellingErrorHighlight SCXW222731315 BCX0\">NtResumeThread<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">.<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\"> The CasPol.exe resumes executi<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">on <\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">and <\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">performs stage <\/span><span class=\"NormalTextRun SCXW222731315 BCX0\">3<\/span><span class=\"NormalTextRun SCXW222731315 BCX0\"> of the infection chain.<\/span><\/span><span class=\"EOP SCXW222731315 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><b><span data-contrast=\"auto\">Stage 3: Payload Deployment\u00a0<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">The GULoader shellcode resumes execution from within a new host process, in this report, analyzed samples inject the shellcode either into the same process spawned as a child process or caspol.exe. Stage3 performs all the anti-analysis once again to make sure this stage is not being analyzed. After all checks, GUloader proceeds to perform stage3 activities by decoding the encoded C2 string in the memory as shown in the image below. The decoding method is the same as discussed before.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169147\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture27.png\" alt=\"\" width=\"527\" height=\"135\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture27.png 527w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture27-300x77.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture27-205x53.png 205w\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" \/><\/p>\n<p><span data-contrast=\"auto\">Later the addresses of following functions are resolved dynamically by loading wininet.dll:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">InternetOpenA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">InternetSetOptionA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">InternetOpenUrlA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">InternetReadFile<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">InternetCloseHandle.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span class=\"TextRun SCXW336340 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW336340 BCX0\">The below<\/span><span class=\"NormalTextRun SCXW336340 BCX0\"> image shows the response<\/span><span class=\"NormalTextRun SCXW336340 BCX0\"> from <\/span><span class=\"NormalTextRun SCXW336340 BCX0\">the content<\/span><span class=\"NormalTextRun SCXW336340 BCX0\"> delivery network (<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW336340 BCX0\">cdn<\/span><span class=\"NormalTextRun SCXW336340 BCX0\">) server where the final payload is <\/span><span class=\"NormalTextRun SCXW336340 BCX0\">stored<\/span><span class=\"NormalTextRun SCXW336340 BCX0\">.<\/span> <span class=\"NormalTextRun SCXW336340 BCX0\">In this analysis<\/span><span class=\"NormalTextRun SCXW336340 BCX0\">, <\/span><span class=\"NormalTextRun SCXW336340 BCX0\">a payload of size 0x2E640 bytes is sent to the <\/span><span class=\"NormalTextRun SCXW336340 BCX0\">loader. Interestingly<\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange SCXW336340 BCX0\"><span class=\"TextRun SCXW336340 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW336340 BCX0\">,<\/span><\/span><\/span><span class=\"TextRun SCXW336340 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW336340 BCX0\"> the first<\/span> <span class=\"NormalTextRun SCXW336340 BCX0\">40 bytes<\/span><span class=\"NormalTextRun SCXW336340 BCX0\"> are ignored by the loader. The actual payload starts from the offset 40 <\/span><span class=\"NormalTextRun SCXW336340 BCX0\">which is highlighted in the image.<\/span><\/span><span class=\"EOP SCXW336340 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169161\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture28.png\" alt=\"\" width=\"624\" height=\"543\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture28.png 624w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture28-300x261.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture28-148x129.png 148w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"EOP SCXW336340 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><span class=\"TextRun SCXW235416500 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW235416500 BCX0\">The <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW235416500 BCX0\">cdn<\/span> <span class=\"NormalTextRun SCXW235416500 BCX0\">server is well protected, it only <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW235416500 BCX0\">serve<\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW235416500 BCX0\">s to<\/span><span class=\"NormalTextRun SCXW235416500 BCX0\"> clients with proper headers <\/span><span class=\"NormalTextRun SCXW235416500 BCX0\">and <\/span><span class=\"NormalTextRun SCXW235416500 BCX0\">cookies. If <\/span><span class=\"NormalTextRun SCXW235416500 BCX0\">these<\/span> <span class=\"NormalTextRun SCXW235416500 BCX0\">are not present in the HTTP request, the following message is shown to the user.<\/span><\/span><span class=\"EOP SCXW235416500 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span> <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169175\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture29.png\" alt=\"\" width=\"498\" height=\"189\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture29.png 498w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture29-300x114.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture29-205x78.png 205w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/p>\n<h2><b><span data-contrast=\"auto\">Final Payload<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<h3><span data-contrast=\"auto\">Quasi Key Generation<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">The first step in decoding the the downloaded final payload by the GUloader is generating a quasi key which will be later used in decoding the actual key embeded in the GULoader shellcode. The encoded embeded key size is 371 bytes in analysed sample. The process of quasi key generation is as follows:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The 40<\/span><span data-contrast=\"auto\">th<\/span><span data-contrast=\"auto\"> and 41<\/span><span data-contrast=\"auto\">st<\/span><span data-contrast=\"auto\"> bytes (word)<\/span> <span data-contrast=\"auto\">are retrived from the download buffer in the memory.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">The above word is XORed with the first word of the encoded embeded key along and a counter value.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">The process is repeated untill the the word taken from the downloaded data fully decodes and have a value of 0x4D5A \u201cMZ\u201d.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">The value present in the counter when the 4D5A gets decoded is taken as the quasi key. This key is shown as \u201ckey-1\u201d in the image below. In the analysed sample the value of this key is \u201c0x5448\u201d<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169248\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture30.png\" alt=\"\" width=\"780\" height=\"261\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture30.png 780w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture30-300x100.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture30-768x257.png 768w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture30-205x69.png 205w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/p>\n<h3><span data-contrast=\"auto\">Decoding Actual Key<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">The embedded key in the GULoader shellcode is of the size 371 bytes as discussed before. The quasi key is used to decode the embeded key as shown in the image below.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"4\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Each word in the embeded key is XORed with quasi key key-1.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"4\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">When the interation counter exceeds the size value of 371 bytes, it stops and proceeds to decode the downloaded payload with this new key.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169262\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture31.png\" alt=\"\" width=\"780\" height=\"186\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture31.png 780w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture31-300x72.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture31-768x183.png 768w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture31-205x49.png 205w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/p>\n<p><span class=\"TextRun SCXW161243550 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW161243550 BCX0\">The <\/span><span class=\"NormalTextRun SCXW161243550 BCX0\">decoded 371 bytes of <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW161243550 BCX0\">embeded<\/span><span class=\"NormalTextRun SCXW161243550 BCX0\"> key is shown below in the image below.<\/span><\/span><span class=\"EOP SCXW161243550 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169276\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture32.png\" alt=\"\" width=\"523\" height=\"608\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture32.png 523w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture32-258x300.png 258w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture32-111x129.png 111w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/p>\n<h3><span data-contrast=\"auto\">Decoding File<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">A byte level decoding happens after embeded key is decoded in the memory. Each byte of the downloaded data is XORed with the key to obtain the actual data, which is a PE file. The decoded data is overwritten to the same buffer used to download the decoded data.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169290\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture33.png\" alt=\"\" width=\"779\" height=\"144\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture33.png 779w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture33-300x55.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture33-768x142.png 768w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture33-205x38.png 205w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/p>\n<p><span class=\"TextRun SCXW66447178 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW66447178 BCX0\">The final decoded PE file <\/span><span class=\"NormalTextRun SCXW66447178 BCX0\">residing<\/span><span class=\"NormalTextRun SCXW66447178 BCX0\"> in the memory is shown in the image below:<\/span><\/span><span class=\"EOP SCXW66447178 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-169304\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture34.png\" alt=\"\" width=\"525\" height=\"299\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture34.png 525w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture34-300x171.png 300w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture34-205x117.png 205w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/span><\/p>\n<p><span data-contrast=\"auto\">Finally, the loader loads the PE file by allocating the memory with RWX permission in the stage3 process, based on analyzing multiple samples it<\/span><span data-contrast=\"auto\">\u2019<\/span><span data-contrast=\"auto\">s either the same process in stage 2 as the child process<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\"> or casPol.exe. The loading involved code relocation and IAT correction as expected in such a scenario. The final payload resumes execution from within the hollowed stage3 process. Below malware families are usually seen deployed by the GULoader:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"5\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Vidar (Stealer)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"5\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Raccoon (Stealer)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"5\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Remcos RAT<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Below image shows the injected memory regions in stage3 process caspol.exe in this report.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-169318\" src=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture35-649x1024.png\" alt=\"\" width=\"649\" height=\"1024\" srcset=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture35-649x1024.png 649w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture35-190x300.png 190w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture35-82x129.png 82w, https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/Picture35.png 685w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/p>\n<h2><span data-contrast=\"auto\">Conclusion\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">The role played by malware loaders popularly known as \u201ccrypters\u201d is significant in the deployment of Remote Administration Tools and stealer malwares that target consumer data. The exfiltrated Personal Identifiable Information (PII) extracted from the compromised endpoints are largely collected and funneled to various underground data selling marketplaces. This also impacts businesses as various critical information used for authentication purposes are getting leaked from the personal systems of the user leading to initial access on the company networks. The GuLoader is heavily used in mass malware campaigns to infect the users with popular stealer malware like Raccoon, Vidar, and Redline. Commodity RATs like Remcos are also seen delivered in such campaign activities. On the bright side<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\"> it is not difficult to fingerprint malware specimens used in the mass campaigns because of the volume its volume and relevance, detection rules and systems can be built around this very fact.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><span data-contrast=\"auto\">Following table summarizes all the dynamically resolved Win32 APIs\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<table style=\"height: 2866px;\" width=\"954\" data-tablestyle=\"MsoTableGrid\" data-tablelook=\"1184\" aria-rowcount=\"47\">\n<tbody>\n<tr aria-rowindex=\"1\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">Win32 API<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:2,&quot;335551620&quot;:2,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"2\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">RtlAddVectoredExceptionHandler<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"3\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtAllocateVirtualMemory<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"4\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">DbgUIRemoteBreakIn<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"5\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">LdrLoadDll<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"6\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">DbgBreakPoint<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"7\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">EnumWindows<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"8\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">Nt\/ZwSetInformationThread<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"9\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">EnumDeviceDrivers<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"10\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">GetDeviceDriverBaseNameA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"11\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">MsiEnumProductsA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"12\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">MsiGetProductInfoA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"13\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">TerminateProcess<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"14\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">ExitProcess<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"15\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtSetContextThread<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"16\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtWriteVirtualMemory<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"17\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtCreateSection<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"18\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtMapViewOfSection<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"19\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtOpenFile<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"20\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtSetInformationProcess<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"21\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtClose<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"22\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtResumeThread<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"23\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtProtectVirtualMemory<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"24\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">CreateProcessInternal<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"25\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">GetLongPathNameW<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"26\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">Sleep<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"27\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtCreateThreadEx<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"28\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">WaitForSingleObject<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"29\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">TerminateThread<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"30\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">CreateFileW<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"31\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">WriteFile<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"32\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">CloseHandle<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"33\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">GetFileSize<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"34\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">ReadFile<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"35\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">ShellExecuteW<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"36\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">SHCreateDirectoryExW<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"37\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">RegCreateKeyExA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"38\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">RegSetValueExA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"39\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">OpenSCManagerA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"40\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">EnumServiceStatusA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"41\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">CloseServiceHandle<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"42\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">NtQueryInformationProcess<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"43\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">InternetOpenA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"44\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">InternetSetOptionA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"45\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">InternetOpenUrlA<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"46\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">InternetReadFile<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"47\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">InternetCloseHandle<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2><span data-contrast=\"auto\">IOC<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">889fddcb57ed66c63b0b16f2be2dbd7ec0252031cad3b15dfea5411ac245ef56<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">59b71cb2c5a14186a5069d7935ebe28486f49b7961bddac0a818a021373a44a3<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">4d9cdd7526f05343fda35aca3e0e6939abed8a037a0a871ce9ccd0e69a3741f2<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">c8006013fc6a90d635f394c91637eae12706f58897a6489d40e663f46996c664<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">c69e558e5526feeb00ab90efe764fb0b93b3a09692659d1a57c652da81f1d123<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">45156ac4b40b7537f4e003d9f925746b848a939b2362753f6edbcc794ea8b36a<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">e68ce815ac0211303d2c38ccbb5ccead144909d295230df4b7a419dfdea12782<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">b24b36641fef3acbf3b643967d408b10bf8abfe1fe1f99d704a9a19f1dfc77e8<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">569aa6697083993d9c387426b827414a7ed225a3dd2e1e3eba1b49667573fdcb<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">60de2308ebfeadadc3e401300172013be27af5b7d816c49696bb3dedc208c54e<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">23458977440cccb8ac7d0d05c238d087d90f5bf1c42157fb3a161d41b741c39d<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Authored by: Anandeshwar Unnikrishnan Stage 1: GULoader Shellcode Deployment\u00a0 In recent GULoader campaigns, we are seeing a rise in NSIS-based&#8230;<\/p>\n","protected":false},"author":695,"featured_media":169435,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[442],"tags":[],"coauthors":[4136],"class_list":["post-168594","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mcafee-labs"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader | McAfee Blog<\/title>\n<meta name=\"description\" content=\"Authored by: Anandeshwar Unnikrishnan Stage 1: GULoader Shellcode Deployment\u00a0 In recent GULoader campaigns, we are seeing a rise in NSIS-based installers\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader | McAfee Blog\" \/>\n<meta property=\"og:description\" content=\"Authored by: Anandeshwar Unnikrishnan Stage 1: GULoader Shellcode Deployment\u00a0 In recent GULoader campaigns, we are seeing a rise in NSIS-based installers\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/\" \/>\n<meta property=\"og:site_name\" content=\"McAfee Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/McAfee\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/McAfee\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-09T17:50:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-11T18:07:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"McAfee Labs\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@McAfee_Labs\" \/>\n<meta name=\"twitter:site\" content=\"@McAfee\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"McAfee Labs\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"20 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/\"},\"author\":{\"name\":\"McAfee Labs\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/86f325fa6532a017d06d6b49a2f3b1ad\"},\"headline\":\"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader\",\"datePublished\":\"2023-05-09T17:50:12+00:00\",\"dateModified\":\"2023-07-11T18:07:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/\"},\"wordCount\":4099,\"publisher\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png\",\"articleSection\":[\"McAfee Labs\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/\",\"name\":\"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader | McAfee Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png\",\"datePublished\":\"2023-05-09T17:50:12+00:00\",\"dateModified\":\"2023-07-11T18:07:02+00:00\",\"description\":\"Authored by: Anandeshwar Unnikrishnan Stage 1: GULoader Shellcode Deployment\u00a0 In recent GULoader campaigns, we are seeing a rise in NSIS-based installers\",\"breadcrumb\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#primaryimage\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png\",\"contentUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png\",\"width\":300,\"height\":200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/www.mcafee.com\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Other Blogs\",\"item\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"McAfee Labs\",\"item\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#website\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/\",\"name\":\"McAfee Blog\",\"description\":\"Internet Security News\",\"publisher\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.mcafee.com\/blogs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#organization\",\"name\":\"McAfee\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/02\/mcafee-logo.png\",\"contentUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/02\/mcafee-logo.png\",\"width\":1286,\"height\":336,\"caption\":\"McAfee\"},\"image\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/McAfee\/\",\"https:\/\/x.com\/McAfee\",\"https:\/\/www.linkedin.com\/company\/mcafee\/\",\"https:\/\/www.youtube.com\/McAfee\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/86f325fa6532a017d06d6b49a2f3b1ad\",\"name\":\"McAfee Labs\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/image\/af947d76ffbef8521094b476cf8050c3\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2017\/07\/Social-Media-PF-Logo-Pic-300x300-2-96x96.jpg\",\"contentUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2017\/07\/Social-Media-PF-Logo-Pic-300x300-2-96x96.jpg\",\"caption\":\"McAfee Labs\"},\"description\":\"McAfee Labs is one of the leading sources for threat research, threat intelligence, and cybersecurity thought leadership. See our blog posts below for more information.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/mcafee\/\",\"https:\/\/www.facebook.com\/McAfee\/\",\"https:\/\/x.com\/McAfee_Labs\"],\"url\":\"https:\/\/www.mcafee.com\/blogs\/author\/mcafee-labs\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader | McAfee Blog","description":"Authored by: Anandeshwar Unnikrishnan Stage 1: GULoader Shellcode Deployment\u00a0 In recent GULoader campaigns, we are seeing a rise in NSIS-based installers","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader | McAfee Blog","og_description":"Authored by: Anandeshwar Unnikrishnan Stage 1: GULoader Shellcode Deployment\u00a0 In recent GULoader campaigns, we are seeing a rise in NSIS-based installers","og_url":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/","og_site_name":"McAfee Blog","article_publisher":"https:\/\/www.facebook.com\/McAfee\/","article_author":"https:\/\/www.facebook.com\/McAfee\/","article_published_time":"2023-05-09T17:50:12+00:00","article_modified_time":"2023-07-11T18:07:02+00:00","og_image":[{"width":300,"height":200,"url":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png","type":"image\/png"}],"author":"McAfee Labs","twitter_card":"summary_large_image","twitter_creator":"@McAfee_Labs","twitter_site":"@McAfee","twitter_misc":{"Written by":"McAfee Labs","Est. reading time":"20 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#article","isPartOf":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/"},"author":{"name":"McAfee Labs","@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/86f325fa6532a017d06d6b49a2f3b1ad"},"headline":"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader","datePublished":"2023-05-09T17:50:12+00:00","dateModified":"2023-07-11T18:07:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/"},"wordCount":4099,"publisher":{"@id":"https:\/\/www.mcafee.com\/blogs\/#organization"},"image":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png","articleSection":["McAfee Labs"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/","url":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/","name":"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader | McAfee Blog","isPartOf":{"@id":"https:\/\/www.mcafee.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#primaryimage"},"image":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png","datePublished":"2023-05-09T17:50:12+00:00","dateModified":"2023-07-11T18:07:02+00:00","description":"Authored by: Anandeshwar Unnikrishnan Stage 1: GULoader Shellcode Deployment\u00a0 In recent GULoader campaigns, we are seeing a rise in NSIS-based installers","breadcrumb":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#primaryimage","url":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png","contentUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/05\/300x200_Blog_GULoader.png","width":300,"height":200},{"@type":"BreadcrumbList","@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/guloader-campaigns-a-deep-dive-analysis-of-a-highly-evasive-shellcode-based-loader\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mcafee.com\/blogs\/"},{"@type":"ListItem","position":2,"name":"Other Blogs","item":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/"},{"@type":"ListItem","position":3,"name":"McAfee Labs","item":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/"},{"@type":"ListItem","position":4,"name":"GULoader Campaigns: A Deep Dive Analysis of a highly evasive Shellcode based loader"}]},{"@type":"WebSite","@id":"https:\/\/www.mcafee.com\/blogs\/#website","url":"https:\/\/www.mcafee.com\/blogs\/","name":"McAfee Blog","description":"Internet Security News","publisher":{"@id":"https:\/\/www.mcafee.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mcafee.com\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mcafee.com\/blogs\/#organization","name":"McAfee","url":"https:\/\/www.mcafee.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/02\/mcafee-logo.png","contentUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/02\/mcafee-logo.png","width":1286,"height":336,"caption":"McAfee"},"image":{"@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/McAfee\/","https:\/\/x.com\/McAfee","https:\/\/www.linkedin.com\/company\/mcafee\/","https:\/\/www.youtube.com\/McAfee"]},{"@type":"Person","@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/86f325fa6532a017d06d6b49a2f3b1ad","name":"McAfee Labs","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/image\/af947d76ffbef8521094b476cf8050c3","url":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2017\/07\/Social-Media-PF-Logo-Pic-300x300-2-96x96.jpg","contentUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2017\/07\/Social-Media-PF-Logo-Pic-300x300-2-96x96.jpg","caption":"McAfee Labs"},"description":"McAfee Labs is one of the leading sources for threat research, threat intelligence, and cybersecurity thought leadership. See our blog posts below for more information.","sameAs":["https:\/\/www.linkedin.com\/company\/mcafee\/","https:\/\/www.facebook.com\/McAfee\/","https:\/\/x.com\/McAfee_Labs"],"url":"https:\/\/www.mcafee.com\/blogs\/author\/mcafee-labs\/"}]}},"_links":{"self":[{"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/posts\/168594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/users\/695"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/comments?post=168594"}],"version-history":[{"count":5,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/posts\/168594\/revisions"}],"predecessor-version":[{"id":171475,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/posts\/168594\/revisions\/171475"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/media\/169435"}],"wp:attachment":[{"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/media?parent=168594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/categories?post=168594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/tags?post=168594"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/coauthors?post=168594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}