Traverse Security Boundaries using Base64 Encoding

2011-08-03 by Administrator, tagged as microsoft, security, software

I often have the issue that I want to send binary code to a friend sitting behind filtering mechanisms that block a lot of content. In most cases I found a workaround base64 encoding the content and sending it either directly in the body of the mail or as simple text attachment. I even managed to get code onto a system that allowed read access to an USB stick but would not allow to copy to or from the stick. I just did cut'n'paste of the base64 content, decoded it and off it went.

Luckily, certutil.exe is part of Windows 7 and there is no need for more. I create a dead simple batch and put it on my desktop. I then simply drag'n'drop the file to be encoded onto the icon and have it saved right beside it. For convenience I also open it inside Notepad.

@ECHO OFF
certutil -f -encode "%1" "%~f1.enc"
notepad "%~f1.enc"

Stay tuned for the decodeing part...

...and here we go:

@ECHO OFF
certutil -f -decode "%1" "%~dpn1"