-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MethodInvocationException - Line 686 - Exception calling "Save" with "0" argument(s): "Error saving file C:\Working\canary.xlsx" #1624
Comments
Thank you @robertstrom for the kind words and using the module. It is possible that using the Canary Token generator, it generates a sheet that the DLL that interacts with the writing of the xlsx ends up corrupting it based on fields in the xml that it cannot map. |
@dfinke - understood but curious. I can open the Canary Token Excel file in Excel and add content to it in Excel without issue. Any additional thoughts on why that works but Export-Excel does not? |
Export-Excel depends on older free version of EPPlus. Off the top of my head, there may be fields it is not exporting or stepping on. |
FYI - I tried updating the Excel file using python and I was able to update it but it wiped out the Canary Token functionality. The spreadsheet no longer had the embedded URL. It no longer had the drawings section (as shown in the screenshots) at all. |
Which python pkg? So it seems how the canery tokens aspect is created, Excel proper has no issues, 3rd parties do? |
it wasn't a specific python package. I just found some code and played with it create an Excel file
append to an Excel file
Yes, canary token Excel file is created and you can open it in Excel and add data to it (it is blank when the Canary Token Excel file is created) using Excel and the Canary Token functionality is still there. Modify the Canary Token Excel file using the python code and I can add data to the Excel file but the Canary Token "phone home" (embedded webhook) is gone. Completely removed from the Excel file. |
ok. and ImportExcel corrupts the file when you add add to the canary file. well, you know what they say, canary in the coal mine |
That's the one! 🙂 |
Hello,
Thanks very much for this PowerShell module! It is amazing!
I am currently trying to add data to an existing, blank spreadsheet the was created using the Canary Token generator that can be found here - https://canarytokens.org/nest/generate
Creating one of these gives you a blank spreadsheet that contains a webhook embedded in the spreadsheet. This article has some information on it and links to a Python script that shows the embedded URL - https://neroswarm.com/blog/detecting-canary-tokens-in-office-files. You can also see the information if you use 7-Zip to view the contents of the Excel file.
Using 7-Zip, you can see that this is where the Canary Token information is stored in the Excel file
When you view that file you can see the embedded WebHook URL
I am trying to add content to the blank sheet1 using the code below, where canary.xlsx is the name of the spreadsheet that was generated by the Canary Token website.
When running the commands above I get the error shown below:
I can run the commands above to create a new spreadsheet without issue. I can create a new blank spreadsheet in Excel and then append the data to it without issue but I have found no way to append data to the spreadsheet that is created with the Canary Token embedded in it.
I'm looking for a scripted way to be able to populate the data into a bunch of these Canary Token spreadsheets.
Any assistance in helping me to accomplish this would be very much appreciated.
Thanks very much!
The text was updated successfully, but these errors were encountered: