Tuesday, March 11, 2014

Another Hex to ASCII Deobfuscator

#!/bin/bash

# Written: December 2012
# Modified: March 2014

# This program is built to decode hex to ASCII text
# The program takes what it is given at the command line and then decodes it...

testInput=$1

# echo $testInput -- If you echo it will read the string from the command line
# cat $testInput -- Takes the filename and decodes it
cat $testInput | sed 's/\\x20/ /g' | \
        sed 's/\\x21/!/g' | sed 's/\\x22/"/g' | sed 's/\\x23/#/g' | sed 's/\\x24/$/g' | \
        sed 's/\\x25/\\x/g' | sed 's/\\x26/&/g' | sed "s/\\x27/'/g" | sed 's/\\x28/(/g' | \
        sed 's/\\x29/)/g' | sed 's/\\x2A/*/g' | sed 's/\\x2B/+/g' | sed 's/\\x2C/,/g' | \
        sed 's/\\x2D/-/g' | sed 's/\\x2E/./g' | sed 's/\\x2F/\//g' | sed 's/\\x30/0/g' | \
        sed 's/\\x31/1/g' | sed 's/\\x32/2/g' | sed 's/\\x33/3/g' | sed 's/\\x34/4/g' | \
        sed 's/\\x35/5/g' | sed 's/\\x36/6/g' | sed 's/\\x37/7/g' | sed 's/\\x38/8/g' | \
        sed 's/\\x39/9/g' | sed 's/\\x3A/:/g' | sed 's/\\x3B/;/g' | sed 's/\\x3C/</g' | \
        sed 's/\\x3D/=/g' | sed 's/\\x3E/>/g' | sed 's/\\x3F/?/g' | sed 's/\\x40/@/g' | \
        sed 's/\\x41/A/g' | sed 's/\\x42/B/g' | sed 's/\\x43/C/g' | sed 's/\\x44/D/g' | \
        sed 's/\\x45/E/g' | sed 's/\\x46/F/g' | sed 's/\\x47/G/g' | sed 's/\\x48/H/g' | \
        sed 's/\\x49/I/g' | sed 's/\\x4A/J/g' | sed 's/\\x4B/K/g' | sed 's/\\x4C/L/g' | \
        sed 's/\\x4D/M/g' | sed 's/\\x4E/N/g' | sed 's/\\x4F/O/g' | sed 's/\\x50/P/g' | \
        sed 's/\\x51/Q/g' | sed 's/\\x52/R/g' | sed 's/\\x53/S/g' | sed 's/\\x54/T/g' | \
        sed 's/\\x55/U/g' | sed 's/\\x56/V/g' | sed 's/\\x57/W/g' | sed 's/\\x58/X/g' | \
        sed 's/\\x59/Y/g' | sed 's/\\x5A/Z/g' | sed 's/\\x5B/[/g' | sed 's/\\x5C/\\/g' | \
        sed 's/\\x5D/]/g' | sed 's/\\x5E/^/g' | sed 's/\\x5F/_/g' | sed 's/\\x60/`/g' | \
        sed 's/\\x61/a/g' | sed 's/\\x62/b/g' | sed 's/\\x63/c/g' | sed 's/\\x64/d/g' | \
        sed 's/\\x65/e/g' | sed 's/\\x66/f/g' | sed 's/\\x67/g/g' | sed 's/\\x68/h/g' | \
        sed 's/\\x69/i/g' | sed 's/\\x6A/j/g' | sed 's/\\x6B/k/g' | sed 's/\\x6C/l/g' | \
        sed 's/\\x6D/m/g' | sed 's/\\x6E/n/g' | sed 's/\\x6F/o/g' | sed 's/\\x70/p/g' | \
        sed 's/\\x71/q/g' | sed 's/\\x72/r/g' | sed 's/\\x73/s/g' | sed 's/\\x74/t/g' | \
        sed 's/\\x75/u/g' | sed 's/\\x76/v/g' | sed 's/\\x77/w/g' | sed 's/\\x78/x/g' | \
        sed 's/\\x79/y/g' | sed 's/\\x7A/z/g' | sed 's/\\x7B/{/g' | sed 's/\\x7C/|/g' | \
        sed 's/\\x7D/}/g' | sed 's/\\x7E/~/g' | sed 's/\\x0A/\n/g'

No comments:

Post a Comment

Powershell - Gather Mapped Drives from a List of Computer Names

I created the following Powershell script to gather remotely the mapped drives that users had in their profiles.  I had to create the script...