Base64 Encoding/Decoding - Windows Basic Authorization (NTLM)

Sometimes during a wireshark or sniffer network capture you will come across communication where the windows system will use Basic Authorization to authenticate to the windows domain. This often looks like "Proxy-Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=". This happens to be authentication to a proxy server.

Here is a simple command line perl to decode the base64 encoded username and password:

perl -e 'use MIME::Base64; $data = decode_base64("dXNlcm5hbWU6cGFzc3dvcmQ="); print "Encoded $data\n";'

And if for some reason you want to do a base64 encoding:

perl -e 'use MIME::Base64; $data = encode_base64("username:password"); print "Encoded $data\n";'
Encoded dXNlcm5hbWU6cGFzc3dvcmQ=

Trackback URL for this post:

http://www.liberterra.com/trackback/40