{"id":13140,"date":"2026-05-26T04:03:58","date_gmt":"2026-05-26T04:03:58","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2026\/05\/26\/33012\/"},"modified":"2026-05-26T04:03:58","modified_gmt":"2026-05-26T04:03:58","slug":"33012","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2026\/05\/26\/33012\/","title":{"rendered":"Microsoft Access VBA, (Mon, May 25th)"},"content":{"rendered":"<p>    Microsoft Access VBA, (Mon, May 25th)<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>Microsoft Access files (Microsoft Office&#8217;s Database) can contain VBA code.<\/p>\n<p>But they are not ole or OOXML files. You can&#8217;t analyze them with <a href=\"https:\/\/github.com\/DidierStevens\/DidierStevensSuite\/blob\/master\/oledump.py\">oledump.py<\/a>:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/isc.sans.edu\/diaryimages\/images\/20260525-151257.png?ssl=1\" style=\"width: 993px; height: 215px;\"><\/p>\n<p>Neither do they contain an embedded OLE file:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/isc.sans.edu\/diaryimages\/images\/20260525-152941.png?ssl=1\" style=\"width: 993px; height: 215px;\"><\/p>\n<p>Microsoft does not publish official documentation for the Microsoft Access file format, like it does for CFB (ole) and OOXML.<\/p>\n<p>That inspired me to add support for VBA compression to my <a href=\"https:\/\/github.com\/DidierStevens\/DidierStevensSuite\/blob\/master\/search-for-compression.py\">search-for-compression.py<\/a> tool.<\/p>\n<p>search-for-compression.py is a tool that searches through binary files, looking for data that is ZLIB compressed. I&#8217;ve now added the option to search for compressed VBA code too. That is done with option -t:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/isc.sans.edu\/diaryimages\/images\/20260525-155505.png?ssl=1\" style=\"width: 993px; height: 201px;\"><\/p>\n<p>There are 3 entries. The first 2 decompress to binary data (01 00 04 &#8230;). These are similar to dir streams in ole files. dir\u00a0streams specify VBA project properties, project references, and module properties. They can be dumped:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/isc.sans.edu\/diaryimages\/images\/20260525-161133.png?ssl=1\" style=\"width: 993px; height: 527px;\"><\/p>\n<p>The 3th one starts with ASCII data (Attritut). This is VBA code that can be selected and dumped:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/isc.sans.edu\/diaryimages\/images\/20260525-155904.png?ssl=1\" style=\"width: 993px; height: 245px;\"><\/p>\n<p>This example is simple, because it&#8217;s just an empty database that I created for this diary entry.<\/p>\n<p>Real samples are a bit more complex. I&#8217;ll cover some examples in an upcoming diary entry.<\/p>\n<p>\u00a0<\/p>\n<p>Didier Stevens<br \/>\nSenior handler<br \/>\n<a href=\"http:\/\/blog.didierstevens.com\/\">blog.DidierStevens.com<\/a><\/p>\n<p> (c) SANS Internet Storm Center. https:\/\/isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.<\/p><\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><\/p>\n<p> \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/isc.sans.edu\/diary\/rss\/33012\">Go to isc.sans.edu<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Access VBA, (Mon, May 25th) Microsoft Access files (Microsoft Office&#8217;s Database) can contain VBA code. But they are not ole or OOXML files. You can&#8217;t analyze them with oledump.py: Neither do they contain an embedded OLE file: Microsoft does not publish official documentation for the Microsoft Access file format, like it does for CFB [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[69],"class_list":["post-13140","post","type-post","status-publish","format-standard","hentry","category-isc-sans-edu","tag-isc-sans-edu"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/13140"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=13140"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/13140\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=13140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=13140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=13140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}