Skip to content

Instantly share code, notes, and snippets.

@elgrunt0
elgrunt0 / Detect-vulnerablelog4j.ps1
Last active June 1, 2022 09:32
Search all drives for log4j*.jar and compare hash against list of known vulnerable hashes. Write to custom eventlog and output Vulnerable/Compliant. Works as MECM Script. Can be used for CI/CB but prone to timeout
#Create custom event log
#------------------------------------------------------------
function Create-CustomEventLog {
param ($logname)
if (!(Get-EventLog -List | Where-Object {$_.LogDisplayName -eq $logname})) {
New-EventLog -LogName $logname -Source $logname
Limit-EventLog -LogName $logname -OverflowAction OverwriteAsNeeded -MaximumSize 20MB
Write-EventLog -LogName $logname -Source $logname -Message "Event log created. When writing to this event log, use the source: $logname" -EventId 0 -EntryType Information
}
}
Add-Type -AssemblyName System.speech
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$speak.Speak("You don't know the power of the darkside")
[Console]::beep(440,500)
[Console]::beep(440,500)
[Console]::beep(440,500)
[Console]::beep(349,350)
[Console]::beep(523,150)
@elgrunt0
elgrunt0 / .PSADT Cheatsheet
Last active June 12, 2020 07:23 — forked from leeramsay/PSADT-Cheatsheet.ps1
PSADT snippits/cheatsheet
.
@elgrunt0
elgrunt0 / publickey-git-error.markdown
Created October 23, 2019 21:57 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th