Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fe6eeb4
Break infinite loops by limiting the # of iterations a while loop can…
kirk-sayre-work Jul 13, 2020
3d7168f
Pull URLs as intermediate IOCs when they show up in analysis.
kirk-sayre-work Jul 30, 2020
43002c6
FIX - Bug in handeling defined names
DissectMalware Sep 24, 2020
e592dbc
Fix - bug in calling convert_ptree_to_str
DissectMalware Sep 24, 2020
89fbce0
FIX - dump json - defined name vals can be Tree objs
DissectMalware Sep 24, 2020
63f5164
FIX - defined name matching
DissectMalware Sep 25, 2020
c42671d
FIX - two minor bugs
DissectMalware Sep 25, 2020
c7ceafa
Fix - bug in get_defined_name and its usage
DissectMalware Sep 30, 2020
428eb95
UPDATE - Added "Project Using XLMMacroDeofuscator"
DissectMalware Sep 30, 2020
af8b519
Update xls_wrapper_2.py
JohnLaTwC Oct 10, 2020
1ff388f
Update deobfuscator.py
JohnLaTwC Oct 10, 2020
e245abe
Merge pull request #59 from JohnLaTwC/patch-4
DissectMalware Oct 10, 2020
0a961de
REFACTOR - using Cell.convert_to_column_name instead of openyxl func
DissectMalware Oct 10, 2020
a20e693
Merge pull request #58 from JohnLaTwC/patch-3
DissectMalware Oct 10, 2020
7a102a7
FIX - defined names are in lower case
DissectMalware Oct 18, 2020
0a9fe14
Brute force emulation of umemulated cells.
kirk-sayre-work Oct 19, 2020
91d4655
Break infinite loops by limiting the # of iterations a while loop can…
kirk-sayre-work Jul 13, 2020
cfa8039
Pull URLs as intermediate IOCs when they show up in analysis.
kirk-sayre-work Jul 30, 2020
fbb5abc
Brute force emulation of umemulated cells.
kirk-sayre-work Oct 19, 2020
fee0cf5
Merge branch 'master' of https://github.com/kirk-sayre-work/XLMMacroD…
kirk-sayre-work Oct 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ xlmdeobfuscator can be executed on any OS to extract and deobfuscate macros in x
Note: if you want to use MS Excel (on Windows), you need to install pywin32 library and use --with-ms-excel switch.
If --with-ms-excel is used, xlmdeobfuscator, first, attempts to load xls files with MS Excel, if it fails it uses [xlrd2 library](https://github.com/DissectMalware/xlrd2).

# Project Using XLMMacroDeofuscator
XLMMacroDeofuscator is adopted in the following projects:
* [CAPE Sandbox](https://github.com/ctxis/CAPE)
* [FAME](https://certsocietegenerale.github.io/fame/)
* [REMNUX](https://remnux.org/)
* [IntlOwl](https://github.com/certego/IntelOwl)

Please contact me if you incorporated XLMMacroDeofuscator in your project.

# How to Contribute
If you found a bug or would like to suggest an improvement, please create a new issue on the [issues page](https://github.com/DissectMalware/XLMMacroDeobfuscator/issues).

Expand Down
24 changes: 24 additions & 0 deletions XLMMacroDeobfuscator/boundsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ def __init__(self):
self.formula = None
self.value = None
self.attributes = {}
self.times_visited = 0
self.emulated = False

def get_attribute(self, attribute_name):
# return default value if attributes doesn't cointain the attribute_name
pass

def visit(self):
self.times_visited += 1

def visited_too_many_times(self):
return (self.times_visited > 1000)

def __deepcopy__(self, memodict={}):
copy = type(self)()
memodict[id(self)] = copy
Expand All @@ -26,6 +34,7 @@ def __deepcopy__(self, memodict={}):
copy.formula = self.formula
copy.value = self.value
copy.attributes = self.attributes
copy.emulated = self.emulated
return copy

def get_local_address(self):
Expand All @@ -34,6 +43,21 @@ def get_local_address(self):
def __str__(self):
return "'{}'!{}".format(self.sheet.name,self.get_local_address())

def debug(self):
"""
Return a string with full details about the cell.
"""
r = ""
r += "Address:\t" + str(self) + "\n"
r += "Sheet:\t\t" + str(self.sheet) + "\n"
r += "Column:\t\t" + str(self.column) + "\n"
r += "Row:\t\t" + str(self.row) + "\n"
r += "Formula:\t" + str(self.formula) + "\n"
r += "Value:\t\t" + str(self.value) + "\n"
r += "Attributes:\t" + str(self.attributes) + "\n"
r += "Emulated:\t" + str(self.emulated) + "\n"
return r

@staticmethod
def convert_to_column_index(s):
number = 0
Expand Down
Loading