gpt-5-mini-high
KQL Benchmark Performance Analysis
Performance Overview
Success Rate
48.4%
(91 / 188 successful)
Average Attempts
3.25
per question
Avg. Execution Time
25.04s
Total Cost
$2.8166
Detailed Test Results
Showing 1 to 50 of 188 results
Page 1 of 4
# | Prompt (Question) | MITRE ATT&CK | Correct Answer | LLM Answer | Correct | KQL Query from LLM |
---|---|---|---|---|---|---|
1 | Review Linux process execution records for any commands that list TCP metric cache entries and filter out loopback interfaces. Which utility was used? | ip | ip | ✓ | let Keywords = dynamic(["tcp","metric","metrics","cache","mcache","route","-i","-s","-I","--metrics","ss -i","ss -I","ip route","ip -s","netstat -s","netstat -i"]);
let CommandFilters = (cmd:string){
cmd =~ cmd
};
union isfuzzy=true
DeviceProcessEvents
,DeviceEvents
| where isnotempty(ProcessCommandLine) or isnotempty(InitiatingProcessCommandLine) or isnotempty(ProcessCommandLine)
| extend Cmd = coalesce(ProcessCommandLine, InitiatingProcessCommandLine, ProcessCommandLine)
| where Cmd has_any ("ip","ss","netstat")
// filter for keywords indicating TCP metric/cache/metrics
| where Cmd has_any ("tcp", "metric", "metrics", "cache", "mcache", "route", "-i", "-s", "--metrics", "-I", "-i=")
// exclude invocations that explicitly target loopback interfaces or 127.0.0.1
| where not(Cmd has " lo" or Cmd has " lo:" or Cmd has "\"lo\"" or Cmd has "127.0.0.1" or Cmd has "::1")
| extend Utility = extract(@"(^|\s)([^/\s]+)(?:$|\s)", 2, Cmd)
| extend Utility = iif(isempty(Utility), file_name_simplified=tolower(tostring(split(Cmd, ' ')[0])), tolower(Utility))
| project TimeGenerated, DeviceName, DeviceId, AccountName, AccountDomain, ProcessId, Cmd, Utility, InitiatingProcessFileName, FileName, ActionType
| summarize count(), SampleCmds = make_set(Cmd, 10) by Utility, DeviceName, DeviceId
| order by count_ desc
| limit 50
| |
2 | On a Windows host, an attacker leveraged COMSVCS.DLL via rundll32.exe to dump the memory of svchost.exe into a file under the Temp directory. Review the file creation logs to determine the exact name of the dump file that was generated. | svchost-exe.dmp | svchost-exe.dmp | ✓ | // Find files created by rundll32.exe using COMSVCS.DLL that likely dumped svchost.exe memory into Temp
union isfuzzy=true
(DeviceFileEvents
| where TimeGenerated between (startofday(ago(7d)) .. now())
| where InitiatingProcessFileName has_cs "rundll32.exe" or InitiatingProcessFileName has_cs "rundll32"
| where InitiatingProcessCommandLine has_cs "COMSVCS.DLL" or InitiatingProcessCommandLine has_cs "comsvcs.dll"
| where FolderPath has_cs "\\Temp" or FileName has_cs "tmp" or FileName has_cs ".dmp" or FileName has_cs ".tmp"
| project TimeGenerated, DeviceName, FileName, FolderPath, FileSize, ActionType, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId, InitiatingProcessCreationTime, InitiatingProcessParentFileName, InitiatingProcessParentId, InitiatingProcessAccountName, AdditionalFields
)
| union (DeviceEvents
| where TimeGenerated between (startofday(ago(7d)) .. now())
| where ActionType has_cs "FileCreated" or ActionType has_cs "Created" or Type has_cs "File" or FileName != ""
| where InitiatingProcessFileName has_cs "rundll32.exe" or InitiatingProcessCommandLine has_cs "COMSVCS.DLL" or ProcessCommandLine has_cs "COMSVCS.DLL"
| where FolderPath has_cs "\\Temp" or FileName has_cs "tmp" or FileName has_cs ".dmp" or FileName has_cs ".tmp"
| project TimeGenerated, DeviceName, FileName, FolderPath, FileSize, ActionType, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId, InitiatingProcessCreationTime, InitiatingProcessParentFileName, InitiatingProcessParentId, InitiatingProcessAccountName, AdditionalFields
)
| where isnotempty(FileName) and (FileName endswith ".dmp" or FileName endswith ".tmp" or FolderPath has_cs "\\Temp")
| extend FullPath = strcat(FolderPath, "\\", FileName)
| summarize FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated), Occurrences=count(), any_InitiatingProcessCommandLine=any(InitiatingProcessCommandLine), any_InitiatingProcessFileName=any(InitiatingProcessFileName) by DeviceName, FullPath, FileName, FolderPath, FileSize
| where any_InitiatingProcessCommandLine has_cs "COMSVCS.DLL" or any_InitiatingProcessCommandLine has_cs "comsvcs.dll"
| order by FirstSeen desc
| take 50 | |
3 | On a Windows host, someone appears to have run a built-in network shell utility to list saved wireless network profiles and their passwords in clear text. Review the process creation logs to discover the exact command that was executed. | netsh wlan show profile * key=clear | netsh wlan show profile * key=clear | ✓ | // Detect netsh wlan show profile ... key=clear usage in process creation logs
let pattern = @"netsh\s+wlan\s+show\s+profile|key=clear";
// Search DeviceProcessEvents (recommended) and DeviceEvents for redundancy
DeviceProcessEvents
| where TimeGenerated between (startofday(ago(7d))..now())
| where isnotempty(ProcessCommandLine) or isnotempty(FileName)
| where tolower(FileName) contains "netsh" or tolower(ProcessCommandLine) matches regex pattern
| extend matched = iff(tolower(FileName) contains "netsh" or tolower(ProcessCommandLine) matches regex pattern, 1, 0)
| where matched == 1
| project TimeGenerated, Timestamp, DeviceName, DeviceId, AccountDomain, AccountName, ProcessId, ProcessCreationTime, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId
| union (
DeviceEvents
| where TimeGenerated between (startofday(ago(7d))..now())
| where isnotempty(ProcessCommandLine) or isnotempty(FileName)
| where tolower(FileName) contains "netsh" or tolower(ProcessCommandLine) matches regex pattern
| project TimeGenerated, Timestamp, DeviceName, DeviceId, AccountDomain, AccountName, ProcessId, ProcessCreationTime=ProcessCreationTime, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId
)
| sort by TimeGenerated desc
| distinct DeviceName, ProcessId, ProcessCreationTime, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, AccountName, AccountDomain, TimeGenerated
| take 100
| |
4 | An analyst suspects a user or script ran a service enumeration command on a Linux system. Review process events to find the service-listing invocation and specify the full command that was executed. | systemctl --type=service | systemctl --type=service | ✓ | // Search for common Linux service enumeration commands across process events and device events
let service_patterns = dynamic([
"systemctl list-units",
"systemctl --type=service",
"systemctl status",
"service --status-all",
"ls /etc/init.d",
"chkconfig --list",
"svcs -a",
"rcsvcs -a",
"systemctl list-units --type=service",
"service --status-all 2>&1",
"systemctl --all",
"systemctl --type=service --all",
"systemctl list-unit-files",
"systemctl --failed"
]);
// DeviceProcessEvents (recommended for process command lines)
let dpe = DeviceProcessEvents
| where TimeGenerated >= ago(30d)
| where isnotempty(ProcessCommandLine)
| where FileName has_any ("systemctl","service","chkconfig","svcs","rcsvcs","ls","systemctl")
| where array_length(service_patterns) == array_length(service_patterns) or true
| where (
ProcessCommandLine has "systemctl" or
ProcessCommandLine has "service --status-all" or
ProcessCommandLine has "/etc/init.d" or
ProcessCommandLine has "chkconfig" or
ProcessCommandLine has "svcs -a" or
ProcessCommandLine has "rcsvcs -a"
)
| extend Command = ProcessCommandLine, Account = tostring(AccountName)
| project TimeGenerated, DeviceName, FileName, ProcessId, Command, Account, InitiatingProcessFileName, InitiatingProcessCommandLine, ProcessCreationTime, ReportId, TenantId
;
// DeviceEvents may also contain process command lines
let de = DeviceEvents
| where TimeGenerated >= ago(30d)
| where isnotempty(ProcessCommandLine)
| where ProcessCommandLine has_any ("systemctl","service","chkconfig","svcs","rcsvcs","/etc/init.d","ls /etc/init.d")
| extend Command = ProcessCommandLine, Account = tostring(AccountName)
| project TimeGenerated, DeviceName, FileName, ProcessId, Command, Account, InitiatingProcessFileName, InitiatingProcessCommandLine, ProcessCreationTime, ReportId, TenantId
;
// Union results and deduplicate by Command + Device + ProcessId
union dpe, de
| sort by TimeGenerated desc
| extend match = case(
Command has "systemctl", "systemctl",
Command has "service --status-all", "service",
Command has "/etc/init.d", "init.d",
Command has "chkconfig", "chkconfig",
Command has "svcs", "svcs",
Command has "rcsvcs", "rcsvcs",
Command has "launchctl", "launchctl",
"other")
| summarize FirstSeenUtc = min(TimeGenerated), LastSeenUtc = max(TimeGenerated), count() by Command, DeviceName, FileName, ProcessId, Account, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by LastSeenUtc desc
| project LastSeenUtc, FirstSeenUtc, DeviceName, FileName, ProcessId, Account, Command, InitiatingProcessFileName, InitiatingProcessCommandLine, count_
| take 200
| |
5 | A Linux host’s Syslog shows a shell-based network discovery script ran multiple commands. One of them listed current TCP connections. Which utility was invoked? | netstat | netstat | ✓ | union isfuzzy=true DeviceProcessEvents, DeviceEvents
| extend cmd = coalesce(ProcessCommandLine, InitiatingProcessCommandLine)
| where isnotempty(cmd)
| extend cmd_l = tolower(cmd)
// Look for commands commonly used to list TCP connections
| where cmd_l matches regex @"\bnetstat\b" or cmd_l matches regex @"\bss\b" or cmd_l matches regex @"\blsof\b" or cmd_l contains "/proc/net/tcp"
| extend utility = case(
cmd_l matches regex @"\bnetstat\b", "netstat",
cmd_l matches regex @"\bss\b", "ss",
cmd_l matches regex @"\blsof\b", "lsof",
cmd_l contains "/proc/net/tcp", "/proc/net/tcp",
"other")
| project TimeGenerated, DeviceName, DeviceId, AccountName, FileName, ProcessId, utility, cmd
| order by TimeGenerated desc | |
6 | On a Windows endpoint, review process creation logs to uncover when a built-in utility was used to reveal ARP entries. What exact command was used to list the ARP cache? | arp -a | arp -a | ✓ | union DeviceProcessEvents, DeviceEvents
| extend cmd = tolower(coalesce(ProcessCommandLine, InitiatingProcessCommandLine, ""))
// Filter for common ways to list ARP neighbors/cache: arp.exe (arp -a), Get-NetNeighbor / Get-NetIPNeighbor, and netsh neighbor show
| where cmd contains "arp" or cmd contains "get-netneighbor" or cmd contains "get-netipneighbor" or (cmd contains "netsh" and (cmd contains "neighbor" or cmd contains "show neighbors"))
| extend matched = case(
cmd contains "get-netneighbor" or cmd contains "get-netipneighbor", "Get-NetNeighbor",
cmd contains "arp", "arp.exe",
cmd contains "netsh" and (cmd contains "neighbor" or cmd contains "show neighbors"), "netsh neighbors",
"other")
| project TimeGenerated, ProcessCreationTime, DeviceName, AccountName, FileName, ProcessId, InitiatingProcessId, InitiatingProcessFileName, ProcessCommandLine, InitiatingProcessCommandLine, matched
| order by ProcessCreationTime desc | |
7 | On Windows hosts, look through recent PowerShell execution records to find any elevated session where remote management was turned on. What exact command was run to enable PSRemoting? | Enable-PSRemoting -Force | Enable-PSRemoting -Force | ✓ | union isfuzzy=true DeviceProcessEvents, DeviceEvents
| where (tolower(FileName) contains "powershell" or tolower(FileName) contains "pwsh" or tolower(ProcessCommandLine) contains "powershell" or tolower(ProcessCommandLine) contains "pwsh")
// Look for common PSRemoting enabling commands
| where (
tolower(ProcessCommandLine) contains "enable-psremoting"
or tolower(ProcessCommandLine) contains "winrm quickconfig"
or tolower(ProcessCommandLine) contains "set-item wsman"
or tolower(ProcessCommandLine) contains "enable-wsmancredssp"
or tolower(ProcessCommandLine) contains "enable-pssessionconfiguration"
)
// Restrict to elevated sessions (token elevation or high integrity)
| where (
tolower(ProcessTokenElevation) contains "elev"
or tolower(InitiatingProcessTokenElevation) contains "elev"
or tolower(ProcessIntegrityLevel) contains "high"
or tolower(InitiatingProcessIntegrityLevel) contains "high"
)
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessAccountName, FileName, ProcessId, InitiatingProcessId, ProcessCommandLine, InitiatingProcessCommandLine, ProcessTokenElevation, InitiatingProcessTokenElevation, ReportId, _ResourceId
| sort by TimeGenerated desc
| take 100 | |
8 | Identify the PowerShell cmdlet used on Windows to format and display the raw volume bytes after an attacker read the boot sector via a DOS device path. | Format-Hex | Format-Hex | ✓ | union isfuzzy=true DeviceProcessEvents, DeviceEvents, DeviceFileEvents
| extend PCmd = tostring(ProcessCommandLine), IPcmd = tostring(InitiatingProcessCommandLine)
| extend PCmdL = tolower(PCmd), IPcmdL = tolower(IPcmd)
// look for Format-Hex (PowerShell) and evidence of DOS device/raw volume access (\\.\ or physicaldrive)
| where (PCmdL contains "format-hex" or PCmdL contains "formathex" or IPcmdL contains "format-hex" or IPcmdL contains "formathex")
and (PCmdL contains "\\\\.\\" or IPcmdL contains "\\\\.\\" or PCmdL contains "physicaldrive" or IPcmdL contains "physicaldrive")
| project TimeGenerated, DeviceName, DeviceId, AccountName, AccountDomain = AccountDomain, FileName, ProcessId, InitiatingProcessId, ProcessCommandLine = PCmd, InitiatingProcessCommandLine = IPcmd, ReportId, SourceSystem
| sort by TimeGenerated desc
| take 100 | |
9 | An analyst notices a PowerShell process on a Windows host that appears to be checking SMB connectivity. Which PowerShell cmdlet was executed to perform this outbound port 445 test? | Test-NetConnection | Test-NetConnection | ✓ | DeviceNetworkEvents
| where RemotePort == 445
| where tolower(tostring(InitiatingProcessFileName)) contains "powershell"
| project TimeGenerated, DeviceName, RemoteIP, RemotePort, InitiatingProcessId, InitiatingProcessFileName, InitiatingProcessCommandLine
| extend CmdLine = tostring(InitiatingProcessCommandLine)
// capture known SMB/test cmdlets first, otherwise fall back to the first verb-noun token
| extend KnownCmdlet = extract(@"(?i)\b(Test-NetConnection|Test-Connection|New-SmbMapping|Get-SmbConnection|Get-SmbShare|New-PSDrive|Test-Path|Invoke-Command|net use)\b", 1, CmdLine)
| extend FirstVerbNoun = extract(@"(?i)\b([a-z]+-[a-z0-9]+)\b", 1, CmdLine)
| extend Cmdlet = iif(isnotempty(KnownCmdlet), KnownCmdlet, FirstVerbNoun)
| where isnotempty(Cmdlet)
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), SampleDevice = any(DeviceName), SampleInitiatingProcessId = any(InitiatingProcessId), SampleCommandLine = any(CmdLine), RemoteIPs = make_set(RemoteIP, 20) by Cmdlet
| order by Count desc | |
10 | On a Linux system, spotting a file‐size change by exactly one byte can indicate hash tampering via padding. Review process execution logs for invocations that increased a file’s size by one byte. Which utility was invoked to perform this padding? | truncate | dd | ✗ | // Identify Linux devices (adjust OSPlatform/OSDistribution checks as needed)
let linuxDevices = DeviceInfo
| where isnotempty(OSPlatform) and tolower(OSPlatform) has "linux"
| distinct DeviceId;
// Find file events for those devices and compute previous observed size (prev event or AdditionalFields.PreviousFileSize)
let hits = DeviceFileEvents
| where DeviceId in (linuxDevices)
| order by DeviceId, FolderPath, FileName, TimeGenerated asc
| serialize
| extend previous_file_size_field = tolong(AdditionalFields["PreviousFileSize"])
| extend prev_event_file_size = prev(FileSize)
| extend prevSize = coalesce(prev_event_file_size, previous_file_size_field)
| where isnotempty(prevSize) and FileSize - prevSize == 1
| project TimeGenerated, DeviceName, DeviceId, FolderPath, FileName, prevSize, FileSize, delta = FileSize - prevSize, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId, InitiatingProcessAccountName, ActionType, AdditionalFields;
// Summary: which initiating utilities/command-lines caused the 1-byte padding
hits
| summarize occurrences = count(), firstSeen = min(TimeGenerated), lastSeen = max(TimeGenerated) by InitiatingProcessFileName, InitiatingProcessCommandLine
| order by occurrences desc
| limit 50 | |
11 | On Windows devices, identify the full command used when the built-in credential manager utility was invoked to list stored credentials. What was the exact command? | cmdkey /list | cmdkey.exe /list | ✓ | union withsource=SourceTable
DeviceProcessEvents,
DeviceEvents,
DeviceFileEvents,
DeviceImageLoadEvents,
DeviceRegistryEvents,
DeviceNetworkEvents,
DeviceLogonEvents
| extend CommandLine = tostring(coalesce(ProcessCommandLine, InitiatingProcessCommandLine, InitiatingProcessCommandLine, ProcessCommandLine))
| where isnotempty(CommandLine)
// Normalize whitespace for matching
| where CommandLine matches regex @"(?i)\bcmdkey(?:\.exe)?\b.*\b(?:/|-)list\b|\bcmdkey(?:\.exe)?\b.*\blist\b"
| project TimeGenerated, SourceTable, DeviceName, AccountName, InitiatingProcessAccountName, FileName = coalesce(FileName, InitiatingProcessFileName), ProcessId, InitiatingProcessId, CommandLine
| summarize Count = count(), LatestTime = max(TimeGenerated), Devices = make_set(DeviceName, 100), Users = make_set(AccountName, 100), SourceTables = make_set(SourceTable) by CommandLine
| order by LatestTime desc
| project ExactCommand = CommandLine, Count, LatestTime, Devices, Users, SourceTables | |
12 | On a Linux system, review process creation logs to spot any dd commands reading from /proc/*/mem. What was the name of the file where the dumped memory was written? | T1003.007.bin | N/A | ✗ | ||
13 | On a Linux host, a ping command was executed to test internet connectivity. Determine which IP address was used as the ping target. | 8.8.8.8 | N/A | ✗ | ||
14 | A Windows host shows a process launch with an extremely obfuscated command line that dynamically builds and invokes code at runtime. Which process name was used to execute this payload? | powershell | N/A | ✗ | ||
15 | A Windows host executed an ICMP-based network reconnaissance using a looping instruction in cmd.exe. Identify the exact command line that was used to perform the ping sweep. | for /l %i in (1,1,254) do ping -n 1 -w 100 192.168.1.%i | "cmd.exe" /c for /l %i in (1,1,254) do ping -n 1 -w 100 192.168.1.%i | ✓ | let cmdSources = (
DeviceProcessEvents
| extend CmdLine = coalesce(ProcessCommandLine, InitiatingProcessCommandLine)
| project Timestamp, DeviceName, FileName, ProcessId, CmdLine, InitiatingProcessFileName
)
| union (
DeviceEvents
| extend CmdLine = coalesce(ProcessCommandLine, InitiatingProcessCommandLine)
| project Timestamp, DeviceName, FileName, ProcessId, CmdLine, InitiatingProcessFileName
);
cmdSources
| where isnotempty(CmdLine)
| where (FileName has_cs "cmd.exe") or (InitiatingProcessFileName has_cs "cmd.exe") or tolower(CmdLine) contains "cmd.exe"
| where tolower(CmdLine) contains "ping"
| where (tolower(CmdLine) contains "for /l" or tolower(CmdLine) contains "for /f" or tolower(CmdLine) contains "for %")
| summarize FirstSeen=min(Timestamp), LastSeen=max(Timestamp), Examples=make_set(CmdLine, 20) by DeviceName, FileName, ProcessId
| mv-expand Examples
| project DeviceName, FileName, ProcessId, PingSweepCommandLine=Examples, FirstSeen, LastSeen
| order by FirstSeen desc | |
16 | In a Linux environment, an elevated process was used to execute a command that read /etc/shadow and redirected its output to a file. Identify what file name was employed to store these results. | T1003.008.txt | N/A | ✗ | ||
17 | Using Windows process event logs, investigate PowerShell activity around lsass.exe memory capture. What was the name of the script file invoked to perform the dump? | Out-Minidump.ps1 | N/A | ✗ | ||
18 | On a Windows endpoint, look for evidence of a base64-encoded PowerShell payload execution. Which executable launched the encoded command? | powershell.exe | N/A | ✗ | ||
19 | In a Windows log analytics workspace, search for PowerShell processes that were used to enumerate network connections. Determine which PowerShell cmdlet was executed to list active TCP connections. | Get-NetTCPConnection | Get-NetTCPConnection | ✓ | // PowerShell processes used to enumerate network connections
DeviceProcessEvents
| where TimeGenerated between (startofday(ago(7d)) .. now())
| where FileName =~ 'powershell.exe' or FileName =~ 'pwsh.exe' or ProcessCommandLine has 'powershell' or ProcessCommandLine has 'pwsh'
// Look for common cmdlets and commands used to list TCP connections
| where ProcessCommandLine has_any ("Get-NetTCPConnection", "Get-NetUDPEndpoint", "Get-NetTCPStatistics", "Get-NetAdapter", "netstat", "ss -t", "Get-NetConnectionProfile", "Get-NetIPConnection")
| extend MatchedCommand = case(
ProcessCommandLine has "Get-NetTCPConnection", "Get-NetTCPConnection",
ProcessCommandLine has "netstat", "netstat",
ProcessCommandLine has "ss -t", "ss -t",
ProcessCommandLine has "Get-NetUDPEndpoint", "Get-NetUDPEndpoint",
ProcessCommandLine has "Get-NetTCPStatistics", "Get-NetTCPStatistics",
ProcessCommandLine has "Get-NetConnectionProfile", "Get-NetConnectionProfile",
ProcessCommandLine has "Get-NetIPConnection", "Get-NetIPConnection",
"other")
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by DeviceName, AccountName, ProcessId, InitiatingProcessId, MatchedCommand, ProcessCommandLine
| order by LastSeen desc, Count desc
| project FirstSeen, LastSeen, Count, DeviceName, AccountName, ProcessId, InitiatingProcessId, MatchedCommand, ProcessCommandLine
| |
20 | Linux hosts may log events when new files are added to /var/spool/cron/crontabs. Query those logs for a creation or write action in that directory and determine the file name that was added. | persistevil | persistevil | ✓ | union isfuzzy=true DeviceFileEvents, DeviceEvents
| where (
tolower(coalesce(FolderPath, "")) startswith "/var/spool/cron/crontabs"
or tolower(coalesce(FileName, "")) contains "/var/spool/cron/crontabs"
or tostring(AdditionalFields) contains "/var/spool/cron/crontabs"
)
| where (
tolower(coalesce(ActionType, "")) contains "creat"
or tolower(coalesce(ActionType, "")) contains "write"
or tolower(coalesce(ActionType, "")) contains "modif"
)
| extend FolderPathLower = tolower(coalesce(FolderPath, "")), FileNameStr = tostring(FileName)
// Build a full path: if FileName is already an absolute path use it, otherwise prefix FolderPath
| extend FullPath = iff(FileNameStr startswith "/", FileNameStr, strcat(FolderPathLower, "/", FileNameStr))
| extend AddedFile = extract(@'([^/]+)$', 1, FullPath)
| project TimeGenerated, DeviceName, AccountName, ActionType, FullPath, AddedFile, InitiatingProcessFileName, InitiatingProcessCommandLine, AdditionalFields
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Devices = dcount(DeviceName), DeviceList = make_set(DeviceName, 20) by AddedFile, FullPath
| order by LastSeen desc
| take 200 | |
21 | A Windows host shows a core command-line utility being duplicated from its System32 location to a user-profile folder and subsequently run. Identify the name of the executable that was copied. | cmd.exe | N/A | ✗ | ||
22 | A threat actor on a Windows system crafted and registered a service named almost identically to the standard time service, but redirecting execution to a custom script. Review the logging data to determine which native command-line tool was used to perform this action. What utility was invoked? | sc | N/A | ✗ | ||
23 | In a Linux environment, you observe a process labeled like the cron daemon but running from an unexpected path. Investigate creation events to uncover the actual filename used by this fake cron process. | crond | N/A | ✗ | ||
24 | A process is running under a familiar Windows host name but originates from a user's AppData folder rather than the System32 directory. Identify the filename used to masquerade the PowerShell binary on this Windows device. | taskhostw.exe | N/A | ✗ | ||
25 | On a Linux system, identify the script that was generated by decoding a base64 data file and then executed. What was the filename of that script? | art.sh | N/A | ✗ | ||
26 | Analyze Windows process events for any schtasks.exe commands that created a new task invoking PowerShell. What is the name of the .ps1 script specified to run? | T1036.004_NonExistingScript.ps1 | t1036.004_nonexistingscript.ps1 | ✓ | let events = union isfuzzy=true DeviceProcessEvents, DeviceEvents;
events
| extend cmd_raw = coalesce(ProcessCommandLine, InitiatingProcessCommandLine)
| where isnotempty(cmd_raw)
| extend cmd = tolower(tostring(cmd_raw)), file = tolower(tostring(FileName)), ipfile = tolower(tostring(InitiatingProcessFileName))
// look for schtasks as the creator (file name or in the commandline) and signs of a PowerShell task being created
| where file contains "schtasks" or ipfile contains "schtasks" or cmd contains "schtasks"
| where cmd contains "powershell" or cmd contains ".ps1" or cmd contains "/tr" or cmd contains "/create"
// extract the first non-space token that ends with .ps1 (may include surrounding quotes)
| extend ps1_raw = extract(@"(?i)(\S+\.ps1)", 1, cmd)
| where isnotempty(ps1_raw)
// remove surrounding single or double quotes if present
| extend ps1 = trim("'\"", tostring(ps1_raw))
// summarize distinct scripts and provide examples for triage
| summarize Devices = make_set(DeviceName), Count = count(), SampleCommand = any(cmd_raw), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by ps1
| order by Count desc | |
27 | You suspect malicious persistence via scheduled tasks on a Windows endpoint. Review the process execution logs to identify the built-in utility used to register tasks at logon or startup. What is the name of this utility? | schtasks | schtasks.exe | ✓ | // Search for executions that indicate scheduled-task creation/registration
DeviceProcessEvents
| where isnotempty(ProcessCommandLine) or isnotempty(FileName)
// Look for known scheduling utilities / patterns and PowerShell cmdlets/flags used to create tasks
| where ProcessCommandLine has_any ("schtasks","/create","/Create","Register-ScheduledTask","New-ScheduledTask","-AtLogon","-AtStartup","schtasks.exe","at ")
or FileName has_any ("schtasks","at","powershell","pwsh")
| extend exe = tolower(tostring(FileName)), cmd = tostring(ProcessCommandLine)
| summarize Count = count(), SampleCommands = make_list(cmd, 10), SampleDevices = make_list(DeviceName, 10) by exe
| order by Count desc
// (Optional) If you want raw events for deeper triage, uncomment the block below:
// DeviceProcessEvents
// | where isnotempty(ProcessCommandLine) or isnotempty(FileName)
// | where ProcessCommandLine has_any ("schtasks","/create","/Create","Register-ScheduledTask","New-ScheduledTask","-AtLogon","-AtStartup","schtasks.exe","at ")
// or FileName has_any ("schtasks","at","powershell","pwsh")
// | project TimeGenerated, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine
// | order by TimeGenerated desc
| |
28 | On Windows, review recent registry changes to detect when the MSC file association was hijacked by a reg add operation. What executable file was configured as the default command under HKCU\Software\Classes\mscfile\shell\open\command? | calc.exe | N/A | ✗ | ||
29 | Examine the logs from the Linux system for events related to the systemd timer activation. Identify any records indicating that a new timer unit was started and enabled, and determine which timer name was used. | art-timer.timer | art-timer.timer | ✓ | union isfuzzy=true
(
DeviceEvents
| where SourceSystem == "Linux" or DeviceName has "linux" or tostring(AdditionalFields) has "systemd" or ProcessCommandLine has "systemctl" or ProcessCommandLine has "systemd"
),
(
DeviceProcessEvents
| where SourceSystem == "Linux" or DeviceName has "linux" or tostring(AdditionalFields) has "systemd" or ProcessCommandLine has "systemctl" or ProcessCommandLine has "systemd"
)
// build a searchable raw message from common fields and any embedded Message in AdditionalFields
| extend raw = strcat(
tostring(AdditionalFields), " ",
extractjson("$.Message", tostring(AdditionalFields)), " ",
ProcessCommandLine, " ", FileName, " ", ActionType
)
// narrow to likely systemd timer related lines
| where raw has_any ("timer", ".timer", "systemd", "started", "starting", "enabled", "created symlink", "loaded", "activated", "triggered")
// try multiple extraction patterns for timer unit names
| extend TimerName = coalesce(
extract(@"([\w\-\.\@]+\.timer)", 1, raw),
extract(@"Unit\s+([\w\-\.\@]+)\.timer", 1, raw),
extract(@"Started\s+([\w\-\.\@]+)\.timer", 1, raw),
extract(@"Created symlink.*?([^/\s]+\.timer)", 1, raw)
)
| extend lraw = tolower(raw)
| extend Action = case(
lraw contains "enabled" or lraw contains "created symlink" or lraw contains "symlink", "Enabled/Linked",
lraw contains "started" or lraw contains "starting", "Started",
lraw contains "loaded", "Loaded",
lraw contains "activated" or lraw contains "triggered", "Activated",
"Other"
)
| where isnotempty(TimerName)
| project TimeGenerated, DeviceName, DeviceId, TimerName, Action, raw, SourceSystem, ReportId
| sort by TimeGenerated desc
| distinct TimeGenerated, DeviceName, DeviceId, TimerName, Action, raw, SourceSystem, ReportId
| take 200 | |
30 | A Linux host briefly hosted an HTTP service under /tmp. Examine process creation logs to determine the exact python3 command that was used to start the server on port 9090. | python3 -m http.server 9090 | N/A | ✗ | ||
31 | On a Windows endpoint you observe a PowerShell process that fetches a script from the internet and immediately executes an RPC service scan against the spooler. Which function name was invoked to perform that scan? | spoolvulnscan | N/A | ✗ | ||
32 | On a Windows system, someone ran PowerShell to copy a file from a remote machine’s C$ share to the local TEMP folder. Using process event logs, what full PowerShell command was executed to perform this action? | copy-item -Path "\\127.0.0.1\C$\Windows\temp\Easter_Bunny.password" -Destination "$Env:TEMP\Easter_egg.password" | N/A | ✗ | ||
33 | On a Windows host, find any scheduled task that was registered using PowerShell native cmdlets instead of schtasks.exe. What was the name given to the new task? | AtomicTask | N/A | ✗ | ||
34 | A reconnaissance tool was executed on a Windows system. Identify the specific function of the tool that was executed. The function has a name from something you can eat | fruit | invoke-webrequest | ✗ | let food_regex = @"(?i)\b(cookie|cookies|cake|honey|donut|donuts|doughnut|biscuit|biscuits|apple|pear|cheese|bacon|burger|sandwich|salad|soup|banana|orange|grape|cherry|muffin)\b";
let recon_keywords = dynamic(["sharphound","bloodhound","invoke-sharphound","invoke-bloodhound","adfind","nbtscan","nmap","masscan","recon-ng","ldapsearch","get-domain","get-ad","get-net","get-aduser","get-adcomputer","find-ad","invoke-aclscanner","invoke-sharefinder","get-localuser","get-localgroup","net user","net group"]);
// Combine relevant sources into a common shape
(
DeviceProcessEvents
| project TimeGenerated, Source = "DeviceProcessEvents", DeviceName, Account = InitiatingProcessAccountName, FileName, ProcessCommandLine, ProcessId, ReportId
)
| union (
DeviceEvents
| project TimeGenerated, Source = "DeviceEvents", DeviceName, Account = InitiatingProcessAccountName, FileName, ProcessCommandLine, ProcessId = InitiatingProcessId, ReportId
)
| union (
DeviceFileEvents
| project TimeGenerated, Source = "DeviceFileEvents", DeviceName, Account = InitiatingProcessAccountName, FileName, ProcessCommandLine = InitiatingProcessCommandLine, ProcessId = InitiatingProcessId, ReportId
)
| extend lcCmd = tolower(tostring(ProcessCommandLine)), lcFile = tolower(tostring(FileName))
// Filter to likely reconnaissance activity or food-named functions
| where (isnotempty(lcCmd) and lcCmd has_any (recon_keywords)) or (isnotempty(lcFile) and lcFile has_any (recon_keywords)) or (isnotempty(lcCmd) and lcCmd matches regex food_regex)
// Extract possible function/collector names and any food word
| extend FoodMatch = extract(food_regex, 1, lcCmd)
| extend InvokedFunction = extract(@"(?i)\b(invoke-[\w-]+)", 1, lcCmd)
| extend CollectionMethods = extract(@"(?i)(?:-c\s+|--collectionmethod(?:=|\s+)?|-collectionmethod\s+|--collectors(?:=|\s+)?|-collectors\s+)\s*([a-z0-9,]+)", 1, lcCmd)
| extend OtherCollectorFlags = extract(@"(?i)(?:--?collector[s]?\s*=?\s*)([a-z0-9,]+)", 1, lcCmd)
// Choose the most relevant function name (food word preferred)
| extend DeducedFunction = case(
isempty(FoodMatch) == false, FoodMatch,
isempty(CollectionMethods) == false, CollectionMethods,
isempty(OtherCollectorFlags) == false, OtherCollectorFlags,
isempty(InvokedFunction) == false, InvokedFunction,
""
)
| project TimeGenerated, Source, DeviceName, Account, FileName, ProcessId, ProcessCommandLine, DeducedFunction, FoodMatch, InvokedFunction, CollectionMethods, OtherCollectorFlags, ReportId
| order by TimeGenerated desc
| take 200 | |
35 | On a Windows host, investigate process events to find when Task Manager was launched via cmd with an unusual flag. What was the full command executed? | taskmgr.exe /7 | "cmd.exe" /c taskmgr.exe /7 | ✓ | let suspiciousRegex = @"(?i)\/(e\b|s\b|q\b|off\b|k\b|c\b)";
union DeviceProcessEvents, DeviceEvents
| where tolower(InitiatingProcessFileName) has "cmd"
and (tolower(FileName) == "taskmgr.exe" or tolower(ProcessCommandLine) has "taskmgr")
| extend InitiatingCommand = tostring(InitiatingProcessCommandLine), TargetCmd = tostring(ProcessCommandLine)
| extend SuspiciousFlagFound = (InitiatingCommand matches regex suspiciousRegex) or (TargetCmd matches regex suspiciousRegex)
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, InitiatingCommand, FileName, TargetCmd, ProcessId, InitiatingProcessId, SuspiciousFlagFound
| sort by SuspiciousFlagFound desc, TimeGenerated desc
| limit 100 | |
36 | On a Windows device, PowerShell was used to collect a snapshot of running processes. Identify the exact cmdlet that was executed. | Get-Process | Get-Process | ✓ | let CmdletRegex = @"(?i)\b((?:get-process|get-wmiobject|get-ciminstance|gwmi|tasklist(?:\.exe)?|\bGet-Process\b|\bGet-WmiObject\b|\bGet-CimInstance\b|\bgwmi\b|\btasklist\b|\bwin32_process\b)[^;|&\r\n]*)";
union isfuzzy=true DeviceProcessEvents, DeviceEvents, DeviceFileEvents, DeviceImageLoadEvents, DeviceRegistryEvents
| extend CmdLine = coalesce(ProcessCommandLine, InitiatingProcessCommandLine, tostring(AdditionalFields.CommandLine), tostring(AdditionalFields.commandline), tostring(AdditionalFields.CommandLineText))
| where isnotempty(CmdLine) and CmdLine has_cs "powershell"
| where CmdLine matches regex CmdletRegex
| extend MatchedCmd = extract(CmdletRegex, 1, CmdLine)
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), ExampleCmd = any(MatchedCmd), ExampleFullCmd = any(CmdLine) by DeviceName, AccountName, FileName, ProcessId, ReportId
| sort by LastSeen desc
| project FirstSeen, LastSeen, Count, DeviceName, AccountName, FileName, ProcessId, ReportId, ExampleCmd, ExampleFullCmd
| take 1000 | |
37 | A user launched a Windows command prompt and executed a built-in utility to enumerate all active network connections. Using process creation logs, identify the exact tool that produced the list of current connections. | netstat | N/A | ✗ | ||
38 | Windows process creation logs show a PowerShell-driven file transfer to an FTP service. Which executable was leveraged to perform this exfiltration? | rclone.exe | N/A | ✗ | ||
39 | During a Linux investigation, you notice processes spawning curl and wget commands that pull a script from a remote GitHub raw URL and pipe it into bash. Identify the name of the script that was retrieved and executed. | echo-art-fish.sh | echo-art-fish.sh | ✓ | // Identify scripts downloaded from GitHub raw URLs via curl/wget piped to bash
let github_raw_patterns = dynamic(["raw.githubusercontent.com", "raw.githubusercontent.com", "raw.github.com","githubusercontent.com"]);
let curl_wget_filter = (s:string) {
s has "curl" and s has "|" and s has "bash" or
s has "wget" and (s has "-O-" or s has "-qO-" or s has "-O -") and s has "|" and s has "bash"
};
// Search DeviceProcessEvents (preferred) and DeviceEvents
let procEvents = DeviceProcessEvents
| where isnotempty(ProcessCommandLine)
| where curl_wget_filter(ProcessCommandLine) or curl_wget_filter(InitiatingProcessCommandLine)
| extend CmdLine = coalesce(ProcessCommandLine, InitiatingProcessCommandLine)
| extend RemoteUrl = extract(@"((https?://)[^\s'\|]+raw[^\s'\|]+|https?://[^\s'\|]+raw\.githubusercontent\.com[^\s'\|]+|https?://[^\s'\|]*raw\.githubusercontent\.com[^\s'\|]+|https?://raw\.githubusercontent\.com[^\s'\|]+|https?://raw\.githubusercontent\.com[^\s'\|]+)", 1, CmdLine)
| extend RemoteUrl = iff(isempty(RemoteUrl), extract(@"https?://[^\s'\|]+githubusercontent\.com[^\s'\|]+", 0, CmdLine), RemoteUrl)
| extend ScriptName = trim_end(@"/", tostring(parse_url(RemoteUrl).Path))
| extend ScriptName = replace_regex(ScriptName, @"^.*/", "")
| project TimeGenerated, DeviceName, ProcessId, ProcessCreationTime, FileName, CmdLine, RemoteUrl, ScriptName
;
let devEvents = DeviceEvents
| where isnotempty(ProcessCommandLine) or isnotempty(InitiatingProcessCommandLine)
| where curl_wget_filter(ProcessCommandLine) or curl_wget_filter(InitiatingProcessCommandLine)
| extend CmdLine = coalesce(ProcessCommandLine, InitiatingProcessCommandLine)
| extend RemoteUrl = extract(@"https?://[^\s'\|]+(raw\.githubusercontent\.com|raw\.github\.com|rawgithubusercontent)\/[^\s'\|]+", 0, CmdLine)
| extend RemoteUrl = iff(isempty(RemoteUrl), extract(@"https?://[^\s'\|]+githubusercontent\.com[^\s'\|]+", 0, CmdLine), RemoteUrl)
| extend ScriptName = trim_end(@"/", tostring(parse_url(RemoteUrl).Path))
| extend ScriptName = replace_regex(ScriptName, @"^.*/", "")
| project TimeGenerated, DeviceName, ProcessId=InitiatingProcessId, ProcessCreationTime=InitiatingProcessCreationTime, FileName=InitiatingProcessFileName, CmdLine, RemoteUrl, ScriptName
;
// Combine and return distinct script names with sample evidence
procEvents
| union devEvents
| where isnotempty(RemoteUrl)
| summarize count(), Samples = make_list(pack_all(), 10) by ScriptName
| order by count_ desc
| project ScriptName, Count = count_, Samples
| |
40 | A Windows endpoint recorded a command-line activity through cmd.exe that lists all running processes. Determine which built-in tool was executed to perform this action. | tasklist | tasklist | ✓ | union isfuzzy=true DeviceProcessEvents, DeviceEvents, DeviceFileEvents
| extend ProcFile = tostring(coalesce(FileName, InitiatingProcessFileName)),
CmdLine = tostring(coalesce(ProcessCommandLine, InitiatingProcessCommandLine, tostring(AdditionalFields["CommandLine"])))
| where isnotempty(ProcFile) and tolower(ProcFile) endswith "cmd.exe"
| where isnotempty(CmdLine) and (
tolower(CmdLine) contains "tasklist" or
tolower(CmdLine) contains "wmic" or
tolower(CmdLine) contains "get-process" or
tolower(CmdLine) contains "powershell" or
tolower(CmdLine) contains "pslist"
)
| extend DetectedTool = case(
tolower(CmdLine) contains "tasklist", "tasklist",
tolower(CmdLine) contains "wmic", "wmic",
tolower(CmdLine) contains "get-process" or tolower(CmdLine) contains "powershell", "PowerShell (Get-Process)",
tolower(CmdLine) contains "pslist", "Sysinternals PsList",
"unknown"
)
| project TimeGenerated, DeviceName, AccountName = coalesce(AccountName, InitiatingProcessAccountName), ProcFile, CmdLine, DetectedTool
| sort by TimeGenerated desc
| take 100 | |
41 | On a Linux system, find any process creation record where awk is used with a BEGIN rule to launch a shell. What was the exact command invoked? | awk 'BEGIN {system("/bin/sh &")}’ | awk 'BEGIN {system("/bin/sh &")}' | ✓ | // Find Linux process creations where awk uses a BEGIN rule to launch a shell
// Search both DeviceProcessEvents and DeviceEvents (some environments populate either table)
let src = union DeviceProcessEvents, DeviceEvents;
src
| where isnotempty(ProcessCommandLine)
// Narrow to commands that call awk and include a BEGIN clause
| where tolower(ProcessCommandLine) contains "awk" and tolower(ProcessCommandLine) contains "begin"
// Look for common indicators of launching a shell from awk: system/exec, explicit /bin/sh or /bin/bash, piping to a shell, getline usage
| where (
tolower(ProcessCommandLine) contains "system"
or tolower(ProcessCommandLine) contains "exec("
or tolower(ProcessCommandLine) contains "/bin/sh"
or tolower(ProcessCommandLine) contains "/bin/bash"
or tolower(ProcessCommandLine) contains "|/bin"
or tolower(ProcessCommandLine) contains "getline"
)
// Also include entries that match a broader regex for patterns like: awk 'BEGIN{system("/bin/sh")}'
or ProcessCommandLine matches regex "(?i)\\bawk\\b.*BEGIN.*system\\s*\\("
| project TimeGenerated, DeviceName, DeviceId, AccountName, ProcessId, ProcessCreationTime, FileName, CommandLine=ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine
| distinct TimeGenerated, DeviceName, DeviceId, AccountName, ProcessId, ProcessCreationTime, FileName, CommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine
| order by TimeGenerated desc
| take 100 | |
42 | While reviewing Windows process events, you spot a PowerShell process executing a WMI enumeration cmdlet. What WMI class name did the attacker query? | Win32_Process | N/A | ✗ | ||
43 | Review the process creation logs on a Windows host to uncover any tool execution indicative of a special APC injection for shellcode execution. What was the name of the executable used? | NtQueueApcThreadEx.exe | N/A | ✗ | ||
44 | Which full interactive shell command, as recorded in the Linux process logs, repeatedly echoed a distinctive marker message to the terminal? | for i in $(seq 1 5); do echo "$i, Atomic Red Team was here!"; sleep 1; done | N/A | ✗ | ||
45 | On a Linux system, review process execution records for any shell process that set an environment variable containing executable code and then piped it into another shell instance. Determine which environment variable name was used to store the script content. | ART | N/A | ✗ | ||
46 | On a Windows device, review the process execution logs to find instances where a built-in listing tool was piped into a string filter. Identify the process name that the attacker was searching for. | lsass | N/A | ✗ | ||
47 | On a Linux endpoint, process events reveal a chain of group‐enumeration utilities executed by a single session. Which utility was used to query the system’s group database? | getent | getent | ✓ | let linuxDevices = DeviceInfo
| where tolower(OSPlatform) has "linux"
| distinct DeviceId;
DeviceProcessEvents
| where DeviceId in (linuxDevices)
// look for common group-enumeration commands or reads of /etc/group
| where tolower(ProcessCommandLine) has_any ("getent", "/etc/group", "groups", "id -g", "id -G")
| extend tool = case(
tolower(ProcessCommandLine) contains "getent", "getent",
tolower(ProcessCommandLine) contains "cat /etc/group" or tolower(ProcessCommandLine) contains "/etc/group", "cat /etc/group",
tolower(ProcessCommandLine) contains "groups", "groups",
tolower(ProcessCommandLine) contains "id -g" or tolower(ProcessCommandLine) contains "id -G" or tolower(FileName) == "id", "id",
"other")
// flag whether this event queried the system group database (getent group)
| extend queried_system_group_db = iff(tool == "getent" or tolower(ProcessCommandLine) has "getent group", true, false)
| project TimeGenerated, DeviceName, DeviceId, FileName, ProcessId, CreatedProcessSessionId, InitiatingProcessFileName, InitiatingProcessId, ProcessCommandLine, tool, queried_system_group_db
| order by TimeGenerated asc | |
48 | On a Linux system, you suspect someone erased their command history by linking the history file to /dev/null. Investigate process events and determine which utility was executed to achieve this. | ln | ln | ✓ | let history_files = dynamic([".bash_history", ".zsh_history", ".sh_history", ".history", "fish_history"]);
let cmd_indicators = dynamic(["/dev/null", "ln -s", "ln -f", "ln ", "unlink ", "rm ", "cat ", "tee ", "dd ", "> /dev/null", ">/dev/null", "history -c", "shred", "truncate"]);
// Process executions that reference /dev/null or history files
let proc_hits = DeviceProcessEvents
| where isnotempty(ProcessCommandLine)
| where ProcessCommandLine has_any(cmd_indicators) or ProcessCommandLine has_any(history_files)
| project TimeGenerated, DeviceName, DeviceId, AccountName, AccountDomain = AccountDomain, ProcessId, InitiatingProcessId, InitiatingProcessFileName, InitiatingProcessCommandLine, ProcessCommandLine, ProcessCreationTime;
// File events touching common history filenames (helps catch symlink/hardlink actions)
let file_hits = DeviceFileEvents
| where FileName in (".bash_history", ".zsh_history", ".sh_history", ".history", "fish_history")
| where ActionType has_any ("Deleted", "Created", "Modified", "HardlinkCreated", "SymlinkCreated", "Renamed", "Overwritten", "Overwrite") or tostring(AdditionalFields) has "/dev/null"
| project TimeGenerated, DeviceName, DeviceId, AccountName = RequestAccountName, AccountDomain = RequestAccountDomain, ProcessId = InitiatingProcessId, InitiatingProcessId = InitiatingProcessParentId, InitiatingProcessFileName, InitiatingProcessCommandLine, ProcessCommandLine = InitiatingProcessCommandLine, ProcessCreationTime = InitiatingProcessCreationTime, FileName, FolderPath, ActionType, AdditionalFields;
union isfuzzy=true proc_hits, file_hits
| extend matched_devnull = (tolower(tostring(ProcessCommandLine)) contains "/dev/null") or (tostring(AdditionalFields) contains "/dev/null")
| extend suspect_utility = case(
tolower(ProcessCommandLine) contains " ln" or tolower(ProcessCommandLine) startswith "ln", "ln",
tolower(ProcessCommandLine) contains "unlink", "unlink",
tolower(ProcessCommandLine) contains " rm" or tolower(ProcessCommandLine) startswith "rm", "rm",
tolower(ProcessCommandLine) contains " cat" or tolower(ProcessCommandLine) startswith "cat", "cat",
tolower(ProcessCommandLine) contains " tee" or tolower(ProcessCommandLine) startswith "tee", "tee",
tolower(ProcessCommandLine) contains " dd" or tolower(ProcessCommandLine) startswith "dd", "dd",
tolower(ProcessCommandLine) contains "shred", "shred",
tolower(ProcessCommandLine) contains "truncate", "truncate",
tolower(ProcessCommandLine) contains "history -c", "history -c",
"other")
| where matched_devnull or suspect_utility != "other"
| summarize
event_count = count(),
first_time = min(TimeGenerated),
last_time = max(TimeGenerated),
sample_commands = make_set(tostring(ProcessCommandLine), 10),
sample_initiators = make_set(tostring(InitiatingProcessFileName), 10),
sample_additional = make_set(tostring(AdditionalFields), 5),
actions = make_set(tostring(ActionType), 5)
by DeviceName, DeviceId, AccountName, AccountDomain, FileName, suspect_utility
| order by last_time desc
// When you run this query, expand the sample_commands and sample_initiators to inspect the exact command lines and parent processes. Look specifically for commands such as: ln -s /dev/null ~/.bash_history, ln -f /dev/null ~/.bash_history, unlink ~/.bash_history, rm ~/.bash_history, or cat /dev/null > ~/.bash_history. If you find a matching entry, the suspect_utility column will indicate which utility was likely used. | |
49 | On a Windows endpoint, review process execution logs to see if any PowerShell sessions were wiped clean. Which command was executed to clear the PowerShell history? | Clear-History | Clear-History | ✓ | union DeviceProcessEvents, DeviceEvents
| where isnotempty(ProcessCommandLine)
// normalize to lower for simpler matching
| extend cmd = tolower(ProcessCommandLine)
// look for explicit PowerShell history clearing commands or file removals/overwrites of the PSReadLine/ConsoleHost history file
| where (
cmd contains "clear-history"
or cmd contains "set-psreadlineoption"
or cmd contains "psreadline"
or cmd contains "consolehost_history"
or cmd contains "consolehost_history.txt"
or cmd contains "historysavestyle"
or cmd contains "maximumhistorycount"
or cmd contains "clear-host"
or (cmd contains "remove-item" and (cmd contains "psreadline" or cmd contains "consolehost_history" or cmd contains "consolehost_history.txt"))
or cmd matches regex "\\b(del|erase|remove-file|rm|remove)\\b.*(consolehost_history|consolehost_history.txt|psreadline)"
or cmd matches regex "set-psreadlineoption\\s+.*(historysavestyle|maximumhistorycount)"
)
| extend MatchedPattern = case(
cmd matches regex "clear-history", "Clear-History",
cmd matches regex "set-psreadlineoption", "Set-PSReadLineOption",
cmd matches regex "psreadline|consolehost_history", "PSReadLine/ConsoleHost_history",
cmd matches regex "remove-item", "Remove-Item",
cmd matches regex "\\b(del|erase|rm|remove-file|remove)\\b", "Delete/Truncate File",
"Other"
)
| project TimeGenerated, DeviceName, AccountName, FileName, ProcessId, ProcessCommandLine, MatchedPattern, InitiatingProcessFileName, InitiatingProcessCommandLine
| order by TimeGenerated desc
| take 500 | |
50 | Investigate Windows process events for PowerShell activity that leverages WMI to register a scheduled task via XML import. What was the name of the XML file supplied to the RegisterByXml method? | T1053_005_WMI.xml | N/A | ✗ |
Page 1 of 4