Gundog : Guided Hunting In Microsoft 365 Defender

gundog – PowerShell based guided hunting in Microsoft 365 Defender

Gundog provides you with guided hunting in Microsoft 365 Defender. Especially (if not only) for Email and Endpoint Alerts at the moment.

Functionality

You provide an AlertID (you might received via Email notification) and gundog will then hunt for as much as possible associated data. It does not give you the flexibility of advanced hunting like you have in the portal, but it will give you a quick, first overview of the alert, all associated entities and some enrichment.

All the hunting it does is based on the alert timestamp – so we only care about events shortly before, or after the alert.

It also provides you with PowerShell objects for each entity it hunted for – like $Network for everything it found related to this alert in the Microsoft 365 Defender DeviceNetworkEvents table.

gundog also comes up with some other features that make your life easier:

  • per default, only the most relevant data is displayed (this is the way)
  • it gives you context wherever possible: last AAD Sign-Ins & user’s AAD address
  • network connections can be automatically filtered to display more relevant connections only (get rid of connections to Office 365 e.g.)
  • network connections are enriched with geo location (country & city)
  • in the variables section you can easily adjust most parameters like advanced hunting timeframe of every query
  • In addition it searches for IOCs at other services like abuse.ch, urlscan.io or ip-api.com. I ask you to apply for their paid services if you use them commercially.

After first evaluations with gundog, you can continue in the portal to dig deeper into the rabbit hole.

Feel free to extend gundog and send me pull requests! For the best psychodelic experience, use Windows Terminal Dracula theme with gundog.

Quick Usage

mandatory parameters:
– TenantID
– ClientID
– ClientSecret
Optional parameters:
– forgetIncidents
(Background: the first thing gundog is doing is to query all incidents and alerts from the incident API from the last 30 days. These are
saved to a global variable. If you restart gundog, it will not query all incidents again, unless you set forgetIncidents to true.)

Requirements

Register an new App in AAD and give it the following permission: (How to register an app)

Microsoft Graph
– Directory.Read.All
– IdentityRiskEvent.Read.All
– IdentityRiskyUser.Read.All
– SecurityEvents.Read.All
– User.Read
Microsoft Threat Protection
– AdvancedHunting.ReadAll
– Incident.Read.All
Windows Defender ATP
– AdvancedQuery.Read.All
– Alert.Read.All
– File.Read.All
– Ip.Read.All
– Url.Read.All
– User.Read.All
– Vulnerability.Read.All

R K

Recent Posts

Pyxel : A Complete Guide To The Python-Based Game Engine

With simple specifications inspired by retro gaming consoles, such as displaying only 16 colors and…

19 hours ago

Shadowsocks : The Ultimate Guide To Features, Installation, And Configuration

hickory-dns - Uses hickory-resolver as DNS resolver instead of tokio's builtin. local-http - Allow using…

19 hours ago

Syscall Tables : Evolution From NT5 To NT11

Syscall tables are critical components of operating systems, mapping system calls to their respective kernel…

20 hours ago

GitButler : Revolutionizing Branch Management With Virtual Branches

GitButler is a git client that lets you work on multiple branches at the same…

2 days ago

Minegrief : Unpacking A Crafty Minecraft Malware

Self-spreading to other Minecraft servers using an extendable, module-based lateral movement system. Crafty Controller Auth'd…

2 days ago

ModTask – Task Scheduler Attack Tool

ModTask is an advanced C# tool designed for red teaming operations, focusing on manipulating scheduled…

4 days ago