Earth O Preta O Spear O - O Phishing O Governments O Worldwide O O trendmicro.com/en_us/research/22/k/earth-preta-spear-phishing-governments-worldwide.html O O November O 18 O , O 2022 O O APT O & O Targeted O Attacks O O We O break O down O the O cyberespionage O activities O of O advanced O persistent O threat O ( O APT O ) O group O O Earth O Preta O , O observed O in O large O - O scale O attack O deployments O that O began O in O March O . O We O also O O show O the O infection O routines O of O the O malware O families O they O use O to O infect O multiple O sectors O O worldwide O : O TONEINS O , O TONESHELL O , O and O PUBLOAD O . O O By O : O Nick O Dai O , O Vickie O Su O , O Sunny O Lu O November O 18 O , O 2022 O Read O time O : O ( O words O ) O O We O have O been O monitoring O a O wave O of O spear O - O phishing O attacks O targeting O the O government O , O O academic O , O foundations O , O and O research O sectors O around O the O world O . O Based O on O the O lure O O documents O we O observed O in O the O wild O , O this O is O a O large O - O scale O cyberespionage O campaign O that O O began O around O March O . O After O months O of O tracking O , O the O seemingly O wide O outbreak O of O targeted O O attacks O includes O but O not O limited O to O Myanmar O , O Australia O , O the O Philippines O , O Japan O and O Taiwan O . O O We O analyzed O the O malware O families O used O in O this O campaign O and O attributed O the O incidents O to O a O O notorious O advanced O persistent O threat O ( O APT O ) O group O called O Earth O Preta O ( O also O known O as O O Mustang O Panda O and O Bronze O President O ) O . O O 1/30 O O Figure O 1 O . O Country O distribution O of O Earth O Preta O attacks O from O May O to O October O 2022 O O In O our O observation O of O the O campaigns O , O we O noted O that O , O Earth O Preta O abused O fake O Google O O accounts O to O distribute O the O malware O via O spear O - O phishing O emails O , O initially O stored O in O an O archive O file O O ( O such O as O rar O / O zip O / O jar O ) O and O distributed O through O Google O Drive O links O . O Users O are O then O lured O into O O downloading O and O triggering O the O malware O to O execute O , O TONEINS O , O TONESHELL O , O and O O PUBLOAD O . O PUBLOAD O has O been O previously O reported O , O but O we O add O new O technical O insights O in O O this O entry O that O tie O it O to O TONEINS O and O TONESHELL O , O newly O discovered O malware O families O used O O by O the O group O for O its O campaigns O . O O In O addition O , O the O actors O leverage O different O techniques O for O evading O detection O and O analysis O , O like O O code O obfuscation O and O custom O exception O handlers O . O We O also O found O that O the O senders O of O the O O spear O - O phishing O emails O and O the O owners O of O Google O Drive O links O are O the O same O . O Based O on O the O O sample O documents O that O were O used O for O luring O the O victims O , O we O also O believe O that O the O attackers O O were O able O to O conduct O research O and O , O potentially O , O prior O breaches O on O the O target O organizations O O that O allowed O for O familiarity O , O as O indicated O in O the O abbreviation O of O names O from O previously O O compromised O accounts O . O O In O this O blog O entry O , O we O discuss O Earth O Preta O ’s O new O campaign O and O its O tactics O , O techniques O , O and O O procedures O ( O TTPs O ) O , O including O new O installers O and O backdoors O . O Last O , O we O share O how O security O O practitioners O can O track O malware O threats O similar O to O those O that O we O have O identified O . O O Initial O compromise O and O targets O O 2/30 O O Based O on O our O monitoring O of O this O threat O , O the O decoy O documents O are O written O in O Burmese O , O and O O the O contents O are O " O လျှို့ဝှက်ချက် O " O ( O “ O Internal O - O only O ” O ) O . O Most O of O the O topics O in O the O O documents O are O controversial O issues O between O countries O and O contain O words O like O " O Secret O " O or O O “ O Confidential O . O ” O These O could O indicate O that O the O attackers O are O targeting O Myanmar O government O O entities O as O their O first O entry O point O . O This O could O also O mean O that O the O attackers O have O already O O compromised O specific O political O entities O prior O to O the O attack O , O something O that O Talos O Intelligence O O had O also O previously O noted O . O O The O attackers O use O the O stolen O documents O as O decoys O to O trick O the O targeted O organizations O O working O with O Myanmar O government O offices O into O downloading O and O executing O the O malicious O O files O . O The O victimology O covers O a O broad O range O of O organizations O and O verticals O worldwide O , O with O a O O higher O concentration O in O the O Asia O Pacific O region O . O Apart O from O the O government O offices O with O O collaborative O work O in O Myanmar O , O subsequent O victims O included O the O education O and O research O O industries O , O among O others O . O In O addition O to O decoy O topics O covering O ongoing O international O events O O concerning O specific O organizations O , O the O attackers O also O lure O individuals O with O subject O headings O O pertaining O to O pornographic O materials O . O O Figure O 2 O . O Distribution O of O Earth O Preta O ’s O targeted O industries O O Analyzing O the O routines O O 3/30 O O Figure O 3 O . O Earth O Preta O attack O campaign O routine O from O March O to O October O 2022 O O Earth O Preta O uses O spear O - O phishing O emails O as O its O first O step O for O intrusion O . O As O aforementioned O , O O some O of O the O emails O ’ O subjects O and O contents O discuss O geopolitical O topics O , O while O others O might O O contain O sensational O subjects O . O We O observed O that O all O the O emails O we O analyzed O had O the O Google O O Drive O links O embedded O in O them O , O which O points O to O how O users O might O be O tricked O into O downloading O O the O malicious O archives O . O The O file O types O of O the O archives O include O compressed O files O such O as O .rar O , O O .zip O , O and O .jar O , O to O name O a O few O . O Upon O accessing O the O links O , O we O learned O that O the O archives O contain O O the O malware O TONEINS O , O TONESHELL O , O and O PUBLOAD O malware O families O . O O 4/30 O O Figure O 4 O . O O Email O document O sample O of O meeting O minutes O , O likely O stolen O from O a O prior O compromise O O Spear O - O phishing O emails O O We O analyzed O the O contents O of O the O emails O and O observed O that O a O Google O Drive O link O is O used O as O a O O lure O for O victims O . O The O email O 's O subject O might O be O empty O or O might O have O the O same O name O as O the O O malicious O archive O . O Rather O than O add O the O victims O ’ O addresses O to O the O email O ’s O “ O To O ” O header O , O the O O 5/30 O O threat O actors O used O fake O emails O . O Meanwhile O , O the O real O victims O ' O addresses O were O written O in O the O O " O CC O " O header O , O likely O to O evade O security O analysis O and O slow O down O investigations O . O Using O opensource O intelligence O ( O OSINT O ) O tool O GHunt O to O probe O those O Gmail O addresses O in O the O “ O To O ” O section O , O O we O found O these O fake O accounts O with O little O information O in O them O . O O Moreover O , O we O observed O that O some O of O the O senders O might O be O compromised O email O accounts O O from O a O specific O organization O . O Victims O might O be O convinced O that O these O mails O were O sent O from O O trusted O partners O , O increasing O the O chances O that O recipients O will O select O the O malicious O links O . O O Decoy O documents O O We O also O found O some O decoy O documents O linked O to O the O organizations O related O to O or O working O with O O Myanmar O government O entities O . O The O first O decoy O 's O file O name O is O Assistance O and O O Recovery(china).exe O , O while O another O decoy O .PDF O document O ( O “ O ပြည်ထောင်စုသမ္မတ O O မြန်မာနိုင်ငံတော်သံရုံး.pdf O , O meaning O “ O Embassy O of O the O Republic O of O Myanmar O " O ) O was O observed O O in O a O compressed O file O named O Assistance O and O Recovery(china).rar O . O Allegedly O , O this O is O a O O document O containing O the O ambassador O ’s O report O in O rough O meeting O schedules O between O the O O embassies O of O Myanmar O and O China O . O O Another O document O is O related O to O the O Japan O Society O for O the O Promotion O of O Science O ( O JSPS O ) O , O an O O initiative O that O provides O researchers O opportunities O to O conduct O and O undergo O research O O exchanges O in O Japan O . O Notably O , O the O documents O in O the O compressed O file O attachment(EN).rar O are O O mostly O image O files O . O The O malicious O DLL O and O the O executable O , O which O are O used O for O the O next O layer O O of O sideloading O , O are O also O included O among O them O . O O 6/30 O O Figure O 5 O . O Sample O decoy O documents O relating O to O government O meetings O ( O left O ) O and O overseas O O research O exchange O ( O right O ) O O There O are O also O other O decoy O documents O with O diverse O content O themes O , O including O regional O affairs O O and O pornography O . O However O , O when O the O victim O opens O the O fake O document O file O in O this O folder O , O no O O corresponding O content O appears O . O O Arrival O vectors O O We O observed O at O least O three O types O of O arrival O vectors O as O the O intrusions O ' O entry O points O , O including O O over O 30 O lure O archives O around O the O world O distributed O via O Google O Drive O links O , O Dropbox O links O , O or O O other O IP O addresses O hosting O the O files O . O In O most O of O the O archives O we O collected O , O there O are O legitimate O O executables O , O as O well O as O the O sideloaded O DLL O . O The O names O of O the O archives O and O the O decoy O O documents O vary O in O each O case O . O In O the O following O sections O , O we O take O some O of O them O as O examples O O and O share O the O TTPs O of O each O . O O Type O A O : O DLL O sideloading O O In O this O case O , O there O are O three O files O in O the O archive O : O " O ~ O , O " O Increasingly O confident O US O is O baiting O O China.exe O , O and O libcef.dll O . O Notably O , O the O names O of O the O lure O documents O and O executables O can O be O O different O , O as O detailed O in O the O next O sections O . O O 7/30 O O Filename O O Detection O O 220509 O - O ( O Cabinet O Meeting O O 2022).zip O O ~ O O Increasingly O confident O US O is O O baiting O China.exe O O libcef.dll O O Description O O Lure O O document O O Legitimate O O executable O for O DLL O O sideloading O O Trojan O . O Win32.PUBLOAD O O Malicious O DLL O O Table O 1 O . O Files O in O the O archive O of O Type O A O O 8/30 O O Figure O 6 O . O An O example O of O a O decoy O document O from O the O PUBLOAD O archives O O Inside O the O archive O , O the O " O ~ O " O file O is O a O lure O document O . O The O executable O Increasingly O confident O US O O is O baiting O China.exe O is O a O legitimate O executable O ( O originally O named O O adobe_licensing_wf_helper.exe O , O which O is O the O Adobe O Licensing O WF O Helper O ) O . O This O executable O O will O sideload O the O malicious O libcef.dll O and O trigger O the O export O function O cef_api_hash O . O O When O executed O for O the O first O time O , O the O executable O tries O to O install O the O malware O by O copying O the O O .exe O file O and O moving O libcef.dll O ( O detected O by O Trend O Micro O as O Trojan O . O Win32.PUBLOAD O ) O to O O < O % O PUBLIC% O > O Both O .exe O and O .dll O files O will O be O renamed O O C:\Users\Public\Pictures\adobe_wf.exe O and O C:\Users\Public\Pictures\libcef.dll O , O respectively O . O O Additionally O , O " O ~ O " O is O renamed O as O 05-09-2022.docx O and O dropped O to O the O Desktop O . O O 9/30 O O Figure O 7 O . O Type O A O ’s O malicious O routine O O Type O B O : O Shortcut O links O O The O malicious O archive O contains O three O files O : O New O Word O Document.lnk O , O putty.exe O , O and O O CefBrowser.dll O . O In O particular O , O the O DLL O and O executable O files O are O placed O in O multiple O layers O of O O folders O named O “ O _ O ” O . O O Filename O O Detection O O Desktop.rar O O New O Word O Document.lnk O O _ O \_\_\_\_\_\putty.exe O O _ O \_\_\_\_\_\CefBrowser.dll O O Description O O Installer O O Legitimate O O executable O for O DLL O O sideloading O O Backdoor O . O Win32.TONESHELL O O Malicious O DLL O O Table O 2 O . O Files O in O the O archive O of O Type O B O O The O threat O actor O utilizes O the O .lnk O file O to O install O the O malicious O files O by O decompressing O the O archive O O file O with O WinRAR O . O The O full O command O line O is O as O follows O . O O % O ComSpec% O /c O " O _ O \_\_\_\_\_\putty.exe||(forfiles O /P O % O APPDATA%\ O .. O \ O .. O \ O /S O /M O Desktop.rar O O /C O " O cmd O /c O ( O c:\progra~1\winrar\winrar.exe O x O -inul O -o+ O @path||c:\progra~2\winrar\winrar.exe O x O inul O -o+ O @path)&&_\_\_\_\_\_\putty.exe O " O ) O " O O 10/30 O O Putty.exe O is O masquerading O as O a O normal O executable O ; O its O original O file O name O is O AppXUpdate.exe O . O O When O it O is O executed O , O it O sideloads O CefBrowser.dll O and O executes O the O main O routine O in O its O export O O function O , O CCefInterface::SubProcessMain O . O It O also O abuses O schtasks O for O persistence O . O O Figure O 8 O . O Type O B O 's O malicious O routine O O Type O C O : O Fake O file O extensions O O In O this O case O , O China O VS O Taiwan.rar O contains O several O files O , O including O : O O Filename O O Detection O O China O VS O Taiwan.rar O O China O VS O Taiwan.exe O O libcef.dll O O Trojan O . O Win32.TONEINS O O ~$20220817.docx O O ~$20220617(1).docx O O Description O O First O - O stage O O legitimate O O executable O for O O DLL O O sideloading O O First O - O stage O O malware O O Second O - O stage O O legitimate O O executable O for O O DLL O sideloading O O Backdoor O . O Win32.TONESHELL O O Second O - O stage O O malware O O 11/30 O O 15-8-2022.docx O O Decoy O O document O O China O VS O O Taiwan(1).docx O O Decoy O O document O O Table O 3 O . O Files O in O the O archive O of O Type O C O O libcef.dll O ( O detected O by O Trend O Micro O as O Trojan O . O Win32.TONEINS O ) O is O an O installer O for O the O nextstage O malware O . O It O copies O two O files O with O names O starting O with O " O ~ O " O , O in O this O case O , O O ~$20220817.docx O and O ~$20220617(1).docx O to O < O % O USERPROFILE%\Pictures O > O . O Both O files O O have O fake O file O extensions O and O masquerade O as O the O temporary O files O generated O while O opening O O Microsoft O Office O software O . O O Figure O 9 O . O Type O C O ’s O malicious O routine O O Malware O O In O this O campaign O , O we O identified O the O following O malware O used O , O namely O PUBLOAD O , O TONEINS O , O O and O TONESHELL O . O O Trojan O . O Win32.PUBLOAD O O 12/30 O O PUBLOAD O is O a O stager O that O can O download O the O next O - O stage O payload O from O its O command O - O andcontrol O ( O C&C O ) O server O . O This O malware O was O first O disclosed O by O Cisco O Talos O in O May O 2022 O . O O Once O the O .dll O is O executed O , O it O first O checks O if O the O same O process O is O already O running O by O calling O O OpenEventA. O According O to O the O tweet O posted O by O Barberousse O , O some O noteworthy O event O names O O are O identified O as O usernames O of O other O cybersecurity O researchers O on O Twitter O , O such O as O O " O moto_sato O " O , O " O xaacrazyman_armyCIAx O , O " O and O " O JohnHammondTeam O . O " O It O is O important O to O note O O that O these O researchers O have O nothing O to O do O with O PUBLOAD O but O were O simply O and O intentionally O O mentioned O by O the O threat O actors O in O the O binaries O . O O Figure O 10 O . O An O example O of O the O special O O event O name O in O PUBLOAD O O Persistence O O PUBLOAD O creates O a O directory O in O < O C:\Users\Public\Libraries\ O > O and O drops O all O the O malware O , O O including O the O malicious O DLL O and O the O legitimate O executable O , O into O the O directory O . O It O then O tries O to O O establish O persistence O in O one O of O the O following O ways O : O O 1 O . O O Adding O a O registry O run O key O O cmd.exe O /C O reg O add O HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run O /v O O Graphics O /t O REG_SZ O /d O \"Rundll32.exe O SHELL32.DLL O , O ShellExec_RunDLL O O \"C:\\Users\\Public\\Libraries\\Graphics\\AdobeLicensing.exe\"\ O " O /f O O 2 O . O O Creating O a O schedule O task O O schtasks.exe O /F O /Create O /TN O Microsoft_Licensing O /sc O minute O /MO O 1 O /TR O O C:\\Users\\Public\\Libraries\\Graphics\\AdobeLicensing.exe O O Anti O - O Antivirus O : O API O with O callback O O 13/30 O O PUBLOAD O malware O decrypts O the O shellcode O in O AES O algorithm O in O memory O . O The O shellcode O is O O invoked O by O creating O a O thread O or O using O different O APIs O . O The O APIs O can O accept O an O argument O of O a O O callback O function O , O working O as O an O alternative O to O trigger O the O shellcode O . O We O observed O several O O leveraged O APIs O including O GrayStringW O , O EnumDateFormatsA O , O and O LineDDA O , O and O can O be O O considered O as O a O technique O to O bypass O antivirus O monitoring O and O detection O . O O Figure O 11 O . O An O example O of O shellcode O callback O in O PUBLOAD O O 14/30 O O Figure O 12 O . O APIs O that O accept O a O callback O function O O C&C O protocol O O The O decrypted O PUBLOAD O shellcode O collects O the O computer O name O and O the O username O as O the O O payload O of O the O first O beacon O . O The O payload O will O then O be O encrypted O with O the O predefined O RC4 O O ( O Rivest O Cipher O 4 O ) O key O . O As O of O this O writing O , O all O the O stagers O we O have O seen O so O far O share O the O same O O key O . O O After O the O encryption O , O the O stager O uses O a O specific O byte O sequence O as O its O packet O ’s O header O . O It O O prepends O the O magic O bytes O " O 17 O 03 O 03 O " O and O the O payload O size O before O the O encrypted O data O . O O Figure O 13 O . O The O RC4 O key O used O ( O top O ) O and O the O packet O body O in O PUBLOAD O malware O ( O bottom O ) O O Name O O Offset O O Size O O Description O O 15/30 O O magic O O 0x0 O O 0X3 O O 17 O 03 O 03 O O size O O 0x3 O O 0x2 O O Payload O size O O payload O O 0x5 O O [ O size O ] O O Payload O O Table O 4 O . O Request O packet O format O in O PUBLOAD O O The O stager O also O checks O if O the O response O packet O has O the O same O magic O header O , O “ O 17 O 03 O 03 O ” O . O If O so O , O O the O downloaded O payload O in O memory O will O be O treated O as O a O piece O of O shellcode O and O will O be O O executed O directly O . O O Noteworthy O debug O strings O O In O early O 2022 O , O we O found O some O samples O of O PUBLOAD O embedded O with O debug O strings O . O They O are O O used O to O distract O analysts O from O the O main O infection O routines O . O O Figure O O 14 O . O The O distracting O debug O strings O in O PUBLOAD O O After O US O House O Speaker O Nancy O Pelosi O ’s O visit O to O Taiwan O in O August O , O we O found O an O archive O file O O named O " O 裴洛西訪台後民意匯總.rar O " O ( O translated O as O “ O The O public O opinion O summary O of O Pelosi O 's O O visit O to O Taiwan O ” O ) O in O Traditional O Chinese O , O but O we O could O only O get O one O of O the O malicious O DLLs O O inside O the O archive O file O . O Since O the O topic O indicated O in O the O file O name O itself O is O considered O a O O controversial O topic O , O it O appears O potentially O catchy O to O the O targeted O recipient O . O The O DLL O turned O out O O to O be O a O PUBLOAD O stager O with O several O output O debug O strings O . O O 16/30 O O 17/30 O O Figure O 15 O . O Debug O strings O in O PUBLOAD O O Trojan O . O Win32.TONEINS O O Trojan O . O Win32.TONEINS O is O the O installer O for O TONESHELL O backdoors O . O The O installer O drops O the O O TONESHELL O malware O to O the O % O PUBLIC% O folder O and O establishes O the O persistence O for O it O . O O TONEINS O malware O usually O comes O in O the O lure O archives O , O and O in O most O cases O , O the O name O of O the O O TONEINS O DLL O is O libcef.dll O . O The O malicious O routine O is O triggered O via O calling O its O export O function O O cef_api_hash O . O O The O TONEINS O malware O is O obfuscated O , O likely O to O slow O down O malware O analysis O . O It O contains O a O lot O O of O junk O codes O in O its O control O flow O and O has O plenty O of O useless O XOR O instructions O as O though O to O O imply O that O these O are O used O to O decode O strings O . O Upon O checking O , O we O found O that O these O obfuscated O O codes O were O reused O from O an O open O - O source O repository O . O O Figure O 16 O . O Code O O obfuscation O in O TONEINS O O The O installer O establishes O the O persistence O for O TONESHELL O backdoors O by O using O the O following O O schtasks O command O : O O schtasks O /create O /sc O minute O /mo O 2 O /tn O " O ServiceHub O . O TestWindowStoreHost O " O /tr O O " O C:\Users\Public\Pictures\ServiceHub O . O TestWindowStoreHost.exe O " O /f O O Based O on O our O observations O , O the O file O names O for O the O dropped O TONESHELL O malware O differ O in O O case O , O and O so O do O the O names O of O the O scheduled O tasks O . O After O persistence O is O established O , O O TONESHELL O then O copies O the O legitimate O executable O and O the O malicious O DLL O to O the O O % O PUBLIC% O folder O , O wherein O both O files O have O names O that O start O with O “ O ~ O ” O in O the O lure O archive O . O In O O this O sample O , O ~$20220817.docx O is O a O legitimate O executable O used O for O DLL O sideloading O , O and O O ~$20220617(1).docx O is O the O TONESHELL O backdoor O DLL O to O be O installed O . O O 18/30 O O Figure O 17 O . O Files O with O fake O file O extensions O O Backdoor O . O Win32.TONESHELL O O The O TONESHELL O malware O is O the O main O backdoor O used O in O this O campaign O . O It O is O a O shellcode O O loader O that O loads O and O decodes O the O backdoor O shellcode O with O a O 32 O - O byte O key O in O memory O . O In O the O O earlier O version O of O TONESHELL O , O it O has O the O capabilities O from O TONEINS O malware O , O including O O establishing O persistence O and O installing O backdoors O . O However O , O the O more O recent O version O of O O TONESHELL O is O a O standalone O backdoor O without O any O installer O capabilities O ( O such O as O the O file O O ~$Talk O points.docx O ) O . O It O is O also O obfuscated O in O a O similar O fashion O to O TONEINS O malware O , O O indicating O that O the O actors O continue O to O update O the O arsenal O and O separate O the O tools O in O order O to O O bypass O detection O . O O Anti O - O Analysis O : O Process O name O check O O In O order O to O make O sure O that O the O TONESHELL O is O installed O correctly O , O O Backdoor O . O Win32.TONESHELL O first O checks O if O the O process O path O matches O the O expected O one O . O If O O so O , O the O malicious O code O could O be O triggered O by O the O custom O exception O handler O . O O Figure O 18 O . O Process O name O check O in O TONESHELL O O Anti O - O Analysis O : O Custom O exception O handler O in O C++ O O Interestingly O , O the O adversary O hides O the O actual O code O flow O with O the O implementation O of O custom O O exception O handlers O . O Different O exception O handlers O will O be O invoked O based O on O the O result O of O the O O process O name O check O , O continuing O the O malicious O routine O by O triggering O the O exception O with O the O O call O _ O CxxThrowException O . O After O it O is O invoked O , O the O C++ O runtime O will O find O the O corresponding O O exception O handler O from O the O ThrowInfo O structure O all O the O way O down O to O the O CatchProc O member O in O O the O _ O msRttiDscr O structure O , O which O contains O the O real O malicious O codes O . O In O this O sample O , O the O O exception O handler O is O located O at O the O offset O 0x10005300 O . O This O technique O not O only O hides O the O O execution O flow O but O also O stops O the O execution O of O the O analyst O 's O debugger O . O O 19/30 O O Figure O 19 O . O Data O workflow O of O exception O handling O in O C++ O ; O the O CatchProc O member O in O the O yellow O O circle O is O the O malicious O exception O handler O to O be O invoked O O Figure O 20 O . O The O main O malicious O routine O in O the O exception O handler O O Anti O - O Analysis O : O ForegroundWindow O check O O Looking O at O more O recent O TONESHELL O samples O , O we O noticed O that O a O new O anti O - O sandbox O O technique O is O added O compared O to O the O earlier O versions O . O The O newer O versions O invoke O the O O GetForegroundWindow O API O twice O and O check O if O there O is O any O window O switch O . O If O the O environment O O is O a O sandbox O , O both O calls O will O get O the O same O window O handle O because O there O is O no O human O O interaction O involved O in O most O sandboxes O , O resulting O in O the O foreground O window O not O changing O . O In O O addition O , O as O an O anti O - O sandbox O and O delayed O execution O technique O , O the O malicious O routine O can O only O O be O triggered O if O the O foreground O window O has O already O been O switched O for O the O fifth O time O . O O Figure O O 21 O . O GetForegroundWindow O check O in O newer O TONESHELL O samples O O 20/30 O O Figure O 22 O . O Malicious O routine O triggered O on O the O fifth O window O switch O O Shellcode O decoding O O After O the O malicious O exception O handler O is O triggered O , O it O starts O to O decode O the O next O - O stage O O TONESHELL O shellcode O . O To O decode O the O shellcode O , O it O first O decodes O a O 32 O - O byte O key O in O XOR O O operations O with O 0x7D O , O and O the O key O will O then O be O used O to O decode O the O shellcode O body O . O O Figure O 23 O . O An O O example O of O the O 32 O - O byte O key O ( O top O ) O and O the O TONESHELL O shellcode O before O decoding O ( O middle O ) O O and O after O decoding O ( O bottom O ) O O Evolving O variants O O After O our O analysis O and O further O threat O hunting O , O we O found O several O variants O of O TONESHELL O O shellcode O : O O First O observed O O Variant O O Protocol O O C&C O encryption O O Supported O functions O O May O 2022 O O A O O Raw O TCP O O RC4 O O File O upload O O File O download O O File O execution O O Lateral O movement O O Jul O 2022 O O B O O Raw O TCP O O 32 O - O byte O XOR O O File O upload O O Lateral O movement O O Sep O 2021 O O C O O HTTP O O RC4 O O File O upload O O File O execution O O Table O 5 O . O Differences O between O TONESHELL O variants O O Variant O A O O 21/30 O O TONESHELL O supports O up O to O 10 O C&C O servers O by O design O , O but O in O all O the O samples O we O O encountered O only O one O C&C O server O was O used O . O Before O connecting O to O the O C&C O server O , O it O O generates O a O victim O ID O ( O the O variable O unique_id O ) O with O the O victim O 's O volume O serial O and O the O O computer O name O , O or O with O a O randomly O generated O GUID O . O O Figure O 24 O . O Finding O 10 O C&C O servers O supported O in O TONESHELL O O Figure O 25 O . O The O algorithm O used O to O generate O the O victim O ’s O ID O in O TONESHELL O variant O A O O In O the O first O beacon O , O it O collects O the O following O data O from O the O victim O 's O machine O and O sends O them O to O O the O C&C O server O : O O 1 O . O Current O process O ID O O 2 O . O Volume O serial O O 3 O . O Username O O 4 O . O Computer O name O O 5 O . O Product O name O O 6 O . O Operating O system O bit O O 7 O . O Processes O list O O TONESHELL O communicates O over O raw O TCP O , O with O the O request O header O and O the O response O O header O starting O with O the O specific O magic O byte O sequence O " O 17 O 03 O 03 O " O . O Based O on O our O research O , O O this O magic O header O is O used O in O all O TONESHELL O TCP O variants O and O the O identified O PUBLOAD O O 22/30 O O malware O . O The O payload O in O the O packet O will O be O encrypted O in O RC4 O algorithm O . O In O this O variant O , O its O O request O packet O format O is O as O follows O : O O Name O O Offset O O Size O O Description O O magic O O 0x0 O O 0x3 O O 17 O 03 O 03 O O size O O 0x3 O O 0x2 O O Payload O size O O type O O 0x5 O O 0x1 O O Connection O type O , O 0x0 O or O 0x1 O O unique_id O O 0x6 O O 0x4 O O Victim O ID O O payload O O 0x10 O O [ O size O ] O O Payload O O Table O 6 O . O Request O packet O format O in O TONESHELL O variant O A O O Figure O 26 O . O Packet O header O check O in O O TONESHELL O ( O all O TCP O variants O and O stagers O ) O O The O backdoor O supports O various O functions O , O including O file O upload O , O file O download O , O file O execution O , O O and O lateral O movement O . O We O also O noticed O that O its O internal O strings O are O self O - O explanatory O . O In O fact O , O O this O malware O is O named O TONESHELL O after O the O typo O found O in O its O command O " O TOnePipeShell O " O . O O The O following O table O shows O all O of O its O commands O : O O Code O O Internal O string O O Additional O description O O 0x1 O O - O O Reset O OnePipeShell O & O TwoPipeShell O O 0x7 O O - O O Reset O OnePipeShell O & O TwoPipeShell O O 0x3 O O - O O Unknown O O 0x4 O O - O O Change O sleep O seconds O O 0x1A O O Upload O file O O begin O O 0x1B O O Upload O file O O begin O O 0x1D O O Upload O file O O cancel O O 0x1C O O Upload O file O O Endup O O 0x10 O O Exec O file O O 23/30 O O 0x21 O O Create O O TOnePipeShell O O 0x22 O O OnePipeShell O O Close O O 0x1E O O TwoPipeShell O O Create O O 0x1F O O TwoPipeShell O O Write O File O O 0x20 O O TwoPipeShell O O Close O O 0x18 O O Download O O 0x19 O O CDownUpLoad O O 0x21 O O - O O OnePipeShell O : O one O - O way O shell O over O one O named O pipe O ( O meant O for O O data O exchange O on O intranet O ) O O TwoPipeShell O : O two O - O way O shell O over O two O named O pipes O ( O meant O for O O data O exchange O on O intranet O ) O O Exit O O Table O 7 O . O Command O codes O in O TONESHELL O variant O A O O Variant O B O O TONESHELL O variant O B O is O slightly O different O from O variant O A O wherein O the O victim O ID O is O generated O O from O the O tick O count O , O username O , O and O computer O name O instead O . O O Figure O 27 O . O Different O O algorithm O for O the O victim O ID O generation O in O TONESHELL O variant O B O O The O backdoor O 's O protocol O is O also O different O . O The O payload O in O the O packet O is O encoded O with O a O O random O 32 O - O byte O key O , O and O the O key O differs O from O packet O to O packet O . O The O new O key O is O generated O O whenever O a O new O request O is O made O . O O Name O O Offset O O Size O O Description O O magic O O 0x0 O O 0x3 O O 17 O 03 O 03 O O size O O 0x3 O O 0x2 O O Payload O size O O 24/30 O O key O O 0x5 O O 0x20 O O 32 O - O byte O XOR O key O O payload O O 0x25 O O [ O size O ] O O Payload O O Table O 8 O . O Request O packet O format O in O TONESHELL O variant O B O O Figure O O 28 O . O In O TONESHELL O variant O B O , O the O payload O will O be O encoded O in O XOR O operations O before O a O O request O is O made O . O O The O command O codes O in O this O variant O are O as O follows O : O O Code O O Internal O string O O Description O O 0x9 O O - O O Reset O OnePipeShell O O 0xA O O - O O Reset O OnePipeShell O O 0x3 O O - O O Unknown O O 0x4 O O - O O Change O sleep O seconds O O 0x4 O O Upload O file O begin O O 0x5 O O Upload O file O write O O 0x7 O O Upload O file O cancel O O 0x6 O O Upload O file O Endup O O 0x3 O O Create O TOnePipeShell O O Table O 9 O . O Command O codes O in O TONESHELL O Variant O B O O Variant O C O O During O our O research O , O we O hunted O a O dumped O TONESHELL O shellcode O from O VirusTotal O ( O SHA256 O : O O 521662079c1473adb59f2d7134c8c1d76841f2a0f9b9e6e181aa54df25715a09 O ) O . O Our O analysis O O showed O it O works O similar O to O the O two O different O variants O , O but O the O C&C O protocol O used O is O HTTP O . O It O O 25/30 O O seems O to O be O the O earlier O version O of O TONESHELL O because O the O sample O was O uploaded O in O O September O 2021 O , O and O uses O the O POST O method O for O the O first O beacon O . O The O following O data O is O O collected O from O the O victim O 's O machine O : O O 1 O . O Memory O size O O 2 O . O Username O O 3 O . O Computer O name O O 4 O . O Disk O size O O 5 O . O Operating O system O bit O O 6 O . O Product O name O O Figure O 29 O . O O The O first O HTTP O beacon O request O in O TONESHELL O Variant O C O O The O victim O 's O ID O ( O specified O by O the O " O Guid O " O header O in O the O first O beacon O and O later O used O in O the O O " O Cookie O " O header O ) O is O also O generated O from O a O random O GUID O . O The O body O is O also O encrypted O in O RC4 O , O O and O the O command O codes O are O much O like O Variant O B O as O follows O : O O Code O O Internal O string O O Additional O description O O 0x2 O O - O O Reset O OnePipeShell O O 0x7 O O - O O Reset O OnePipeShell O O 0x3 O O - O O Unknown O O 0x4 O O - O O Change O sleep O seconds O O 0x1A O O Upload O file O begin O O 0x1B O O Upload O file O write O O 26/30 O O 0x1D O O Upload O file O cancel O O 0x1C O O Upload O file O Endup O O 0x10 O O Exec O file O O Table O 10 O . O Command O codes O in O TONESHELL O variant O C O O Threat O hunting O O We O observed O that O several O TONESHELL O and O TONEINS O malware O samples O were O uploaded O to O O VirusTotal O in O recent O months O . O With O the O help O of O these O , O we O collected O several O Google O Drive O links O , O O such O as O 770d5b60d8dc0f32941a6b530c9598df92a7ec76b60309aa8648f9b3a3f3cca5 O . O O Figure O 30 O . O Example O of O a O Google O Drive O link O , O found O in O the O wild O , O containing O both O TONESHELL O O and O TONEINS O O Usually O , O we O see O such O download O links O as O the O first O arrival O vectors O . O The O Google O Drive O direct O O download O link O is O represented O in O the O format O https[:]//drive.google.com O / O uc O ? O O id O = O gdrive_file_id&export O = O download O . O The O gdrive_file_id O is O a O unique O identifier O for O this O specific O O file O . O We O can O switch O to O web O viewer O to O check O its O file O contents O and O its O owner O by O modifying O the O O URL O : O https[:]//drive.google.com O / O file O / O d O / O gdrive_file_id O / O view O . O O In O the O details O panel O , O we O can O find O the O owner O of O this O file O , O and O by O hovering O on O the O icon O we O can O get O O the O email O address O . O O Figure O 31 O . O The O web O viewer O of O Google O Drive O O 27/30 O O Figure O 32 O . O The O file O owner O 's O O name O and O email O address O O We O can O conduct O further O research O with O this O specific O email O account O . O For O example O , O after O our O O investigation O , O we O know O that O the O actors O abused O the O same O email O address O to O store O the O lure O O archives O in O Google O Drive O , O as O well O as O deliver O the O phishing O email O . O If O we O hunt O for O this O specific O O email O address O in O the O monitoring O logs O , O we O might O find O more O distributed O malware O . O O Attribution O O The O observed O TTPs O in O this O campaign O are O similar O to O the O campaign O mentioned O by O O Secureworks O . O Both O campaigns O abused O the O .lnk O files O to O trigger O the O malware O . O Compared O to O the O O said O report O ’s O observations O , O the O archive O we O found O in O this O campaign O share O similar O folder O O structures O . O O Figure O 33 O . O Similar O folder O structure O of O BRONZE O PRESIDENT O ( O left O ) O and O Earth O Preta O ( O right O ) O O Based O on O the O same O report O , O Bronze O President O was O known O to O be O leveraging O APIs O with O a O O callback O function O argument O to O invoke O the O shellcode O like O EnumThreadWindows O . O Similar O O techniques O are O also O used O in O PUBLOAD O malware O . O O In O addition O , O we O also O spotted O a O link O between O the O two O campaigns O : O One O of O the O C&C O servers O O ( O 98[.]142[.]251[.]29 O ) O can O be O correlated O to O a O shortcut O file O . O This O shortcut O file O appears O in O one O lure O O archive O “ O EU O 31st O session O of O the O Commission O on O Crime O Prevention O and O Criminal O Justice O O United O Nations O on O Drugs O and O Crime.rar O ” O ( O SHA256 O : O O 09fc8bf9e2980ebec1977a8023e8a2940e6adb5004f48d07ad34b71ebf35b877 O ) O , O which O the O O Secureworks O report O also O mentioned O . O We O used O the O tool O LECmd O to O parse O the O shortcut O files O O wherein O we O found O the O specific O C&C O string O inside O the O metadata O of O the O .lnk O file O . O It O seems O that O O the O actor O used O the O C&C O string O as O the O folder O name O . O O 28/30 O O Figure O 34 O . O Metadata O of O the O .lnk O file O ( O SHA256 O : O O a693b9f9ffc5f4900e094b1d1360f7e7b907c9c8680abfeace34e1a8e380f405 O ) O O Third O , O the O infection O chains O mentioned O by O Cisco O Talos O also O resemble O what O we O have O observed O O recently O : O O 1 O . O Both O use O schtasks O and O registry O run O key O for O persistence O . O O 2 O . O Both O use O benign O executables O for O DLL O sideloading O . O O 3 O . O Both O use O malicious O archives O for O arrival O vectors O . O O Most O importantly O , O the O stager O mentioned O in O the O report O uses O the O same O magic O header O ( O 17 O 03 O 03 O ) O O as O TONESHELL O does O in O the O C&C O communication O protocol O , O thereby O solidifying O these O malware O O families O ’ O link O to O Earth O Preta O . O O Conclusion O O Earth O Preta O is O a O cyberespionage O group O known O to O develop O their O own O loaders O in O combination O O with O existing O tools O like O PlugX O and O Cobalt O Strike O for O compromise O . O Recent O research O papers O O show O that O it O is O constantly O updating O its O toolsets O and O indicate O that O it O is O further O expanding O its O O capabilities O . O O Based O on O our O analysis O , O once O the O group O has O infiltrated O a O targeted O victim O ’s O systems O , O the O O sensitive O documents O stolen O can O be O abused O as O the O entry O vectors O for O the O next O wave O of O O intrusions O . O This O strategy O largely O broadens O the O affected O scope O in O the O region O involved O . O For O the O O group O ’s O objectives O , O the O targeted O area O appears O to O be O the O countries O in O Asia O . O O As O part O of O organizational O mitigation O plans O , O we O recommend O implementing O continuous O phishing O O awareness O trainings O for O partners O and O employees O . O We O advise O always O checking O the O sender O and O O the O subject O twice O before O opening O an O email O , O especially O with O an O unidentifiable O sender O or O an O O unknown O subject O . O We O also O recommend O a O multi O - O layered O protection O solution O is O recommended O to O O detect O and O block O threats O as O far O left O to O the O malware O infection O chain O as O possible O . O O MITRE O ATT&CK O O 29/30 O O MITRE O ATT&CK O table O O Indicators O of O Compromise O ( O IOCs O ) O O The O full O list O of O IOCs O can O be O found O here O . O O 30/30 O