Skip to content

Instantly share code, notes, and snippets.

@Karneades
Last active May 24, 2021 09:31
Show Gist options
  • Save Karneades/38cce20ca960da821c7b091c9d9f93fa to your computer and use it in GitHub Desktop.
Save Karneades/38cce20ca960da821c7b091c9d9f93fa to your computer and use it in GitHub Desktop.

Revisions

  1. Karneades revised this gist Apr 7, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ps-decody.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # Karneades (2019)
    # CyberChef recipe: https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true)Remove_null_bytes()

    import sys
  2. Karneades created this gist Apr 7, 2019.
    15 changes: 15 additions & 0 deletions ps-decody.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # CyberChef recipe: https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true)Remove_null_bytes()

    import sys
    from base64 import b64encode,b64decode

    if len(sys.argv) < 2:
    print ("Usage: python3 ps-decode.py <encodedCommand>")
    sys.exit(-1)

    encodedCommand = sys.argv[1]

    try:
    print (b64decode(encodedCommand).decode('UTF-16LE'))
    except Exception as e:
    print (str(e))