I hereby claim:
- I am jcefoli on github.
- I am jcefoli (https://keybase.io/jcefoli) on keybase.
- I have a public key whose fingerprint is 1EEF B0D8 3F20 F83B 086B 888C CE34 4425 E18C 50B4
To claim this, I am signing this object:
| #Run as Admin | |
| New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisallowShaking" -Value "0" -PropertyType "DWord" |
I hereby claim:
To claim this, I am signing this object:
| # Force TLS 1.2 | |
| [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
| # Basic Auth Credentials | |
| $user = 'changeme' | |
| $pass = 'insecure-password' | |
| # Handle Basic Auth (Hacky in Powershell) | |
| $pair = "$($user):$($pass)" | |
| $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) |
| $message = new-object Net.Mail.MailMessage; | |
| $message.From = "[email protected]"; | |
| $message.To.Add('[email protected]'); | |
| $message.Subject = "Test by Joe"; | |
| $message.Body = "Message body here"; | |
| $smtp = new-object Net.Mail.SmtpClient("smtp.server.local", "25"); | |
| $smtp.send($message); |
| [bool]$isLocked = (Get-ADUser 'username' -Properties LockedOut).LockedOut | |
| if ($isLocked -eq $True) { | |
| Write-Host "Account is locked" | |
| } else { | |
| Write-Host "Account is not locked" | |
| } |
| for ($x = 1; $x -le 100; $x++) { | |
| $Output = "" | |
| if ($x % 3 -eq 0) { $Output += "Fizz" } | |
| if ($x % 5 -eq 0) { $Output += "Buzz" } | |
| if ($Output -eq "") { $Output = $x } | |
| Write-Output $Output | |
| } |
| #Add to end of script | |
| if ($PSSenderInfo) { | |
| #Script was launched remotely. Do Not Pause | |
| } | |
| else { | |
| #Script is running locally, pause | |
| [void](Read-Host 'Press Enter to continue') | |
| } |
| $headers = @{'Accept' = 'application/json'} | |
| $tokenString = "REPLACE-GITHUB-TOKEN-HERE" + ":x-oauth-basic" | |
| $base64Auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(($tokenString))) | |
| $headers.Add('Authorization',"Basic $base64Auth") | |
| $content = Invoke-RestMethod -Uri "https://raw.githubusercontent.com/ORG/Repo/master/something.ps1" -Headers $headers |
| [bool]$isLocked = (Get-ADUser 'username' -Properties LockedOut).LockedOut | |
| if ($isLocked -eq $True) { | |
| Write-Host "Account is locked" | |
| } else { | |
| Write-Host "Account is not locked" | |
| } |
| $host.ui.RawUI.WindowTitle = "Idle Keepalive" | |
| $dotNetCode = @' | |
| [DllImport("kernel32.dll", CharSet = CharSet.Auto,SetLastError = true)] | |
| public static extern void SetThreadExecutionState(uint esFlags); | |
| '@ | |
| $ste = Add-Type -memberDefinition $dotNetCode -name System -namespace Win32 -passThru | |
| $ES_CONTINUOUS = [uint32]"0x80000000" #Requests that the other EXECUTION_STATE flags set remain in effect until SetThreadExecutionState is called again with the ES_CONTINUOUS flag set and one of the other EXECUTION_STATE flags cleared. | |
| $ES_AWAYMODE_REQUIRED = [uint32]"0x00000040" #Requests Away Mode to be enabled. |