%3CLINGO-SUB%20id%3D%22lingo-sub-1995095%22%20slang%3D%22en-US%22%3ESolarWinds%20Post-Compromise%20Hunting%20with%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1995095%22%20slang%3D%22en-US%22%3E%3CP%3EMicrosoft%20recently%20blogged%20about%20the%20%3CA%20href%3D%22https%3A%2F%2Fblogs.microsoft.com%2Fon-the-issues%2F2020%2F12%2F13%2Fcustomers-protect-nation-state-cyberattacks%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ERecent%20Nation-State%20Cyber%20Attacks%3C%2FA%3E%20that%20has%20impacted%20high%20value%20targets%20both%20across%20the%20government%20and%20private%20sector.%20This%20attack%20is%20also%20known%20as%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fwdsi%2Fthreats%2Fmalware-encyclopedia-description%3FName%3DTrojan%3AMSIL%2FSolorigate.B!dha%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESolorigate%3C%2FA%3E%20or%20%3CA%20href%3D%22https%3A%2F%2Fwww.fireeye.com%2Fblog%2Fthreat-research%2F2020%2F12%2Fevasive-attacker-leverages-solarwinds-supply-chain-compromises-with-sunburst-backdoor.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESunburst%3C%2FA%3E.%20This%20threat%20actor%20is%20believed%20to%20be%20highly%20sophisticated%20and%20motivated.%20Relevant%20security%20data%20required%20for%20hunting%20and%20investigating%20such%20a%20complex%20attack%20is%20produced%20in%20multiple%20locations%20-%20cloud%2C%20on-premises%20and%20across%20multiple%20security%20tools%20and%20product%20logs.%26nbsp%3B%20Being%20able%20to%20analyze%20all%20the%20data%20from%20a%20single%20point%20makes%20it%20easier%20to%20spot%20trends%20and%20attacks.%20Azure%20Sentinel%20has%20made%20it%20easy%20to%20collect%20data%20from%20multiple%20data%20sources%20across%20different%20environments%20both%20on-prem%20and%20cloud%20with%20the%20goal%20of%20connecting%20that%20data%20together%20more%20easily.%20This%20blog%20post%20contains%20guidance%20and%20generic%20approaches%20to%20hunt%20for%20attacker%20activity%20(TTPs)%20in%20data%20that%20is%20available%20by%20default%20in%20Azure%20Sentinel%20or%20can%20be%20onboarded%20to%20Azure%20Sentinel.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20goal%20of%20this%20article%20is%20post-compromise%20investigation%20strategies%20and%20is%20focused%20on%20TTPs%20and%20not%20focused%20on%20specific%20IOCs.%26nbsp%3B%20Azure%20Sentinel%20customers%20are%20encouraged%20to%20review%20advisories%20and%20IOC%E2%80%99s%20shared%20by%20Microsoft%20MSRC%20and%20security%20partners%20to%20search%20on%20specific%20IOC%E2%80%99s%20in%20their%20environment%20using%20Azure%20Sentinel.%26nbsp%3B%20Links%20to%20these%20IOC%E2%80%99s%20are%20listed%20in%20the%20reference%20section%20at%20the%20end.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20make%20it%20easier%20for%20security%20teams%20to%20visualize%20and%20monitor%20their%20environments%20for%20this%20attack%20the%20MSTIC%20team%20has%20shared%20a%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FWorkbooks%2FSolarWindsPostCompromiseHunting.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESolarWinds%20Post%20Compromise%3C%2FA%3E%20hunting%20workbook%20via%20Azure%20Sentinel%20and%20Azure%20Sentinel%20GitHub.%20There%20are%20many%20things%20in%20this%20workbook%20that%20threat%20hunters%20would%20find%20useful%20and%20the%20workbook%20is%20complimentary%20to%20the%20hunting%20methods%20shared%20below.%20Importantly%2C%20if%20you%20have%20recently%20rotated%20ADFS%20key%20material%20this%20workbook%20can%20be%20useful%20in%20identifying%20attacker%20logon%20activity%20if%20they%20logon%20with%20old%20key%20material.%20Security%20teams%20should%20leverage%20this%20hunting%20workbook%20as%20part%20of%20their%20workflow%20in%20investigating%20this%20attack.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20to%20the%20MSTIC%20and%20M365%20teams%20for%20collaborating%20to%20deliver%20this%20content%20in%20a%20timely%20manner.%26nbsp%3B%20This%20document%20will%20be%20updated%20as%20needed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20note%20that%20since%20Azure%20Sentinel%20and%20the%20M365%20Advanced%20Hunting%20portal%20share%20the%20same%20query%20language%20and%20share%20similar%20data%20types%2C%20all%20of%20the%20referenced%20queries%20can%20be%20used%20directly%20or%20slightly%20modified%20to%20work%20in%20both.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-617980909%22%20id%3D%22toc-hId-617980909%22%3EGaining%20a%20foothold%3C%2FH1%3E%0A%3CP%3EAs%20shared%20in%20Microsoft%E2%80%99s%20technical%20blog%20%E2%80%93%20%3CA%20href%3D%22https%3A%2F%2Fmsrc-blog.microsoft.com%2F2020%2F12%2F13%2Fcustomer-guidance-on-recent-nation-state-cyber-attacks%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECustomer%20Guidance%20on%20Recent%20Nation-state%20Cyber%20Attacks%3C%2FA%3E%20-%20attackers%20might%20have%20compromised%20the%20internal%20build%20systems%20or%20the%20update%20distribution%20systems%20of%20SolarWinds%20Orion%20software%20then%20modified%20a%20DLL%20component%20in%20the%20legitimate%20software%20and%20embedded%20backdoor%20code%20that%20would%20allow%20these%20attackers%20to%20remotely%20perform%20commands%20or%20deliver%20additional%20payloads.%20Below%20is%20a%20representation%20of%20various%20attack%20stages%20which%20you%20can%20also%20see%20in%20%3CA%20href%3D%22https%3A%2F%2Fsecuritycenter.windows.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Threat%20Protection%20(MTP)%20portal%3C%2FA%3E.%26nbsp%3B%20Note%20that%20if%20you%20do%20not%20have%20Microsoft%20Threat%20Protection%20this%20link%20will%20not%20work%20for%20you.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Image1.png%22%20style%3D%22width%3A%20729px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F241151i3FE658CAF9C33585%2Fimage-dimensions%2F729x481%3Fv%3D1.0%22%20width%3D%22729%22%20height%3D%22481%22%20role%3D%22button%22%20title%3D%22Image1.png%22%20alt%3D%22Image1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E2%80%83%3C%2FP%3E%0A%3CP%3ETo%20hunt%20for%20similar%20TTPs%20used%20in%20this%20attack%2C%20a%20good%20place%20to%20start%20is%20to%20build%20an%20inventory%20of%20the%20machines%20that%20have%20SolarWinds%20Orion%20components.%20Organizations%20might%20already%20have%20a%20software%20inventory%20management%20system%20to%20indicate%20hosts%20where%20the%20SolarWinds%20application%20is%20installed.%20Alternatively%2C%20Azure%20Sentinel%20could%20be%20leveraged%20to%20run%20a%20simple%20query%20to%20gather%20similar%20details.%20Azure%20Sentinel%20collects%20data%20from%20multiple%20different%20logs%20that%20could%20be%20used%20to%20gather%20this%20information.%20For%20example%2C%20through%20the%20recently%20released%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsentinel%2Fconnect-microsoft-365-defender%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20365%20Defender%20connector%3C%2FA%3E%3C%2FSPAN%3E%2C%20security%20teams%20can%20now%20easily%20ingest%20Microsoft%20365%20raw%20data%20into%20Azure%20Sentinel.%20Using%20the%20ingested%20data%2C%20a%20simple%20query%20like%20below%20can%20be%20written%20that%20will%20pull%20the%20hosts%20with%20SolarWinds%20process%20running%20in%20last%2030%20days%20based%20on%20Process%20execution%20either%20via%20host%20on%20boarded%20to%20Sentinel%20or%20on%20boarded%20via%20Microsoft%20Defender%20for%20Endpoints%20(MDE).%20The%20query%20also%20leverages%20the%20Sysmon%20logs%20that%20a%20lot%20of%20customers%20are%20collecting%20from%20their%20environment%20to%20surface%20the%20machines%20that%20have%20SolarWinds%20running%20on%20them.%20Similar%20queries%20that%20leverage%20M365%20raw%20data%20could%20also%20be%20run%20from%20the%20M365's%20Advanced%20hunting%20portal.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FMultipleDataSources%2FSolarWindsInventory.yaml%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ESolarWindows%20Inventory%20check%20query%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3Elet%26nbsp%3Btimeframe%26nbsp%3B%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E30%3C%2FSPAN%3E%3CSPAN%3Ed%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Eunion%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Bisfuzzy%3D%3C%2FSPAN%3E%3CSPAN%3Etrue%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3ESecurityEvent%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BTimeGenerated%26nbsp%3B%26gt%3B%3D%26nbsp%3Bago%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Etimeframe%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BEventID%26nbsp%3B%3D%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E'4688'%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Btolower%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ENewProcessName%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ehas%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E'solarwinds'%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineName%26nbsp%3B%3D%26nbsp%3BComputer%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BProcess%26nbsp%3B%3D%26nbsp%3BNewProcessName%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BStartTime%26nbsp%3B%3D%26nbsp%3Bmin%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BEndTime%26nbsp%3B%3D%26nbsp%3Bmax%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineCount%26nbsp%3B%3D%26nbsp%3Bdcount%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EMachineName%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BAccountCount%26nbsp%3B%3D%26nbsp%3Bdcount%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EAccount%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineNames%26nbsp%3B%3D%26nbsp%3Bmake_set%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EMachineName%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BAccounts%26nbsp%3B%3D%26nbsp%3Bmake_set%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EAccount%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BProcess%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BType%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3EDeviceProcessEvents%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BTimeGenerated%26nbsp%3B%26gt%3B%3D%26nbsp%3Bago%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Etimeframe%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Btolower%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EInitiatingProcessFolderPath%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ehas%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E'solarwinds'%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineName%26nbsp%3B%3D%26nbsp%3BDeviceName%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BProcess%26nbsp%3B%3D%26nbsp%3BInitiatingProcessFolderPath%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BAccount%26nbsp%3B%3D%26nbsp%3BAccountName%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BStartTime%26nbsp%3B%3D%26nbsp%3Bmin%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BEndTime%26nbsp%3B%3D%26nbsp%3Bmax%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineCount%26nbsp%3B%3D%26nbsp%3Bdcount%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EMachineName%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BAccountCount%26nbsp%3B%3D%26nbsp%3Bdcount%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EAccount%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineNames%26nbsp%3B%3D%26nbsp%3Bmake_set%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EMachineName%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BAccounts%26nbsp%3B%3D%26nbsp%3Bmake_set%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EAccount%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BProcess%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BType%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3EEvent%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BTimeGenerated%26nbsp%3B%26gt%3B%3D%26nbsp%3Bago%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Etimeframe%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BSource%26nbsp%3B%3D%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Microsoft-Windows-Sysmon%22%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BEventID%26nbsp%3B%3D%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BImage%26nbsp%3B%3D%26nbsp%3BEventDetail%3C%2FSPAN%3E%3CSPAN%3E.%5B%3C%2FSPAN%3E%3CSPAN%3E4%3C%2FSPAN%3E%3CSPAN%3E%5D.%5B%3C%2FSPAN%3E%3CSPAN%3E%22%23text%22%3C%2FSPAN%3E%3CSPAN%3E%5D%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Btolower%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EImage%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ehas%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E'solarwinds'%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineName%26nbsp%3B%3D%26nbsp%3BComputer%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BProcess%26nbsp%3B%3D%26nbsp%3BImage%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BAccount%26nbsp%3B%3D%26nbsp%3BUserName%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BStartTime%26nbsp%3B%3D%26nbsp%3Bmin%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BEndTime%26nbsp%3B%3D%26nbsp%3Bmax%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineCount%26nbsp%3B%3D%26nbsp%3Bdcount%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EMachineName%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BAccountCount%26nbsp%3B%3D%26nbsp%3Bdcount%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EAccount%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BMachineNames%26nbsp%3B%3D%26nbsp%3Bmake_set%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EMachineName%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BAccounts%26nbsp%3B%3D%26nbsp%3Bmake_set%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EAccount%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BProcess%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BType%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Elet%26nbsp%3Btimeframe%26nbsp%3B%3D%26nbsp%3B30d%3B%26nbsp%3B%20(union%26nbsp%3Bisfuzzy%3Dtrue%26nbsp%3B%20(%26nbsp%3B%20SecurityEvent%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3BTimeGenerated%26nbsp%3B%26gt%3B%3D%26nbsp%3Bago(timeframe)%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3BEventID%26nbsp%3B%3D%3D%26nbsp%3B'4688'%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3Btolower(NewProcessName)%26nbsp%3Bhas%26nbsp%3B'solarwinds'%26nbsp%3B%20%7C%26nbsp%3Bextend%26nbsp%3BMachineName%26nbsp%3B%3D%26nbsp%3BComputer%26nbsp%3B%2C%26nbsp%3BProcess%26nbsp%3B%3D%26nbsp%3BNewProcessName%20%7C%26nbsp%3Bsummarize%26nbsp%3BStartTime%26nbsp%3B%3D%26nbsp%3Bmin(TimeGenerated)%2C%26nbsp%3BEndTime%26nbsp%3B%3D%26nbsp%3Bmax(TimeGenerated)%2C%26nbsp%3BMachineCount%26nbsp%3B%3D%26nbsp%3Bdcount(MachineName)%2C%26nbsp%3BAccountCount%26nbsp%3B%3D%26nbsp%3Bdcount(Account)%2C%26nbsp%3BMachineNames%26nbsp%3B%3D%26nbsp%3Bmake_set(MachineName)%2C%26nbsp%3BAccounts%26nbsp%3B%3D%26nbsp%3Bmake_set(Account)%26nbsp%3Bby%26nbsp%3BProcess%2C%26nbsp%3BType%20)%2C%26nbsp%3B%20(%26nbsp%3B%20DeviceProcessEvents%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3BTimeGenerated%26nbsp%3B%26gt%3B%3D%26nbsp%3Bago(timeframe)%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3Btolower(InitiatingProcessFolderPath)%26nbsp%3Bhas%26nbsp%3B'solarwinds'%26nbsp%3B%20%7C%26nbsp%3Bextend%26nbsp%3BMachineName%26nbsp%3B%3D%26nbsp%3BDeviceName%26nbsp%3B%2C%26nbsp%3BProcess%26nbsp%3B%3D%26nbsp%3BInitiatingProcessFolderPath%2C%26nbsp%3BAccount%26nbsp%3B%3D%26nbsp%3BAccountName%20%7C%26nbsp%3Bsummarize%26nbsp%3BStartTime%26nbsp%3B%3D%26nbsp%3Bmin(TimeGenerated)%2C%26nbsp%3BEndTime%26nbsp%3B%3D%26nbsp%3Bmax(TimeGenerated)%2C%26nbsp%3BMachineCount%26nbsp%3B%3D%26nbsp%3Bdcount(MachineName)%2C%26nbsp%3BAccountCount%26nbsp%3B%3D%26nbsp%3Bdcount(Account)%2C%26nbsp%3BMachineNames%26nbsp%3B%3D%26nbsp%3Bmake_set(MachineName)%2C%26nbsp%3BAccounts%26nbsp%3B%3D%26nbsp%3Bmake_set(Account)%26nbsp%3B%26nbsp%3Bby%26nbsp%3BProcess%2C%26nbsp%3BType%20)%2C%26nbsp%3B%20(%26nbsp%3B%20Event%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3BTimeGenerated%26nbsp%3B%26gt%3B%3D%26nbsp%3Bago(timeframe)%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3BSource%26nbsp%3B%3D%3D%26nbsp%3B%22Microsoft-Windows-Sysmon%22%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3BEventID%26nbsp%3B%3D%3D%26nbsp%3B1%26nbsp%3B%20%7C%26nbsp%3Bextend%26nbsp%3BImage%26nbsp%3B%3D%26nbsp%3BEventDetail.%5B4%5D.%5B%22%23text%22%5D%26nbsp%3B%20%7C%26nbsp%3Bwhere%26nbsp%3Btolower(Image)%26nbsp%3Bhas%26nbsp%3B'solarwinds'%26nbsp%3B%20%7C%26nbsp%3Bextend%26nbsp%3BMachineName%26nbsp%3B%3D%26nbsp%3BComputer%26nbsp%3B%2C%26nbsp%3BProcess%26nbsp%3B%3D%26nbsp%3BImage%2C%26nbsp%3BAccount%26nbsp%3B%3D%26nbsp%3BUserName%20%7C%26nbsp%3Bsummarize%26nbsp%3BStartTime%26nbsp%3B%3D%26nbsp%3Bmin(TimeGenerated)%2C%26nbsp%3BEndTime%26nbsp%3B%3D%26nbsp%3Bmax(TimeGenerated)%2C%26nbsp%3BMachineCount%26nbsp%3B%3D%26nbsp%3Bdcount(MachineName)%2C%26nbsp%3BAccountCount%26nbsp%3B%3D%26nbsp%3Bdcount(Account)%2C%26nbsp%3BMachineNames%26nbsp%3B%3D%26nbsp%3Bmake_set(MachineName)%2C%26nbsp%3BAccounts%26nbsp%3B%3D%26nbsp%3Bmake_set(Account)%26nbsp%3B%26nbsp%3Bby%26nbsp%3BProcess%2C%26nbsp%3BType%20)%26nbsp%3B%20)%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH1%20id%3D%22toc-hId--1189473554%22%20id%3D%22toc-hId--1189473554%22%3EPrivilege%20Escalation%3C%2FH1%3E%0A%3CP%3EOnce%20the%20adversary%20acquires%20an%20initial%20foothold%20on%20a%20system%20thru%20the%20SolarWinds%20process%20they%20will%20have%20System%20account%20level%20access%2C%20the%20attacker%20will%20then%20attempt%20to%20elevate%20to%20domain%20admin%20level%20access%20to%20the%20environment.%20The%20Microsoft%20Threat%20Intelligence%20Center%20(MSTIC)%20team%20has%20already%20delivered%20multiple%20queries%20into%20Azure%20Sentinel%20that%20identify%20similar%20TTPs%20and%20many%20are%20also%20available%20in%20M365.%20These%20methodologies%20are%20not%20specific%20to%20just%20this%20threat%20actor%20or%20this%20attack%20but%20have%20been%20seen%20in%20various%20attack%20campaigns.%3C%2FP%3E%0A%3CP%3EIdentifying%20abnormal%20logon%20activities%20or%20additions%20to%20privileged%20groups%20is%20one%20way%20to%20identify%20privilege%20escalation.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EChecking%20for%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FSecurityEvent%2FHostsWithNewLogons.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehosts%20with%20new%20logons%3C%2FA%3E%20to%20identify%20potential%20lateral%20movement%20by%20the%20attacker.%3C%2FLI%3E%0A%3CLI%3ELook%20for%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FSecurityEvent%2FUserCreatedAddedToBuiltinAdmins_1d.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eaccount%20being%20created%20and%20added%20to%20built-in%20administrators%20group%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EMonitor%20for%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FMultipleDataSources%2FTrackingPrivAccounts.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Erare%20activity%20by%20a%20high-value%20account%3C%2FA%3E%20carried%20out%20on%20a%20system%20or%20service%20Along%20with%20%3CSPAN%3Eadding%20accounts%20to%20a%20domain%20privileged%20group%3C%2FSPAN%3E%20such%20as%20Enterprise%20Admins%2C%20Cert%20Publishers%20or%20DnsAdmins.%3C%2FLI%3E%0A%3CLI%3EAdditionally%2C%20monitor%20for%20%3CA%20style%3D%22font-family%3A%20inherit%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FMultipleDataSources%2FTrackingPrivAccounts.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Erare%20activity%20by%20a%20high-value%20account%3C%2FA%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3Es%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%20which%20has%20been%20carried%20out%20on%20a%20system%20or%20service.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ERelated%20to%20this%20attack%2C%20in%20some%20environments%20service%20account%20credentials%20had%20been%20granted%20administrative%20privileges.%20The%20above%20queries%20can%20be%20modified%20to%20remove%20the%20condition%20of%20focusing%20%E2%80%9CUser%E2%80%9D%20accounts%20by%20commenting%20the%20query%20to%20include%20service%20accounts%20in%20the%20scope%20where%20applicable%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%2F%2F%7C%20where%20AccountType%20%3D%3D%20%22User%22%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20see%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20Github%3C%2FA%3E%20for%20additional%20queries%20and%20hunting%20ideas%20related%20to%20Accounts%20under%20the%20Detections%20and%20Hunting%20Queries%20sections%20for%20AuditLogs%2C%20and%20SecurityEvents%3C%2FP%3E%0A%3CP%3EMicrosoft%20365%20Defender%20team%20has%20also%20shared%20quite%20a%20few%20sample%20queries%20for%20use%20in%20their%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FMicrosoft-365-Defender-Hunting-Queries%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%26nbsp%3Badvanced%20hunting%3C%2FA%3E%3C%2FSPAN%3E%20portal%20that%20could%20be%20leveraged%20to%20detect%20this%20part%20of%20the%20attack.%20Additionally%2C%20the%20logic%20for%20many%20of%20the%20Azure%20Sentinel%20queries%20can%20also%20be%20transformed%20to%20equivalent%20queries%20for%20Microsoft%20365%20Defender%2C%20that%20could%20be%20run%20in%20their%20Advanced%20Hunting%20Portal.%3C%2FP%3E%0A%3CP%3EMicrosoft%20365%20Defender%20has%20an%20upcoming%20complimentary%20blog%20that%20will%20be%20updated%20here%20once%20available.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1298039279%22%20id%3D%22toc-hId-1298039279%22%3ECertificate%20Export%3C%2FH1%3E%0A%3CP%3EThe%20next%20step%20in%20the%20attack%20was%20stealing%20the%20certificate%20that%20signs%20SAML%20tokens%20from%20the%20federation%20server%20(ADFS)%20called%20a%20Token%20Signing%20Cert%20(TSC).%20SAML%20Tokens%26nbsp%3Bare%20basically%20XML%20representations%20of%20claims.%26nbsp%3B%20You%20can%20read%20more%20about%20ADFS%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fhybrid%2Fwhatis-fed%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWhat%20is%20federation%20with%20Azure%20AD%3F%20%7C%20Microsoft%20Docs%3C%2FA%3E%20and%20SAML%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fdevelop%2Fsingle-sign-on-saml-protocol%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Single%20Sign%20On%20SAML%20Protocol%20-%20Microsoft%20identity%20platform%20%7C%20Microsoft%20Docs%3C%2FA%3E.%20The%20process%20is%20as%20follows%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EA%20client%20requests%20a%20SAML%20token%20from%20an%20ADFS%20Server%20by%20authenticating%20to%20that%20server%20using%20Windows%20credentials.%3C%2FLI%3E%0A%3CLI%3EThe%20ADFS%20server%20issues%20a%20SAML%20token%20to%20the%20client.%3C%2FLI%3E%0A%3CLI%3EThe%20SAML%20token%20is%20signed%20with%20a%20certificate%20associated%20with%20the%20server.%3C%2FLI%3E%0A%3CLI%3EThe%20client%20then%20presents%20the%20SAML%20token%20to%20the%20application%20that%20it%20needs%20access%20to.%3C%2FLI%3E%0A%3CLI%3EThe%20signature%20over%20the%20SAML%20token%20tells%20the%20application%20that%20the%20security%20token%20service%20issued%20the%20token%20and%20grants%20access%20to%20the%20client.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EThe%20implication%20of%20stealing%20the%20TSC%20is%20that%20once%20the%20certificate%20has%20been%20acquired%2C%20the%20actor%20can%20forge%20SAML%20tokens%20with%20whatever%20claims%20and%20lifetime%20they%20choose%2C%20then%20sign%20it%20with%20the%20certificate%20that%20has%20been%20acquired.%26nbsp%3BThis%26nbsp%3Benables%20the%20actor%20to%26nbsp%3Bforge%26nbsp%3BSAML%20tokens%20that%20impersonate%20highly%20privileged%20accounts.%26nbsp%3BThere%20are%20many%20publicly%20available%20pen-testing%20tools%20like%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffireeye%2Fadfsdump%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EADFSDump%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffireeye%2Fadfspoof%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EADFSpoof%3C%2FA%3E%20that%20help%20with%20extracting%20required%20information%20from%20ADFS%20configuration%20database%20to%20generate%20the%20forged%20security%20tokens.%20%26nbsp%3BMicrosoft%E2%80%99s%20M365%20Defender%20team%20has%20created%20several%20high-fidelity%20detections%20related%20to%20this.%20A%20few%20of%20them%20include%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EPossible%20attempt%20to%20access%20ADFS%20key%20material%3C%2FSTRONG%3E%20which%20detects%20when%20a%20suspicious%20LDAP%20query%20is%20searching%20for%20sensitive%20key%20material%20in%20AD.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EADFS%20private%20key%20extraction%3C%2FSTRONG%3E%20which%20detects%20ADFS%20private%20key%20extraction%20patterns%20from%20tools%20such%20as%20ADFSDump.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ENote%3A%20These%20detections%20can%20be%20seen%20in%20Azure%20Sentinel%20Security%20Alerts%20or%20in%20the%20M365%20security%20portal.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOutside%20of%20directly%20looking%20for%20tools%2C%20this%20adversary%20may%20have%20used%20custom%20tooling%20so%20looking%20for%20anomalous%20process%20executions%20or%20anomalous%20accounts%20logging%20on%20to%20our%20ADFS%20server%20can%20give%20us%20some%20clue%20when%20such%20attacks%20happen.%20Azure%20Sentinel%20provides%20queries%20that%20can%20help%20to%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EFind%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FSecurityEvent%2FProcessEntropy.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Erare%20anomalous%20process%20in%20your%20environment%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EAlso%20look%20for%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FSecurityEvent%2FRareProcbyServiceAccount.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Erare%20processes%20run%20by%20service%20accounts%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EOr%20uncommon%20processes%20that%20are%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FSecurityEvent%2Funcommon_processes.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ebottom%205%25%20of%20all%20the%20process%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EIn%20some%20instances%2C%20there%20is%20a%20rare%20command%20line%20syntax%20related%20to%20DLL%20loading%2C%20you%20can%20adjust%20these%20queries%20to%20also%20look%20at%20rarity%20on%20the%20command%20line.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EEvery%20environment%20is%20different%20and%20some%20of%20these%20queries%20being%20generic%20could%20be%20noisy.%20So%2C%20in%20the%20first%20step%20a%20good%20approach%20would%20be%20to%20limit%20this%20kind%20of%20hunting%20to%20our%20ADFS%20server.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--509415184%22%20id%3D%22toc-hId--509415184%22%3EAzure%20Active%20Directory%20Hunting%3C%2FH1%3E%0A%3CP%3EHaving%20gained%20a%20significant%20foothold%20in%20the%20on-prem%20environment%2C%20the%20actor%20also%20targeted%20the%20Azure%20AD%20of%20the%20compromised%20organizations%20and%20made%20modifications%20to%20Azure%20AD%20settings%20to%20facilitate%20long%20term%20access.%20The%20MSTIC%20team%20at%20Microsoft%20has%20shared%20many%20relevant%20queries%20through%20the%20Azure%20Sentinel%20Github%20to%20identify%20these%20actions.%3C%2FP%3E%0A%3CP%3EOne%20such%20activity%20is%20related%20to%20modifying%20%3CSTRONG%3Edomain%20federation%20trust%20settings%3C%2FSTRONG%3E.%20In%20layperson%20terms%2C%20a%20federation%20trust%20signifies%20an%20agreement%20between%20two%20organizations%20so%20that%20users%20located%20in%20partner%20organization%20can%20send%20authentication%20requests%20successfully.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThe%20Azure%20Sentinel%20query%20for%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FAuditLogs%2FADFSDomainTrustMods.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edomain%20federation%20trust%20settings%20modification%3C%2FA%3E%20will%20alert%20when%20a%20user%20or%20application%20modifies%20the%20federation%20settings%20on%20the%20domain%20particularly%20when%20a%20new%20Active%20Directory%20Federated%20Service%20(ADFS)%20Trusted%20Realm%20object%2C%20such%20as%20a%20signing%20certificate%2C%20is%20added%20to%20the%20domain.%20Modification%20to%20domain%20federation%20settings%20should%20be%20rare%20hence%20this%20would%20be%20a%20high-fidelity%20alert%20that%20Azure%20Sentinel%20users%20should%20pay%20attention%20to.%3C%2FLI%3E%0A%3CLI%3EIf%20a%20threat%20actor%20obtains%20access%20to%20an%20Application%20Administrator%20account%2C%20they%20may%20configure%20alternate%20authentication%20mechanisms%20for%20direct%20access%20to%20any%20of%20the%20scopes%20and%20services%20available%20to%20the%20Service%20Principal.%20With%20these%20privileges%2C%20the%20actor%20can%20add%20alternative%20authentication%20material%20for%20direct%20access%20to%20resources%20using%20this%20credential.%20The%20team%20has%20produced%20a%20detectoin%20that%20looks%20for%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FAuditLogs%2FNewAppOrServicePrincipalCredential.yaml%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3ENew%20access%20credential%20added%20to%20Application%20or%20Service%20Principal%3C%2FSPAN%3E.%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EWhile%20OAuth%20applications%20in%20this%20intrusion%20campaign%20are%20being%20used%20for%20persistent%20access%20via%20attacker-added%20credentials%2C%20as%20you%20are%20performing%20your%20investigation%20it%20may%20be%20prudent%20to%20review%20OAuth%20applications%20looking%20for%20evidence%20of%20previously%20unknown%20OAuth%20permissions%2C%20such%20as%20those%20that%20can%20read%20sensitive%20data%20and%20provide%20offline%20access%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-indent-padding-left-60px%22%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FAuditLogs%2FMaliciousOAuthApp_O365AttackToolkit.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESuspicious%20application%20consent%20similar%20to%20O365%20Attack%20Toolkit%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-60px%22%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FAuditLogs%2FMaliciousOAuthApp_PwnAuth.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESuspicious%20application%20consent%20similar%20to%20PwnAuth%3C%2FA%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-60px%22%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FAuditLogs%2FSuspiciousOAuthApp_OfflineAccess.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESuspicious%20application%20consent%20for%20offline%20access%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20addition%2C%20all%20of%20these%20queries%20have%20been%20been%20incorporated%20into%20the%20related%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FWorkbooks%2FSolarWindsPostCompromiseHunting.json%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehunting%20workbook%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1978097649%22%20id%3D%22toc-hId-1978097649%22%3EData%20%3CSPAN%3EAccess%3C%2FSPAN%3E%3C%2FH1%3E%0A%3CP%3EAccessing%20confidential%20data%20is%20one%20of%20the%20primary%20motives%20of%20this%20attack.%20Data%20access%20for%20the%20attacker%20here%20relied%20on%20leveraging%20minted%20SAML%20tokens%20to%20access%20user%20files%2Femail%20stored%20in%20the%20cloud%20via%20compromised%20AppIds.%20One%20way%20to%20detect%20this%20is%20when%20a%20user%20or%20application%20signs%20in%20using%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FSigninLogs%2FAzureAADPowerShellAnomaly.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Active%20Directory%20PowerShell%20to%20access%20non-Active%20Directory%20resources%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMicrosoft%20Graph%20is%20one%20way%20that%20the%20attacker%20may%20be%20seen%20accessing%20resources%20and%20can%20help%20find%20what%20the%20attacker%20may%20have%20accessed%20using%20the%20Service%20principal%20Azure%20Active%20Directory%20sign-in%20logs.%20If%20you%20have%20data%20in%20your%20Log%20analytics%20you%20could%20easily%20plot%20a%20chart%20to%20see%20what%20anomalous%20activity%20is%20happening%20in%20your%20environment%20that%20is%20leveraging%20the%20graph.%20Note%20that%20the%20data%20type%20in%20Azure%20Sentinel%20below%20is%20only%20available%20when%20XXX%20is%20configured.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3EAADServicePrincipalSignInLogs%3CBR%20%2F%3E%7C%20where%20TimeGenerated%20%26gt%3B%20ago(90d)%3CBR%20%2F%3E%7C%20where%20ResourceDisplayName%20%3D%3D%20%22Microsoft%20Graph%22%3CBR%20%2F%3E%7C%20where%20ServicePrincipalId%20%3D%3D%20%22524c43c4-c484-4f7a-bd44-89d4a0d8aeab%22%3CBR%20%2F%3E%7C%20summarize%20count()%20by%20bin(TimeGenerated%2C%201h)%3CBR%20%2F%3E%7C%20render%20timechart%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3EAADServicePrincipalSignInLogs%7C%20where%20TimeGenerated%20%26gt%3B%20ago(90d)%7C%20where%20ResourceDisplayName%20%3D%3D%20%22Microsoft%20Graph%22%7C%20where%20ServicePrincipalId%20%3D%3D%20%22524c43c4-c484-4f7a-bd44-89d4a0d8aeab%22%7C%20summarize%20count()%20by%20bin(TimeGenerated%2C%201h)%7C%20render%20timechart%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3ESecurity%20Analysts%20using%20Azure%20Sentinel%20could%20also%20leverage%20KQL's%20built-in%20anomaly%20detection%20algorithms%20to%20find%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FDetections%2FOfficeActivity%2FMailItemsAccessedTimeSeries.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eanomalous%20increases%20in%20Exchange%20mail%20items%20accessed%3C%2FA%3E%20operations%20which%20is%20another%20way%20to%20identify%20this%20attacker%20activity.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20below%20is%20a%20sample%20query%20that%20brings%20out%20some%20of%20the%20logons%20to%20Azure%20AD%20that%20did%20not%20use%20multi%20factor%20authentication.%20It%20is%20possible%20this%20could%20produce%20many%20results%2C%20so%20additional%20tuning%20is%20suggested%20for%20your%20environment.%20This%20attack%20also%20used%20Virtual%20Private%20Servers%20(VPS)%20hosts%20to%20access%20victim%20networks.%20Combining%20the%20query%20below%20with%20data%20that%20list%20VPS%20server%20ranges%20will%20make%20this%20a%20high-confidence%20alert.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3ESigninLogs%3CBR%20%2F%3E%7C%20where%20TimeGenerated%20%26gt%3B%20ago(30d)%3CBR%20%2F%3E%7C%20where%20ResultType%20%3D%3D%200%3CBR%20%2F%3E%7C%20extend%20additionalDetails%20%3D%20tostring(Status.additionalDetails)%3CBR%20%2F%3E%7C%20evaluate%20ipv4_lookup(IP_Data%2C%20IPAddress%2C%20network%2C%20return_unmatched%20%3D%20false)%3CBR%20%2F%3E%7C%20summarize%20make_set(additionalDetails)%2C%20min(TimeGenerated)%2C%20max(TimeGenerated)%20by%20IPAddress%2C%20UserPrincipalName%3CBR%20%2F%3E%7C%20where%20array_length(set_additionalDetails)%20%3D%3D%202%3CBR%20%2F%3E%7C%20where%20(set_additionalDetails%5B1%5D%20%3D%3D%20%22MFA%20requirement%20satisfied%20by%20claim%20in%20the%20token%22%20and%20set_additionalDetails%5B0%5D%20%3D%3D%20%22MFA%20requirement%20satisfied%20by%20claim%20provided%20by%20external%20provider%22)%20or%20(set_additionalDetails%5B0%5D%20%3D%3D%20%22MFA%20requirement%20satisfied%20by%20claim%20in%20the%20token%22%20and%20set_additionalDetails%5B1%5D%20%3D%3D%20%22MFA%20requirement%20satisfied%20by%20claim%20provided%20by%20external%20provider%22)%3CBR%20%2F%3E%2F%2F%7C%20project%20IPAddress%2C%20UserPrincipalName%2C%20min_TimeGenerated%2C%20max_TimeGenerated%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3ESigninLogs%7C%20where%20TimeGenerated%20%26gt%3B%20ago(30d)%7C%20where%20ResultType%20%3D%3D%200%7C%20extend%20additionalDetails%20%3D%20tostring(Status.additionalDetails)%7C%20evaluate%20ipv4_lookup(IP_Data%2C%20IPAddress%2C%20network%2C%20return_unmatched%20%3D%20false)%7C%20summarize%20make_set(additionalDetails)%2C%20min(TimeGenerated)%2C%20max(TimeGenerated)%20by%20IPAddress%2C%20UserPrincipalName%7C%20where%20array_length(set_additionalDetails)%20%3D%3D%202%7C%20where%20(set_additionalDetails%5B1%5D%20%3D%3D%20%22MFA%20requirement%20satisfied%20by%20claim%20in%20the%20token%22%20and%20set_additionalDetails%5B0%5D%20%3D%3D%20%22MFA%20requirement%20satisfied%20by%20claim%20provided%20by%20external%20provider%22)%20or%20(set_additionalDetails%5B0%5D%20%3D%3D%20%22MFA%20requirement%20satisfied%20by%20claim%20in%20the%20token%22%20and%20set_additionalDetails%5B1%5D%20%3D%3D%20%22MFA%20requirement%20satisfied%20by%20claim%20provided%20by%20external%20provider%22)%2F%2F%7C%20project%20IPAddress%2C%20UserPrincipalName%2C%20min_TimeGenerated%2C%20max_TimeGenerated%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EIn%20relation%20to%20the%20VPS%20servers%20section%20above%2C%20the%20previously%20mentioned%20workbook%20has%20a%20section%20that%20shows%20successful%20user%20signins%20from%20VPS%20(Virtual%20Private%20Server)%20providers%20where%20only%20tokens%20were%20used%20to%20authenticate.%20This%20uses%20the%20new%20KQL%20operator%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fipv4-lookup-plugin%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eipv4_lookup%3C%2FA%3E%20to%20evaluate%20if%20a%20login%20came%20from%20a%20known%20VPS%20provider%20network%20range.%20This%20operator%20can%20alternatively%20be%20used%20to%20look%20for%20all%20logons%20not%20coming%20from%20known%20ranges%20should%20your%20environment%20have%20a%20common%20logon%20source.%3C%2FP%3E%0A%3CP%3EIn%20addition%20to%20pre-compromise%20logon%20hunting%20it%20is%20also%20possible%20to%20monitor%20for%20logons%20attempting%20to%20use%20invalid%20key%20material.%20This%20can%20help%20identify%20attempted%20logons%20using%20stolen%20key%20material%20made%20after%20key%20material%20has%20been%20rotated.%20This%20can%20be%20done%20by%20querying%20SigninLogs%20in%20Azure%20Sentinel%20where%20the%20ResultType%20is%205000811.%20%3CSTRONG%3EPlease%20note%3C%2FSTRONG%3E%20that%20if%20you%20roll%20your%20token%20signing%20certificate%2C%20there%20will%20be%20expected%20activity%20when%20searching%20on%20the%20above.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAdditionally%2C%20as%20a%20cloud%20native%20SIEM%20Azure%20Sentinel%20can%20not%20only%20collect%20raw%20data%20from%20various%20disparate%20logs%20but%20it%20also%20gets%20alerts%20from%20various%20security%20products.%20For%20example%2C%20M365%20Defender%20has%20a%20range%20of%20alerts%20for%20various%20attack%20components%20like%20SolarWinds%20malicious%20binaries%2C%20network%20traffic%20to%20the%20compromised%20domains%2C%20DNS%20queries%20for%20known%20patterns%20associated%20with%20SolarWinds%20compromise%20that%20can%20flow%20into%20Sentinel.%20Combining%20these%20alerts%20with%20other%20raw%20logs%20and%20additional%20data%20sources%20provides%20the%20security%20team%20with%20additional%20insights%20as%20well%20as%20a%20complete%20picture%20of%20nature%20and%20the%20scope%20of%20attack.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-170643186%22%20id%3D%22toc-hId-170643186%22%3EReferences%3C%2FH1%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fblogs.microsoft.com%2Fon-the-issues%2F2020%2F12%2F13%2Fcustomers-protect-nation-state-cyberattacks%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ERecent%20Nation-State%20Cyber%20Attacks%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fwdsi%2Fthreats%2Fmalware-encyclopedia-description%3FName%3DBehavior%3AWin32%2FSolorigate.C!dha%26amp%3BThreatID%3D2147771132%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EBehavior%3AWin32%2FSolorigate.C!dha%20threat%20description%20-%20Microsoft%20Security%20Intelligence%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmsrc-blog.microsoft.com%2F2020%2F12%2F13%2Fcustomer-guidance-on-recent-nation-state-cyber-attacks%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECustomer%20guidance%20on%20recent%20nation-state%20cyberattacks%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.fireeye.com%2Fblog%2Fthreat-research%2F2020%2F12%2Fevasive-attacker-leverages-solarwinds-supply-chain-compromises-with-sunburst-backdoor.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EFireEye%20Advisory%3A%20Highly%20Evasive%20Attacker%20Leverages%20SolarWinds%20Supply%20Chain%20to%20Compromise%20Multiple%20Global%20Victims%20With%20SUNBURST%20Backdoor%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffireeye%2Fsunburst_countermeasures%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EFireEye%20GitHub%20page%3A%20Sunburst%20Countermeasures%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcyber.dhs.gov%2Fed%2F21-01%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDHS%20Directive%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.solarwinds.com%2Fsecurityadvisory%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESolarWinds%20Security%20Advisory%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FFalconForceTeam%2FFalconFriday%2Fblob%2Fmaster%2FUncategorized%2FFireEye_red_team_tool_countermeasures.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EFalconFriday%20%E2%80%93%20Fireeye%20Red%20Team%20Tool%20Countermeasures%20KQL%20Queries%20%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FMicrosoft-365-Defender-Hunting-Queries%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft-365-Defender-Hunting-Queries%3A%20Sample%20queries%20for%20Advanced%20hunting%20in%20Microsoft%20365%20Defender%20(github.com)%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FWorkbooks%2FSolarWindsPostCompromiseHunting.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20SolarWinds%20Post%20Compromise%20Hunting%20Workbook%3C%2FA%3E%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel-Notebooks%2Fblob%2Fmaster%2FGuided%2520Investigation%2520-%2520Solarwinds%2520Post%2520Compromise%2520Activity.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20SolarWinds%20Post%20Compromise%20Notebook%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1995095%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Image1.png%22%20style%3D%22width%3A%20799px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F241168iEB718C9675C49CD7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Image1.png%22%20alt%3D%22Image1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EMicrosoft%20recently%20blogged%20about%20the%20%3CA%20href%3D%22https%3A%2F%2Fblogs.microsoft.com%2Fon-the-issues%2F2020%2F12%2F13%2Fcustomers-protect-nation-state-cyberattacks%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ERecent%20Nation-State%20Cyber%20Attacks%3C%2FA%3E%20that%20has%20impacted%20high%20value%20targets%20both%20across%20the%20government%20and%20private%20sector.%20This%20attack%20is%20also%20known%20as%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fwdsi%2Fthreats%2Fmalware-encyclopedia-description%3FName%3DTrojan%3AMSIL%2FSolorigate.B!dha%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESolorigate%3C%2FA%3E%20or%20%3CA%20href%3D%22https%3A%2F%2Fwww.fireeye.com%2Fblog%2Fthreat-research%2F2020%2F12%2Fevasive-attacker-leverages-solarwinds-supply-chain-compromises-with-sunburst-backdoor.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESunburst%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1995095%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHunting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

MSTIC has released a number of new hunting and detection queries for Azure Sentinel based on additional observations as well as research released by partners and the wider community. In addition, the SolarWinds post compromise hunting workbook has been updated to include a number of new sections.  

Blog sections have been marked with Updated and include the date they were last updated.

 

Microsoft recently blogged about the Recent Nation-State Cyber Attacks that has impacted high value targets both across the government and private sector. This attack is also known as Solorigate or Sunburst. This threat actor is believed to be highly sophisticated and motivated. Relevant security data required for hunting and investigating such a complex attack is produced in multiple locations - cloud, on-premises and across multiple security tools and product logs.  Being able to analyze all the data from a single point makes it easier to spot trends and attacks. Azure Sentinel has made it easy to collect data from multiple data sources across different environments both on-prem and cloud with the goal of connecting that data together more easily. This blog post contains guidance and generic approaches to hunt for attacker activity (TTPs) in data that is available by default in Azure Sentinel or can be onboarded to Azure Sentinel. 

 

Associated content details:

Updated 12/18/2020
Currently known in depth attack details have been provided by the M365 and MSTIC teams via the deep dive analysis blog.

Updated 12/21/2020

Current advice for incident responders on recovery from systemic identity compromises has been provided by Microsoft Detection and Response Team.

Updated 12/22/2020

Azure AD Identity admins who want to gain further visibility and understanding related to the identity implications of this attack on their environment can use the newly released Sensitive Operations Report workbook.

Updated 12/26/2020

For Identity Vendors and their customers to understand the Solorigate identity related attack components the Identity team at Microsoft has produced a blog has been created to walk thru this information.

Updated 12/28/2020

Users of Microsoft 365 Defender can also hunt and detect on similar items in this blog, but tailored towards investigation using Microsoft 365 Defender to protect against Solorigate.

 

The goal of this article is post-compromise investigation strategies and is focused on TTPs and not focused on specific IOCs.  Azure Sentinel customers are encouraged to review advisories and IOC’s shared by Microsoft MSRC and security partners to search on specific IOC’s in their environment using Azure Sentinel.  Links to these IOC’s are listed in the reference section at the end.

 

To make it easier for security teams to visualize and monitor their environments for this attack the MSTIC team has shared a SolarWinds Post Compromise hunting workbook via Azure Sentinel and Azure Sentinel GitHub. There are many things in this workbook that threat hunters would find useful and the workbook is complimentary to the hunting methods shared below. Importantly, if you have recently rotated ADFS key material this workbook can be useful in identifying attacker logon activity if they logon with old key material. Security teams should leverage this hunting workbook as part of their workflow in investigating this attack.

 

Thanks to the MSTIC and M365 teams for collaborating to deliver this content in a timely manner. Special thanks to @aprakash13@Ashwin_Patil@Pete Bryan@ItsReallyNick, Chris Glyer, @Cyb3rWard0g@Tim Burrell (MSTIC), Rob Mead, @TomMcElroy@Elia Florio@Corina Feuerstein, Ramin Nafisi, Michael Matonis. 

 

Please note that since Azure Sentinel and the M365 Advanced Hunting portal share the same query language and share similar data types, all of the referenced queries can be used directly or slightly modified to work in both.

 

Gaining a foothold

As shared in Microsoft’s technical blog – Customer Guidance on Recent Nation-state Cyber Attacks - attackers might have compromised the internal build systems or the update distribution systems of SolarWinds Orion software then modified a DLL component in the legitimate software and embedded backdoor code that would allow these attackers to remotely perform commands or deliver additional payloads. Below is a representation of various attack stages which you can also see in Microsoft Threat Protection (MTP) portal.  Note that if you do not have Microsoft Threat Protection this link will not work for you.

 

Image1.png

To hunt for similar TTPs used in this attack, a good place to start is to build an inventory of the machines that have SolarWinds Orion components. Organizations might already have a software inventory management system to indicate hosts where the SolarWinds application is installed. Alternatively, Azure Sentinel could be leveraged to run a simple query to gather similar details. Azure Sentinel collects data from multiple different logs that could be used to gather this information. For example, through the recently released Microsoft 365 Defender connector, security teams can now easily ingest Microsoft 365 raw data into Azure Sentinel. Using the ingested data, a simple query like below can be written that will pull the hosts with SolarWinds process running in last 30 days based on Process execution either via host on boarded to Sentinel or on boarded via Microsoft Defender for Endpoints (MDE). The query also leverages the Sysmon logs that a lot of customers are collecting from their environment to surface the machines that have SolarWinds running on them. Similar queries that leverage M365 raw data could also be run from the M365's Advanced hunting portal.

 

SolarWinds Inventory check query

Spoiler
let timeframe = 30d; 
(union isfuzzy=true 
( 
SecurityEvent 
where TimeGenerated >= ago(timeframe) 
where EventID == '4688' 
where tolower(NewProcessName) has 'solarwinds' 
extend MachineName = Computer , Process = NewProcessName
summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), MachineCount = dcount(MachineName), AccountCount = dcount(Account), MachineNames = make_set(MachineName), Accounts = make_set(Account) by Process, Type
), 
( 
DeviceProcessEvents 
where TimeGenerated >= ago(timeframe) 
where tolower(InitiatingProcessFolderPath) has 'solarwinds' 
extend MachineName = DeviceName , Process = InitiatingProcessFolderPath, Account = AccountName
summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), MachineCount = dcount(MachineName), AccountCount = dcount(Account), MachineNames = make_set(MachineName), Accounts = make_set(Account)  by Process, Type
), 
( 
Event 
where TimeGenerated >= ago(timeframe) 
where Source == "Microsoft-Windows-Sysmon" 
where EventID == 1 
extend Image = EventDetail.[4].["#text"] 
where tolower(Image) has 'solarwinds' 
extend MachineName = Computer , Process = Image, Account = UserName
summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), MachineCount = dcount(MachineName), AccountCount = dcount(Account), MachineNames = make_set(MachineName), Accounts = make_set(Account)  by Process, Type
) 
) 
Updated 12/30/2020

On systems where the malicious SolarWinds DLL (SolarWinds.Orion.Core.BusinessLayer.dll) is running, it is known that the attacker used a hardcoded named pipe '583da945-62af-10e8-4902-a8f205c72b2e' to conduct various checks as well as to ensure only one instance of the backdoor was running. The use of named pipes by malware is not uncommon as it provides a mechanism for communication between processes. This activity by the malware can be detected if you are collecting Sysmon (Event Id 17/18) or Security Event Id 5145 in your Azure Sentinel workspace. The Solorigate Named Pipe detection should not be considered reliable on its own as the creation of just the hardcoded named pipe does not indicate that the malicious code was completely triggered, and the machine beaconed out or received additional commands. However, presence of this is definitely suspicious and should warrant further in-depth investigation.

Spoiler
let timeframe = 1d;
(union isfuzzy=true
(Event
| where TimeGenerated >= ago(timeframe)
| where Source == "Microsoft-Windows-Sysmon"
| where EventID in (17,18)
| extend EvData = parse_xml(EventData)
| extend EventDetail = EvData.DataItem.EventData.Data
| extend NamedPipe = EventDetail.[5].["#text"]
| extend ProcessDetail = EventDetail.[6].["#text"]
| where NamedPipe contains '583da945-62af-10e8-4902-a8f205c72b2e'
| extend Account = UserName
| project-away EventDetail, EvData
),
(
SecurityEvent
| where TimeGenerated >= ago(timeframe)
| where EventID == '5145'
| where AccessList has '%%4418' // presence of CreatePipeInstance value
| where RelativeTargetName contains '583da945-62af-10e8-4902-a8f205c72b2e'
)
)
| extend timestamp = TimeGenerated, AccountCustomEntity = Account, HostCustomEntity = Computer

Privilege Escalation

Once the adversary acquires an initial foothold on a system thru the SolarWinds process they will have System account level access, the attacker will then attempt to elevate to domain admin level access to the environment. The Microsoft Threat Intelligence Center (MSTIC) team has already delivered multiple queries into Azure Sentinel that identify similar TTPs and many are also available in M365. These methodologies are not specific to just this threat actor or this attack but have been seen in various attack campaigns.

Identifying abnormal logon activities or additions to privileged groups is one way to identify privilege escalation.

Updated 12/17/2020

Related to this attack, in some environments service account credentials had been granted administrative privileges. The above queries can be modified to remove the condition of focusing “User” accounts by commenting the query to include service accounts in the scope where applicable:

 

//| where AccountType == "User"

 

Please see the Azure Sentinel Github for additional queries and hunting ideas related to Accounts under the Detections and Hunting Queries sections for AuditLogs, and SecurityEvents

Microsoft 365 Defender team has also shared quite a few sample queries for use in their advanced hunting portal that could be leveraged to detect this part of the attack. Additionally, the logic for many of the Azure Sentinel queries can also be transformed to equivalent queries for Microsoft 365 Defender, that could be run in their Advanced Hunting Portal.

Microsoft 365 Defender has an upcoming complimentary blog that will be updated here once available.

 

Certificate Export

The next step in the attack was stealing the certificate that signs SAML tokens from the federation server (ADFS) called a Token Signing Cert (TSC). SAML Tokens are basically XML representations of claims.  You can read more about ADFS in What is federation with Azure AD? | Microsoft Docs and SAML at Azure Single Sign On SAML Protocol - Microsoft identity platform | Microsoft Docs. The process is as follows:

  1. A client requests a SAML token from an ADFS Server by authenticating to that server using Windows credentials.
  2. The ADFS server issues a SAML token to the client.
  3. The SAML token is signed with a certificate associated with the server.
  4. The client then presents the SAML token to the application that it needs access to.
  5. The signature over the SAML token tells the application that the security token service issued the token and grants access to the client.

 

ADFS Key Extraction

Updated 01/15/2021

The implication of stealing the Token Signing Cert (TSC) is that once the certificate has been acquired, the actor can forge SAML (Security Assertions Markup Language) tokens with whatever claims and lifetime they choose, then sign it with the certificate that has been acquired.  Microsoft continues to strongly recommend securing your AD FS (Active Directory Federation Service) TSC because if these TSC’s are acquired by a bad actor, this then enables the actor to forge SAML tokens that impersonate highly privileged accounts.  There are publicly available pen-testing tools like ADFSDump and ADFSpoof that help with extracting required information from the AD FS configuration database to generate the forged security tokens.  While we have not confirmed these specific tools were used in this attack, they are useful for simulating the attack behavior or executing a similar attack and therefore, Microsoft has created a high-fidelity detection related to this for M365 Defender:

  • ADFS private key extraction which detects ADFS private key extraction patterns from tools such as ADFSDump.

Note: Any M365 Defender alert can be seen in Azure Sentinel Security Alerts or in the M365 security portal.

Updated 01/15/2021

The TTP (tactics, techniques, and procedures) observed in the Solorigate attack is the creation of legitimate SAML token used to authenticate as any user. One way an attacker could achieve this is by compromising AD FS key material. Microsoft has a new detection for this as stated above and for Azure Sentinel has also created a Windows Event Log based detection that indicates anADFS DKM Master Key Export. As part of the update for this query to the Azure Sentinel GitHub, there is a detailed write up for why this is interesting along with a subsequent addition providing clarity on how to get 4662 events to fire.  This detection should not be considered reliable on its own but can identify suspicious activity that warrants further investigation.

Updated 01/15/2021

Spoiler

 (union isfuzzy=true (SecurityEvent
| where EventID == 4662 // You need to create a SACL on the ADFS Policy Store DKM group for this event to be created.
| where ObjectServer == 'DS'
| where OperationType == 'Object Access'
//| where ObjectName contains '<GUID of ADFS Policy Store DKM Group object' This is unique to the domain. Check description for more details.
| where ObjectType contains '5cb41ed0-0e4c-11d0-a286-00aa003049e2' // Contact Class
| where Properties contains '8d3bca50-1d7e-11d0-a081-00aa006c33ed' // Picture Attribute - Ldap-Display-Name: thumbnailPhoto
| extend timestamp = TimeGenerated, HostCustomEntity = Computer, AccountCustomEntity = SubjectAccount),
(DeviceEvents
| where ActionType =~ "LdapSearch"
| where AdditionalFields.AttributeList contains "thumbnailPhoto"
| where AdditionalFields.DistinguishedName contains "CN=ADFS,CN=Microsoft,CN=Program Data" // Filter results to show only hits related to the ADFS AD container
| extend timestamp = TimeGenerated, HostCustomEntity = DeviceName, AccountCustomEntity = InitiatingProcessAccountName)
)

Updated 12/19/2020

MSTIC has developed another detection for ADFS server key export events. This detection leverages the visibility provided by Sysmon and provides a more reliable detection method than that covered in the Windows Event Log detection. For this detection to be effective you must be collecting Sysmon Event IDs 17 and 18 into your Azure Sentinel workspace.

Spoiler
// Adjust this to use a longer timeframe to identify ADFS servers
let lookback = 6d;
// Adjust this to adjust the key export detection timeframe
let timeframe = 1d;
// Start be identifying ADFS servers to reduce FP chance
let ADFS_Servers = (
Event
| where TimeGenerated > ago(timeframe+lookback)
| where Source == "Microsoft-Windows-Sysmon"
| extend EventData = parse_xml(EventData).DataItem.EventData.Data
| mv-expand bagexpansion=array EventData
| evaluate bag_unpack(EventData)
| extend Key=tostring(['@Name']), Value=['#text']
| evaluate pivot(Key, any(Value), TimeGenerated, Source, EventLog, Computer, EventLevel, EventLevelName, EventID, UserName, RenderedDescription, MG, ManagementGroupName, Type, _ResourceId)
| extend process = split(Image, '\\', -1)[-1]
| where process =~ "Microsoft.IdentityServer.ServiceHost.exe"
| summarize by Computer);
// Look for ADFS servers where Named Pipes event are present
Event
| where TimeGenerated > ago(timeframe)
| where Source == "Microsoft-Windows-Sysmon"
| where Computer in~ (ADFS_Servers)
| extend RenderedDescription = tostring(split(RenderedDescription, ":")[0])
| extend EventData = parse_xml(EventData).DataItem.EventData.Data
| mv-expand bagexpansion=array EventData
| evaluate bag_unpack(EventData)
| extend Key=tostring(['@Name']), Value=['#text']
| evaluate pivot(Key, any(Value), TimeGenerated, Source, EventLog, Computer, EventLevel, EventLevelName, EventID, UserName, RenderedDescription, MG, ManagementGroupName, Type, _ResourceId)
| extend RuleName = column_ifexists("RuleName", ""), TechniqueId = column_ifexists("TechniqueId", ""), TechniqueName = column_ifexists("TechniqueName", "")
| parse RuleName with * 'technique_id=' TechniqueId ',' * 'technique_name=' TechniqueName
| where EventID in (17,18)
// Look for Pipe related to querying the WID
| where PipeName == "\\MICROSOFT##WID\\tsql\\query"
| extend process = split(Image, '\\', -1)[-1]
// Exclude expected processes
| where process !in ("Microsoft.IdentityServer.ServiceHost.exe", "Microsoft.Identity.Health.Adfs.PshSurrogate.exe", "AzureADConnect.exe", "Microsoft.Tri.Sensor.exe", "wsmprovhost.exe","mmc.exe", "sqlservr.exe")
| extend Operation = RenderedDescription
| project-reorder TimeGenerated, EventType, Operation, process, Image, Computer, UserName
| extend HostCustomEntity = Computer, AccountCustomEntity = UserName

Outside of directly looking for tools, this adversary may have used custom tooling so looking for anomalous process executions or anomalous accounts logging on to our ADFS server can give us some clue when such attacks happen. Azure Sentinel provides queries that can help to:

Every environment is different and some of these queries being generic could be noisy. So, in the first step a good approach would be to limit this kind of hunting to our ADFS server.

 

Azure Active Directory Hunting

Having gained a significant foothold in the on prem environment, the actor also targeted the Azure AD of some of the compromised organizations and made modifications to Azure AD settings to facilitate long term access. Microsoft has shared many relevant queries through the Azure Sentinel GitHub to identify these actions.

Updated 01/15/2021

One such activity is related to modifying domain federation trust settings. A federation trust signifies the establishment of authentication and authorization trust between two organizations so that users located in partner organizations can send authentication and authorization requests successfully.

  • While not specifically seen in this attack, tracking federation trust modifications is important. The Azure Sentinel query for domain federation trust settings modification will alert when a user or application modifies the federation settings on the domain particularly when a new Active Directory Federated Service (ADFS) Trusted Realm object, such as a signing certificate, is added to the domain or there is an update to domain authentication from managed to federated. Modification to domain federation settings should be rare and this should be treated as a high-fidelity alert that Azure AD and Azure Sentinel users should follow up on.

Updated 01/15/2021

The original purpose of the STSRefreshTokenModification low severity, hunting-only query was to demonstrate an event that has token validity time periods in it and demonstrate how one could monitor for anomalous/edited tokens. We have determined this event will only fire on the manual expiration of the StsRefreshToken by an admin (or the user). These types of events are most often generated when legitimate administrators troubleshoot frequent AAD (Azure AD) user sign-ins. To avoid any confusion with Solorigate investigation and hunting, we have removed this section from the blog.

 

Another such activity is adding access to the Service Principal or Application.  If a threat actor obtains access to an Application Administrator account, they may configure alternate authentication mechanisms for direct access to any of the scopes and services available to the Service Principal. With these privileges, the actor can add alternative authentication material for direct access to resources using this credential.

Updated 12/20/2020

 

Spoiler

New access credential added to Application or Service Principal
let auditLookback = 1h;
AuditLogs
| where TimeGenerated > ago(auditLookback)
| where OperationName has_any ("Add service principal", "Certificates and secrets management") // captures "Add service principal", "Add service principal credentials", and "Update application – Certificates and secrets management" events
| where Result =~ "success"
| mv-expand target = TargetResources
| where tostring(InitiatedBy.user.userPrincipalName) has "@" or tostring(InitiatedBy.app.displayName) has "@"
| extend targetDisplayName = tostring(TargetResources[0].displayName)
| extend targetId = tostring(TargetResources[0].id)
| extend targetType = tostring(TargetResources[0].type)
| extend keyEvents = TargetResources[0].modifiedProperties
| mv-expand keyEvents
| where keyEvents.displayName =~ "KeyDescription"
| extend new_value_set = parse_json(tostring(keyEvents.newValue))
| extend old_value_set = parse_json(tostring(keyEvents.oldValue))
| where old_value_set != "[]"
| extend diff = set_difference(new_value_set, old_value_set)
| where isnotempty(diff)
| parse diff with * "KeyIdentifier=" keyIdentifier:string ",KeyType=" keyType:string ",KeyUsage=" keyUsage:string ",DisplayName=" keyDisplayName:string "]" *
| where keyUsage == "Verify" or keyUsage == ""
| extend UserAgent = iff(AdditionalDetails[0].key == "User-Agent",tostring(AdditionalDetails[0].value),"")
| extend InitiatingUserOrApp = iff(isnotempty(InitiatedBy.user.userPrincipalName),tostring(InitiatedBy.user.userPrincipalName), tostring(InitiatedBy.app.displayName))
| extend InitiatingIpAddress = iff(isnotempty(InitiatedBy.user.ipAddress), tostring(InitiatedBy.user.ipAddress), tostring(InitiatedBy.app.ipAddress))
// The below line is currently commented out but Azure Sentinel users can modify this query to show only Application or only Service Principal events in their environment
//| where targetType =~ "Application" // or targetType =~ "ServicePrincipal"
| project-away diff, new_value_set, old_value_set
| project-reorder TimeGenerated, OperationName, InitiatingUserOrApp, InitiatingIpAddress, UserAgent, targetDisplayName, targetId, targetType, keyDisplayName, keyType, keyUsage, keyIdentifier, CorrelationId, TenantId
| extend timestamp = TimeGenerated, AccountCustomEntity = InitiatingUserOrApp, IPCustomEntity = InitiatingIpAddress

First access credential added to Application or Service Principal where no credential was present
let auditLookback = 1h;
AuditLogs
| where TimeGenerated > ago(auditLookback)
| where OperationName has_any ("Add service principal", "Certificates and secrets management") // captures "Add service principal", "Add service principal credentials", and "Update application – Certificates and secrets management" events
| where Result =~ "success"
| mv-expand target = TargetResources
| where tostring(InitiatedBy.user.userPrincipalName) has "@" or tostring(InitiatedBy.app.displayName) has "@"
| extend targetDisplayName = tostring(TargetResources[0].displayName)
| extend targetId = tostring(TargetResources[0].id)
| extend targetType = tostring(TargetResources[0].type)
| extend keyEvents = TargetResources[0].modifiedProperties
| mv-expand keyEvents
| where keyEvents.displayName =~ "KeyDescription"
| extend new_value_set = parse_json(tostring(keyEvents.newValue))
| extend old_value_set = parse_json(tostring(keyEvents.oldValue))
| where old_value_set == "[]"
| parse new_value_set with * "KeyIdentifier=" keyIdentifier:string ",KeyType=" keyType:string ",KeyUsage=" keyUsage:string ",DisplayName=" keyDisplayName:string "]" *
| where keyUsage == "Verify" or keyUsage == ""
| extend UserAgent = iff(AdditionalDetails[0].key == "User-Agent",tostring(AdditionalDetails[0].value),"")
| extend InitiatingUserOrApp = iff(isnotempty(InitiatedBy.user.userPrincipalName),tostring(InitiatedBy.user.userPrincipalName), tostring(InitiatedBy.app.displayName))
| extend InitiatingIpAddress = iff(isnotempty(InitiatedBy.user.ipAddress), tostring(InitiatedBy.user.ipAddress), tostring(InitiatedBy.app.ipAddress))
// The below line is currently commented out but Azure Sentinel users can modify this query to show only Application or only Service Principal events in their environment
//| where targetType =~ "Application" // or targetType =~ "ServicePrincipal"
| project-away new_value_set, old_value_set
| project-reorder TimeGenerated, OperationName, InitiatingUserOrApp, InitiatingIpAddress, UserAgent, targetDisplayName, targetId, targetType, keyDisplayName, keyType, keyUsage, keyIdentifier, CorrelationId, TenantId
| extend timestamp = TimeGenerated, AccountCustomEntity = InitiatingUserOrApp, IPCustomEntity = InitiatingIpAddress

Updated 12/19/2020

This threat actor has been observed using applications to read users mailboxes within a target environment. To help identify this activity MSTIC has created a hunting query that looks for applications that have been granted mailbox read permissions followed by consent to this application. Whilst this may uncover legitimate applications hunters should validate applications granted mail read permissions genuinely require them.

Spoiler
AuditLogs
| where Category =~ "ApplicationManagement"
| where ActivityDisplayName =~ "Add delegated permission grant"
| where Result =~ "success"
| where tostring(InitiatedBy.user.userPrincipalName) has "@" or tostring(InitiatedBy.app.displayName) has "@"
| extend props = parse_json(tostring(TargetResources[0].modifiedProperties))
| mv-expand props
| extend UserAgent = tostring(AdditionalDetails[0].value)
| extend InitiatingUser = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
| extend UserIPAddress = tostring(parse_json(tostring(InitiatedBy.user)).ipAddress)
| extend DisplayName = tostring(props.displayName)
| extend Permissions = tostring(parse_json(tostring(props.newValue)))
| where Permissions has_any ("Mail.Read", "Mail.ReadWrite")
| extend PermissionsAddedTo = tostring(TargetResources[0].displayName)
| extend Type = tostring(TargetResources[0].type)
| project-away props
| join kind=leftouter(
AuditLogs
| where ActivityDisplayName has "Consent to application"
| extend AppName = tostring(TargetResources[0].displayName)
| extend AppId = tostring(TargetResources[0].id)
| project AppName, AppId, CorrelationId) on CorrelationId
| project-reorder TimeGenerated, OperationName, InitiatingUser, UserIPAddress, UserAgent, PermissionsAddedTo, Permissions, AppName, AppId, CorrelationId
| extend timestamp = TimeGenerated, AccountCustomEntity = InitiatingUser, IPCustomEntity = UserIPAddress

It’s also advised to hunt for application consents for unexpected applications, particularly where they provide offline access to data or other high value access;

Updated 12/17/2020 (moved location)

In addition to Azure AD pre-compromise logon hunting it is also possible to monitor for logons attempting to use invalid key material. This can help identify attempted logons using stolen key material made after key material has been rotated. This can be done by querying SigninLogs in Azure Sentinel where the ResultType is 5000811. Please note that if you roll your token signing certificate, there will be expected activity when searching on the above.

 

Recon and Remote Execution

Updated 12/27/2020

The adversary will often attempt to access on-prem systems to gain further insight and mapping of the environment.  As described in the Resulting hands-on-keyboard attack section of the Analyzing Solorigate blog by Microsoft, attackers renamed windows administrative tools like adfind.exe which were then used for domain enumeration. An example of the process execution command like can look like this:

C:\Windows\system32\cmd.exe /C csrss.exe -h breached.contoso.com -f (name=”Domain Admins”) member -list | csrss.exe -h breached.contoso.com -f objectcategory=* > .\Mod\mod1.log


We have provided a query in the Azure Sentinel Github which will help in detecting the command line patterns related to ADFind usage. You can customize this query to look at your specific DC/ADFS servers.

Spoiler
let startdate = 1d;
let lookupwindow = 2m;
let threshold = 3; //number of commandlines in the set below
let DCADFSServersList = dynamic (["DCServer01", "DCServer02", "ADFSServer01"]); // Enter a reference list of hostnames for your DC/ADFS servers
let tokens = dynamic(["objectcategory","domainlist","dcmodes","adinfo","trustdmp","computers_pwdnotreqd","Domain Admins", "objectcategory=person", "objectcategory=computer", "objectcategory=*"]);
SecurityEvent
//| where Computer in (DCADFSServersList) // Uncomment to limit it to your DC/ADFS servers list if specified above or any pattern in hostnames (startswith, matches regex, etc).
| where TimeGenerated between (ago(startdate) .. now())
| where EventID == 4688
| where CommandLine has_any (tokens)
| where CommandLine matches regex "(.*)>(.*)"
| summarize Commandlines = make_set(CommandLine), LastObserved=max(TimeGenerated) by bin(TimeGenerated, lookupwindow), Account, Computer, ParentProcessName, NewProcessName
| extend Count = array_length(Commandlines)
| where Count > threshold

On the remote execution side, there is a pattern that can be identified related to using alternate credentials than the currently logged on user, such as when using the RUN AS feature on a Windows system and passing in explicit credentials.  We have released a query that will identify when execution is occurring via multiple explicit credentials against remote targets.  This requires that Windows Event 4648 is being collected as part of Azure Sentinel.

 

Spoiler
let WellKnownLocalSIDs = "S-1-5-[0-9][0-9]$";
let protocols = dynamic(['cifs', 'ldap', 'RPCSS', 'host' , 'HTTP', 'RestrictedKrbHost', 'TERMSRV', 'msomsdksvc', 'mssqlsvc']);
SecurityEvent
| where TimeGenerated >= ago(1d)
| where EventID == 4648
| where SubjectUserSid != 'S-1-0-0' // this is the Nobody SID which really means No security principal was included.
| where not(SubjectUserSid matches regex WellKnownLocalSIDs) //excluding system account/service account as this is generally normal
| where TargetInfo has '/' //looking for only items that indicate an interesting protocol is included
| where Computer !has tostring(split(TargetServerName,'$')[0])
| where TargetAccount !~ tostring(split(SubjectAccount,'$')[0])
| extend TargetInfoProtocol = tolower(split(TargetInfo, '/')[0]), TargetInfoMachine = toupper(split(TargetInfo, '/')[1])
| extend TargetAccount = tolower(TargetAccount), SubjectAccount = tolower(SubjectAccount)
| extend UncommonProtocol = case(not(TargetInfoProtocol has_any (protocols)), TargetInfoProtocol, 'NotApplicable')
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), AccountsUsedCount = dcount(TargetAccount), AccountsUsed = make_set(TargetAccount), TargetMachineCount = dcount(TargetInfoMachine),
TargetMachines = make_set(TargetInfoMachine), TargetProtocols = dcount(TargetInfoProtocol), Protocols = make_set(TargetInfoProtocol), Processes = make_set(Process) by Computer, SubjectAccount, UncommonProtocol
| where TargetMachineCount > 1 or UncommonProtocol != 'NotApplicable'
| extend ProtocolCount = array_length(Protocols)
| extend ProtocolScore = case(
Protocols has 'rpcss' and Protocols has 'host' and Protocols has 'cifs', 10, //observed in Solorigate and depending on which are used together the higher the score
Protocols has 'rpcss' and Protocols has 'host', 5,
Protocols has 'rpcss' and Protocols has 'cifs', 5,
Protocols has 'host' and Protocols has 'cifs', 5,
Protocols has 'ldap' or Protocols has 'rpcss' or Protocols has 'host' or Protocols has 'cifs', 1, //ldap is more commonly seen in general, this was also seen with Solorigate but not usually to the same machines as the others above
UncommonProtocol != 'NotApplicable', 3,
0 //other protocols may be of interest, but in relation to observations for enumeration/execution in Solorigate they receive 0
)
| extend Score = ProtocolScore + ProtocolCount + AccountsUsedCount
| where Score >= 9 or (UncommonProtocol != 'NotApplicable' and Score >= 4) // Score must be 9 or better as this will include 5 points for atleast 2 of the interesting protocols + the count of protocols (min 2) + the number of accounts used for execution (min 2) = min of 9 OR score must be 4 or greater for an uncommon protocol
| extend TimePeriod = EndTime - StartTime //This identifies the time between start and finish for the use of the explicit credentials, shorter time period may indicate scripted executions
| project-away UncommonProtocol
| extend timestamp = StartTime, AccountCustomEntity = SubjectAccount, HostCustomEntity = Computer
| order by Score desc

 

Data Access

Accessing confidential data is one of the primary motives of this attack. Data access for the attacker here relied on leveraging minted SAML tokens to access user files/email stored in the cloud via compromised AppIds. One way to detect this is when a user or application signs in using Azure Active Directory PowerShell to access non-Active Directory resources.

 

Microsoft Graph is one way that the attacker may be seen accessing resources and can help find what the attacker may have accessed using the Service principal Azure Active Directory sign-in logs. If you have data in your Log analytics you could easily plot a chart to see what anomalous activity is happening in your environment that is leveraging the graph. 

Updated 12/17/2020

Note that this data type in Azure Sentinel below is only available when additional Diagnostic Logging is enabled on the workspace.  Please see the instructions in the expandable section below.

Spoiler
The AADServicePrincipalSigninLogs datatype will not be available in Azure Sentinel unless it is configured under Diagnostic Settings.  Please see screenshots below the query.

AADServicePrincipalSignInLogs
| where TimeGenerated > ago(90d)
| where ResourceDisplayName == "Microsoft Graph"
| where ServicePrincipalId == "524c43c4-c484-4f7a-bd44-89d4a0d8aeab"
| summarize count() by bin(TimeGenerated, 1h)
| render timechart

To enable Service Principal Signin Logging, do the following:

DiagnosticSettings1.png

DiagnosticSettings2.png

DiagnosticSettings3.png

Updated 12/21/2020

Additionally, below is a sample query that brings out some of the logons to Azure AD where multi factor authentication was satisfied by token based logons versus MFA via phone auth or the like. It is possible this could produce many results, so additional tuning is suggested for your environment.

Spoiler
SigninLogs
| where TimeGenerated > ago(30d)
| where ResultType == 0
| extend additionalDetails = tostring(Status.additionalDetails)
| summarize make_set(additionalDetails), min(TimeGenerated), max(TimeGenerated) by IPAddress, UserPrincipalName
| where array_length(set_additionalDetails) == 2
| where (set_additionalDetails[1] == "MFA requirement satisfied by claim in the token" and set_additionalDetails[0] == "MFA requirement satisfied by claim provided by external provider") or (set_additionalDetails[0] == "MFA requirement satisfied by claim in the token" and set_additionalDetails[1] == "MFA requirement satisfied by claim provided by external provider")
//| project IPAddress, UserPrincipalName, min_TimeGenerated, max_TimeGenerated

UPDATED 12/17/2020

This attack also used Virtual Private Servers (VPS) hosts to access victim networks and can be used in conjunction with the query above. Both MSTIC and FireEye have reported attacker logon events coming from network ranges associated with VPS providers. In order to highlight these logons, MSTIC has created a new hunting query - Signins From VPS Providers - that looks for successful signins from network ranges associated with VPS providers. This is joined with the above query, the new query looks for IPs that only display sign-ins based on tokens and not other MFA options, although this could be removed if wanted. The list of VPS ranges in the query is not comprehensive and there is significant potential for false positives so results should be investigated before responding, however it can provide very effective signal. Combining the query below with data that list VPS server ranges will make this a high-confidence hunting query. 

 

In relation to the VPS servers section above, the previously mentioned workbook has a section that shows successful user signins from VPS (Virtual Private Server) providers where only tokens were used to authenticate. This uses the new KQL operator ipv4_lookup to evaluate if a login came from a known VPS provider network range. This operator can alternatively be used to look for all logons not coming from known ranges should your environment have a common logon source.

 

Data Exfiltration 

Updated 12/20/2020

Email data has been observed as a target for the Solorigate attackers, one way to monitor for potential suspicious access is to look for anomalous MailItemsAccessed volumes. MSTIC has created a specific hunting query to identify Anomolous User Accessing Other Users Mailbox which can help to identify malicious activity related to this attack. Additionally, MSTIC previously created a more generic detection - Exchange workflow MailItemsAccessed operation anomaly - which looks for time series based anomalies in MailItemsAccessed events in the OfficeActivity log. 

Spoiler
Anomalous access to other user's mailboxes
let timeframe = 14d;
let user_threshold = 1;
let folder_threshold = 5;
OfficeActivity
| where TimeGenerated > ago(timeframe)
| where Operation =~ "MailItemsAccessed"
| where ResultStatus =~ "Succeeded"
| mv-expand parse_json(Folders)
| extend folders = tostring(Folders.Path)
| where tolower(MailboxOwnerUPN) != tolower(UserId)
| extend ClientIP = iif(Client_IPAddress startswith "[", extract("\\[([^\\]]*)", 1, Client_IPAddress), Client_IPAddress)
| summarize make_set(folders), make_set(ClientInfoString), make_set(ClientIP), make_set(MailboxGuid), make_set(MailboxOwnerUPN) by UserId
| extend folder_count = array_length(set_folders)
| extend user_count = array_length(set_MailboxGuid)
| where user_count > user_threshold or folder_count > folder_threshold
| sort by user_count desc
| project-reorder UserId, user_count, folder_count, set_MailboxOwnerUPN, set_ClientIP, set_ClientInfoString, set_folder

Exchange workflow MailItemsAccessed operation anomaly
let starttime = 14d;
let endtime = 1d;
let timeframe = 1h;
let scorethreshold = 1.5;
let percentthreshold = 50;
// Preparing the time series data aggregated hourly count of MailItemsAccessd Operation in the form of multi-value array to use with time series anomaly function.
let TimeSeriesData =
OfficeActivity
| where TimeGenerated between (startofday(ago(starttime))..startofday(ago(endtime)))
| where OfficeWorkload=~ "Exchange" and Operation =~ "MailItemsAccessed" and ResultStatus =~ "Succeeded"
| project TimeGenerated, Operation, MailboxOwnerUPN
| make-series Total=count() on TimeGenerated from startofday(ago(starttime)) to startofday(ago(endtime)) step timeframe;
let TimeSeriesAlerts = TimeSeriesData
| extend (anomalies, score, baseline) = series_decompose_anomalies(Total, scorethreshold, -1, 'linefit')
| mv-expand Total to typeof(double), TimeGenerated to typeof(datetime), anomalies to typeof(double), score to typeof(double), baseline to typeof(long)
| where anomalies > 0
| project TimeGenerated, Total, baseline, anomalies, score;
// Joining the flagged outlier from the previous step with the original dataset to present contextual information
// during the anomalyhour to analysts to conduct investigation or informed decisions.
TimeSeriesAlerts | where TimeGenerated > ago(2d)
// Join against base logs since specified timeframe to retrive records associated with the hour of anomoly
| join (
OfficeActivity
| where TimeGenerated > ago(2d)
| where OfficeWorkload=~ "Exchange" and Operation =~ "MailItemsAccessed" and ResultStatus =~ "Succeeded"
) on TimeGenerated

Updated 12/19/2020

Targeting of email data has also been observed by other industry members including Volexity who reported attackers using PowerShell commands to export on premise Exchange mailboxes and then hosting those files on OWA servers in order to exfiltrate them.

MSTIC has created detections to identify this activity at both the OWA server and attacking host level through IIS logs, and PowerShell command line logging.

 

OWA exfiltration:

Spoiler
let excludeIps = dynamic(["127.0.0.1", "::1"]);
let scriptingExt = dynamic(["aspx", "ashx", "asp"]);
W3CIISLog
| where csUriStem contains "/owa/"
//The actor pulls a file back but won't send it any URI params
| where isempty(csUriQuery)
| extend file_ext = tostring(split(csUriStem, ".")[-1])
//Giving your file a known scripting extension will throw an error
//rather than just serving the file as it will try to interpret the script
| where file_ext !in~ (scriptingExt)
//The actor was seen using image files, but we go wider in case they change this behaviour
//| where file_ext in~ ("jpg", "jpeg", "png", "bmp")
| extend file_name = tostring(split(csUriStem, "/")[-1])
| where file_name != ""
| where cIP !in~ (excludeIps)
| project file_ext, csUriStem, file_name, Computer, cIP, sIP, TenantId, TimeGenerated
| summarize dcount(cIP), AccessingIPs=make_set(cIP), AccessTimes=make_set(TimeGenerated), Access=count() by TenantId, file_name, Computer, csUriStem
//Collection of the exfiltration will occur only once, lets check for 2 accesses in case they mess up
//Tailor this for hunting
| where Access <= 2 and dcount_cIP == 1

Host creating then removing mailbox export requests using PowerShell cmdlets:

Spoiler

  // Adjust the timeframe to change the window events need to occur within to alert

  let timeframe = 1h;

  SecurityEvent

  | where Process in ("powershell.exe", "cmd.exe")

  | where CommandLine contains 'New-MailboxExportRequest'

  | summarize by Computer, timekey = bin(TimeGenerated, timeframe), CommandLine, SubjectUserName

  | join kind=inner (SecurityEvent

  | where Process in ("powershell.exe", "cmd.exe")

  | where CommandLine contains 'Remove-MailboxExportRequest'

  | summarize by Computer, timekey = bin(TimeGenerated, timeframe), CommandLine, SubjectUserName) on Computer, timekey, SubjectUserName

  | extend commands = pack_array(CommandLine1, CommandLine)

  | summarize by timekey, Computer, tostring(commands), SubjectUserName

  | project-reorder timekey, Computer, SubjectUserName, ['commands']

  | extend HostCustomEntity = Computer, AccountCustomEntity = SubjectUserName

Updated 12/28/2020

Email Delegation and later delegate access is another tactic that has been observed to gain access to user's mailboxes.  We have a previously created a method to discover Non-owner mailbox login activity that can be applied here to help identify when delegates are inappropriately access email.

 

Spoiler
let timeframe = 1d;
OfficeActivity
| where TimeGenerated >= ago(timeframe)
| where Operation == "MailboxLogin" and Logon_Type != "Owner"
| summarize count(), min(TimeGenerated), max(TimeGenerated) by Operation, OrganizationName, UserType, UserId, MailboxOwnerUPN, Logon_Type
| extend timestamp = min_TimeGenerated, AccountCustomEntity = UserId

 

Domain Hunting

Updated 12/17/2020

Domain specific

MSTIC has collated network based IoCs from MSTICFireEye and Volexity to create a network based IoC detection - Solorigate Network Beaconthat leverage multiple network focused data sources within Azure Sentinel.  

Spoiler
let domains = dynamic(["incomeupdate.com","zupertech.com","databasegalore.com","panhardware.com","avsvmcloud.com","digitalcollege.org","freescanonline.com","deftsecurity.com","thedoccloud.com","virtualdataserver.com","lcomputers.com","webcodez.com","globalnetworkissues.com","kubecloud.com","seobundlekit.com","solartrackingsystem.net","virtualwebdata.com"]);
let timeframe = 6h;
(union isfuzzy=true
(CommonSecurityLog
| where TimeGenerated >= ago(timeframe)
| parse Message with * '(' DNSName ')' *
| where DNSName in~ (domains) or DestinationHostName has_any (domains) or RequestURL has_any(domains)
| extend AccountCustomEntity = SourceUserID, HostCustomEntity = DeviceName, IPCustomEntity = SourceIP
),
(DnsEvents
| where TimeGenerated >= ago(timeframe)
| extend DNSName = Name
| where isnotempty(DNSName)
| where DNSName in~ (domains)
| extend IPCustomEntity = ClientIP
),
(VMConnection
| where TimeGenerated >= ago(timeframe)
| parse RemoteDnsCanonicalNames with * '["' DNSName '"]' *
| where isnotempty(DNSName)
| where DNSName in~ (domains)
| extend IPCustomEntity = RemoteIp
),
(DeviceNetworkEvents
| where TimeGenerated >= ago(timeframe)
| where isnotempty(RemoteUrl)
| where RemoteUrl has_any (domains)
| extend DNSName = RemoteUrl
| extend IPCustomEntity = RemoteIP
| extend HostCustomEntity = DeviceName
)
)

Domain DGA

The avsvmcloud[.]com has been observed by several organizations as making DGA like subdomain queries as part of C2 activities. MSTIC have generated a hunting query - Solorigate DNS Patternto look for similar patterns of activity from other domains that might help identify other potential C2 sources.

Spoiler
let cloudApiTerms = dynamic(["api", "east", "west"]);
DnsEvents
| where IPAddresses != "" and IPAddresses != "127.0.0.1"
| where Name endswith ".com" or Name endswith ".org" or Name endswith ".net"
| extend domain_split = split(Name, ".")
| where tostring(domain_split[-5]) != "" and tostring(domain_split[-6]) == ""
| extend sub_domain = tostring(domain_split[0])
| where sub_domain !contains "-"
| extend sub_directories = strcat(domain_split[-3], " ", domain_split[-4])
| where sub_directories has_any(cloudApiTerms)
//Based on sample communications the subdomain is always between 20 and 30 bytes
| where strlen(domain_split) < 32 or strlen(domain_split) > 20
| extend domain = strcat(tostring(domain_split[-2]), ".", tostring(domain_split[-1]))
| extend subdomain_no = countof(sub_domain, @"(\d)", "regex")
| extend subdomain_ch = countof(sub_domain, @"([a-z])", "regex")
| where subdomain_no > 1
| extend percentage_numerical = toreal(subdomain_no) / toreal(strlen(sub_domain)) * 100
| where percentage_numerical < 50 and percentage_numerical > 5
| summarize count(), make_set(Name), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated) by Name
| order by count_ asc

Encoded Domain

In addition we have another query - Solorigate Encoded Domain in URL- that takes the encoding pattern the DGA uses, encodes the domains seen in signin logs and then looks for those patterns in DNS logs. This can help identify other C2 domains using the same encoding scheme. 

Spoiler
let dictionary = dynamic(["r","q","3","g","s","a","l","t","6","u","1","i","y","f","z","o","p","5","7","2","d","4","9","b","n","x","8","c","v","m","k","e","w","h","j"]);
let regex_bad_domains = SigninLogs
//Collect domains from tenant from signin logs
| where TimeGenerated > ago(1d)
| extend domain = tostring(split(UserPrincipalName, "@", 1)[0])
| where domain != ""
| summarize by domain
| extend split_domain = split(domain, ".")
//This cuts back on domains such as na.contoso.com by electing not to match on the "na" portion
| extend target_string = iff(strlen(split_domain[0]) <= 2, split_domain[1], split_domain[0])
| extend target_string = split(target_string, "-")
| mv-expand target_string
//Rip all of the alphanumeric out of the domain name
| extend string_chars = extract_all(@"([a-z0-9])", tostring(target_string))
//Guid for tracking our data
| extend guid = new_guid()
//Expand to get all of the individual chars from the domain
| mv-expand string_chars
| extend chars = tostring(string_chars)
//Conduct computation to encode the domain as per actor spec
| extend computed_char = array_index_of(dictionary, chars)
| extend computed_char = dictionary[(computed_char + 4) % array_length(dictionary)]
| summarize make_list(computed_char) by guid, domain
| extend target_encoded = tostring(strcat_array(list_computed_char, ""))
//These are probably too small, but can be edited (expect FP's when going too small)
| where strlen(target_encoded) > 5
| distinct target_encoded
| summarize make_set(target_encoded)
//Key to join to DNS
| extend key = 1;
DnsEvents
| where TimeGenerated > ago(1d)
| summarize by Name
| extend key = 1
//For each DNS query join the malicious domain list
| join kind=inner (
regex_bad_domains
) on key
| project-away key
//Expand each malicious key for each DNS query observed
| mv-expand set_target_encoded
//IndexOf allows us to fuzzy match on the substring
| extend match = indexof(Name, set_target_encoded)
| where match > -1

Security Service Tampering

Updated 12/30/2020

There has been additional indication that security services are being tampered with to hinder detection and investigation. While this is a common tactic, we felt that we should include this reference. The query is currently written specifically for Potential Microsoft Defender services tampering, but can easily be adapted to identify other security services.

Spoiler
let includeProc = dynamic(["sc.exe","net1.exe","net.exe", "taskkill.exe", "cmd.exe", "powershell.exe"]);
let action = dynamic(["stop","disable", "delete"]);
let service1 = dynamic(['sense', 'windefend', 'mssecflt']);
let service2 = dynamic(['sense', 'windefend', 'mssecflt', 'healthservice']);
let params1 = dynamic(["-DisableRealtimeMonitoring", "-DisableBehaviorMonitoring" ,"-DisableIOAVProtection"]);
let params2 = dynamic(["sgrmbroker.exe", "mssense.exe"]);
let regparams1 = dynamic(['reg add "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender"', 'reg add "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Advanced Threat Protection"']);
let regparams2 = dynamic(['ForceDefenderPassiveMode', 'DisableAntiSpyware']);
let regparams3 = dynamic(['sense', 'windefend']);
let regparams4 = dynamic(['demand', 'disabled']);
let timeframe = 1d;
(union isfuzzy=true
(
SecurityEvent
| where TimeGenerated >= ago(timeframe)
| where EventID == 4688
| extend ProcessName = tostring(split(NewProcessName, '\\')[-1])
| where ProcessName in~ (includeProc)
| where (CommandLine has_any (action) and CommandLine has_any (service1))
or (CommandLine has_any (params1) and CommandLine has 'Set-MpPreference' and CommandLine has '$true')
or (CommandLine has_any (params2) and CommandLine has "/IM")
or (CommandLine has_any (regparams1) and CommandLine has_any (regparams2) and CommandLine has '/d 1')
or (CommandLine has "start" and CommandLine has "config" and CommandLine has_any (regparams3) and CommandLine has_any (regparams4))
| project TimeGenerated, Computer, Account, AccountDomain, ProcessName, ProcessNameFullPath = NewProcessName, EventID, Activity, CommandLine, EventSourceName, Type
),
(
Event
| where TimeGenerated >= ago(timeframe)
| where Source =~ "Microsoft-Windows-SENSE"
| where EventID == 87 and ParameterXml in ("<Param>sgrmbroker</Param>", "<Param>WinDefend</Param>")
| project TimeGenerated, Computer, Account = UserName, EventID, Activity = RenderedDescription, EventSourceName = Source, Type
),
(
DeviceProcessEvents
| where TimeGenerated >= ago(timeframe)
| where InitiatingProcessFileName in~ (includeProc)
| where (InitiatingProcessCommandLine has_any(action) and InitiatingProcessCommandLine has_any (service2) and InitiatingProcessParentFileName != 'cscript.exe')
or (InitiatingProcessCommandLine has_any (params1) and InitiatingProcessCommandLine has 'Set-MpPreference' and InitiatingProcessCommandLine has '$true')
or (InitiatingProcessCommandLine has_any (params2) and InitiatingProcessCommandLine has "/IM")
or (InitiatingProcessCommandLine has_any (regparams1) and InitiatingProcessCommandLine has_any (regparams2) and InitiatingProcessCommandLine has '/d 1')
or (InitiatingProcessCommandLine has_any("start") and InitiatingProcessCommandLine has "config" and InitiatingProcessCommandLine has_any (regparams3) and InitiatingProcessCommandLine has_any (regparams4))
| extend Account = iff(isnotempty(InitiatingProcessAccountUpn), InitiatingProcessAccountUpn, InitiatingProcessAccountName), Computer = DeviceName
| project TimeGenerated, Computer, Account, AccountDomain, ProcessName = InitiatingProcessFileName, ProcessNameFullPath = FolderPath, Activity = ActionType, CommandLine = InitiatingProcessCommandLine, Type, InitiatingProcessParentFileName
)
)
| extend timestamp = TimeGenerated, AccountCustomEntity = Account, HostCustomEntity = Computer

Microsoft M365 Defender + Azure Sentinel detection correlation

In addition we have created a query in Azure Sentinel Solorigate Defender Detectionsto collate the range of Defender detections that are now deployed. This query can be used to get an overview of such alerts and the hosts they relate to. 

Spoiler
DeviceInfo
| extend DeviceName = tolower(DeviceName)
| join (SecurityAlert
| where ProviderName =~ "MDATP"
| extend ThreatName = tostring(parse_json(ExtendedProperties).ThreatName)
| where ThreatName has "Solarigate"
| extend HostCustomEntity = tolower(CompromisedEntity)
| take 10) on $left.DeviceName == $right.HostCustomEntity
| project TimeGenerated, DisplayName, ThreatName, CompromisedEntity, PublicIP, MachineGroup, AlertSeverity, Description, LoggedOnUsers, DeviceId, TenantId
| extend timestamp = TimeGenerated, IPCustomEntity = PublicIP

 

Conclusion

Additionally, as a cloud native SIEM Azure Sentinel can not only collect raw data from various disparate logs but it also gets alerts from various security products. For example, M365 Defender has a range of alerts for various attack components like SolarWinds malicious binaries, network traffic to the compromised domains, DNS queries for known patterns associated with SolarWinds compromise that can flow into Sentinel. Combining these alerts with other raw logs and additional data sources provides the security team with additional insights as well as a complete picture of nature and the scope of attack.

 

Appendix

Many of these queries have been incorporated into the related hunting workbook.

List of all Azure Sentinel Queries from each section

Updated 01/15/2021

Spoiler
Gaining a foothold  
SolarWinds Inventory check query https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/MultipleDataSources/SolarWinds...
Solorigate Name Pipe https://github.com/Azure/Azure-Sentinel/blob/master/Detections/SecurityEvent/SolorigateNamedPipe.yam... 
Privilege Escalation  
Hosts with new logons https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/SecurityEvent/HostsWithNewLogo...
New user created and added to the built-in administrators group https://github.com/Azure/Azure-Sentinel/blob/master/Detections/SecurityEvent/UserCreatedAddedToBuilt...
User account added to built in domain local or global group https://github.com/Azure/Azure-Sentinel/blob/master/Detections/SecurityEvent/UserAccountAddedToPrivl...
Tracking Privileged Account Rare Activity https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/MultipleDataSources/TrackingPr...
ADFS Key Extraction  
ADFS DKM Master Key Export https://github.com/Azure/Azure-Sentinel/blob/master/Detections/MultipleDataSources/ADFS-DKM-MasterKe...
ADFS Key Export (Sysmon) https://github.com/Azure/Azure-Sentinel/blob/master/Detections/SecurityEvent/ADFSKeyExportSysmon.yam...
Entropy for Processes for a given Host https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/SecurityEvent/ProcessEntropy.y...
Rare processes run by Service accounts https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/SecurityEvent/RareProcbyServic...
Uncommon processes - bottom 5% https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/SecurityEvent/uncommon_process...
Azure Active Directory  
Modified domain federation trust settings https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/ADFSDomainTrustMods.yaml
New access credential added to Application or Service Principal https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/NewAppOrServicePrincipalCre...
First access credential added to Application or Service Principal where no credential was present https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/FirstAppOrServicePrincipalC...
Mail.Read Permissions Granted to Application https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/MailPermissionsAddedToAppli...
Suspicious application consent similar to O365 Attack Toolkit https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/MaliciousOAuthApp_O365Attac...
Suspicious application consent for offline access https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/SuspiciousOAuthApp_OfflineA...
Recon and Remote Execution  
Suspicious enumeration using Adfind tool https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/SecurityEvent/Suspicious_enume...
Multiple explicit credential usage - 4648 events https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/SecurityEvent/MultipleExplicit...
Data Access  
Azure Active Directory PowerShell accessing non-AAD resources https://github.com/Azure/Azure-Sentinel/blob/master/Detections/SigninLogs/AzureAADPowerShellAnomaly....
Signins From VPS Providers https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/SigninLogs/Signins-From-VPS-Pr...
Data Exfiltration  
Anomalous access to other user's mailboxes https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/OfficeActivity/AnomolousUserAc...
Exchange workflow MailItemsAccessed operation anomaly https://github.com/Azure/Azure-Sentinel/blob/master/Detections/OfficeActivity/MailItemsAccessedTimeS...
Suspect Mailbox Export on IIS/OWA https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/W3CIISLog/SuspectedMailBoxExpo...
Host Exporting Mailbox and Removing Export https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/SecurityEvent/HostExportingMai...
Non-owner mailbox login activity https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/OfficeActivity/nonowner_Mailbo...
Domain Hunting  
Solorigate Network Beacon https://github.com/Azure/Azure-Sentinel/blob/master/Detections/MultipleDataSources/Solorigate-Networ...
Solorigate DNS Pattern https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/DnsEvents/Solorigate-DNS-Patte...
Solorigate Encoded Domain in URL https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/DnsEvents/Solorigate-Encoded-D...
Security Service Tampering  
Potential Microsoft Defender services tampering https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/MultipleDataSources/PotentialM... 
M365+Sentinel  
Solorigate Defender Detections https://github.com/Azure/Azure-Sentinel/blob/master/Detections/SecurityAlert/Solorigate-Defender-Det...

References

Recent Nation-State Cyber Attacks 

Behavior:Win32/Solorigate.C!dha threat description - Microsoft Security Intelligence

Customer guidance on recent nation-state cyberattacks 

FireEye Advisory: Highly Evasive Attacker Leverages SolarWinds Supply Chain to Compromise Multiple G...

FireEye GitHub page: Sunburst Countermeasures 

DHS Directive

SolarWinds Security Advisory

FalconFriday – Fireeye Red Team Tool Countermeasures KQL Queries  

Microsoft-365-Defender-Hunting-Queries: Sample queries for Advanced hunting in Microsoft 365 Defende...

Azure Sentinel SolarWinds Post Compromise Hunting Workbook

Azure Sentinel SolarWinds Post Compromise Notebook 

Updated 12/18/2020

New Threat analytics report shares the latest intelligence on recent nation-state cyber attacks - Mi...

Analyzing Solorigate, the compromised DLL file that started a sophisticated cyberattack, and how Mic...

Updated 12/28/2020

Using Microsoft 365 Defender to protect against Solorigate - Microsoft Security

 

 

 

 

 

 

5 Comments

Thanks @shainw for Sharing with the community !

Great Blogpost and Information. :smile:

Occasional Visitor

When running a couple of the queries in Sentinel I get a "'evaluate' operator: Failed to resolve table expression named 'IP_Data'" Is there a data connector that I'm missing or what can I do to resolve this? 

Microsoft

@mrman5917 - Apologies, that was a typo in this section and the evaluate has been removed - "Additionally, below is a sample query that brings out some of the logons to Azure AD where multi factor authentication was satisfied by token based logons versus MFA via phone auth or the like. It is possible this could produce many results, so additional tuning is suggested for your environment."  It comes from the query that associated the VPS providers discussed right below this - Signins From VPS Providers - where there is a list of IPs that are referenced by using IP_Data. 

 

image.png

Occasional Visitor

sorry if this is not the right place

 

As CISO of a company that uses Office365, Azure, Teams and several services from Microsoft Cloud how can we be assured that Microsoft is not impacted by Solarwinds breach themselves. Essentially need to understand Microsoft's assessment for their own infrastructure. It will help me immensely if someone can direct me on where to look. Or should I chase our Account Execs?

Microsoft

@VidyaPhalke 
“Like other SolarWinds customers, we have been actively looking for indicators of this actor and can confirm that we detected malicious SolarWinds binaries in our environment, which we isolated and removed. We have not found evidence of access to production services or customer data. Our investigations, which are ongoing, have found absolutely no indications that our systems were used to attack others
.”

 

Ref: A moment of reckoning: the need for a strong and global cybersecurity response - Microsoft On the Is...