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
| Add-Type -Path "$env:userprofile\Documents\Development\Other Files\PacketDotNet-0.12.0\release\PacketDotNet.dll" | |
| $sourcePort = "31623" | |
| $destPort = "80" | |
| $packet = New-Object PacketDotNet.TcpPacket($sourcePort,$destPort) | |
| $sourceAddr = [System.Net.IPAddress]::Parse("10.0.0.1") | |
| $destAddr = [System.Net.IPAddress]::Parse("10.0.1.95") | |
| $ipPacket = New-Object PacketDotNet.IPv4Packet($sourceAddr, $destAddr) |
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
| $Port = 80 | |
| $IPAddress = "10.0.1.95" | |
| $Address = [System.Net.IPAddress]::Parse($IPAddress) | |
| $EndPoint = New-Object System.Net.IPEndPoint $Address, $Port | |
| $AddressFamily = [System.Net.Sockets.AddressFamily]::InterNetwork | |
| $SocketType = [System.Net.Sockets.SocketType]::Dgram | |
| $ProtocolType = [System.Net.Sockets.ProtocolType]::Udp |
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-GitHubStatus { | |
| $gitHub = Invoke-WebRequest -Uri 'https://status.github.com/api/status.json' | |
| $gitHub | ConvertFrom-Json | |
| } |
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 Search-Chrome { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
| [string]$Search | |
| ) | |
| begin { | |
| Write-Verbose -Message "Starting $($MyInvocation.Mycommand)" | |
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 Invoke-RestMethod { | |
| [CmdletBinding(HelpUri='http://go.microsoft.com/fwlink/?LinkID=217034')] | |
| param( | |
| [Microsoft.PowerShell.Commands.WebRequestMethod] | |
| ${Method}, | |
| [Parameter(Mandatory=$true, Position=0)] | |
| [ValidateNotNullOrEmpty()] | |
| [uri] | |
| ${Uri}, |
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
| [Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } |
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 Set-LocalPasswords | |
| { | |
| param( | |
| [Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
| [string]$computer, | |
| [Parameter(Mandatory=$true)] | |
| [string]$password | |
| ) | |
| process { | |
| $userList = Get-WmiObject -Class Win32_UserAccount -ComputerName $computer |
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-DaysUntilBSidesDetroit { | |
| Write-Host "There are $((New-Timespan -end '6/7/2013 9:00:00AM').Days) days until BSidesDetroit." | |
| } |
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
| Invoke-WebRequest 'http://myip.dnsomatic.com' | Select Content |
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-OracleJavaVersion { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(ValueFromPipeline=$true)] | |
| [alias("Computer")] | |
| [string]$ComputerName = "$env:COMPUTERNAME" | |
| ) | |
| begin{ |
OlderNewer