// question

Investigate registry modifications on Windows that reveal when cmd.exe persistence was configured via the CommandProcessor AutoRun key. What command was configured under the AutoRun value?

Reference KQL answer and model-by-model comparison.

a574dafe-a903-4cce-9701-14040f4f3532
question id
14/23
models correct
1
valid answer
61%
success rate
// reference answer

Human-validated correct answer for this question.

notepad.exe
// model comparison
ModelAnswerKQL queryStatusTriesTimeCost
gemini-2.5-flash-preview-04-17
notepad.exe
DeviceRegistryEvents
| where ActionType in ("RegistryValueSet", "RegistryKeySet")
| where RegistryKey contains "Command Processor"
| where RegistryValueName =~ "AutoRun"
| project Timestamp, DeviceName, ActionType, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessCommandLine, InitiatingProcessFileName
pass16.87s0.0024
gpt-35-turbo
no answer
no query generatedfail50.00s0.0112
gpt-4-turbo-2024-04-09
no answer
no query generatedfail50.00s0.2339
gpt-4.1
notepad.exe
DeviceRegistryEvents
| where ActionType in ('RegistryValueSet', 'RegistryValueCreated')
| where RegistryKey has @'Software\Microsoft\Command Processor'
| where RegistryValueName == 'AutoRun'
| project TimeGenerated, DeviceName, InitiatingProcessAccountDomain, InitiatingProcessAccountName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine
pass521.29s0.0443
gpt-4.1-finetuned
no answer
no query generatedfail50.00s0.0421
gpt-4.1-mini
no answer
no query generatedfail50.00s0.0072
gpt-4.1-nano
no answer
no query generatedfail50.00s0.0011
gpt-4o
notepad.exe
DeviceRegistryEvents
| where RegistryKey contains "\\Software\\Microsoft\\Command Processor" and RegistryValueName == "AutoRun"
| project TimeGenerated, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessAccountName, InitiatingProcessCommandLine
pass26.09s0.0285
gpt-5-high
notepad.exe
DeviceRegistryEvents
| where ActionType in~ ('RegistryValueSet','RegistryValueCreate')
| where RegistryValueName =~ 'AutoRun'
| where tolower(RegistryKey) has '\\software\\microsoft\\command processor'
   or tolower(RegistryKey) has '\\software\\wow6432node\\microsoft\\command processor'
// Identify the hive (HKLM vs user hive)
| extend rk = tolower(RegistryKey)
| extend Hive = case(
    rk startswith 'hkey_local_machine' or rk startswith 'hklm', 'HKLM',
    rk startswith 'hkey_current_user' or rk startswith 'hkcu' or rk startswith 'hkey_users' or rk startswith 'hku', 'HKCU/HKU',
    'Other')
// Latest AutoRun configuration per device + hive
| summarize arg_max(TimeGenerated,
         RegistryKey, RegistryValueData, PreviousRegistryValueData,
         InitiatingProcessAccountDomain, InitiatingProcessAccountName,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         InitiatingProcessSHA1, ActionType) by DeviceId, DeviceName, Hive
| project TimeGenerated,
          DeviceName,
          Hive,
          RegistryKey,
          AutoRunCommand = tostring(RegistryValueData),
          PreviousAutoRunCommand = tostring(PreviousRegistryValueData),
          ActionType,
          SetBy = iff(isempty(InitiatingProcessAccountDomain), InitiatingProcessAccountName, strcat(InitiatingProcessAccountDomain, '\\', InitiatingProcessAccountName)),
          SettingProcess = InitiatingProcessFileName,
          SettingProcessCommandLine = InitiatingProcessCommandLine,
          InitiatingProcessSHA1
| order by TimeGenerated desc
pass3254.03s0.1329
gpt-5-mini-high
notepad.exe
DeviceRegistryEvents
| where RegistryKey has_cs "\\Software\\Microsoft\\Command Processor" or RegistryKey has_cs "\\Software\\Wow6432Node\\Microsoft\\Command Processor"
| where RegistryValueName == "AutoRun"
| where ActionType in ("SetValue", "Created", "Modified", "ValueSet") or RegistryValueData != ""
| project TimeGenerated, DeviceName, DeviceId, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName, RegistryKey, RegistryValueName, RegistryValueData, PreviousRegistryValueData, ActionType, ReportId
| extend AutoRunCommand = tostring(RegistryValueData)
| order by TimeGenerated desc
| take 50
pass17.78s0.0026
gpt-5-mini-low
notepad.exe
DeviceRegistryEvents
| where RegistryKey has_any ("\\Software\\Microsoft\\Command Processor", "\\Command Processor")
| where RegistryValueName =~ "AutoRun"
| where RegistryKey has_any ("HKEY_CURRENT_USER", "HKCU", "HKEY_LOCAL_MACHINE", "HKLM")
| where ActionType in ("SetValue", "Create", "Modify", "Add", "ValueSet", "Delete", "Remove") or isnotempty(RegistryValueData) or isnotempty(PreviousRegistryValueData)
| project TimeGenerated, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, PreviousRegistryValueData, RegistryValueType, ActionType, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName, InitiatingProcessAccountDomain, InitiatingProcessId, InitiatingProcessCreationTime, InitiatingProcessParentFileName, InitiatingProcessParentId, InitiatingProcessRemoteSessionIP
| order by TimeGenerated desc
| take 500
pass112.66s0.0023
gpt-5-mini-medium
no answer
no query generatedfail50.00s0.0186
gpt-5-nano-high
no answer
no query generatedfail50.00s0.0066
gpt-5-nano-medium
notepad.exe
DeviceRegistryEvents
| where RegistryValueName == "AutoRun"
| where (RegistryKey contains "Command Processor") or (RegistryKey contains "CommandProcessor")
| where ActionType in ("RegistryValueModified", "RegistryValueSet", "RegistryValueUpdated", "RegistryValueCreated")
| project TimeGenerated, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessAccountName, InitiatingProcessAccountDomain, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessCreationTime, InitiatingProcessId
| sort by TimeGenerated desc
pass129.78s0.0015
grok-3-beta
notepad.exe
DeviceRegistryEvents
| where RegistryKey contains 'Software\\Microsoft\\Command Processor'
| where RegistryValueName == 'AutoRun'
| where ActionType == 'RegistryValueSet'
| project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName, InitiatingProcessAccountName
| order by Timestamp desc
pass19.81s0.0216
grok-3-mini-beta
notepad.exe
DeviceRegistryEvents
| where RegistryValueName == 'AutoRun'
| where RegistryKey contains 'Command Processor'
| project TimeGenerated, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessCommandLine
| order by TimeGenerated desc
pass110.22s0.0017
o1-high
notepad.exe
DeviceRegistryEvents
| where ActionType =~ "RegistryValueSet" or ActionType =~ "RegistryValueModified"
| where RegistryKey has "\\Microsoft\\Command Processor"    // searching for both HKLM and HKCU possible paths
| where RegistryValueName =~ "AutoRun"
| project TimeGenerated, DeviceName, InitiatingProcessAccountName, InitiatingProcessCommandLine, RegistryKey, RegistryValueData
| order by TimeGenerated desc
pass120.65s0.1824
o1-low
notepad.exe
DeviceRegistryEvents
| where RegistryKey has "\\Command Processor"
| where RegistryValueName =~ "AutoRun"
| where ActionType in ("RegistryValueSet", "RegistryValueCreated", "RegistryValueModified")
| project TimeGenerated, DeviceName, ActionType, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessCommandLine
| order by TimeGenerated desc
pass119.12s0.1496
o3-high
notepad.exe
// Investigate CommandProcessor → AutoRun persistence modifications
let cmdProcessorKeySuffixes = dynamic([
    "\\SOFTWARE\\Microsoft\\Command Processor",
    "\\SOFTWARE\\Wow6432Node\\Microsoft\\Command Processor"
]);
DeviceRegistryEvents
| where RegistryKey has "Command Processor"                    // quick pre-filter
| where RegistryKey has_any(cmdProcessorKeySuffixes)             // precise match for both 32/64-bit views
| where RegistryValueName =~ "AutoRun"                           // the persistence value
| where ActionType in ("RegistryValueSet", "RegistryValueCreated", "RegistryValueModified", "RegistryKeyCreated")
| extend AutoRunCommand = tostring(RegistryValueData)
| where isnotempty(AutoRunCommand)
| extend RegistryHive = extract("^(HKLM|HKEY_LOCAL_MACHINE|HKCU|HKEY_CURRENT_USER)", 1, RegistryKey)
| project TimeGenerated,
          DeviceName,
          RegistryHive,
          RegistryKey,
          RegistryValueName,
          AutoRunCommand,
          ActionType,
          InitiatingProcessAccountDomain,
          InitiatingProcessAccountName,
          InitiatingProcessFileName,
          InitiatingProcessCommandLine
| order by TimeGenerated desc
pass3113.32s0.0600
o3-mini-high
notepad.exe
DeviceRegistryEvents
| where RegistryKey contains "Command Processor" and RegistryValueName == "AutoRun"
| where isnotempty(RegistryValueData)
| project TimeGenerated, DeviceName, RegistryValueData, InitiatingProcessCommandLine, ActionType
| sort by TimeGenerated desc
pass110.41s0.0075
o3-mini-low
notepad.exe
DeviceRegistryEvents
| where RegistryValueName =~ "AutoRun"
| where RegistryKey contains "Command Processor"
| project TimeGenerated, DeviceName, InitiatingProcessAccountName, RegistryKey, RegistryValueData, ActionType
| order by TimeGenerated desc
pass19.61s0.0081
o4-mini-high
no answer
no query generatedfail50.00s0.0585
o4-mini-low
no answer
no query generatedfail50.00s0.0422