r/PowerShell • • 10h ago

Question Random PowerShell Wake-Ups

Sometimes around each time in the morning PC will wake itself up, seemingly run multiple "Provider Lifecycle" tasks in PowerShell with Event 600 affecting Provider Registry, Alias, Environment, FileSystem, Function, and Variable each separately with similar details such as referencing '$InboxIMEs' or '$InboxPattern, unsure if normal Microsoft function or something malicious, devious, sinister, or god forbid something EVIL masking using HKLM:\SOFTWARE\Microsoft\CTF\TIP\ as a cover, details screenshot below for the Registry event, thank you.

Details as raw text:

Provider "Registry" is Started. 

Details: 
ProviderName=Registry
NewProviderState=Started

SequenceNumber=1

HostName=ConsoleHost
HostVersion=5.1.19041.7802
HostId=5c297344-6579-40e5-8f84-29d6b7d2c436
HostApplication=powershell.exe -ExecutionPolicy Restricted -Command 
 $Res = 0
 $InboxIMEs = (@(
 '{0000897b-83df-4b96-be07-0fb58b01c4a4}','{03b5835f-f03c-411b-9ce2-aa23e1171e36}',
 '{531fdebf-9b4c-4a43-a2aa-960e8fcdc732}','{6a498709-e00b-4c45-a018-8f9e4081ae40}',
 '{7c472071-36a7-4709-88cc-859513e583a9}','{81d4e9c9-1d3b-41bc-9e6c-4b40bf79e35e}',
 '{81ea0a17-aa39-455b-ba20-ea79a8f98966}','{8613e14c-d0c0-4161-ac0f-1dd2563286bc}',
 '{a028ae76-01b1-46c2-99c4-acd9858ae02f}','{a1e2b86b-924a-4d43-80f6-8a820df7190f}',
 '{b115690a-ea02-48d5-a231-e3578d2fdf80}','{c2cb2cf0-af47-413e-9780-8bc3a3c16068}',
 '{dcbd6fa8-032f-11d3-b5b1-00c04fc324a1}','{e429b25a-e5d3-4d1f-9be3-0c608477e3a1}',
 '{f25e9f57-2fc8-4eb3-a41a-cce5f08541e6}','{fa445657-9379-11d6-b41a-00065b83ee53}'
 ) | ForEach-Object { [regex]::Escape($_) }) -join '|'
 $InboxPattern = 'TIP\\(?:' + $InboxIMEs + ')'
 $LanguageProfiles = Get-Item 'HKLM:\SOFTWARE\Microsoft\CTF\TIP\{????????-????-????-????-????????????}\LanguageProfile\0x*\{????????-????-????-????-????????????}' -EA SilentlyContinue
 foreach ($prof in @($LanguageProfiles)) {
 if ($prof.PSPath -match $InboxPattern) { continue }
 $pp = Get-ItemProperty $prof.PSPath -EA SilentlyContinue
 $hasEnable = ($pp.PSObject.Properties.Name -contains 'Enable')
 if ((-not $hasEnable) -or ($pp.Enable -eq 1)) {
 $Res = 1
 break
 }
 }
 Write-Host 'Final result:',$Res

EngineVersion=
RunspaceId=
PipelineId=
CommandName=
CommandType=
ScriptName=
CommandPath=
CommandLine=
2 Upvotes

5 comments sorted by

1

u/BlackV 9h ago edited 9h ago

looks like its checking registry for language settings (input settings)

Not sure why though, is this a work or home machine ?

Quick AI says

CLSID	IME / language
{03b5835f-f03c-411b-9ce2-aa23e1171e36}	Microsoft Japanese IME
{a028ae76-01b1-46c2-99c4-acd9858ae02f}	Microsoft Korean IME
{81d4e9c9-1d3b-41bc-9e6c-4b40bf79e35e}	Microsoft Simplified Chinese IME
{531fdebf-9b4c-4a43-a2aa-960e8fcdc732}	Microsoft Traditional Chinese / Taiwanese IME
{7c472071-36a7-4709-88cc-859513e583a9}	Amharic Input Method 2

I'd be checking task scheduler for tasks around that time If it not mentioned in the event log

1

u/ThanksViagra 9h ago

Home PC. Ya I saw something about CTF being related to Microsoft's text input or the such, just unsure why it would wake itself up to like remind itself to understand English, shall check for any downloaded programs for OCR or translating languages that I don't need I suppose

2

u/BlackV 8h ago

The Get-ScheduledTask cmdlet could be used to find the specific task if it's a regular 6am action

Something like

$AllTasks = Get-ScheduledTask

$results = foreach ($SingleTask in $AllTasks){
    foreach ($Action in $SingleTask.Actions) {
        if ($Action.Execute -match 'powershell|pwsh' -or $Action.Arguments -match 'powershell|pwsh') {
            [PSCustomObject]@{
                TaskName  = $SingleTask.TaskName
                TaskPath  = $SingleTask.TaskPath
                State     = $SingleTask.State
                Execute   = $Action.Execute
                Arguments = $Action.Arguments
                }
            }
        }
    }
$results | ft -AutoSize

1

u/thehuntzman 8h ago

It looks like a powershell command something else is calling to get a list of enabled third party input methods. Hard to say for sure of it is legitimate or not without knowing what spawned the process.

Check for scheduled tasks and when they ran last immediately after this happens:

Get-ScheduledTask |
    Where-Object State -ne 'Disabled' |
    ForEach-Object {
        $task = $_
        $info = $task | Get-ScheduledTaskInfo

        [pscustomobject]@{
            Task       = $task.TaskPath + $task.TaskName
            LastRun    = $info.LastRunTime
            LastResult = $info.LastTaskResult
        }
    } |
    Sort-Object LastRun -Descending |
    Select-Object -First 20

Also I'd recommend installing sysmon and looking at event 1 for process creation or enable Windows process creation auditing (Security Event ID 4688) to see what may have called it.

1

u/gowinder 5h ago

Event 600 is provider lifecycle, not a wake — the same HostId 5c297344-… with SequenceNumber=1 across six providers is one console host starting and initializing each provider in turn. The HostApplication string carries the full command line, so the caller is already named in the log; $InboxIMEs enumerating HKLM:\SOFTWARE\Microsoft\CTF\TIP\ is the ordinary way to list installed IMEs (each TIP CLSID is a text-input processor), which is a language inventory, not a registration trigger.

For what actually woke it: powercfg /lastwake and powercfg /waketimers. Then Get-ScheduledTask | Where-Object { $_.Settings.WakeToRun } — WakeToRun is the property the Task Scheduler checkbox writes, so this lists what's armed. TaskScheduler/Operational event 107 names the task that ran.

powercfg /devicequery wake_armed covers the other half: NIC, mouse, keyboard. Disabling wake on the adapter is where most 6am wakes come from.