Check out the new web app!


craXcel-cli (v2.0)

Python command line application to unlock Microsoft Office password protected files.


craxcel-cli-basic

craxcel-cli-list


What is craXcel

craXcel (“crack-cel”) is a tool that makes removing various password protections from Microsoft Office files seemless. It works by directly amending the underlying XML files that make up modern Microsoft Office files.

Please note that craXcel cannot unlock encrypted files.


Supported applications

As of V2.0:

  • Microsoft Excel (workbook, worksheet, vba)
    • .xlsx
    • .xlsm
  • Microsoft Word (modify, format, vba)
    • .docx
    • .docm
  • Microsoft Powerpoint (modify, vba)
    • .pptx
    • .pptm

Others may work, but have not been tested.

Important note on unlocking the VBA project of macro files

Upon unlocking the VBA Project of a Macro Enabled file, that file will state it has encountered issues and needs to recover… DO NOT PANIC, this is normal.

The steps to follow to complete the unlock is as follows:

  1. Open the unlocked file and click ‘Enable Content’ on the warning:

image

  1. Click ‘OK’ on the following pop-up:

image

  1. Open Visual Basic from the Developer toolbar:

image

  1. Open VBAProject Propeties under Tools:

image

  1. Navigate to the Protection tab and enter a new password (a one character password is fine, as we will be removing it again straight away). Click ‘OK’.

image

  1. Head back in to VBAProject Properties > Protection tab, and de-select the ‘Lock project for viewing’ checkbox and clear any passwords in the boxes below. Click ‘OK’.

  2. The modules will now be unlocked and you can save the document without having to repeat these steps.

image

Note to developers: If you’re willing to take on the challenge of automating these steps (preferably without user input mimicking…) you are welcome to contribute!


Installation

Prerequisites

  1. Download and install Python (v3+) (https://www.python.org/downloads/)

Step-by-Step

  1. Clone or download the repository from GitHub to a local folder of your choosing
  2. Open a terminal of your choice (i.e. cmd, powershell, bash)
  3. In the terminal navigate to the folder with craxcel (from step 1)
    • If you’re not familiar with how to do this, search online for: “[name of terminal] change directory”
  4. In the terminal, enter the command: pip install -r requirements.txt
    • If you have trouble, try opening the terminal as an administrator
  5. You are now good to go! Refer to the Usage section below for instructions on how to use craXcel

If You Get Stuckā€¦

Usage

Basic

  1. Open a terminal of your choice (i.e. cmd, powershell, bash)
  2. In the terminal, navigate to the folder with craxcel
  3. In the terminal, enter the command: python craxcel.py yourfilename.xlsx
    • The terminal doesn’t necessarily have to be in the same folder as craxcel, and nor does your file
    • If craxcel is not located in the current directory, simply give the terminal the full path, i.e.:
      • python ‘c:/users/me/downloads/craxcel/craxcel.py’ yourfile.xlsx
    • The same applies in the case of your file, simply give the terminal the full path, i.e.:
      • python craxcel.py ‘c:/users/me/documents/yourfile.xlsx’
    • And you can, of course, combine these for both if required, i.e.:
      • python ‘c:/users/me/downloads/craxcel/craxcel.py’ ‘c:/users/me/documents/yourfile.xlsx’
  4. The unlocked file will be saved in the created ‘unlocked’ folder where the app is installed

List Mode

craXcel also has the ability to unlock multiple files at a time!

  1. Create a .txt file with a line for each filepath (see file-list-example.txt for an example)
  2. Instead of entering the filename of an individual Microsoft Office application, enter the .txt filename
  3. Finish the command by entering ‘–list’, i.e.
    • python craxcel.py ‘c:/users/me/documents/list-of-files.txt’ –list

Options

  • craXcel has several options that can be passed in for more advanced uses, i.e.:
    • Unlock the VBA Project (macro file) of a macro enabled file
      • python craxcel.py yourfile.xlsm –vba
    • Selecting to only remove Workbook protection (leaving Worksheet protection intact)
      • python craxcel.py yourfile.xlsx -wb
    • Selecting to only remove Worksheet protection (leaving Workbook protection intact)
      • python craxcel.py yourfile.xlsx -ws
    • Run without deleting the temporary XML files
      • python craxcel.py yourfile.xlsx –debug
  • For a full list of options, enter the command: python craxcel.py –help

Contribution

If you have a feature you would like to see you can either raise an issue in the GitHub repository, or branch off and give it a go yourself!

GitHub

View Github