Adversaries associated with the OilRig campaign may use custom malware to establish persistence and exfiltrate data, which could indicate a targeted attack on the network. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify and mitigate potential long-term compromise and data theft.
YARA Rule
rule OilRig_Malware_Campaign_Mal1
{
meta:
description = "Detects malware from OilRig Campaign"
author = "Florian Roth"
reference = "https://goo.gl/QMRZ8K"
date = "2016-10-12"
hash1 = "e17e1978563dc10b73fd54e7727cbbe95cc0b170a4e7bd0ab223e059f6c25fcc"
strings:
$x1 = "DownloadExecute=\"powershell \"\"&{$r=Get-Random;$wc=(new-object System.Net.WebClient);$wc.DownloadFile(" ascii
$x2 = "-ExecutionPolicy Bypass -File \"&HOME&\"dns.ps1\"" fullword ascii
$x3 = "CreateObject(\"WScript.Shell\").Run Replace(DownloadExecute,\"-_\",\"bat\")" fullword ascii
$x4 = "CreateObject(\"WScript.Shell\").Run DnsCmd,0" fullword ascii
$s1 = "http://winodwsupdates.me" ascii
condition:
( uint16(0) == 0x4f48 and filesize < 4KB and 1 of them ) or ( 2 of them )
}
This YARA rule can be deployed in the following contexts:
This rule contains 7 string patterns in its detection logic.
Scenario: Legitimate system update using oilrig.exe as part of a Windows Update or Microsoft Defender ATP tool
Filter/Exclusion: Check for process.parent_process containing svchost.exe or taskhost.exe, and process.name matching known Microsoft-signed binaries.
Scenario: Scheduled job running oilrig.exe as part of a legitimate backup or log management tool (e.g., Veritas NetBackup or Splunk)
Filter/Exclusion: Filter by process.name containing “backup” or “splunk” and check for process.parent_process matching a known enterprise service like ntsvcs.exe or splunkd.exe.
Scenario: Admin task using oilrig.exe for network monitoring or packet capture (e.g., Wireshark or Microsoft Network Monitor)
Filter/Exclusion: Filter by process.name containing “wireshark” or “nmt” and ensure the process is running under a user with administrative privileges and a known enterprise IP range.
Scenario: Malware analysis tool (e.g., Cuckoo Sandbox) executing oilrig.exe in a sandboxed environment
Filter/Exclusion: Check for process.parent_process containing “cuckoo” or “sandbox” and verify the process is running in a virtualized or isolated environment.
Scenario: Legitimate PowerShell script using oilrig.exe as part of a custom enterprise tool or script automation
Filter/Exclusion: Filter by process.name containing “powershell.exe” and check for process.parent_process matching a known enterprise service or user account with script execution rights.