The password is not used to encrypt the content of the VBA project, it is just used as protection by the VBA IDE: when the password is set, you will be prompted for the password. Tools like oledump. This data encryption is done according to an algorithm that does not use a secret key. I wrote an oledump. The following are interessting from my point of view: either for obfuscation or my difficuties to analyse:. PPT, the ony one of a serious with good obfuscation 9bddffe62da33bcbe77cb4fce5ea14f98c2dfa Comment by No anonym — Friday 24 July Hi, This is absolutely amazing work, I was wondering whether you have written or know of a way to do the same with MS Access?
Comment by Didier Stevens — Saturday 6 March Comment by shigari — Sunday 23 May RSS feed for comments on this post. TrackBack URI. You are commenting using your WordPress. The file created in Excel with the extension for visual basic that also contains the visual basic code can be used for adding functionality to the Office Suite.
Yet, there are chances, that users may forget the password and are now trying crack VBA project password in Excel. How is it possible though? Well, there are a lot of techniques for this task.
We will be explaining some of the most useful ones that a user can take under consideration. It is a smart utility that can remove VBA password protection. There are going to be manual methods that we have here, but before learning the steps, you shall know the pre-requisites of these approaches:.
Now, you have to extract the vbaproject. In this window, set a new password in the Protection tab and hit OK. Exit the file and open it again. Enter the new password and you will be able to open the required VBA file. This workaround has the capability to bypass the project password simply by swapping it.
Using HxD, there is a counter tracking how much file you're selecting. Copy starting from CMG until the counter reads 8F hex for and likewise when pasting into the locked file - I ended up with twice the number of " I don't know if it is crucial, but I made sure I shut both the hex editor and excel down before reopening the file in Excel.
I then had to go through the menus to open the VB Editor, into VBProject Properties and entered in the 'new' password to unlock the code. ElcomSoft makes Advanced Office Password Breaker and Advanced Office Password Recovery products which may apply to this case, as long as the document was created in Office or prior. My tool, VbaDiff , reads VBA directly from the file, so you can use it to recover protected VBA code from most office documents without resorting to a hex editor.
The accepted answer didn't work in Excel on Windows Found out the extra steps we need to take to see the locked macro. I am summarizing the steps. Open the file in excel - you may receive a couple of error notifications, just click through them. The protection is a simple text comparison in Excel. Load Excel in your favourite debugger Ollydbg being my tool of choice , find the code that does the comparison and fix it to always return true, this should let you access the macros.
For Excel bit on a Windows 10 machine, I have used a hex editor to be able to change the password of a protected xla have not tested this for any other extensions. Tip: create a backup before you do this. The truth is that the code files for most macro-enabled Office documents are not encrypted and the password only prevents opening the project with Office programs. This means that, as other answers suggested, you can usually use an Office alternative to access and edit the file.
However, if you just need access to the code, you can use a tool like oledump. This is useful for malware analysis, as well as getting most of the code from the file so that you don't have to start from scratch if you forget the password. In addition, many excel files dynamically set the password when the file is opened. This means that if you can read the code, you can usually find the password in plaintext or de-obfuscate it.
I usually combine this with a loop to extract all files to a folder. This quick PowerShell script will extract all streams in most files:. And open it in notepad.
After extracting VBA scripts from. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 12 years, 6 months ago. Active yesterday. Viewed 1. Is there a way of removing or cracking the password on a VBA project? Jonathan Sayce Jonathan Sayce 8, 4 4 gold badges 36 36 silver badges 48 48 bronze badges.
Are you able to Save-As an. Not sure if this would make a difference. Fandango68 This question was discussed years ago on meta. TLDR: Lots most? There are plenty of legitimately legal and ethical reasons to crack a VBA password. Additionally, discussing weaknesses of the current systems ultimately contributes to better security in the future and discourages people from blindly relying on insecure systems now.
Add a comment. Active Oldest Votes. Tested and works on: Excel Excel Excel - 32 bit version Excel - 32 bit version Looking for 64 bit version? See this answer How it works I will try my best to explain how it works - please excuse my English.
The VBE will call a system function to create the password dialog box. If user enters the right password and click OK, this function returns 1.
If user enters the wrong password or click Cancel, this function returns 0. After the dialog box is closed, the VBE checks the returned value of the system function if this value is 1, the VBE will "think" that the password is right, hence the locked VBA project will be opened. The code below swaps the memory of the original function used to display the password dialog with a user defined function that will always return 1 when being called.
Using the code Please backup your files first! Chris you are absolutely right. Because the Windows API functions are defined for win 32 in this code. Some explanation would be nice of how this is working.
Now the only question left after seeing this impressive method works perfectly , is how the hell can I make my VBA project protected stronger to prevent others from using this hack on it : — Omer Greenwald. This code works perfectly in unlocking the VBA code although each time I have used this it prevents me from re-protecting the project with a different password, has anyone else had this problem?
At this point, I could save file as xlsm with my own password on the VBA project. Show 18 more comments. Step by step example: Create a new simple excel file. In the VBA part, set a simple password say - Save the file and exit. Then check the file size - see Stewbob's gotcha Open the file you just created with a hex editor.
Save the excel file and exit. Now, open the excel file you need to see the VBA code in. The password for the VBA code will simply be as in the example I'm showing here. Community Bot 1 1 1 silver badge. Colin Pickard Colin Pickard In the blank excel file, or the locked one? Check the file size of the blank file. If its the locked file, make sure your backup is safe, then try changing just the other two lines.
You sure it's encrypted file? Excel password protection and file format is radically different than Excel I included some specifics about it in my answer below. In my opinion, the password protected option on an Excel file is the first time in Microsoft Office history that they have produced a reasonably secure file.
I wasn't able to set vba password on an excel new file. Could someone simply share the HEX to replace with ? Or can it change from machine to machine? This approach worked for me on a. I saved it as a. It should be noted you can safely increase the length of the file if the new CMG Show 8 more comments.
Open the file s that contain your locked VBA Projects. I am not sure why but when I run this on Excel for MSP bit excel crashes, it closes the files and when I restart it, the password is still there. This cannot be done in excel anymore as the options in the context menu is grayed out so you cannot create the module.
It seems super-smart.
0コメント