Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Powershell functions used to execute cmdlets without explicitly naming them
- # Author : TDiff
- # Example of usage (using New-Object without naming it by its name) :
- # .(q "1B-60-00-93-3C-FE-59-C5-5C-71-4D-C9-97-1E-5F-B8-69-E9-04-3A") -COM Wscript.Shell
- # Usage of w function :
- # w "Cmdlet-Name"
- # Functions :
- # Get the cmdlet searching names matching a hash
- function q($h){gcm|?{[System.BitConverter]::ToString((New-Object System.Security.Cryptography.SHA1CryptoServiceProvider).ComputeHash([system.Text.Encoding]::UTF8.GetBytes($_.name)))-eq$h}}
- # Get the hash of a cmdlet's name
- function w($h){[System.BitConverter]::ToString((New-Object System.Security.Cryptography.SHA1CryptoServiceProvider).ComputeHash([system.Text.Encoding]::UTF8.GetBytes($h)))}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement