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
#Requires -modules Microsoft.PowerShell.ConsoleGuiTools, PowerTrello | |
# Read more about positions | |
# https://migueldeicaza.github.io/gui.cs/api/Terminal.Gui/Terminal.Gui.Pos.html | |
# Getting started with Terminal.UI by Adam Driscoll | |
# https://blog.ironmansoftware.com/tui-powershell/ | |
# options https://github.com/cbttrevor/powershell-terminal |
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
^q:: | |
Send, pentesterlab | |
sleep 250 | |
Send, {enter} | |
Sleep 555 | |
Send, pentesterlab | |
sleep 250 | |
Send, {enter} | |
return |
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 New-TempDirectory { | |
$pathToCreate = join-path ([io.path]::GetTempPath()) ([io.path]::GetRandomFileName()) | |
New-Item -ItemType Directory -Path $pathToCreate | |
} |
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
<# | |
.Description | |
This script was written to solve the Based challenge from PicoCTF 2019. | |
This script connects to a target computer nad port and converts the output from Base2, Base8, and Base16. | |
It establishes a tcp connection, answers the questions and returns the flag for this challenge. | |
#> | |
[cmdletbinding()] | |
param( | |
[string]$computer = '2019shell1.picoctf.com', | |
$port = '44303', |
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 Get-PublicIPInfo { | |
<# | |
.Description | |
Returns Public IP info from ip.nf | |
.Parameter IPAddress | |
Supply an IP address that you would like to lookup. | |
.Parameter ComputerName | |
Names of computers to run this command on. | |
.Parameter Credential | |
Credential used by Invoke-Command when performing the lookup on a remote machine. |
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 Get-MmaEvent { | |
<# | |
.Description | |
Returns upcoming MMA events from https://www.whenarethefights.com/ | |
#> | |
$request = Invoke-WebRequest -Uri 'https://www.whenarethefights.com/' | |
# Only grab the events that have a countdown. | |
$content = $request.Links.outertext | Where-Object {$_ -like '*days*'} |
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
# Path to the profile when installed from the Windows Store. | |
$profilePath = "C:\Users\$Env:Username\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json" | |
# Remove existing comments from the profiles.json file. | |
$profile = (Get-Content $ProfilePath) -replace '(?m)(?<=^([^"]|"[^"]*")*)//.*' -replace '(?ms)/\*.*?\*/' | Out-String | ConvertFrom-Json | |
$backupProfilePath = "$home\Documents\WindowsTerminalprofiles.json" | |
Write-Verbose "Backing up profile to $backupProfilePath" | |
$profile | ConvertTo-Json | Set-Content $backupProfilePath |
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
<# | |
.Parameter Credential | |
Enter WEBdav creds for an account with the WEBDav Read permission | |
.Parameter TOPdeskURL | |
The URL of the topdesk instance. eg: Support.Company.com, company.topdesk.net | |
.Parameter OutputFolder | |
Folder where you want the logs to be downloaded to. If not provided, the files will be downloaded into your tmp folder and will be cleaned up at the end. | |
.Parameter MonthsBack | |
Select how many months back you want to go. Default select the current month. 1 would be for this month, 3 whereas 3 would be the last 3 months | |
.Parameter DaysBack |
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
# Credential needs to | |
$Credential = Get-Credential -Message 'enter TOPdesk operator credential with WebDAV permissions.' | |
$OutputFolder = 'C:\path\to\folder' | |
$tdurl = 'company.topdesk.net' | |
$psDriveParams = @{ | |
PSProvider = 'FileSystem' | |
Root = "\\$tdUrl@SSL\webdav" # ex: '\\contoso.topdesk.net@SSL\webdav' | |
Credential = $Credential | |
Name = 'TOPdesk' |
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
# Create a pscustomobject from a hashtable | |
$object = [pscustomobject]@{ Key1 = 'Val1' ; Key2 = 'Val2' } | |
# Grab all noteproperty members | |
$objMembers = $object.psobject.Members | where-object membertype -like 'noteproperty' | |
foreach ($member in $objMembers) { | |
# Now you can do what you want with the name and value. | |
$Member.name | |
$Member.Value |