This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "NamePrefix": { | |
| "defaultValue": "", | |
| "type": "String", | |
| "metadata": { | |
| "description": "Optional prefix to prepend to all resource names for easy identification." | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PowerShell script in response to this: | |
| # https://github.com/hattonsec/hattonsec.github.io/commit/1d78938bf324fac1a68d89f83e8d6dcd785ac8bd#diff-0eb547304658805aad788d320f10bf1f292797b5e6d745a3bf617584da017051R838 | |
| $BaseUrl = "https://log[.]linpeas[.]sh" # defanged. Don't actually do this, I just generated this script for the lolz | |
| # Need the lyrics in a text file somewhere | |
| $rick = Get-Content C:\temp\rick.txt | Where-Object {-not [string]::IsNullOrWhiteSpace($_)} | |
| foreach ($roll in $rick) { | |
| $uuid = [guid]::NewGuid().guid -replace '-','' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Retrieves file names from the current folder and copies them to the clipboard. | |
| Drop this function and the alias definition into your PowerShell profile file to make it available in every PowerShell session. | |
| .EXAMPLE | |
| Get-FileNamesFromCurrentFolder -Recurse | |
| Recursively gets all file names from the current folder and subfolders, copying them to the clipboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # First, connect to Microsoft Graph | |
| Connect-MgGraph -Scopes "Policy.Read.All", "Directory.Read.All" | |
| # Retrieve all Conditional Access policies | |
| $policies = Get-MgIdentityConditionalAccessPolicy | |
| # Iterate through each policy | |
| foreach ($policy in $policies) { | |
| [pscustomobject]@{ | |
| ID = $policy.Id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Retrieves and exports group data from Atlassian Crowd via REST API. | |
| .DESCRIPTION | |
| The Get-CrowdData function is designed to interact with the Atlassian Crowd REST API to retrieve group and group membership data from a specified Crowd Directory. | |
| It requires the Crowd Base URL and Directory ID as inputs. Optionally, you can specify an output path to save the exported data; if not specified, it defaults to the user's profile directory. | |
| Based on API documentation from here: https://docs.atlassian.com/atlassian-crowd/5.2.1/REST/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Connect to Microsoft Graph | |
| Connect-MgGraph -Scopes "User.Invite.All" | |
| # Microsoft Graph API endpoint for invitations | |
| $graphApiUrl = "https://graph.microsoft.com/v1.0/invitations" | |
| # Create the invitation object | |
| $invitation = @{ | |
| invitedUserDisplayName = "Daniel Streefkerk" | |
| invitedUserEmailAddress = "daniel@example.com" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Script to compile all of the findings in JSON format from multiple Prowler runs and export to a usable CSV | |
| # Note: will also run fine if there's just a single JSON file in the output folder | |
| # | |
| # Hard-coded to grab FAILures only, not PASSes | |
| # | |
| # Make sure that only relevant findings files are being merged to CSV. i.e. remove old output files from previous runs | |
| # Path to the default Prowler output folder | |
| $prowlerReportsFolder = Join-Path -Path $env:USERPROFILE -ChildPath "output" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Showing the state of a temperature in a template card: | |
| {{ states('sensor.your_temperature_sensor') }} | |
| #Change the colour of the light depending on status: | |
| {% if is_state('light.your_light', 'on') %} | |
| orange | |
| {% endif %} | |
| #Welcome template: | |
| #Updated to greet the user by first name only |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SigninLogs | |
| | mv-expand ConditionalAccessPolicies | |
| | project DisplayName = tostring(ConditionalAccessPolicies.displayName),ID = tostring(ConditionalAccessPolicies.id) | |
| | distinct ID,DisplayName | |
| | order by DisplayName asc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get Sign-in logs for any Report-Only Conditional Access policies where the result = ReportOnlyFailure | |
| SigninLogs | |
| | mvexpand ConditionalAccessPolicies | |
| | where ConditionalAccessPolicies["result"] == "reportOnlyFailure" | |
| | project TimeGenerated, Identity, UserPrincipalName, AzureADApplication = AppDisplayName, ClientApplication = ClientAppUsed, ClientBrowser = DeviceDetail.browser, ClientOperatingSystem = DeviceDetail.operatingSystem, ClientIPAddress = IPAddress , ClientUserAgent = UserAgent , ConditionalAccessPolicyName = ConditionalAccessPolicies["displayName"], ConditionalAccessPolicyID = ConditionalAccessPolicies["id"] |