Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Server Oriented Cmdlet And User Oriented Cmdlet used

Back
Id7bce901b-9bc8-4948-8dfc-8f68878092d5
RulenameServer Oriented Cmdlet And User Oriented Cmdlet used
DescriptionDetect if a server oriented cmdlet and a user oriented cmdlet that are monitored are launched by the same user in the same server within a 10 minutes timeframe
SeverityHigh
TacticsExfiltration
Persistence
Collection
TechniquesT1020
T1098
T1114
Required data connectorsESI-ExchangeAdminAuditLogEvents
KindScheduled
Query frequency1d
Query period1d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft Exchange Security - Exchange On-Premises/Analytic Rules/ServerOrientedWithUserOrientedAdministration.yaml
Version1.2.0
Arm template7bce901b-9bc8-4948-8dfc-8f68878092d5.json
Deploy To Azure
let timeframe = 1d;
let spanoftime = 10m;
let threshold = 0;
ExchangeAdminAuditLogs 
  | where TimeGenerated > ago(2 * timeframe)
  | where isempty(UserOriented)
  | project serverExecutedTime = TimeGenerated,
    ServerCmdlet = CmdletName,
    ServerCmdletParams = CmdletParameters,
    Computer,
    Caller,
    ServerCmdletTargetObject = TargetObject
  | join kind= inner (
      ExchangeAdminAuditLogs
      | where TimeGenerated > ago(timeframe)
      | where UserOriented =~ 'Yes'
      | project userExecutedTime = TimeGenerated,
        UserCmdlet = CmdletName,
        UserCmdletParams = CmdletParameters,
        Computer,
        Caller,
        UserCmdletTargetObject = TargetObject,
        userPrincipalName,
        objectGUID,
        sAMAccountName,
        IsVIP)
    on Computer, Caller
  | where userExecutedTime - serverExecutedTime < spanoftime
  | extend TimeDelta = userExecutedTime - serverExecutedTime
  | extend TimeDeltaInverse = serverExecutedTime - userExecutedTime
  | where tolong(TimeDelta) >= threshold or tolong(TimeDeltaInverse) >= threshold
triggerThreshold: 0
queryFrequency: 1d
id: 7bce901b-9bc8-4948-8dfc-8f68878092d5
kind: Scheduled
description: |
    'Detect if a server oriented cmdlet and a user oriented cmdlet that are monitored are launched by the same user in the same server within a 10 minutes timeframe'
entityMappings:
- entityType: Mailbox
  fieldMappings:
  - identifier: MailboxPrimaryAddress
    columnName: userPrincipalName
  - identifier: Upn
    columnName: userPrincipalName
- entityType: Host
  fieldMappings:
  - identifier: FullName
    columnName: Computer
- entityType: Host
  fieldMappings:
  - identifier: HostName
    columnName: ServerCmdletTargetObject
- entityType: Account
  fieldMappings:
  - identifier: Name
    columnName: Caller
  - identifier: ObjectGuid
    columnName: objectGUID
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft Exchange Security - Exchange On-Premises/Analytic Rules/ServerOrientedWithUserOrientedAdministration.yaml
queryPeriod: 1d
query: |
  let timeframe = 1d;
  let spanoftime = 10m;
  let threshold = 0;
  ExchangeAdminAuditLogs 
    | where TimeGenerated > ago(2 * timeframe)
    | where isempty(UserOriented)
    | project serverExecutedTime = TimeGenerated,
      ServerCmdlet = CmdletName,
      ServerCmdletParams = CmdletParameters,
      Computer,
      Caller,
      ServerCmdletTargetObject = TargetObject
    | join kind= inner (
        ExchangeAdminAuditLogs
        | where TimeGenerated > ago(timeframe)
        | where UserOriented =~ 'Yes'
        | project userExecutedTime = TimeGenerated,
          UserCmdlet = CmdletName,
          UserCmdletParams = CmdletParameters,
          Computer,
          Caller,
          UserCmdletTargetObject = TargetObject,
          userPrincipalName,
          objectGUID,
          sAMAccountName,
          IsVIP)
      on Computer, Caller
    | where userExecutedTime - serverExecutedTime < spanoftime
    | extend TimeDelta = userExecutedTime - serverExecutedTime
    | extend TimeDeltaInverse = serverExecutedTime - userExecutedTime
    | where tolong(TimeDelta) >= threshold or tolong(TimeDeltaInverse) >= threshold  
requiredDataConnectors:
- connectorId: ESI-ExchangeAdminAuditLogEvents
  dataTypes:
  - Event
severity: High
name: Server Oriented Cmdlet And User Oriented Cmdlet used
tactics:
- Exfiltration
- Persistence
- Collection
version: 1.2.0
status: Available
triggerOperator: gt
relevantTechniques:
- T1020
- T1098
- T1114