SEZIONE 1: LE 80 QUERY ESPORTATE DA DEFENDER (01 – 80)
1.1 Ricerca Globale IOC
01. Ricerca Globale IOC nelle Tabelle (ID:
32384)// The following query allows you to identify where the data is located in the available telemetry. Once you know which table it is in, you can search for the data needed for the analysis.
search "8.8.8.8"
| summarize Count=count() by $table
| order by Count desc
1.2 Pulizia Log di Sicurezza Windows (Rule027_Windows logs audit cleared)
02. Rule027_Query01 — Evento SecurityLogCleared (ID:
32385)//Search for event with action type "SecurityLogCleared"
DeviceEvents
| where ActionType == "SecurityLogCleared"
| where DeviceName contains "DEVICE"
| sort by Timestamp desc
03. Rule027_Query02 — Comandi di cancellazione Event Log (ID:
32386)//This query checks the device for commands that might indicate the deletion of Windows logs (for example, using `wevtutil cl`, `Clear-EventLog`, or `Remove-EventLog`).
DeviceProcessEvents
| where DeviceName contains "DEVICE"
| where ProcessCommandLine has_any (
"wevtutil",
"Clear-EventLog",
"Remove-EventLog",
"clear-log"
)
| project Timestamp,
DeviceName,
AccountName,
FileName,
ProcessCommandLine,
InitiatingProcessFileName,
InitiatingProcessCommandLine
| order by Timestamp desc
04. Rule027_Query03 — Ricerca Event ID 4612 (ID:
32387)//Search for Event ID 4612. 4612 = Internal resources allocated for the queuing of audit messages have been exhausted, leading to loss of some audits.
SecurityEvent
| where Computer contains "DEVICE"
| where EventID == 4612
| project TimeGenerated,
Computer,
Account,
Activity,
EventID
| order by TimeGenerated desc
05. Rule027_Query04 — Verifica Event ID 4612 sull'host (ID:
32389)// Search for Event ID 4612. 4612 = Internal resources allocated for the queuing of audit messages have been exhausted, leading to loss of some audits.
SecurityEvent
| where Computer contains "DEVICE"
| where EventID == 4612
| project TimeGenerated,
Computer,
Account,
Activity,
EventID
| order by TimeGenerated desc
06. Rule027_Query05 — Parsing XML dell'evento 4612 (ID:
32390)//Parsing the XML details of event 4612
SecurityEvent
| where Computer contains "DEVICE"
| where EventID == 4612
| extend ParsedData = parse_xml(EventData)
| project TimeGenerated, ParsedData
1.3 Dispositivi USB e Supporti Rimovibili (USB mounted on device)
07. USB_Query01 — Identificazione dispositivo USB collegato (ID:
32391)//Identify a USB that was plugged on a device to retreive product name, serianN etc..-and check was the correct one
DeviceEvents
| where DeviceName contains "xxxxx"
| where ActionType contains "UsbDriveMounted"
08. USB_Query02 — Lettere di unità rimovibili rilevate (ID:
32392)//Other queries
DeviceFileEvents
| where Timestamp > ago(30d)
| where DeviceName == "[DEVICE_NAME]"
| extend DriveLetter = tostring(split(FolderPath, "\\")[0])
| where DriveLetter !in ("C:", "D:") // Assuming C: and D: are internal
| summarize RemovableDrives = make_set(DriveLetter) by DeviceName
| project DeviceName, RemovableDrives
09. USB_Query03 — Riepilogo unità interne e rimovibili per Hostname (ID:
32393)//Other queries
DeviceFileEvents
| where Timestamp > ago(30d)
| where DeviceName == "[DEVICE_NAME]"
| extend DriveLetter = tostring(split(FolderPath, "\\")[0])
| summarize
AllDrives = make_set(DriveLetter),
InternalDrives = make_set(iff(DriveLetter in ("C:", "D:"), DriveLetter, "")),
RemovableDrives = make_set(iff(DriveLetter !in ("C:", "D:"), DriveLetter, "")),
DriveCount = dcount(DriveLetter)
by DeviceName
| project DeviceName, DriveCount, AllDrives, InternalDrives, RemovableDrives
10. USB_Query04 — Riepilogo unità interne e rimovibili per FQDN (ID:
32394)//Other queries
DeviceFileEvents
| where Timestamp > ago(30d)
| where DeviceName == "[DEVICE_NAME].[INTERNAL_DOMAIN]"
| extend DriveLetter = tostring(split(FolderPath, "\\")[0])
| summarize
AllDrives = make_set(DriveLetter),
InternalDrives = make_set(iff(DriveLetter in ("C:", "D:"), DriveLetter, "")),
RemovableDrives = make_set(iff(DriveLetter !in ("C:", "D:"), DriveLetter, "")),
DriveCount = dcount(DriveLetter)
by DeviceName
| project DeviceName, DriveCount, AllDrives, InternalDrives, RemovableDrives
11. USB_Query05 — Elenco file e operazioni sulle unità disco (ID:
32395)//Other queries
DeviceFileEvents
| where Timestamp > ago(2d)
| where DeviceName == "[DEVICE_NAME].[INTERNAL_DOMAIN]"
| extend DriveLetter = tostring(split(FolderPath, "\\")[0])
| distinct Timestamp, DeviceName, FolderPath, FileName, ActionType, DriveLetter
| order by Timestamp desc
1.4 Analisi WAF Akamai (Rule017_AKAMAI)
12. AKAMAI_Query01 — Dettaglio eventi WAF Akamai per IP sorgente (ID:
32396)//To log the events that triggered the rule, including key fields such as status code, target, and action:
CommonSecurityLogDL_CL
| where DeviceVendor == "Akamai"
| where DeviceProduct == "akamai_siem"
| where SourceIP == "IP_MALEVOLO"
| extend HttpStatusCode = extract(@'.*AkamaiSiemResponseStatus=(.*?);', 1, AdditionalExtensions)
| project
TimeGenerated,
SourceIP,
DestinationHostName,
HttpStatusCode,
DeviceCustomString2,
DeviceAction,
RequestMethod,
AdditionalExtensions
| order by TimeGenerated desc
13. AKAMAI_Query02 — Riepilogo target e Status Code HTTP (ID:
32397)//To understand the targets and the returned status codes:
CommonSecurityLogDL_CL
| where DeviceVendor == "Akamai"
| where DeviceProduct == "akamai_siem"
| where SourceIP == "IP_MALEVOLO"
| extend HttpStatusCode = extract(@'.*AkamaiSiemResponseStatus=(.*?);', 1,
AdditionalExtensions)
| summarize Count=count() by DestinationHostName, HttpStatusCode
| order by Count desc
14. Filtra eventi WAF per Content-Type con Status 200 (ID:
32428)//Filter events by Content-Type.
CommonSecurityLogDL_CL
| where DeviceVendor == "Akamai"
| where DeviceProduct == "akamai_siem"
| where SourceIP == "[MALICIOUS_IP]"
| extend HttpStatusCode = extract(@"AkamaiSiemResponseStatus=(.*?);", 1, AdditionalExtensions)
| where HttpStatusCode == "200"
| extend ContentType = extract(@"Content-Type:\+([^\\n;]+)", 1, AdditionalExtensions)
| summarize Count=count() by ContentType
| order by Count desc
15. Ispezione singolo evento WAF con Status 200 (ID:
32429)//Expansion of a single field, survey 200.
CommonSecurityLogDL_CL
| where DeviceVendor == "Akamai"
| where DeviceProduct == "akamai_siem"
| where SourceIP == "[MALICIOUS_IP]"
| extend HttpStatusCode = extract(@"AkamaiSiemResponseStatus=(.*?);", 1, AdditionalExtensions)
| where HttpStatusCode == "200"
| order by TimeGenerated desc
| take 1
16. Raggruppa le risposte HTTP 200 per percorso URL (ID:
32430)//Group the 200 by path
CommonSecurityLogDL_CL
| where DeviceVendor == "Akamai"
| where DeviceProduct == "akamai_siem"
| where SourceIP == "[MALICIOUS_IP]"
| extend HttpStatusCode = extract(@"AkamaiSiemResponseStatus=(.*?);", 1, AdditionalExtensions)
| where HttpStatusCode == "200"
| extend UrlPath = tostring(parse_url(RequestURL).Path)
| extend QueryString = extract(@"\?(.*)$", 1, RequestURL)
| extend DecodedQuery = url_decode(QueryString)
| summarize
Hits=count(),
FirstSeen=min(TimeGenerated),
LastSeen=max(TimeGenerated),
Queries=make_set(DecodedQuery, 20)
by DestinationHostName, RequestMethod, UrlPath
| order by Hits desc
17. Dettaglio richieste WAF con Status Code 200 (ID:
32431)//Status Code 200
CommonSecurityLogDL_CL
| where DeviceVendor == "Akamai"
| where DeviceProduct == "akamai_siem"
| where SourceIP == "[MALICIOUS_IP]"
| extend HttpStatusCode = extract(@"AkamaiSiemResponseStatus=(.*?);", 1, AdditionalExtensions)
| where HttpStatusCode == "200"
| extend UrlPath = tostring(parse_url(RequestURL).Path)
| extend QueryString = extract(@"\?(.*)$", 1, RequestURL)
| extend DecodedQuery = url_decode(QueryString)
| project
TimeGenerated,
SourceIP,
DestinationHostName,
RequestMethod,
HttpStatusCode,
DeviceAction,
UrlPath,
QueryString,
DecodedQuery,
DeviceCustomString1,
DeviceCustomString2,
RequestURL
| order by TimeGenerated desc
18. Richieste HTTP POST con Status Code 200 (ID:
32432)//POST whit 200
CommonSecurityLogDL_CL
| where DeviceVendor == "Akamai"
| where DeviceProduct == "akamai_siem"
| where SourceIP == "[MALICIOUS_IP]"
| extend HttpStatusCode = extract(@"AkamaiSiemResponseStatus=(.*?);", 1, AdditionalExtensions)
| where HttpStatusCode == "200"
| where RequestMethod == "POST"
| extend
ResponseContentType = extract(@"AkamaiSiemResponseHeaders=Content-Type:\+([^\\n;]+)", 1, AdditionalExtensions),
ContentLength = extract(@"Content-Length:\+(\d+)", 1, AdditionalExtensions),
RuleTags = extract(@"AkamaiSiemRuleTags=([^;]+)", 1, AdditionalExtensions)
| project
TimeGenerated,
RequestMethod,
RequestURL,
ResponseContentType,
ContentLength,
SentBytes,
DeviceAction,
RuleTags,
DeviceCustomString1,
DeviceCustomString2
| order by TimeGenerated asc
1.5 Indagini su URL, Domini e Navigazione (URL Search)
19. Ricerca URL all'interno delle Email (ID:
32398)//To detect URLs in emails
EmailEvents
// | where RecipientEmailAddress contains "@xxx.xxx"
|join EmailUrlInfo on NetworkMessageId
|where Url contains "xxx"
20. Utenti e dispositivi che hanno contattato un URL (ID:
32399)//check who contacted an URL, i.e. clicked on a phishing link
DeviceNetworkEvents
| where RemoteUrl contains "xxxx"
// retrieve user from device name u can delete this part if no needed
| join IdentityInfo on $left.InitiatingProcessAccountSid == $right.OnPremSid
| project Timestamp, RemoteUrl,ActionType,InitiatingProcessAccountName,EmailAddress,JobTitle,Department, DeviceName, InitiatingProcessFileName
| summarize count() by EmailAddress, JobTitle, Department, DeviceName, ActionType
21. Ricerca multi-tabella di un dominio sospetto (ID:
32400)//This query searches for evidence of interaction with the domain [SUSPICIOUS_DOMAIN] in various MDE telemetry tables, then filters the results to three specific internal IP addresses.
let url = "[SUSPICIOUS_DOMAIN]";
search in (EmailUrlInfo, UrlClickEvents, DeviceNetworkEvents, DeviceFileEvents, DeviceEvents)
(
RemoteUrl has url
or FileOriginUrl has url
or FileOriginReferrerUrl has url
or Url has url
)
| where LocalIP in ("[INTERNAL_IP_1]", "[INTERNAL_IP_2]", "[INTERNAL_IP_3]")
| summarize EventCount=count(), LastSeen=max(Timestamp)
by DeviceName, AccountName, Url
| order by LastSeen desc
22. Dispositivi distinti che hanno contattato il dominio (ID:
32401)//This query returns the various devices that have contacted the domain
DeviceNetworkEvents
| where RemoteUrl contains "[SUSPICIOUS_DOMAIN]"
| distinct DeviceName
23. Tentativi di connessione verso uno specifico dominio (ID:
32402)//Search for access attempts to a specific domain
DeviceNetworkEvents
| where RemoteUrl contains "evil-domain.com"
| project Timestamp,
DeviceName,
InitiatingProcessAccountName,
InitiatingProcessFileName,
RemoteUrl,
RemoteIP
| order by Timestamp desc
24. Tutti i domini contattati da un singolo host (ID:
32403)//All domains contacted by a host
DeviceNetworkEvents
| where DeviceName contains "DEVICE"
| summarize Count=count() by RemoteUrl
| order by Count desc
25. Domini contattati tramite PowerShell (ID:
32404)//Domains Contacted by PowerShell
DeviceNetworkEvents
| where InitiatingProcessFileName =~ "powershell.exe"
| project Timestamp,
DeviceName,
RemoteUrl,
RemoteIP,
InitiatingProcessCommandLine
| order by Timestamp desc
26. URL contattati da interpreti e script sospetti (ID:
32405)//Domains contacted by suspicious scripts
DeviceNetworkEvents
| where InitiatingProcessFileName in~ (
"powershell.exe",
"cmd.exe",
"wscript.exe",
"cscript.exe",
"mshta.exe"
)
| project Timestamp,
DeviceName,
RemoteUrl,
RemoteIP,
InitiatingProcessFileName,
InitiatingProcessCommandLine
27. File scaricati da Internet (FileOriginUrl) (ID:
32406)//Downloading Files from the Internet
DeviceFileEvents
| where FileOriginUrl != ""
| project Timestamp,
DeviceName,
FileName,
FileOriginUrl,
FolderPath
| order by Timestamp desc
28. File scaricati da uno specifico dominio (ID:
32407)//Downloading Files from specific domain
DeviceFileEvents
| where FileOriginUrl contains "evil-domain.com"
| project Timestamp,
DeviceName,
FileName,
FileOriginUrl
29. Navigazione browser verso uno specifico dominio (ID:
32408)//Browsers that have visited a domain
DeviceNetworkEvents
| where RemoteUrl contains "evil-domain.com"
| where InitiatingProcessFileName in~ (
"chrome.exe",
"msedge.exe",
"firefox.exe",
"iexplore.exe"
)
| project Timestamp,
DeviceName,
InitiatingProcessFileName,
RemoteUrl
30. Top 50 domini più contattati nelle ultime 24 ore (ID:
32409)//Top 50 domains last 24h
DeviceNetworkEvents
| where Timestamp > ago(24h)
| summarize Connections=count() by RemoteUrl
| top 50 by Connections
31. Possibile Command & Control (Domini rari nel tenant) (ID:
32410)//Possible Command & Control (rare domains)
DeviceNetworkEvents
| where Timestamp > ago(30d)
| summarize Devices=dcount(DeviceName) by RemoteUrl
| where Devices <= 2
| order by Devices asc
32. Domini contattati in concomitanza di un Alert (ID:
32411)//Domains contacted immediately before an alert
AlertEvidence
| where DeviceName contains "[DEVICE_NAME]"
| join kind=inner (
DeviceNetworkEvents
) on DeviceId
| project AlertTitle,
Timestamp,
DeviceName,
RemoteUrl,
RemoteIP
| order by Timestamp desc
33. Domini contattati da applicazioni Microsoft Office (ID:
32412)//Domains Contacted by Office (phishing)
DeviceNetworkEvents
| where InitiatingProcessFileName in~ (
"winword.exe",
"excel.exe",
"powerpnt.exe",
"outlook.exe"
)
| project Timestamp,
DeviceName,
RemoteUrl,
InitiatingProcessFileName
| order by Timestamp desc
34. Ricerca combinata IOC di rete (Dominio + IP + URL) (ID:
32413)//Complete IOC Search (Domain + IP + URL)
DeviceNetworkEvents
| where RemoteUrl contains "evil-domain.com"
or RemoteIP == "1.2.3.4"
| project Timestamp,
DeviceName,
RemoteUrl,
RemoteIP,
InitiatingProcessFileName,
InitiatingProcessAccountName
| order by Timestamp desc
1.6 Monitoraggio Storage Account Azure Blob (Storage Account Azure Blob)
35. Accessi e connessioni verso Azure Blob Storage (ID:
32414)//Who has signed in to the storage account?
DeviceNetworkEvents
| where RemoteUrl contains "blob.core.windows.net"
| where RemoteUrl contains "[STORAGE_ACCOUNT_NAME]"
| project TimeGenerated,
DeviceName,
InitiatingProcessAccountName,
RemoteUrl,
RemoteIP,
LocalIP
| order by TimeGenerated desc
36. Attività di uno specifico dispositivo verso lo Storage Account (ID:
32415)//Activities of a Specific Device
DeviceNetworkEvents
| where DeviceName startswith "[DEVICE_NAME]"
| where RemoteUrl contains "[STORAGE_ACCOUNT_NAME]"
| project
TimeGenerated,
InitiatingProcessAccountName,
InitiatingProcessFileName,
RemoteUrl
| order by TimeGenerated desc
37. Utilizzo del client Azure Storage Explorer (ID:
32416)//Check the usage of Azure Storage Explorer
DeviceProcessEvents
| where DeviceName startswith "[DEVICE_NAME]"
| where FileName contains "Storage"
or ProcessCommandLine contains "StorageExplorer"
| project
TimeGenerated,
DeviceName,
InitiatingProcessAccountName,
FileName,
ProcessCommandLine
| order by TimeGenerated desc
1.7 Analisi Completa per Hash (HASH Search)
38. Ricerca generica di Hash SHA256 nei file (ID:
32417)let hashList = dynamic([
"[SHA256_HASH]"
]);
DeviceFileEvents
| where SHA256 in (hashList)
| summarize MacchineCoinvolte = make_set(DeviceName) by SHA256
39. Verifica esecuzione di un file tramite Hash (ID:
32418)//This is very useful for determining whether the file simply exists or has actually been launched.
let Hash = "INSERISCI_HASH";
DeviceProcessEvents
| where Timestamp > ago(30d)
| where SHA1 =~ Hash or SHA256 =~ Hash or MD5 =~ Hash
| project Timestamp,
DeviceName,
AccountName,
FileName,
FolderPath,
ProcessCommandLine,
SHA1,
SHA256,
InitiatingProcessFileName,
InitiatingProcessCommandLine
| order by Timestamp desc
40. Creazione o modifica di file corrispondenti all'Hash (ID:
32419)//Search for file creation/editing
let Hash = "INSERISCI_HASH";
DeviceFileEvents
| where Timestamp > ago(30d)
| where SHA1 =~ Hash or SHA256 =~ Hash or MD5 =~ Hash
| project Timestamp,
DeviceName,
ActionType,
FileName,
FolderPath,
FileSize,
SHA1,
SHA256,
InitiatingProcessFileName,
InitiatingProcessCommandLine
| order by Timestamp desc
41. Provenienza del download per uno specifico Hash (ID:
32420)//Find out where it was downloaded from
let Hash = "INSERISCI_HASH";
DeviceFileEvents
| where Timestamp > ago(30d)
| where SHA1 =~ Hash or SHA256 =~ Hash or MD5 =~ Hash
| where isnotempty(FileOriginUrl)
or isnotempty(FileOriginIP)
or isnotempty(FileOriginReferrerUrl)
| project Timestamp,
DeviceName,
FileName,
FolderPath,
SHA1,
SHA256,
FileOriginUrl,
FileOriginReferrerUrl,
FileOriginIP,
InitiatingProcessFileName
| order by Timestamp desc
42. Diffusione del file: quante postazioni lo hanno avuto? (ID:
32421)//How many workstations have accessed that file?
let Hash = "INSERISCI_HASH";
DeviceFileEvents
| where Timestamp > ago(30d)
| where SHA1 =~ Hash or SHA256 =~ Hash or MD5 =~ Hash
| summarize
FirstSeen = min(Timestamp),
LastSeen = max(Timestamp),
DeviceCount = dcount(DeviceId),
Devices = make_set(DeviceName, 100),
Paths = make_set(FolderPath, 100),
Actions = make_set(ActionType, 100)
by SHA1, SHA256, FileName
| order by DeviceCount desc
43. Verifica della firma digitale e del certificato del file (ID:
32422)//Verify the file's digital signature
let Hash = "SHA1_HERE";
DeviceProcessEvents
| where Timestamp > ago(30d)
| where SHA1 =~ Hash
| join kind=leftouter (
DeviceFileCertificateInfo
| summarize arg_max(Timestamp, *) by SHA1
| project SHA1,
IsSigned,
IsTrusted,
Signer,
Issuer,
CertificateCreationTime,
CertificateExpirationTime
) on SHA1
| project Timestamp,
DeviceName,
FileName,
FolderPath,
ProcessCommandLine,
SHA1,
IsSigned,
IsTrusted,
Signer,
Issuer
44. Connessioni di rete generate dal file sospetto (ID:
32423)//Connections made by the suspicious file
let Hash = "INSERISCI_HASH";
DeviceNetworkEvents
| where Timestamp > ago(30d)
| where InitiatingProcessSHA1 =~ Hash
or InitiatingProcessSHA256 =~ Hash
or InitiatingProcessMD5 =~ Hash
| project Timestamp,
DeviceName,
InitiatingProcessFileName,
InitiatingProcessCommandLine,
RemoteUrl,
RemoteIP,
RemotePort,
Protocol,
LocalIP
| order by Timestamp desc
45. Modifiche al Registro di Sistema effettuate dal file (ID:
32424)//Changes to the registry made by the file
let Hash = "INSERISCI_HASH";
DeviceRegistryEvents
| where Timestamp > ago(30d)
| where InitiatingProcessSHA1 =~ Hash
or InitiatingProcessSHA256 =~ Hash
or InitiatingProcessMD5 =~ Hash
| project Timestamp,
DeviceName,
ActionType,
RegistryKey,
RegistryValueName,
RegistryValueData,
InitiatingProcessFileName,
InitiatingProcessCommandLine
| order by Timestamp desc
46. Timeline completa dell'Hash: File → Esecuzione → Rete (ID:
32425)//This reconstructs the following sequence in a single timeline: file presence → execution → network activity
let Hash = "INSERISCI_HASH";
union
(
DeviceFileEvents
| where SHA1 =~ Hash or SHA256 =~ Hash or MD5 =~ Hash
| project Timestamp,
DeviceName,
EventType="FILE",
ActionType,
FileName,
FolderPath,
SHA1,
SHA256,
Info=strcat(
"Parent: ", InitiatingProcessFileName,
" | CMD: ", InitiatingProcessCommandLine,
" | Origin: ", FileOriginUrl
)
),
(
DeviceProcessEvents
| where SHA1 =~ Hash or SHA256 =~ Hash or MD5 =~ Hash
| project Timestamp,
DeviceName,
EventType="PROCESS",
ActionType,
FileName,
FolderPath,
SHA1,
SHA256,
Info=strcat(
"CMD: ", ProcessCommandLine,
" | Parent: ", InitiatingProcessFileName,
" | Parent CMD: ", InitiatingProcessCommandLine
)
),
(
DeviceNetworkEvents
| where InitiatingProcessSHA1 =~ Hash
or InitiatingProcessSHA256 =~ Hash
or InitiatingProcessMD5 =~ Hash
| project Timestamp,
DeviceName,
EventType="NETWORK",
ActionType,
FileName=InitiatingProcessFileName,
FolderPath=InitiatingProcessFolderPath,
SHA1=InitiatingProcessSHA1,
SHA256=InitiatingProcessSHA256,
Info=strcat(
"RemoteUrl: ", RemoteUrl,
" | RemoteIP: ", RemoteIP,
":", tostring(RemotePort)
)
)
| order by Timestamp asc
1.8 Analisi Errori HTTP 5xx su Syslog (Rule031_statuscode5XX)
47. Identificazione degli Application Host impattati (ID:
32426)//Identify the affected application hosts
search "[CLIENT_IP]"
| extend StringaPulita = extract(@"(\{.*\})", 1, SyslogMessage)
| extend json_p = parse_json(StringaPulita)
| summarize Count=count() by apphost=tostring(json_p.apphost)
| order by Count desc
48. Quali URL stanno generando errori HTTP 5xx (ID:
32427)//Identifying Which URLs Are Generating 5xx HTTP Errors
search "[CLIENT_IP]"
| extend StringaPulita = extract(@"(\{.*\})", 1, SyslogMessage)
| extend json_p = parse_json(StringaPulita)
| where toint(json_p.status_code) between (500 .. 599)
| summarize Count=count() by url=tostring(json_p.url_path)
| order by Count desc
49. Estrazione e conversione del payload JSON da Syslog (ID:
32433)//This query simply converts the raw JSON into readable columns.
search "[CLIENT_IP]"
| extend StringaPulita = extract(@"(\{.*\})", 1, SyslogMessage)
| extend json_p = parse_json(StringaPulita)
| extend
datetime_p = tostring(json_p.local_datetime),
clientip_p = tostring(json_p.clientip),
apphost_p = tostring(json_p.apphost),
url_path_p = tostring(json_p.url_path),
status_code_p = toint(json_p.status_code),
username_p = tostring(json_p.username)
| project datetime_p, clientip_p, apphost_p, url_path_p, status_code_p, username_p
50. Quali Client IP generano errori HTTP 5xx sul portale (ID:
32434)//Which IP clients generate 5xx errors on the portal?
search "[APP_HOSTNAME]"
| extend StringaPulita = extract(@"(\{.*\})", 1, SyslogMessage)
| extend json_p = parse_json(StringaPulita)
| where toint(json_p.status_code) between (500 .. 599)
| summarize Count=count() by clientip=tostring(json_p.clientip)
| order by Count desc
51. Timeline completa delle richieste ed errori HTTP 5xx (ID:
32435)//Complete Timeline. It is helpful for understanding how the service performed before, during, and after the malfunction.
Syslog
| where SyslogMessage contains "[CLIENT_IP]"
| extend json_p = parse_json(
extract(@"(\{.*\})", 1, SyslogMessage)
)
| extend
Ora = coalesce(todatetime(json_p["datetime"]), TimeGenerated),
ClientIP = tostring(json_p["clientip"]),
AppHost = tostring(json_p["apphost"]),
Path = tostring(json_p["url_path"]),
Status = toint(json_p["status_code"]),
Username = tostring(json_p["username"])
| where ClientIP == "[CLIENT_IP]"
| where AppHost =~ "[APP_HOSTNAME]"
| where Path in (
"/api/jobs?page=1&pageSize=20",
"/api/notifications?page=1&pageSize=50",
"/api/notifications?unreadCount=true"
)
| where Status between (100 .. 599)
| summarize
Totale = count(),
HTTP200 = countif(Status == 200),
HTTP500 = countif(Status == 500),
HTTP503 = countif(Status == 503),
Errori5xx = countif(Status between (500 .. 599))
by bin(Ora, 1m), Path, Username
| order by Ora asc, Path asc, Username asc
52. Identificazione picchi di errore HTTP 5xx e impatto (ID:
32436)//To quickly identify error spikes, determine which APIs or users are most affected, and quantify the impact of the errors.
Syslog
| where SyslogMessage contains "[CLIENT_IP]"
| extend json_p = parse_json(
extract(@"(\{.*\})", 1, SyslogMessage)
)
| extend
Ora = coalesce(todatetime(json_p["datetime"]), TimeGenerated),
ClientIP = tostring(json_p["clientip"]),
AppHost = tostring(json_p["apphost"]),
Path = tostring(json_p["url_path"]),
Status = toint(json_p["status_code"]),
Username = tostring(json_p["username"])
| where ClientIP == "[CLIENT_IP]"
| where AppHost =~ "[APP_HOSTNAME]"
| where Path in (
"/api/jobs?page=1&pageSize=20",
"/api/notifications?page=1&pageSize=50",
"/api/notifications?unreadCount=true"
)
| where Status between (100 .. 599)
| summarize
Totale = count(),
HTTP200 = countif(Status == 200),
HTTP500 = countif(Status == 500),
HTTP503 = countif(Status == 503),
Errori5xx = countif(Status between (500 .. 599))
by bin(Ora, 1m), Path, Username
| where Errori5xx > 0
| extend Percentuale5xx = round(100.0 * Errori5xx / Totale, 2)
| order by Errori5xx desc, Ora asc
1.9 Modifica Permessi Caselle di Posta (Rule051_Mailbox Permission)
53. Dettaglio completo operazioni su Mailbox in OfficeActivity (ID:
32437)//Full Event Details
OfficeActivity
| where UserId =~ "[GUEST_USER_UPN]"
| where Operation contains "Mailbox"
| project
TimeGenerated,
UserId,
UserType,
Operation,
OfficeObjectId,
ClientIP,
Parameters,
ResultStatus,
ExternalAccess,
OriginatingServer
| order by TimeGenerated asc
54. Dettagli operazione Add-MailboxPermission in CloudAppEvents (ID:
32438)//CloudApps Details
CloudAppEvents
| where Timestamp between (datetime(2026-09-16 06:00:00) .. datetime(2026-09-16 09:00:00))
| where ActionType =~ "Add-MailboxPermission"
| where AccountId =~ "[ACTOR_ACCOUNT_UPN]"
or tostring(RawEventData) contains "[ACTOR_ACCOUNT_NAME]"
| project
Timestamp,
ActionType,
AccountDisplayName,
AccountId,
IPAddress,
ObjectName,
ObjectId,
IsAdminOperation,
RawEventData
| order by Timestamp asc
55. Attività eseguite dall'attore nell'intorno dell'evento (ID:
32439)//What did the actor do around the time of the event?
CloudAppEvents
| where Timestamp between (datetime(2026-09-16 05:00:00) .. datetime(2026-09-16 10:00:00))
| where AccountId =~ "[ACTOR_ACCOUNT_UPN]"
or tostring(RawEventData) contains "[ACTOR_ACCOUNT_UPN]"
| project
Timestamp,
ActionType,
IPAddress,
ObjectName,
IsAdminOperation,
RawEventData
| order by Timestamp asc
56. Storico modifiche effettuate sulla Mailbox target (ID:
32440)//Changes made to targets
CloudAppEvents
| where Timestamp between (datetime(2026-09-15 00:00:00) .. datetime(2026-09-17 00:00:00))
| where ObjectName contains "[TARGET_MAILBOX_ID]"
or ObjectId contains "[TARGET_MAILBOX_ID]"
or tostring(RawEventData) contains "[TARGET_MAILBOX_ID]"
| project
Timestamp,
ActionType,
AccountId,
IPAddress,
ObjectName,
ObjectId,
RawEventData
| order by Timestamp asc
1.10 Esecuzione PowerShell Remota Sospetta (Suspicious remote PowerShell execution)
57. Catena completa di esecuzione PowerShell e sessione remota (ID:
32441)//Complete Chain
DeviceProcessEvents
| where DeviceName startswith "[DEVICE_NAME]"
| where FileName in~ (
"powershell.exe",
"cmd.exe",
"Code.exe",
"explorer.exe",
"svchost.exe",
"chcp.com"
)
| project
Timestamp,
DeviceName,
AccountDomain,
AccountName,
FileName,
ProcessCommandLine,
ProcessId,
InitiatingProcessFileName,
InitiatingProcessCommandLine,
InitiatingProcessId,
InitiatingProcessParentFileName,
IsProcessRemoteSession,
ProcessRemoteSessionIP,
ProcessRemoteSessionDeviceName,
InitiatingProcessRemoteSessionIP,
InitiatingProcessRemoteSessionDeviceName
| order by Timestamp asc
58. Esecuzione di processi in sessione remota o DcomLaunch (ID:
32442)//Remote Process Execution
DeviceProcessEvents
| where DeviceName contains "[DEVICE_NAME]"
| where Timestamp > ago(1d)
| where FileName in~ ("cmd.exe", "powershell.exe", "explorer.exe")
| where
IsProcessRemoteSession == true
or isnotempty(ProcessRemoteSessionIP)
or isnotempty(InitiatingProcessRemoteSessionIP)
or InitiatingProcessCommandLine has "DcomLaunch"
| project
Timestamp,
DeviceName,
AccountDomain,
AccountName,
FileName,
ProcessCommandLine,
InitiatingProcessFileName,
InitiatingProcessCommandLine,
ProcessRemoteSessionIP,
ProcessRemoteSessionDeviceName,
InitiatingProcessRemoteSessionIP,
InitiatingProcessRemoteSessionDeviceName,
LogonId
| order by Timestamp asc
59. Verifica accessi e connessioni RDP sull'host (ID:
32443)//RDP connections
DeviceLogonEvents
| where DeviceName startswith "[DEVICE_NAME]"
| where AccountName =~ "[ACCOUNT_NAME]"
or RemoteIP == "[SOURCE_IP]"
| project
Timestamp,
DeviceName,
AccountDomain,
AccountName,
LogonType,
ActionType,
RemoteIP,
RemoteDeviceName,
Protocol,
FailureReason
| order by Timestamp asc
1.11 Indagini su Connessioni RDP e Porte Aperte (Rule059 - RDP Connections)
60. Eventi di autenticazione sul dispositivo (DeviceLogonEvents) (ID:
32444)//Device Logon Events
DeviceLogonEvents
| where DeviceName contains "[DEVICE_NAME]"
| sort by Timestamp
61. Connessioni e tentativi di accesso RDP su porta 3389 (ID:
32445)//RDP Connection/ Attempts
DeviceNetworkEvents
| where LocalIP contains "[LOCAL_IP]"
| where LocalPort == 3389
62. Mappatura porte in ascolto (Listening Ports) sul dispositivo (ID:
32446)//Determine which ports are open on the device
DeviceNetworkEvents
| where DeviceName contains "[DEVICE_NAME]"
| where ActionType == "ListeningConnectionCreated"
| summarize LastSeen=max(Timestamp)
by LocalPort,
Protocol,
InitiatingProcessFileName
| order by LocalPort asc
1.12 Eseguibile di Sistema Rinominato e Avviato (System executable renamed and launched)
63. Dettagli completi sull'eseguibile di sistema rinominato (ID:
32451)// All file details
DeviceFileEvents
| where DeviceName contains "[DEVICE_NAME_1]" or DeviceName contains "[DEVICE_NAME_2]"
| where FileName contains "[RENAMED_EXE_NAME].exe"
| project
Timestamp,
DeviceName,
ActionType,
FileName,
FolderPath,
FileSize,
SHA1,
SHA256,
InitiatingProcessAccountName,
InitiatingProcessFileName,
InitiatingProcessCommandLine
| order by Timestamp asc
64. Analisi dell'esecuzione e riga di comando del file rinominato (ID:
32452)//How is the file executed?
DeviceProcessEvents
| where DeviceName contains "[DEVICE_NAME_1]" or DeviceName contains "[DEVICE_NAME_2]"
| where FileName =~ "[RENAMED_EXE_NAME].exe"
or ProcessCommandLine has "[RENAMED_EXE_NAME]"
| project
Timestamp,
DeviceName,
AccountDomain,
AccountName,
FileName,
FolderPath,
SHA1,
SHA256,
ProcessCommandLine,
InitiatingProcessFileName,
InitiatingProcessCommandLine,
InitiatingProcessParentFileName
| order by Timestamp asc
65. Confronto Hash tra il file rinominato e l'eseguibile originale (ID:
32453)//Compare the hash with the genuine powershell.exe file on the machine
DeviceProcessEvents
| where DeviceName contains "[DEVICE_NAME_1]"
| where FileName in~ ("powershell.exe", "[RENAMED_EXE_NAME].exe")
| summarize
FirstSeen=min(Timestamp),
LastSeen=max(Timestamp),
Commands=make_set(ProcessCommandLine, 10)
by FileName, SHA1, SHA256, FolderPath
66. Verifica diffusione dell'attività su altri host del tenant (ID:
32454)//Does this activity occur on multiple hosts?
DeviceProcessEvents
| where Timestamp > ago(30d)
| where ProcessCommandLine has @"D:\[TOOL_FOLDER_PATH]"
or InitiatingProcessCommandLine has @"D:\[TOOL_FOLDER_PATH]"
| summarize
Count=count(),
Devices=make_set(DeviceName, 100),
Accounts=make_set(AccountName, 100)
by FileName, InitiatingProcessFileName
| order by Count desc
1.13 Modifiche ai Gruppi di Sicurezza AD (013 - User added or removed from groups)
67. 01 - Chi ha aggiunto o rimosso utenti dai gruppi di sicurezza? (ID:
32458)// To check who added you and to which CERT groups
let CertGroups = dynamic([
"[SECURITY_GROUP_1]",
"[SECURITY_GROUP_2]",
"[SECURITY_GROUP_2]",
"[VDI_GROUP]",
"WDATP_ReadOnly",
"splunk_ess_analyst"
]);
SecurityEvent
| where EventID in (4728,4729)
| where TargetUserName in (CertGroups)
| extend Action =
case(
EventID == 4728, "Add member",
EventID == 4729, "Remove member",
"Other"
)
| project
TimeGenerated,
Action,
GroupName = TargetUserName,
MemberName,
PerformedBy = SubjectUserName,
Computer
| order by TimeGenerated desc
68. 02 - Tutti i gruppi AD modificati per uno specifico utente (ID:
32459)//To view all the groups to which the user has been added
SecurityEvent
| where EventID in (4728,4729)
| where MemberName contains "[USER_ACCOUNT_ID]"
1.14 Processi e Connessioni Azure Guest Agent (RDP Connections Azure Guest Agent)
69. Esecuzione processi di Azure Guest Agent sulle VM (ID:
32461)// Esecuzione processi Azure Guest Agent e telemetria
DeviceProcessEvents
| where DeviceName has_any("[VM_NAME_1]", "[VM_NAME_2]")
| where FileName in~ ("WindowsAzureGuestAgent.exe", "WaAppAgent.exe", "CollectGuestLogs.exe", "WaSecAgentProv.exe")
| project Timestamp, DeviceName, ActionType, FileName, FolderPath, AccountName, ProcessCommandLine, SHA256, InitiatingProcessFileName
| sort by Timestamp desc
70. Connessioni di rete verso l'IP virtuale di Azure (168.63.129.16) (ID:
32462)// Connessioni verso l'IP Virtuale di Azure (168.63.129.16)
DeviceNetworkEvents
| where RemoteIP == "168.63.129.16"
| where DeviceName has_any("[VM_NAME_1]", "[VM_NAME_2]")
| project Timestamp, DeviceName, ActionType, RemoteIP, RemotePort, InitiatingProcessFileName, InitiatingProcessAccountName, InitiatingProcessCommandLine
| sort by Timestamp desc
1.15 Query Schedulate e Root Condivisa (71 – 80)
71. Rilevamento massivo di file messi in quarantena su più host per Hash (ID:
32224)DeviceEvents
| where ActionType == "AntivirusDetection" and isnotempty(SHA1) and TimeGenerated > ago(3h)
| extend ThreatName = tostring(parse_json(AdditionalFields)["ThreatName"])
| extend Action = tostring(parse_json(AdditionalFields)["Action"])
| extend Action = case(
Action == 2, "Quarantined",
Action == 3, "Removed",
Action == 0, "Detected",
Action)
| where Action == "Quarantined"
| extend DeviceId = "QuarantineCheck"
| summarize (Timestamp, ReportId) = arg_max(Timestamp, ReportId), AssetList = make_set(DeviceName), UniqueAssets = dcount(DeviceName) by DeviceId, FileName, ThreatName, SHA1
| where UniqueAssets >= 100
72. Rilevamento pattern JNDI di sfruttamento vulnerabilità Log4j (Regex) (ID:
32084)DeviceProcessEvents
| where ProcessCommandLine matches regex @'(?i)\$\{jndi:(ldap|http|https|ldaps|dns|rmi|iiop):\/\/(\$\{([a-z]){1,20}:([a-z]){1,20}\})?(([a-zA-Z0-9]|-){2,100})?(\.([a-zA-Z0-9]|-){2,100})?\.([a-zA-Z0-9]|-){2,100}\.([a-z0-9]){2,20}(\/).*}' or InitiatingProcessCommandLine matches regex @'(?i)\$\{jndi:(ldap|http|https|ldaps|dns|rmi|iiop):\/\/(\$\{([a-z]){1,20}:([a-z]){1,20}\})?(([a-zA-Z0-9]|-){2,100})?(\.([a-zA-Z0-9]|-){2,100})?\.([a-zA-Z0-9]|-){2,100}\.([a-z0-9]){2,20}(\/).*}'
73. Monitoraggio connessioni verso IP sospetto segnalato (ID:
29)DeviceNetworkEvents
| where RemoteIP == "[SUSPICIOUS_IP]"
74. Rilevamento spoolsv.exe che avvia rundll32.exe senza argomenti (PrintNightmare) (ID:
32070)DeviceProcessEvents
| where InitiatingProcessParentFileName has "spoolsv.exe"
| where InitiatingProcessFileName =~ "rundll32.exe"
| where isempty(InitiatingProcessCommandLine) or InitiatingProcessCommandLine endswith "rundll32.exe" //either commandline is empty or just "rundll32.exe"
| where FileName !in~ ("WerFault.exe")
75. Monitoraggio esecuzione PowerShell da processo non firmato (ID:
32074)DeviceProcessEvents
| where FileName in~ ("powershell.exe", "powershell_ise.exe")
and ProcessCommandLine has_any ("-v","-version")
and InitiatingProcessSignatureStatus has_any ("Unknown", "Invalid")
and InitiatingProcessIntegrityLevel == "Medium"
76. Rilevamento esecuzione PowerShell offuscata o MSI remoto (Powershell_Isolation) (ID:
32226)DeviceProcessEvents
| where (FileName == "powershell.exe"
and ((ProcessCommandLine contains "hidden" and ProcessCommandLine has_any("Invoke-Webrequest","New-Object System.Net.webClient") or
(ProcessCommandLine contains "Microsoft.VisualBasic" and ProcessCommandLine contains "DownloadString" and ProcessCommandLine contains "iex") or
(ProcessCommandLine startswith "\"Powershell.exe\" -eC") or
(ProcessCommandLine startswith "\"Powershell.exe\" -w Hidden -eC") or
(ProcessCommandLine contains "hidden" and ProcessCommandLine contains "FromBase64String" and ProcessCommandLine contains "iex")))
or (FileName has "msiexec" and ProcessCommandLine has "http" and ProcessCommandLine has_all("/fv","/q")))
77. Rilevamento esecuzione software di accesso remoto (RAT / RMM) (ID:
32358)DeviceProcessEvents
| where FileName has_any ("teamviewer", "anydesk", "rustdesk", "manageengine", "fastclient",
"logmein", "bomgar", "netviewer", "ultraviewer", "dwrcs", "splashtop",
"zerotier", "supremo")
| project
DeviceId,
Timestamp,
DeviceName,
AccountUpn,
FileName,
FolderPath,
ProcessCommandLine,
InitiatingProcessFileName,
InitiatingProcessCommandLine
| sort by Timestamp desc
78. Sospetto tentativo di sfruttamento vulnerabilità Log4j (ID:
32083)DeviceProcessEvents
| where ProcessCommandLine has_all('${jndi') and ProcessCommandLine has_any('ldap', 'ldaps', 'http', 'rmi', 'dns', 'iiop') //Removing FPs
| where not(ProcessCommandLine has_any('stackstorm', 'homebrew'))
79. Creazione e caricamento di DLL sospette nella cartella Spooler (ID:
32069)DeviceFileEvents
| where FolderPath contains @"\system32\spool\drivers\x64\3\"
| where FileName endswith ".dll"
| where ActionType in ("FileCreated", "FileRenamed")
| join kind=inner DeviceImageLoadEvents on DeviceId,DeviceName,FileName,InitiatingProcessFileName
| where Timestamp1 >= Timestamp and FolderPath1 contains @"\system32\spool\drivers\x64\3\Old"
80. Processi figli sospetti generati da spoolsv.exe — CVE-2021-1675 (ID:
32068)// Look for file load events for spoolsv
DeviceImageLoadEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName =~ "spoolsv.exe"
| where FolderPath has @"spool\drivers"
| extend LoadFileTime = Timestamp
| distinct DeviceId, LoadFileTime, FileName, SHA256
// Join process data associated with spoolsv launching suspicious processes after image load
| join DeviceProcessEvents on $left.DeviceId == $right.DeviceId
| where Timestamp > ago(7d)
| where Timestamp < LoadFileTime +5m
| where InitiatingProcessFileName =~ "spoolsv.exe"
| where ProcessIntegrityLevel =~ 'SYSTEM'
| where (FileName1 in~("gpupdate.exe", "whoami.exe", "nltest.exe", "taskkill.exe",
"wmic.exe", "taskmgr.exe", "sc.exe", "findstr.exe", "curl.exe", "wget.exe", "certutil.exe", "bitsadmin.exe", "accesschk.exe",
"wevtutil.exe", "bcdedit.exe", "fsutil.exe", "cipher.exe", "schtasks.exe", "write.exe", "wuauclt.exe") or
// Processes with specific FPs removed
(FileName1 =~ "net.exe" and ProcessCommandLine !has "start") or
(FileName1 =~ "cmd.exe" and not(ProcessCommandLine has_any(".spl", "route add", "program files"))) or
(FileName1 =~ "netsh.exe" and not(ProcessCommandLine has_any("add portopening", "rule name")))) or
(FileName1 =~ "powershell.exe" and ProcessCommandLine!has ".spl") or
(FileName1 =~ "rundll32.exe" and ProcessCommandLine != "" and ProcessCommandLine !contains " ")