Question Analysis
Windows process creation logs show a cmd.exe launch that retrieved the system’s locale code page. Which exact command was executed to discover the system language?
d91473ca-944e-477a-b484-0e80217cd789
Question ID
21/23
Models Correct
1
Valid Answer
91%
Success Rate
Reference Answer
Human-validated correct answer for this question
chcp
Model Performance Comparison
See how different AI models performed on this question
Model | Answer | KQL Query | Status | Attempts | Time | Cost |
---|---|---|---|---|---|---|
gemini-2.5-flash-preview-04-17 | chcp | DeviceProcessEvents
| where FileName =~ "cmd.exe"
| where ProcessCommandLine has "chcp"
| project Timestamp, DeviceName, ProcessCommandLine | Correct | 1 | 8.98s | 0.0024 |
gpt-35-turbo | chcp | DeviceProcessEvents | where FileName == 'cmd.exe' and ProcessCommandLine contains 'chcp' | Correct | 1 | 2.78s | 0.0029 |
gpt-4-turbo-2024-04-09 | chcp | DeviceProcessEvents
| where FileName == 'cmd.exe' and (ProcessCommandLine contains 'systeminfo' or ProcessCommandLine contains 'chcp')
| project DeviceName, AccountName, ProcessCommandLine, TimeGenerated | Correct | 2 | 12.63s | 0.0932 |
gpt-4.1 | wmic /node:localhost os get Locale,OSLanguage,MUILanguages /format:table | DeviceProcessEvents
| where FileName =~ "cmd.exe"
| where ProcessCommandLine has_any ("chcp", "Get-WinSystemLocale", "systeminfo", "locale")
| project TimeGenerated, DeviceName, AccountName, ProcessCommandLine | Incorrect | 1 | 4.61s | 0.0115 |
gpt-4.1-finetuned | cmd.exe /c chcp | DeviceProcessEvents
| where (InitiatingProcessFileName =~ "cmd.exe" and InitiatingProcessCommandLine has "chcp")
or (InitiatingProcessFileName =~ "powershell.exe" and InitiatingProcessCommandLine has "chcp.exe")
| project InitiatingProcessCommandLine
| summarize make_set(InitiatingProcessCommandLine) | Correct | 2 | 11.63s | 0.0122 |
gpt-4.1-mini | cmd.exe /c chcp | DeviceProcessEvents
| where FileName == "cmd.exe"
| where ProcessCommandLine contains "chcp"
| project TimeGenerated, DeviceName, AccountName, ProcessCommandLine
| sort by TimeGenerated desc | Correct | 1 | 3.68s | 0.0021 |
gpt-4.1-nano | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0018 |
gpt-4o | "cmd.exe" /c chcp | DeviceProcessEvents
| where FileName == "cmd.exe"
| where ProcessCommandLine has "chcp"
| project TimeGenerated, DeviceName, InitiatingProcessCommandLine, ProcessCommandLine | Correct | 1 | 16.59s | 0.0147 |
gpt-5-high | chcp | DeviceProcessEvents
| where ActionType == "ProcessCreated"
| where FileName =~ "cmd.exe"
// Code page / locale discovery via cmd
| where ProcessCommandLine matches regex @"(?i)(\bchcp(\.com)?\b|\breg(\.exe)?\s+query\s+[^\r\n]*\\Control\\Nls\\CodePage\b|\bwmic(\.exe)?\s+os\s+get\s+code(set|page)\b)"
| project TimeGenerated, DeviceName, AccountName, ProcessCommandLine
| order by TimeGenerated desc | Correct | 1 | 85.04s | 0.0464 |
gpt-5-mini-high | chcp | // Search DeviceProcessEvents and DeviceEvents for cmd.exe launches that retrieve the system locale/code page
let localeKeywords = dynamic(["chcp","Get-Culture","systeminfo","wmic","LocaleName","Locale","Get-WinSystemLocale","Get-Culture","reg query"]);
union isfuzzy=true
(
DeviceProcessEvents
| where isnotempty(FileName) and (FileName =~ "cmd.exe" or ProcessCommandLine contains_cs "cmd.exe")
| extend CommandLine = coalesce(ProcessCommandLine, InitiatingProcessCommandLine)
| project TimeGenerated, DeviceName, FileName, ProcessId, CommandLine, AccountName, AccountDomain = AccountDomain, ProcessCreationTime
),
(
DeviceEvents
| where isnotempty(FileName) and (FileName =~ "cmd.exe" or ProcessCommandLine contains_cs "cmd.exe" or InitiatingProcessFileName =~ "cmd.exe")
| extend CommandLine = coalesce(ProcessCommandLine, InitiatingProcessCommandLine, InitiatingProcessCommandLine)
| project TimeGenerated, DeviceName, FileName, ProcessId, CommandLine, AccountName, AccountDomain = AccountDomain, ProcessCreationTime
)
| where isnotempty(CommandLine)
// filter for common locale/code-page discovery commands invoked from cmd.exe
| where CommandLine has_any ("chcp","/c chcp","/c systeminfo","/c wmic","/c powershell","systeminfo","wmic","Get-Culture","LocaleName","reg query")
| extend MatchedKeyword = case(
CommandLine has "chcp", "chcp",
CommandLine has "Get-Culture", "Get-Culture",
CommandLine has "systeminfo", "systeminfo",
CommandLine has "wmic", "wmic",
CommandLine has "LocaleName", "LocaleName",
CommandLine has "reg query", "reg query",
"other"
)
| project TimeGenerated, DeviceName, AccountDomain, AccountName, FileName, ProcessId, ProcessCreationTime, CommandLine, MatchedKeyword
| order by TimeGenerated desc
| distinct DeviceName, CommandLine, TimeGenerated, ProcessId, AccountName, AccountDomain, MatchedKeyword, ProcessCreationTime | Correct | 2 | 23.92s | 0.0071 |
gpt-5-mini-low | chcp | let locale_terms = dynamic(["chcp","wmic os get locale","get-culture","get-winsystemlocale","get-uiculture","reg query hklm\\system\\currentcontrolset\\control\\nls","[console]::inputencoding","get-winuserlanguagelist","system.language"]);
union (DeviceProcessEvents | extend SourceTable = "DeviceProcessEvents"), (DeviceEvents | extend SourceTable = "DeviceEvents")
| where isnotempty(ProcessCommandLine) or isnotempty(InitiatingProcessCommandLine) or isnotempty(FileName) or isnotempty(InitiatingProcessFileName)
| extend fn = tolower(coalesce(FileName, "")), ipfn = tolower(coalesce(InitiatingProcessFileName, "")), pcmd = tolower(coalesce(ProcessCommandLine, "")), ipcmd = tolower(coalesce(InitiatingProcessCommandLine, ""))
// Narrow to events where cmd.exe is involved (as file or in a commandline)
| where fn has "cmd.exe" or ipfn has "cmd.exe" or pcmd has "cmd.exe" or ipcmd has "cmd.exe"
// Keep events that contain any of the known locale-checking terms
| where pcmd has_any (locale_terms) or ipcmd has_any (locale_terms)
| extend MatchedCommand = case(
pcmd has "chcp" or ipcmd has "chcp", "chcp",
pcmd has "wmic os get locale" or ipcmd has "wmic os get locale", "wmic os get locale",
pcmd has "get-culture" or ipcmd has "get-culture", "Get-Culture",
pcmd has "get-winsystemlocale" or ipcmd has "get-winsystemlocale", "Get-WinSystemLocale",
pcmd has "get-uiculture" or ipcmd has "get-uiculture", "Get-UICulture",
(pcmd has "reg query" and pcmd has "nls") or (ipcmd has "reg query" and ipcmd has "nls"), "reg query NLS Locale",
pcmd has "[console]::inputencoding" or ipcmd has "[console]::inputencoding", "[console]::InputEncoding",
"other")
| project TimeGenerated, Timestamp, SourceTable, DeviceName, DeviceId, AccountName, AccountDomain = coalesce(AccountDomain, InitiatingProcessAccountDomain), FileName, ProcessId, ProcessCreationTime, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId, InitiatingProcessCreationTime, MatchedCommand
| sort by TimeGenerated desc
| take 200 | Correct | 4 | 85.61s | 0.0194 |
gpt-5-mini-medium | chcp | DeviceProcessEvents
| where FileName has_cs "cmd.exe" or InitiatingProcessFileName has_cs "cmd.exe"
| where ProcessCommandLine has_cs "chcp" or ProcessCommandLine has_cs "Get-WinSystemLocale" or ProcessCommandLine has_cs "Get-Culture"
or ProcessCommandLine contains "systeminfo" and ProcessCommandLine contains "Locale"
or ProcessCommandLine contains "reg query" and (ProcessCommandLine contains "LocaleName" or ProcessCommandLine contains "InstallLanguage" or ProcessCommandLine contains "Nls")
or InitiatingProcessCommandLine has_cs "chcp" or InitiatingProcessCommandLine has_cs "Get-WinSystemLocale" or InitiatingProcessCommandLine has_cs "Get-Culture"
or InitiatingProcessCommandLine contains "systeminfo" and InitiatingProcessCommandLine contains "Locale"
or InitiatingProcessCommandLine contains "reg query" and (InitiatingProcessCommandLine contains "LocaleName" or InitiatingProcessCommandLine contains "InstallLanguage" or InitiatingProcessCommandLine contains "Nls")
| project TimeGenerated, DeviceName, FileName, ProcessId, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessId, InitiatingProcessCommandLine, InitiatingProcessAccountName, InitiatingProcessAccountDomain
| extend MatchType = case(
ProcessCommandLine has_cs "chcp" or ProcessCommandLine has_cs "Get-WinSystemLocale" or ProcessCommandLine has_cs "Get-Culture" or (ProcessCommandLine contains "systeminfo" and ProcessCommandLine contains "Locale") or (ProcessCommandLine contains "reg query" and (ProcessCommandLine contains "LocaleName" or ProcessCommandLine contains "InstallLanguage" or ProcessCommandLine contains "Nls")), "Process",
InitiatingProcessCommandLine has_cs "chcp" or InitiatingProcessCommandLine has_cs "Get-WinSystemLocale" or InitiatingProcessCommandLine has_cs "Get-Culture" or (InitiatingProcessCommandLine contains "systeminfo" and InitiatingProcessCommandLine contains "Locale") or (InitiatingProcessCommandLine contains "reg query" and (InitiatingProcessCommandLine contains "LocaleName" or InitiatingProcessCommandLine contains "InstallLanguage" or InitiatingProcessCommandLine contains "Nls")), "InitiatingProcess",
"Other")
| sort by TimeGenerated desc
| take 100 | Correct | 1 | 18.59s | 0.0048 |
gpt-5-nano-high | chcp | DeviceProcessEvents
| where (InitiatingProcessFileName contains "cmd.exe" or FileName contains "cmd.exe" or InitiatingProcessCommandLine contains "cmd.exe" or ProcessCommandLine contains "cmd.exe")
| where (InitiatingProcessCommandLine contains "chcp" or ProcessCommandLine contains "chcp")
| extend CmdLine = tostring(coalesce(InitiatingProcessCommandLine, ProcessCommandLine))
| project TimeGenerated, DeviceName, CmdLine
| sort by TimeGenerated desc
| take 100 | Correct | 1 | 28.05s | 0.0018 |
gpt-5-nano-medium | chcp | DeviceProcessEvents
| where tolower(InitiatingProcessFileName) contains "cmd.exe"
| where InitiatingProcessCommandLine has_any ("chcp","wmic os get oslangu","get-locale","get-culture","oslanguage")
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, ProcessCommandLine | Correct | 1 | 56.33s | 0.0024 |
grok-3-beta | chcp | DeviceProcessEvents
| where FileName contains 'cmd.exe'
| where ProcessCommandLine contains 'chcp' or ProcessCommandLine contains 'locale' or ProcessCommandLine contains 'language'
| project DeviceName, AccountName, ProcessCommandLine, TimeGenerated
| order by TimeGenerated desc | Correct | 1 | 7.45s | 0.0205 |
grok-3-mini-beta | "cmd.exe" /c chcp | DeviceProcessEvents
| where FileName == 'cmd.exe'
| where ProcessCommandLine contains 'chcp'
| project ProcessCommandLine, TimeGenerated, DeviceName
| order by TimeGenerated desc
| limit 10 | Correct | 1 | 10.89s | 0.0016 |
o1-high | chcp | DeviceProcessEvents
| where ActionType == "ProcessCreated"
| where FileName == "cmd.exe"
| where ProcessCommandLine has "chcp"
| project TimeGenerated, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessCommandLine, SHA256, ReportId
| order by TimeGenerated desc | Correct | 1 | 28.64s | 0.2240 |
o1-low | chcp | DeviceProcessEvents
| where ActionType =~ "CreateProcess" or ActionType =~ "ProcessCreated"
| where FileName =~ "cmd.exe"
| where ProcessCommandLine has "chcp"
| project TimeGenerated, DeviceName, FolderPath, ProcessCommandLine
| order by TimeGenerated desc | Correct | 1 | 24.58s | 0.1842 |
o3-high | chcp | // Windows process creation – identifying cmd.exe commands that query locale / code-page
DeviceProcessEvents
| where FileName =~ "cmd.exe" // limit to interactive shell launches
// ---- locale / code-page discovery primitives ------------------------
| where ProcessCommandLine has_any (
"wmic os get locale", // returns numeric locale identifier
"wmic os get codeset", // returns the code-page value
"wmic os get codepage", // synonym of the above
"chcp", // change / display active code page
"systeminfo" // can be combined with findstr to extract locale
)
or ProcessCommandLine matches regex @"findstr\s+.*Locale" // e.g. systeminfo | findstr /B /C:"System Locale"
// ---------------------------------------------------------------------
| project TimeGenerated,
DeviceName,
Account = strcat(AccountDomain, "\\", AccountName),
ProcessCommandLine
// Group identical command lines so we can see which exact command(s) were run
| summarize FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated),
ExecCount = count()
by DeviceName, Account, ProcessCommandLine
| order by LastSeen desc | Correct | 2 | 76.66s | 0.0377 |
o3-mini-high | chcp | DeviceProcessEvents
| where FileName =~ "cmd.exe"
| where ProcessCommandLine has "chcp"
| project TimeGenerated, DeviceName, ProcessCommandLine
| order by TimeGenerated desc | Correct | 1 | 32.20s | 0.0078 |
o3-mini-low | chcp | DeviceProcessEvents
| where FileName =~ "cmd.exe"
| where tolower(ProcessCommandLine) contains "chcp"
| project TimeGenerated, DeviceName, FileName, ProcessCommandLine
| limit 10 | Correct | 1 | 9.47s | 0.0075 |
o4-mini-high | chcp | DeviceProcessEvents
| where FileName == "cmd.exe"
| where ProcessCommandLine has "chcp"
| project TimeGenerated, DeviceName, InitiatingProcessAccountName, ProcessCommandLine
| sort by TimeGenerated desc | Correct | 1 | 30.89s | 0.0126 |
o4-mini-low | chcp | DeviceProcessEvents
| where FileName == "cmd.exe"
| where ProcessCommandLine contains "chcp"
| project ProcessCreationTime, DeviceName, AccountName, ProcessCommandLine | Correct | 1 | 28.08s | 0.0082 |