Maldocs - Tips For Red Teamers, Didier Stevens
Maldocs - Tips For Red Teamers, Didier Stevens
eu
Classification: Internal
1 Quick intro Office file format
4 Questions
Classification: Internal
Didier Stevens
Senior Analyst, SANS ISC Senior Handler
Classification: Internal
Quick intro Office file format
www.nviso.eu
Classification: Internal
Maldocs: Tips for Red Teamers
www.nviso.eu | 5
Classification: Internal
OOXML: Office Open XML
ZIP + XMLs (+ sometimes a bit more)
www.nviso.eu | 6
Classification: Internal
CFBF: Compound File Binary Format
I like to call this OLE format
.doc, .xls, …
www.nviso.eu | 7
Classification: Internal
www.nviso.eu | 8
Classification: Internal
4 tips for red teamers
www.nviso.eu
Classification: Internal
4 tips for red teamers
1 Analyze your sh+chr(105)+t
Classification: Internal
4 tips for red teamers
1 Analyze your sh+chr(105)+t
Classification: Internal
4 tips for red teamers
1 Analyze your sh+chr(105)+t
Classification: Internal
4 tips for red teamers
1 Analyze your sh+chr(105)+t
Classification: Internal
Examples (with some disclosures)
www.nviso.eu
Classification: Internal
Example 1: the power of strings
Tip 1: Analyze!
www.nviso.eu | 15
Classification: Internal
Example 1: the power of strings
Tip 1: Analyze!
www.nviso.eu | 16
Classification: Internal
Example 1: the power of strings
Tip 1: Analyze!
www.nviso.eu | 17
Classification: Internal
Example 2: limiting the power of strings
Tip 2: Learn!
www.nviso.eu | 18
Classification: Internal
Example 2: limiting the power of strings
Tip 2: Learn!
www.nviso.eu | 19
Classification: Internal
Example 2: limiting the power of strings
Tip 2: Learn!
www.nviso.eu | 20
Classification: Internal
Example 2: limiting the power of strings
Tip 2: Learn!
www.nviso.eu | 21
Classification: Internal
Example 2: limiting the power of strings
Tip 2: Learn!
www.nviso.eu | 22
Classification: Internal
Example 3: very hidden
Tip 3: Use!
www.nviso.eu | 23
Classification: Internal
Example 3: very hidden
Tip 3: Use!
www.nviso.eu | 24
Classification: Internal
Example 3: very hidden
Tip 3: Use!
www.nviso.eu | 25
Classification: Internal
Example 3: very hidden
Tip 3: Use!
www.nviso.eu | 26
Classification: Internal
Example 3: very hidden
Tip 3: Use!
www.nviso.eu | 27
Classification: Internal
Example 3: very hidden
Tip 3: Use!
www.nviso.eu | 28
Classification: Internal
Example 3: very hidden
Tip 3: Use!
https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/cd03cb5f-ca02-4934-a391-bb674cb8aa06
www.nviso.eu | 29
Classification: Internal
Example 3: very hidden
Tip 3: Use!
www.nviso.eu | 30
Classification: Internal
Example 3: very hidden
Tip 3: Use!
www.nviso.eu | 31
Classification: Internal
Example 4: very, very hidden?
Tip 4: Abuse!
www.nviso.eu | 32
Classification: Internal
Example 4: very, very hidden?
Tip 4: Abuse!
www.nviso.eu | 33
Classification: Internal
Example 4: very, very hidden?
Tip 4: Abuse!
www.nviso.eu | 34
Classification: Internal
Example 4: very, very hidden?
Tip 4: Abuse!
www.nviso.eu | 35
Classification: Internal
Example 5: unused bits
Tip 4: Abuse!
www.nviso.eu | 36
Classification: Internal
Example 5: unused bits
Tip 4: Abuse!
www.nviso.eu | 37
Classification: Internal
Example 5: unused bits
Tip 4: Abuse!
www.nviso.eu | 38
Classification: Internal
Example 5: unused bits
Tip 4: Abuse!
www.nviso.eu | 39
Classification: Internal
Example 5: unused bits
Tip 4: Abuse!
www.nviso.eu | 40
Classification: Internal
Example 5: unused bits
Tip 4: Abuse!
www.nviso.eu | 41
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 42
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 43
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 44
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ovba/575462ba-bf67-4190-9fac-c275523c75fc
www.nviso.eu | 45
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 46
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 47
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 48
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 49
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
Alter
Supress
www.nviso.eu | 50
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 51
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 52
Classification: Internal
Example 6: VBA stomping
Tip 2: Learn!
www.nviso.eu | 53
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
Alter
Supress
www.nviso.eu | 54
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
https://blog.nviso.eu/2020/02/25/evidence-of-vba-purging-found-in-malicious-documents/
www.nviso.eu | 55
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
www.nviso.eu | 56
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
www.nviso.eu | 57
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
www.nviso.eu | 58
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
www.nviso.eu | 59
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
www.nviso.eu | 60
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
https://www.virustotal.com/gui/file/b829ef640b3ee2965e25453727598509aff4a461d41ac7d1be56d8c8f917c2c1/detection
www.nviso.eu | 61
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
https://www.virustotal.com/gui/file/e7788fbbf072b34484abe68255a63b8722f0dd406d3f2f68ce956bd92e60e3b6/detection
www.nviso.eu | 62
Classification: Internal
Example 7: VBA purging
Tip 3: Use!
https://www.virustotal.com/gui/file/f44e067e011ab13bddf3e3143ea427090ac07c59dcb434d069bcefb4fe3cb434/detection
www.nviso.eu | 63
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
Alter
Supress
www.nviso.eu | 64
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 65
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ovba/575462ba-bf67-4190-9fac-c275523c75fc
www.nviso.eu | 66
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ovba/575462ba-bf67-4190-9fac-c275523c75fc
www.nviso.eu | 67
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 68
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 69
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 70
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 71
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 72
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 73
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
Launch calc
www.nviso.eu | 74
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 75
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 76
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 77
Classification: Internal
Example 8: Code signing tampering
Tip 4: Abuse!
www.nviso.eu | 78
Classification: Internal
Overview examples
Classification: Internal
4 tips for red teamers
1 Analyze your sh+chr(105)+t
Classification: Internal
More info
https://isc.sans.edu
https://isc.sans.edu/handler_list.html#didier-stevens
https://blog.nviso.eu
https://blog.didierstevens.com
www.nviso.eu
Classification: Internal
Questions?
www.nviso.eu | 82
Classification: Internal
Thank you
www.nviso.eu
Classification: Internal