Skip to content

Siemphony is in beta and still being built. How a rule earns its badge.

Siemphony’s repertoire

Command line builds a new logon token for impersonation

AN1375 is a five-step API/event chain — suspicious command, LogonUser*/ SetThreadToken API evidence, a 4624 New Logon with no interactive desktop, a child process running under the new LogonId, and optional follow-on privileged activity — and lib/sigma has no join, so this rule targets only step (1), the one link in that chain with a command line: MITRE's own example of "runas /netonly" or a "PowerShell P/Invoke of LogonUser". The first selection matches runas.exe invoked with /netonly, which creates a new logon session for an alternate credential without validating it against the domain — the classic CLI proxy for LogonUser-style token creation. The second matches a process command line that names both a token-creation API (LogonUser or LsaLogonUser) and an impersonation API (SetThreadToken or ImpersonateLoggedOnUser) together, the P/Invoke or Add-Type pattern offensive PowerShell tooling uses to call both from a single script passed inline. Neither selection sees the technique when the actual API calls are made in-process by injected or compiled code, or when the PowerShell is wrapped in -EncodedCommand, since the base64 blob hides the literal API names from CommandLine — that path leaves no command-line evidence at all. The brief's second logsource, Security 4672 (Special Privileges Assigned to New Logon), is not used: it fires for every logon carrying an administrative-equivalent privilege set — built-in admins, most service accounts, scheduled tasks, IIS app pools — and it has no process field to filter against MITRE's own AllowedImpersonators knob (winlogon.exe, lsass.exe, IIS worker, trusted service accounts), since 4672 is a logon event, not a process-creation event; without that filter it is far too coarse to carry this technique on its own. Prerequisite: 4688-backed process creation needs *Audit Process Creation* and the separate *Include command line in process creation events* policy, neither on by default. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0498, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full description

The detection

The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.

detection.yml

title: Command line builds a new logon token for impersonationid: 7e706190-f71b-4a08-b481-2e8a0d769dc3status: experimentaldescription: |  AN1375 is a five-step API/event chain — suspicious command, LogonUser*/  SetThreadToken API evidence, a 4624 New Logon with no interactive desktop,  a child process running under the new LogonId, and optional follow-on  privileged activity — and lib/sigma has no join, so this rule targets only  step (1), the one link in that chain with a command line: MITRE's own  example of "runas /netonly" or a "PowerShell P/Invoke of LogonUser". The  first selection matches runas.exe invoked with /netonly, which creates a  new logon session for an alternate credential without validating it against  the domain — the classic CLI proxy for LogonUser-style token creation. The  second matches a process command line that names both a token-creation API  (LogonUser or LsaLogonUser) and an impersonation API (SetThreadToken or  ImpersonateLoggedOnUser) together, the P/Invoke or Add-Type pattern  offensive PowerShell tooling uses to call both from a single script passed  inline. Neither selection sees the technique when the actual API calls are  made in-process by injected or compiled code, or when the PowerShell is  wrapped in -EncodedCommand, since the base64 blob hides the literal API  names from CommandLine — that path leaves no command-line evidence at all.  The brief's second logsource, Security 4672 (Special Privileges Assigned to  New Logon), is not used: it fires for every logon carrying an  administrative-equivalent privilege set — built-in admins, most service  accounts, scheduled tasks, IIS app pools — and it has no process field to  filter against MITRE's own AllowedImpersonators knob (winlogon.exe,  lsass.exe, IIS worker, trusted service accounts), since 4672 is a logon  event, not a process-creation event; without that filter it is far too  coarse to carry this technique on its own. Prerequisite: 4688-backed  process creation needs *Audit Process Creation* and the separate *Include  command line in process creation events* policy, neither on by default.  UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0498, not hand-written and not tested by its author. Any lab result is on this rule's own page.references:  - https://attack.mitre.org/techniques/T1134/003  - https://attack.mitre.org/detectionstrategies/DET0498author: Siemphony pipeline (machine-derived from MITRE ATT&CK v19.2)date: 2026-08-18tags:  - attack.defense-evasion  - attack.privilege-escalation  - attack.t1134.003logsource:  category: process_creation  product: windowsdetection:  selection_runas_netonly:    Image|endswith: '\runas.exe'    CommandLine|contains: '/netonly'  selection_psh_logonuser:    CommandLine|contains:      - 'LogonUser'      - 'LsaLogonUser'  selection_psh_impersonate:    CommandLine|contains:      - 'SetThreadToken'      - 'ImpersonateLoggedOnUser'  condition: selection_runas_netonly or (selection_psh_logonuser and selection_psh_impersonate)falsepositives:  - "Administrators and help-desk staff running `runas /netonly /user:domain\\admin` by hand to launch a management console with alternate-domain credentials from a workstation that is not joined to, or not currently authenticated to, that domain — a routine, documented workflow."  - "Jump-box, PAM and credential-vault client tooling that shells out to runas /netonly to pre-load a vaulted alternate credential before launching a remote-administration console, without disabling UAC."  - "Authorized red-team, purple-team or security-tooling PowerShell modules (e.g. credential-validation or sandboxed-execution test harnesses) that P/Invoke LogonUser together with SetThreadToken or ImpersonateLoggedOnUser as part of their own legitimate function rather than as an attack."level: medium

Sentinel · KQL

Run this as a search.

DeviceProcessEvents| where ((FolderPath endswith "\\runas.exe" and ProcessCommandLine contains "/netonly") or ((ProcessCommandLine contains "LogonUser" or ProcessCommandLine contains "LsaLogonUser") and (ProcessCommandLine contains "SetThreadToken" or ProcessCommandLine contains "ImpersonateLoggedOnUser")))

Splunk · SPL

Run this as a search.

index=* ((Image="*\\runas.exe" AND CommandLine="*/netonly*") OR ((CommandLine="*LogonUser*" OR CommandLine="*LsaLogonUser*") AND (CommandLine="*SetThreadToken*" OR CommandLine="*ImpersonateLoggedOnUser*")))

Elastic · ES|QL

Run this as a search.

FROM logs-*| WHERE ((TO_LOWER(process.executable) LIKE "*\\\\runas.exe" AND TO_LOWER(process.command_line) LIKE "*/netonly*") OR ((TO_LOWER(process.command_line) LIKE "*logonuser*" OR TO_LOWER(process.command_line) LIKE "*lsalogonuser*") AND (TO_LOWER(process.command_line) LIKE "*setthreadtoken*" OR TO_LOWER(process.command_line) LIKE "*impersonateloggedonuser*")))

Wazuh · XML rule

Deploy to your manager — this is a rule, not a search.

<group name="sigma,windows,process_creation,">  <!-- Rule ids must be unique on your manager; 100000+ is the user range. -->  <!-- 2 rules: the Sigma condition ORs across different fields,       which one rule cannot express. Any one matching is a hit. -->  <rule id="100000" level="7">    <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. -->    <field name="Image" type="pcre2">(?i)\\runas\.exe$</field>    <field name="CommandLine" type="pcre2">(?i)/netonly</field>    <description>Command line builds a new logon token for impersonation (1/2)</description>    <mitre>      <id>T1134.003</id>    </mitre>  </rule>   <rule id="100001" level="7">    <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. -->    <field name="CommandLine" type="pcre2">(?i)(LogonUser|LsaLogonUser)</field>    <field name="CommandLine" type="pcre2">(?i)(SetThreadToken|ImpersonateLoggedOnUser)</field>    <description>Command line builds a new logon token for impersonation (2/2)</description>    <mitre>      <id>T1134.003</id>    </mitre>  </rule></group>

Verdicts · reactions · comments

Community

Verdicts from engineers who actually deployed it, and the conversation around it.

Log in to react
Not yet reported on

Nobody has run this in a real environment and said what happened.

Verdicts from engineers who deployed it

0 cast

No verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.

Log in to report a verdict.

Log in to join the discussion.

No comments yet. Someone who deploys this will have something to say about it.