Converting commands to Powershell compatible encoded strings for dummies

1 · byt3bl33d3r · July 1, 2015, 3:18 a.m.
This is basically a reminder for me but could be useful for anyone. I keep forgetting how to convert commands to a Powershell compatible encoded string: From the command line: echo "iex(command)" | iconv --to-code UTF-16LE | base64 -w 0 For Python: from base64 import b64encode b64encode('iex(command)'.encode('UTF-16LE …...