ruby

So we have found the base64 string “SGVsbG9Xb3JsZCE=” on a locked down workstation and we want to decode. Quite often we don’t have access to tools so here’s a list of ways to decode the string using various languages.

Python

12>>> import base64 >>> base64.b64decode("SGVsbG9Xb3JsZCE=")

PowerShell

12PS > [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("SGVsbG9Xb3JsZCE=")) blahblah

Perl

12use MIME::Base64; print decode_base64("SGVsbG9Xb3JsZCE=");

BASH

1echo SGVsbG9Xb3JsZCE= | base64 --decode

php

1echo base64_decode("SGVsbG9Xb3JsZCE=");

C#

12byte[] data = Convert.FromBase64String("SGVsbG9Xb3JsZCE=");… Continue reading

So, when you don’t have metasploit or ruby in your environment and you need to run pattern_create.rb what do you do?

Well if you’ve got Python available you simply rewrite the code in python.

Here’s the code (it’s used in exactly the same way as the metasploit version of pattern create):

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#!/usr/bin/env python # Author: phillips321 # Site: www.phillips321.co.uk # Version 0.1 # Credits: metasploit project # About: Replicates msf… Continue reading