Using Bitwise NOT operations to obfuscate commands in PowerShell
malware powershellBitwise NOT commands are often used in PowerShell malware samples to obfuscate commands. A bitwise NOT operation flips all the bits in a given byte sequence.
<#
Bitwise NOT operations will flip all bits
As an example, consider the following:
$byte = 00000101 | binary for 5
Performing a bitwise NOT operation flips all of the bits
$byte = 11111010 | binary for -6 (two's complement)
#>
$dec = 5
-bnot $dec # will print out -6
PowerShell
Read more...