من الـ Advanced Hunting، بتغطي أجهزة Defender for Endpoint. ممكن تتحول لـ Detection Rule بعد ما تظبط الـ False Positives.
PowerShell بأمر مشفّر
T1059.001PowerShell شغال بـ Base64 أو بـ -EncodedCommand. الـ Attacker بيستخدمه عشان يخبي الأمر.
DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any ("-enc", "-encodedcommand", "FromBase64String")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, ProcessCommandLine
| order by Timestamp desc
بعد النتيجة: فك الـ Base64 وشوف الأمر الحقيقي. بص على الـ Parent Process: Office أو الـ Browser بيشغّل PowerShell مش طبيعي. أدوات الإدارة ممكن تطلع هنا كـ False Positive.
DeviceProcessEvents · الجهاز متضاف على Defender for Endpoint
Office بيشغّل Shell
T1204.002Word أو Excel أو Outlook فتح cmd أو PowerShell أو Script Host. غالبًا مرفق فيه Macro.
DeviceProcessEvents
| where Timestamp > ago(1d)
| where InitiatingProcessFileName in~ ("winword.exe", "excel.exe", "powerpnt.exe", "outlook.exe")
| where FileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, FileName, ProcessCommandLine
بعد النتيجة: ابدأ من الإيميل أو الملف اللي اتفتح قبلها بدقايق. قليل جدًا من الحالات دي تبقى شرعية.
DeviceProcessEvents · الجهاز متضاف على Defender for Endpoint
Scheduled Task جديدة بـ schtasks
T1053.005حد عمل Scheduled Task من سطر الأوامر. طريقة شائعة للـ Persistence.
DeviceProcessEvents
| where Timestamp > ago(1d)
| where FileName =~ "schtasks.exe"
| where ProcessCommandLine has "/create"
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, ProcessCommandLine
بعد النتيجة: بص على الأمر اللي الـ Task بتشغله ومسارها. Task بتشغّل Script من فولدر مؤقت أو بحساب SYSTEM تستاهل Investigation.
DeviceProcessEvents · الجهاز متضاف على Defender for Endpoint
مسح الـ Shadow Copies و الـ Backups
T1490الـ Ransomware بيمسح النسخ الاحتياطية المحلية قبل ما يشفّر.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where (FileName =~ "vssadmin.exe" and ProcessCommandLine has "delete" and ProcessCommandLine has "shadows")
or (FileName =~ "wbadmin.exe" and ProcessCommandLine has "delete" and ProcessCommandLine has "catalog")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, ProcessCommandLine
بعد النتيجة: لو ظهر على جهاز، اعزله فورًا. الـ Containment الأول، وبعدها التحقيق.
DeviceProcessEvents · الجهاز متضاف على Defender for Endpoint
certutil أداة شرعية، بس الـ Attackers بيستخدموها لتنزيل ملفات من الإنترنت.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "certutil.exe"
| where ProcessCommandLine has_any ("urlcache", "-split", "-decode")
| where ProcessCommandLine has_any ("http://", "https://")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, ProcessCommandLine
بعد النتيجة: راجع الـ URL و الـ Domain، وشوف الملف اللي اتحفظ اتشغّل ولا لأ.
DeviceProcessEvents · الجهاز متضاف على Defender for Endpoint