This file contains 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 all IPs for accessible subscriptions | |
#Only Enabled Subs | |
$subscriptionList = Get-AzSubscription | where-object State -eq "Enabled" | |
$all = $null | |
foreach($sub in $subscriptionList) | |
{ | |
$context = Set-AzContext -Subscription $sub.Id -Tenant $sub.TenantId | |
This file contains 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
//https://docs.microsoft.com/en-us/azure/sentinel/connect-windows-security-events | |
let Minimal = dynamic ([1102, 4624, 4625, 4657, 4663, 4688, 4700, 4702, 4719, 4720, 4722, 4723, 4724, 4727, 4728, 4732, 4735, 4737, 4739, 4740, 4754, 4755, 4756, 4767, 4799, 4825, 4946, 4948, 4956, 5024, 5033, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8222]); | |
let Common = dynamic( [1, 299, 300, 324, 340, 403, 404, 410, 411, 412, 413, 431, 500, 501, 1100, 1102, 1107, 1108, 4608, 4610, 4611, 4614, 4622, 4624, 4625, 4634, 4647, 4648, 4649, 4657, 4661, 4662, 4663, 4665, 4666, 4667, 4688, 4670, 4672, 4673, 4674, 4675, 4689, 4697, 4700, 4702, 4704, 4705, 4716, 4717, 4718, 4719, 4720, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4733, 4732, 4735, 4737, 4738, 4739, 4740, 4742, 4744, 4745, 4746, 4750, 4751, 4752, 4754, 4755, 4756, 4757, 4760, 4761, 4762, 4764, 4767, 4768, 4771, 4774, 4778, 4779, 4781, 4793, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4825, 4826, 4870, 4886, 4887, 4888, 4893, 4898, 4902, 4904, 4905, 4907, 4931, 4932, 49 |
This file contains 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-AzKeyVaultKey -VaultName $Vault -Name $Name).Key.ToString() | ConvertFrom-Json).n |
This file contains 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
$VmIps=@{}; Get-AzVmSS | %{ $VmSS = $_; (Get-AzNetworkInterface -VirtualMachineScaleSetName $VmSS.Name -ResourceGroupName $VmSS.ResourceGroupName ) | %{ $nics = $_; $nics| %{ [string[]]$VmIps[(Get-AzVmSsVm -VMScaleSetName $VmSS.Name -ResourceGroupName $VmSS.ResourceGroupName -InstanceId $_.VirtualMachine.Id.tostring().split('/')[-1]).OsProfile.ComputerName]+=$_.IpConfigurations.PrivateIpAddress} } }; $VmIps |
This file contains 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
1. Create a file: /etc/wsl.conf. | |
2. Put the following lines in the file in order to ensure the your DNS changes do not get blown away | |
[network] | |
generateResolvConf = false | |
3. In a cmd window, run wsl --shutdown | |
4. Restart WSL2 | |
5. Create a file: /etc/resolv.conf. If it exists, replace existing one with this new file: `rm /etc/resolv.conf` | |
6. Put the following line in the file |
This file contains 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
function jwtDecode(t) { | |
let token = {}; | |
token.raw = t; | |
token.header = JSON.parse(atob(t.toString().split('.')[0])); | |
token.payload = JSON.parse(atob(t.toString().split('.')[1])); | |
return (token); | |
} | |
console.log("JWT Decode"); | |
var jwt = jwtDecode(pm.response.json().access_token); |
This file contains 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
$uri = 'https://owner-api.teslamotors.com/oauth/token' | |
$email = "a@b.com" | |
$pw = "pw123!" | |
$json = @{ | |
grant_type = "password" | |
client_id = "81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384" | |
client_secret = "c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3" | |
email = "$email" | |
password = "$pw" |
This file contains 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-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | where { -not [str | |
ing]::IsNullOrEmpty($_.DisplayName) } |
This file contains 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
using Microsoft.VisualStudio.TestTools.WebTesting; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using System.ComponentModel; | |
using Tavis; | |
namespace Extensions.ExtractionRules | |
{ | |
/// <summary> |
This file contains 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
#http://powershell.com/cs/blogs/tips/archive/2010/10/28/running-programs-as-different-user.aspx | |
Start-Process powershell -LoadUserProfile -Credential (Get-Credential) |