Skip to content

Instantly share code, notes, and snippets.

@0xDing
Created January 2, 2019 08:05
Show Gist options
  • Save 0xDing/93bfe620870eb31d9c22864287f10257 to your computer and use it in GitHub Desktop.
Save 0xDing/93bfe620870eb31d9c22864287f10257 to your computer and use it in GitHub Desktop.
Decrypt Office 2003
#!/usr/bin/env bash
echo -n $'\E[31m'
echo $''
echo $' _,.'
echo $' ,` -.)'
echo $' \'( _/\'-\\\\-.'
echo $' /,|`--._,-^| ,'
echo $' \\_| |`-._/|| ,\'|'
echo $' | `-, / | / /'
echo $' | || | / /'
echo $' `r-._||/ __ / /'
echo $' __,-<_ )`-/ `./ /'
echo $'\' \\ `---\' \\ / /'
echo $' | |./ /'
echo $' / // /'
echo $'\\_/\' \\ |/ /'
echo $' | | _,^-\'/ /'
echo $' | , `` (\\/ /_'
echo $' \\,.->._ \\X-=/^'
echo $' ( / `-._//^`'
echo $' `Y-.____(__}'
echo $' | {__)'
echo $' ()`'
echo -n $'\E[32m'
echo '======================================'
echo '=== Office 2003 Password Decrypter ==='
echo '=== [email protected] ==='
echo '======================================'
echo -n $'\E[0m'
MASK="$1"
FILE="$2"
if [ $# -ne 2 ]; then
echo -n $'\E[31m'
echo "[Bad argument]"
echo "USAGE ./decrypt.sh [MASK OR OPT] [FILE]."
echo -n $'\E[33m'
echo "example: ./decrypt.sh '-i --increment-min 1 --increment-max 8 ?d?d?d?d?d?d?d?d' ~/Downloads/1.doc" && exit 1
fi
O2J="./office2john.py"
TMP="$FILE-hash.tmp"
rm -rf $TMP
echo "Hash info is saved on $TMP"
$("$O2J" "$FILE" > $TMP)
echo -n $'\E[32m'
echo '======================================'
echo '==== Decrypting..... ===='
echo '======================================'
echo -n $'\E[0m'
hashcat -m 9700 $TMP -a 3 $MASK
echo -n $'\E[32m'
echo '======================================'
echo '==== The password may be: ===='
echo '======================================'
echo -n $'\E[0m'
hashcat --show -m 9700 $TMP -a 3 $MASK | tr ":" "\n" | gsed '1d'
#!/bin/bash -x
if ! command -v brew > /dev/null; then
printf "${LIGHT_GREEN}Homebrew not installed! ${GOLD}Installing Homebrew...\n"
ruby -e "$(curl --location --fail --silent --show-error https://raw.githubusercontent.com/Homebrew/install/master/install)"
export PATH="/usr/local/bin:$PATH"
printf "export PATH=\"/usr/local/bin:$PATH\"\n" >> $HOME/.bash_profile
else
printf "$NORMAL${LIGHT_GREEN}Homebrew installed.\n"
fi
brew install gnu-sed
brew install hashcat
wget https://raw.githubusercontent.com/magnumripper/JohnTheRipper/bleeding-jumbo/run/office2john.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment