Closed malicious-user closed 3 years ago
@malicious-user
To read the binary file,you should use this:
[System.IO.File]::ReadAllBytes('$fileName')
not get-content $fileName
Hi, can you please explain how I should use the gzip compressed after i get the base64 string?
The question is regarding the" executes mimikatz.xml" template. I first base64 the executable I want to load, as follows.
"$fileName = "executable" $fileContent = get-content $fileName $fileContentBytes = [System.Text.Encoding]::UTF8.GetBytes($fileContent) $fileContentEncoded = [System.Convert]::ToBase64String($fileContentBytes) $fileContentEncoded | set-content ($fileName + ".b64")"
Then, I understand that I should gzip compress the base64 string above. (Am I correct?)
Finally, I copy paste the gzip compressed string but I always get " error MSB4018: System.IO.EndOfStreamException: Unable to read beyond the end of the stream.\r"
Can you please describe how you create the compressed exe?