#!/usr/bin/perl # Decrypt Oracle Toplink Mapping WorkBench passwords. # Author: Martin (broadcast@mail.ptraced.net) # Version 2 - Code cleanup and modifications by ps (ps@brokethe.net) # # Thanks to Martin for allowing me to host this script on my site # please send corrections - improvements to pete@petefinnigan.com for # inclusion here and directly to Martin $string = "A7FCAA504BA7E4FC"; sub usage { print " Usage: $0 \n"; } if ($#ARGV != 0) { usage(); } else { $encrypted = $ARGV[0]; $encrypted =~ s/$string$/ / or die ("Invalid Password\n"); $chars = (length($encrypted) / 2) - 1; $enc2 = substr($encrypted,0,2); $encrypted = substr($encrypted,2,length($encrypted) - 2); for($i = 0; $chars >= $i; $i++) { $int = hex($enc2); if (($i%2) == 1) { $result .= chr($int - ( ($i + 1 )/3 ) - 112); } else { $result .= chr($int - 4 + $i); } $enc2 = substr($encrypted,0,2); $encrypted = substr($encrypted,2,length($encrypted) - 2); } print "$result\n"; }