Share via


使用適用於 Azure 防火牆的 Microsoft Sentinel 偵測惡意程式碼

惡意程式碼是指設計目的是為了成損害、中斷或危害電腦系統、網路或裝置安全性與功能的任何軟體。 其中包含不同類型的威脅,例如病毒、蠕蟲、特洛伊木馬、勒索軟體、間諜軟體、廣告軟體、Rootkit 等等。 惡意程式碼可能會造成各種負面影響,例如竊取敏感性資料、加密或刪除檔案、顯示垃圾廣告、降低效能,甚至控制裝置。

請務必從系統或網路中識別和消除惡意程式碼,若要達成此目的,您可以使用各種偵測技術,例如簽章型、行為型、啟發學習型或機器學習型技術。 惡意程式碼偵測對於保護使用者的安全和隱私,以及系統和網路的完整性和可用性至關重要。

Azure 防火牆 IDPS 功能預設會自動偵測和拒絕惡意程式碼,並可防止雲端工作負載受到感染。 您可以使用預先建置的偵測查詢和 Microsoft Sentinel 來執行自動偵測和回應,以進一步強化這項功能。 在本文中,您將探索如何使用適用於 Azure 防火牆的預先定義 KQL 偵測查詢,偵測出現在 Azure 防火牆記錄中的一些常見惡意程式碼,例如 CoinminerCl0p 以及 Sunburst

當內部網路的機器要求連線到網際網路上的網域名稱或 IP 位址,而這些網域和位址連結到偵測規則查詢所定義的已知入侵指標 (IOC) 時,這些偵測可讓安全性小組收到 Sentinel 警示。 確判為真的偵測應視為入侵指標 (IOC)。 然後,安全性事件回應小組就會起始回應,並根據這些偵測訊號,實作適當的自訂補救動作。

如需使用下列查詢部署分析規則的指示,請參閱使用 Microsoft Sentinel 搭配 Azure Web 應用程式防火牆偵測新的威脅

常見的惡意程式碼惡意探索

以下是現今網路上常見的惡意程式碼惡意探索。

Coinminer

由於最近加密貨幣採礦激增,高效能網路處理單位的需求也隨之增加。 分散式運算不斷擴展,且採礦軟體在合法和非法環境中都普遍存在。

Coinminer 代表一種惡意程式碼,使用不知情受害者的電腦硬體資源進行加密貨幣採礦。 惡意程式碼使用毫無戒備的使用者電腦中的圖形處理器 (GPU) 來執行各種指令碼,目的在於加密貨幣採礦和計算交易區塊雜湊。

若要降低這些威脅的風險,應在一般進入點採取主動措施。 這包括確保 Jupyter 軟體已部署適當的驗證、設定及更新 Web 應用程式以將弱點降到最低、控制 Docker 的外部存取,以及遵循額外的零信任原則。

下列偵測查詢可用來在 Sentinel 中建立分析規則,以使用 Azure 防火牆記錄自動偵測及回應此惡意程式碼。

// Coinminer Detection Rule
// Detects suspicious traffic patterns associated with coinmining activity in Azure Firewall logs for Sentinel

let coinminerPorts = dynamic(["2375", "2376", "2377", "4243", "4244"]); // List of known coinminer ports  
//Assign the known domains to a variable
let coinminerdomains = dynamic(["teamtnt.red", "kaiserfranz.cc", "45.9.148.123"]); // List of known coinminer domains  

(union isfuzzy=true 

(AzureDiagnostics  
| where ResourceType == "AZUREFIREWALLS"  
| where Category == "AzureFirewallApplicationRule" 
| parse msg_s with Protocol 'request from ' SourceHost ':' SourcePort 'to ' DestinationHost ':' DestinationPort '. Action:' Action 
| extend action_s = column_ifexists("action_s", ""), transactionId_g = column_ifexists("transactionId_g", "")  
| where DestinationPort in (coinminerPorts) // Filter traffic on known coinminer ports  
| summarize CoinminerAttempts = count() by DestinationHost, DestinationPort  
| where CoinminerAttempts > 10 // Adjust threshold as needed  
), 

(AZFWIdpsSignature 
| where DestinationPort in (coinminerPorts) 
| summarize CoinminerAttempts = count() by DestinationIp, DestinationPort 
| where CoinminerAttempts > 10 // Adjust threshold as needed   

), 

(AzureDiagnostics  
| where ResourceType == "AZUREFIREWALLS"  
| where Category == "AzureFirewallDnsProxy"  
| parse msg_s with "DNS Request: " ClientIP ":" ClientPort " - " QueryID " " Request_Type " " Request_Class " " Request_Name ". " Request_Protocol " " Request_Size " " EDNSO_DO " " EDNS0_Buffersize " " Response_Code " " Response_Flags " " Response_Size " " Response_Duration  
| where Request_Name has_any(coinminerdomains)  
| extend DNSName = Request_Name  
| extend IPCustomEntity = ClientIP  

),  

(AzureDiagnostics  
| where ResourceType == "AZUREFIREWALLS"  
| where Category == "AzureFirewallApplicationRule"  
| parse msg_s with Protocol ' request from ' SourceHost ':' SourcePort 'to' DestinationHost ':' DestinationPort '. Action:' Action  
| where isnotempty(DestinationHost)  
| where DestinationHost has_any(coinminerdomains)  
| extend DNSName = DestinationHost  
| extend IPCustomEntity = SourceHost), 

(AZFWApplicationRule 
| where isnotempty(Fqdn) 
| where Fqdn has_any (coinminerdomains)   
| extend DNSName = Fqdn  
| extend IPCustomEntity = SourceIp), 

(AZFWDnsQuery 
| where isnotempty(QueryName) 
| where QueryName has_any (coinminerdomains) 
| extend DNSName = QueryName 
| extend IPCustomEntity = SourceIp 

), 

(AZFWIdpsSignature 
| where DestinationIp has_any (coinminerdomains) 
| extend DNSName = DestinationIp 
| extend IPCustomEntity = SourceIp 

), 

(AZFWIdpsSignature 
| where Description contains "coinminer" 
| extend DNSName = DestinationIp 
| extend IPCustomEntity = SourceIp 
) 

)

Cl0p

Cl0p 是勒索軟體,其運作方式是將獨特的加密金鑰套用至受害者的檔案,然後要求使用者支付贖金以解密檔案。 它會使用資料傳輸軟體 MOVEit 中的弱點,並將魚叉式網路釣魚電子郵件傳送給許多員工,意圖傳遞 cl0p。 然後它會使用 truebotdewmode 之類的工具,在網路內橫向移動並洩露資料。 勒索軟體使用 AES-256 加密演算法來加密檔案。

Cl0p 軟點包括 CVE-2023-35036、CVE-2023-34362 和 CVE-2023-35708。 2023 年 6 月,FBI 和 CISA 發佈了有關這種惡意探索的新聞稿。 cl0p 勒索軟體的影響已在美國中西部的數所大學和政府機構登記在案。 航空公司、電視網路和總部位於英國的零售商店都是 cl0p 勒索軟體團夥的最新受害者。

下列偵測查詢可用來在 Sentinel 中建立分析規則,以使用 Azure 防火牆記錄自動偵測及回應此惡意程式碼。

Cl0p 的偵測查詢:適用於 Sentinel/偵測的防火牆惡意程式碼偵測 - Cl0p.json 的分析規則查詢

Sunburst

此惡意程式碼使用網域產生演算法 (DGA) 字串來鎖定目標受害者,以避開偵測並建立命令和控制後門程式攻擊。 DGA 字串通常會讓安全性工具難以識別惡意程式碼所使用的網域,因為語法中使用的模式及其不斷變更的網域資訊。

下列偵測查詢可用來在 Sentinel 中建立分析規則,以使用 Azure 防火牆記錄自動偵測及回應此惡意程式碼。

Sunburst 惡意程式碼的偵測查詢:適用於 Sentinel/偵測的防火牆惡意程式碼偵測 - Sunburst.json 的分析規則查詢