↳ Source GitHubRègle analytiqueMedium

Access Token Manipulation - Create Process with Token

Description

This query detects the use of the 'runas' command and checks whether the account used to elevate privileges isn't the user's own admin account. Additionally, it will match this event to the logon events - to check whether it has been successful as well as augment the event with the new SID.
Type de règle
Scheduled
Version
1.0.0
Statut déclaré
Available
Fréquence
1h
Période analysée
1h
Déclenchement
gt 0

Couverture MITRE déclarée

Sources déclarées

Métadonnées du fichier source. Aucune dépendance déduite du KQL.

Connecteurs

Types de données

Requête KQL

Requête originale, sans modification.

let RunAsProcess=DeviceProcessEvents
    | where FileName =~ "runas.exe" 
    // You can choose to filter out the local admin account. This is based on convention. Here, we assume that localadmin accounts
    // end with _ladmin (RID 500 / LAPS).
    | where not(AccountName has_any("_ladmin"))
    // De-obfuscate the commandline used. 
    | extend CleanProcessCommandLine=parse_command_line(tostring(ProcessCommandLine), "windows")
    // Exclude a user running something on their system through their admin account.
    | where CleanProcessCommandLine !contains strcat(AccountName, "_adm") // Replace this with your admin account naming convention.
    // Exclude local admin account activities by, for instance, the servicedesk that uses the LAPS provisioned account. This is optional. 
    // Disable the line below if the number of false positives is acceptable. 
    | where not(CleanProcessCommandLine has_any (":_ladmin")) // Replace this with your local RID500/LAPS account.
    // Extract the username for the elevation action.
    | extend ElevatedAccountName=extract("user:([a-zA-Z0-9\\\\]+)",1,tostring(CleanProcessCommandLine))
    // Strip the domain suffix.
    | extend CleanElevatedAccountName= trim("(.*\\\\)",ElevatedAccountName);
RunAsProcess
| join kind=leftouter ( 
    DeviceLogonEvents
    | project-rename CleanElevatedAccountName = AccountName
    ) on CleanElevatedAccountName,DeviceId
| project-rename ElevatedActionType=ActionType1,ElevatedAccountSid=AccountSid1
| project TimeGenerated,DeviceId,DeviceName,FileName,FolderPath,ProcessCommandLine,SHA256,ProcessIntegrityLevel,AccountDomain,AccountName,AccountSid, LogonId, InitiatingProcessFileName,InitiatingProcessFolderPath,InitiatingProcessCommandLine,CleanProcessCommandLine,ElevatedAccountName,CleanElevatedAccountName,ElevatedActionType,LogonType,ElevatedAccountSid

Entités déclarées

HostAccountProcess

Contenus associés

Liens établis à partir des identifiants déclarés et des manifests des solutions.

Traçabilité de la source

GitHub

Les valeurs affichées proviennent des fichiers du dépôt Azure/Azure-Sentinel. Elles décrivent le modèle publié, pas la configuration de votre workspace.

Identifiant source
8df80270-b4fa-4a7a-931e-8d17c0b321ae
Autres fichiers source 2Solutions/FalconFriday/Analytic Rules/CreateProcessWithToken.yamlsource ↗Solutions/FalconFriday/Data/Solution_FalconFriday.jsonsolution-membership ↗
GSTEP / SUIVI DU CATALOGUE

Ajouté au catalogue : 16 sept. 2026 · 05:49 UTC
Dernier changement observé : 16 sept. 2026 · 05:49 UTC

Dates de synchronisation GSTEP, distinctes des dates de publication du contenu source.