Skip to content

Commit

Permalink
Create Guest Accounts.kql
Browse files Browse the repository at this point in the history
  • Loading branch information
rootsecdev committed May 12, 2024
1 parent f73e98a commit 040ff43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PurpleTeam/Guest Accounts.kql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//Hunt for creation of new guest accounts

CloudAppEvents
| where Timestamp > ago(7d)
| where ActionType == "Add user."
| where RawEventData.ResultStatus == "Success"
| where RawEventData has "guest" and RawEventData.ObjectId has "#EXT#"
| mv-expand Property = RawEventData.ModifiedProperties
| where Property.Name == "AccountEnabled" and Property.NewValue has "true"
| project Timestamp, AccountObjectId, AccountDisplayName, newGuestAccount = RawEventData.ObjectId, UserAgent

0 comments on commit 040ff43

Please sign in to comment.