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
| # Define parameters | |
| $captureFile = "C:\tmp\mycapture.pcap" | |
| $tsharkPath = "C:\Program Files\Wireshark\tshark.exe" | |
| $RemoteIP = "192.168.1.10" | |
| $TestShare = "\\server1.example.com\admin$" | |
| $User = "[email protected]" | |
| $Password = "FAKE-Password" | |
| $TestPassword = ConvertTo-SecureString -AsPlainText -String $Password -Force | |
| $TestCred = [Management.Automation.PSCredential]::new($User, $TestPassword) |
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
| $Headers = @{ | |
| "Accept" = "application/json" | |
| "authorization" = "Bearer BQAJ" # Can acquire from the browser | |
| } | |
| $uri = @' | |
| https://api.spotify.com/v1/me/top/tracks?limit=50 | |
| '@ | |
| $QueryResults = [Collections.Generic.List[Object]]::new() |
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
| What rolls down stairs | |
| alone or in pairs, | |
| and over your neighbor's dog? | |
| What's great for a snack, | |
| And fits on your back? | |
| It's log, log, log | |
| It's log, it's log, | |
| It's big, it's heavy, it's wood. | |
| It's log, it's log, it's better than bad, it's good." |
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
| function Get-ShodanIpLookup { | |
| param ( | |
| [ipaddress]$Ip, | |
| [string]$ApiKey = "" | |
| ) | |
| if ($ApiKey -eq "") { Invoke-RestMethod -Uri "https://internetdb.shodan.io/$Ip" } | |
| else { Invoke-RestMethod -uri "https://api.shodan.io/shodan/host/$($ip)?key=$ApiKey" } | |
| # Free Service: https://internetdb.shodan.io/ | |
| # Paid API access: https://developer.shodan.io/api |
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
| function Get-Superscript { | |
| param ($letter) | |
| switch ($letter) { | |
| "a" { [char]::ConvertFromUtf32(7491 )} | |
| "b" { [char]::ConvertFromUtf32(7495 )} | |
| "c" { [char]::ConvertFromUtf32(7580 )} | |
| "d" { [char]::ConvertFromUtf32(7496 )} | |
| "e" { [char]::ConvertFromUtf32(7497 )} | |
| "f" { [char]::ConvertFromUtf32(7584 )} | |
| "g" { [char]::ConvertFromUtf32(7501 )} |
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
| Function Get-ADSiteByIp { | |
| param ( | |
| [parameter(Mandatory = $true)][ipaddress] | |
| [ipaddress]$IP, | |
| [bool]$CheckForScript = $true # faster | |
| ) | |
| if ($CheckForScript -eq $true) { | |
| try { Get-InstalledScript IP-Calc | Out-Null } | |
| catch { | |
| Install-Script -Name IP-Calc -Scope CurrentUser -Force -Confirm:$false |
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
| <# Wordscapes solver | |
| 14Jul2021 | |
| https://apps.apple.com/us/app/wordscapes/id1207472156 | |
| https://play.google.com/store/apps/details?id=com.peoplefun.wordcross&hl=en_US&gl=US | |
| #> | |
| #import Get-StringPermutation from https://learn-powershell.net/2013/02/21/fun-with-powershell-and-permutations/ | |
| $wordArray = Get-Content C:\tmp\words.txt | |
| $wordHash = @{} |
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
| <#To do | |
| -Test local machine | |
| -Test remote domains | |
| -Explore AADJ experience | |
| #> | |
| function Test-Credential { | |
| <# | |
| .SYNOPSIS | |
| This function validates the credentials of a PSCredential (Get-Credential) object against the local machine or Active Directory. | |
| Active Directory users are first queried to add support for UPNs. Unfortunately this approach ignores the netbios name of the |