Commit 0c345ef569f59cc800ad7b5fcba8d83bd48a4234

Authored by decalage2
1 parent d02c8456

updated doc and setup.py for v0.50

oletools/README.html
... ... @@ -9,12 +9,19 @@
9 9 </head>
10 10 <body>
11 11 <h1 id="python-oletools">python-oletools</h1>
12   -<p><a href="http://www.decalage.info/python/oletools">python-oletools</a> is a package of python tools to analyze <a href="http://en.wikipedia.org/wiki/Compound_File_Binary_Format">Microsoft OLE2 files</a> (also called Structured Storage, Compound File Binary Format or Compound Document File Format), such as Microsoft Office documents or Outlook messages, mainly for malware analysis, forensics and debugging. It is based on the <a href="http://www.decalage.info/olefile">olefile</a> parser. See <a href="http://www.decalage.info/python/oletools">http://www.decalage.info/python/oletools</a> for more info.</p>
  12 +<p><a href="http://www.decalage.info/python/oletools">oletools</a> is a package of python tools to analyze <a href="http://en.wikipedia.org/wiki/Compound_File_Binary_Format">Microsoft OLE2 files</a> (also called Structured Storage, Compound File Binary Format or Compound Document File Format), such as Microsoft Office documents or Outlook messages, mainly for malware analysis, forensics and debugging. It is based on the <a href="http://www.decalage.info/olefile">olefile</a> parser. See <a href="http://www.decalage.info/python/oletools">http://www.decalage.info/python/oletools</a> for more info.</p>
13 13 <p><strong>Quick links:</strong> <a href="http://www.decalage.info/python/oletools">Home page</a> - <a href="https://github.com/decalage2/oletools/wiki/Install">Download/Install</a> - <a href="https://github.com/decalage2/oletools/wiki">Documentation</a> - <a href="https://github.com/decalage2/oletools/issues">Report Issues/Suggestions/Questions</a> - <a href="http://decalage.info/contact">Contact the Author</a> - <a href="https://github.com/decalage2/oletools">Repository</a> - <a href="https://twitter.com/decalage2">Updates on Twitter</a></p>
14 14 <p>Note: python-oletools is not related to OLETools published by BeCubed Software.</p>
15 15 <h2 id="news">News</h2>
16 16 <ul>
17   -<li><strong>2016-06-10 v0.47</strong>: <a href="https://github.com/decalage2/oletools/wiki/olevba">olevba</a> added PPT97 macros support, improved handling of malformed/incomplete documents, improved error handling and JSON output, now returns an exit code based on analysis results, new --relaxed option. <a href="https://github.com/decalage2/oletools/wiki/rtfobj">rtfobj</a>: improved parsing to handle obfuscated RTF documents, added -d option to set output dir. Moved repository and documentation to GitHub.</li>
  17 +<li><strong>2016-10-?? v0.50 (development version)</strong>: most tools now support python 2 and 3.
  18 +<ul>
  19 +<li>olevba: Several bugfixes and improvements.</li>
  20 +<li>mraptor: improved detection, added mraptor_milter for Sendmail/Postfix integration.</li>
  21 +<li>rtfobj: brand new RTF parser, obfuscation-aware, improved display, detect executable files in OLE Package objects.</li>
  22 +<li>setup: now creates handy command-line scripts to run oletools from anywhere.</li>
  23 +</ul></li>
  24 +<li>2016-06-10 v0.47: <a href="https://github.com/decalage2/oletools/wiki/olevba">olevba</a> added PPT97 macros support, improved handling of malformed/incomplete documents, improved error handling and JSON output, now returns an exit code based on analysis results, new --relaxed option. <a href="https://github.com/decalage2/oletools/wiki/rtfobj">rtfobj</a>: improved parsing to handle obfuscated RTF documents, added -d option to set output dir. Moved repository and documentation to GitHub.</li>
18 25 <li>2016-04-19 v0.46: <a href="https://github.com/decalage2/oletools/wiki/olevba">olevba</a> does not deobfuscate VBA expressions by default (much faster), new option --deobf to enable it. Fixed color display bug on Windows for several tools.</li>
19 26 <li>2016-04-12 v0.45: improved <a href="https://github.com/decalage2/oletools/wiki/rtfobj">rtfobj</a> to handle several <a href="http://www.decalage.info/rtf_tricks">anti-analysis tricks</a>, improved <a href="https://github.com/decalage2/oletools/wiki/olevba">olevba</a> to export results in JSON format.</li>
20 27 <li>2016-03-11 v0.44: improved <a href="https://github.com/decalage2/oletools/wiki/olevba">olevba</a> to extract and analyse strings from VBA Forms.</li>
... ... @@ -51,6 +58,8 @@
51 58 <li><a href="https://github.com/decalage2/oletools/wiki/rtfobj">rtfobj</a>: to extract embedded objects from RTF files.</li>
52 59 <li>and a few others (coming soon)</li>
53 60 </ul>
  61 +<h2 id="projects-using-oletools">Projects using oletools:</h2>
  62 +<p>oletools are used by a number of projects and online malware analysis services, including <a href="http://viper.li/">Viper</a>, <a href="https://remnux.org/">REMnux</a>, <a href="https://www.hybrid-analysis.com/">Hybrid-analysis.com</a>, <a href="https://www.document-analyzer.net/">Joe Sandbox</a>, <a href="https://sandbox.deepviz.com/">Deepviz</a>, <a href="https://github.com/lmco/laikaboss">Laika BOSS</a>, <a href="https://github.com/cuckoosandbox/cuckoo">Cuckoo Sandbox</a>, <a href="https://sandbox.anlyz.io/">Anlyz.io</a>, <a href="https://github.com/bontchev/pcodedmp">pcodedmp</a> and probably <a href="https://www.virustotal.com">VirusTotal</a>. (Please <a href="(http://decalage.info/contact)">contact me</a> if you have or know a project using oletools)</p>
54 63 <h2 id="download-and-install">Download and Install:</h2>
55 64 <p>To use python-oletools from the command line as analysis tools, you may simply <a href="https://github.com/decalage2/oletools/releases">download the latest release archive</a> and extract the files into the directory of your choice.</p>
56 65 <p>You may also download the <a href="https://github.com/decalage2/oletools/archive/master.zip">latest development version</a> with the most recent features.</p>
... ...
oletools/README.rst
1 1 python-oletools
2 2 ===============
3 3  
4   -`python-oletools <http://www.decalage.info/python/oletools>`__ is a
5   -package of python tools to analyze `Microsoft OLE2
  4 +`oletools <http://www.decalage.info/python/oletools>`__ is a package of
  5 +python tools to analyze `Microsoft OLE2
6 6 files <http://en.wikipedia.org/wiki/Compound_File_Binary_Format>`__
7 7 (also called Structured Storage, Compound File Binary Format or Compound
8 8 Document File Format), such as Microsoft Office documents or Outlook
... ... @@ -26,7 +26,18 @@ Software.
26 26 News
27 27 ----
28 28  
29   -- **2016-06-10 v0.47**:
  29 +- **2016-10-?? v0.50 (development version)**: most tools now support
  30 + python 2 and 3.
  31 +
  32 + - olevba: Several bugfixes and improvements.
  33 + - mraptor: improved detection, added mraptor\_milter for
  34 + Sendmail/Postfix integration.
  35 + - rtfobj: brand new RTF parser, obfuscation-aware, improved display,
  36 + detect executable files in OLE Package objects.
  37 + - setup: now creates handy command-line scripts to run oletools from
  38 + anywhere.
  39 +
  40 +- 2016-06-10 v0.47:
30 41 `olevba <https://github.com/decalage2/oletools/wiki/olevba>`__ added
31 42 PPT97 macros support, improved handling of malformed/incomplete
32 43 documents, improved error handling and JSON output, now returns an
... ... @@ -152,6 +163,23 @@ Tools in python-oletools:
152 163 extract embedded objects from RTF files.
153 164 - and a few others (coming soon)
154 165  
  166 +Projects using oletools:
  167 +------------------------
  168 +
  169 +oletools are used by a number of projects and online malware analysis
  170 +services, including `Viper <http://viper.li/>`__,
  171 +`REMnux <https://remnux.org/>`__,
  172 +`Hybrid-analysis.com <https://www.hybrid-analysis.com/>`__, `Joe
  173 +Sandbox <https://www.document-analyzer.net/>`__,
  174 +`Deepviz <https://sandbox.deepviz.com/>`__, `Laika
  175 +BOSS <https://github.com/lmco/laikaboss>`__, `Cuckoo
  176 +Sandbox <https://github.com/cuckoosandbox/cuckoo>`__,
  177 +`Anlyz.io <https://sandbox.anlyz.io/>`__,
  178 +`pcodedmp <https://github.com/bontchev/pcodedmp>`__ and probably
  179 +`VirusTotal <https://www.virustotal.com>`__. (Please `contact
  180 +me <(http://decalage.info/contact)>`__ if you have or know a project
  181 +using oletools)
  182 +
155 183 Download and Install:
156 184 ---------------------
157 185  
... ...
oletools/doc/Contribute.html
... ... @@ -10,8 +10,8 @@
10 10 <body>
11 11 <h1 id="how-to-suggest-improvements-report-issues-or-contribute">How to Suggest Improvements, Report Issues or Contribute</h1>
12 12 <p>This is a personal open-source project, developed on my spare time. Any contribution, suggestion, feedback or bug report is welcome.</p>
13   -<p>To <strong>suggest improvements, report a bug or any issue</strong>, please use the <a href="https://github.com/decalage2/oletools/issues">issue reporting page</a>, providing all the information and files to reproduce the problem.</p>
14   -<p>You may also <a href="http://decalage.info/contact">contact the author</a> directly to <strong>provide feedback</strong>.</p>
  13 +<p>To <strong>suggest improvements, report a bug or any issue</strong>, please use the <a href="https://github.com/decalage2/oletools/issues">issue reporting page</a>, and provide all the information and files to reproduce the problem.</p>
  14 +<p>You may also <a href="http://decalage.info/contact">contact the author</a> directly to <strong>send feedback</strong>.</p>
15 15 <p>The code is available in <a href="https://github.com/decalage2/oletools">a repository on GitHub</a>. You may use it to <strong>submit enhancements</strong> using forks and pull requests.</p>
16 16 <hr />
17 17 <h2 id="python-oletools-documentation">python-oletools documentation</h2>
... ...
oletools/doc/Contribute.md
1 1 How to Suggest Improvements, Report Issues or Contribute
2 2 ========================================================
3 3  
4   -This is a personal open-source project, developed on my spare time. Any contribution, suggestion, feedback or bug report is welcome.
  4 +This is a personal open-source project, developed on my spare time.
  5 +Any contribution, suggestion, feedback or bug report is welcome.
5 6  
6   -To **suggest improvements, report a bug or any issue**, please use the [issue reporting page](https://github.com/decalage2/oletools/issues),
7   -providing all the information and files to reproduce the problem.
  7 +To **suggest improvements, report a bug or any issue**,
  8 +please use the [issue reporting page](https://github.com/decalage2/oletools/issues),
  9 +and provide all the information and files to reproduce the problem.
8 10  
9   -You may also [contact the author](http://decalage.info/contact) directly to **provide feedback**.
  11 +You may also [contact the author](http://decalage.info/contact) directly
  12 +to **send feedback**.
10 13  
11 14 The code is available in [a repository on GitHub](https://github.com/decalage2/oletools).
12 15 You may use it to **submit enhancements** using forks and pull requests.
... ...
oletools/doc/Home.html
... ... @@ -8,7 +8,7 @@
8 8 <style type="text/css">code{white-space: pre;}</style>
9 9 </head>
10 10 <body>
11   -<h1 id="python-oletools-v0.47-documentation">python-oletools v0.47 documentation</h1>
  11 +<h1 id="python-oletools-v0.50-documentation">python-oletools v0.50 documentation</h1>
12 12 <p>This is the home page of the documentation for python-oletools. The latest version can be found <a href="https://github.com/decalage2/oletools/wiki">online</a>, otherwise a copy is provided in the doc subfolder of the package.</p>
13 13 <p><a href="http://www.decalage.info/python/oletools">python-oletools</a> is a package of python tools to analyze <a href="http://en.wikipedia.org/wiki/Compound_File_Binary_Format">Microsoft OLE2 files</a> (also called Structured Storage, Compound File Binary Format or Compound Document File Format), such as Microsoft Office documents or Outlook messages, mainly for malware analysis, forensics and debugging. It is based on the <a href="http://www.decalage.info/olefile">olefile</a> parser. See <a href="http://www.decalage.info/python/oletools">http://www.decalage.info/python/oletools</a> for more info.</p>
14 14 <p><strong>Quick links:</strong> <a href="http://www.decalage.info/python/oletools">Home page</a> - <a href="https://github.com/decalage2/oletools/wiki/Install">Download/Install</a> - <a href="https://github.com/decalage2/oletools/wiki">Documentation</a> - <a href="https://github.com/decalage2/oletools/issues">Report Issues/Suggestions/Questions</a> - <a href="http://decalage.info/contact">Contact the Author</a> - <a href="https://github.com/decalage2/oletools">Repository</a> - <a href="https://twitter.com/decalage2">Updates on Twitter</a></p>
... ...
oletools/doc/Home.md
1   -python-oletools v0.47 documentation
  1 +python-oletools v0.50 documentation
2 2 ===================================
3 3  
4 4 This is the home page of the documentation for python-oletools. The latest version can be found
... ...
oletools/doc/Install.html
... ... @@ -10,24 +10,39 @@
10 10 <body>
11 11 <h1 id="how-to-download-and-install-python-oletools">How to Download and Install python-oletools</h1>
12 12 <h2 id="pre-requisites">Pre-requisites</h2>
13   -<p>For now, python-oletools require <strong>Python 2.x</strong>, if possible 2.7 or 2.6 to enable all features.</p>
14   -<p>They are not compatible with Python 3.x yet. (Please contact me if that is a strong requirement)</p>
15   -<h2 id="to-use-oletools-as-command-line-tools">To use oletools as command-line tools</h2>
16   -<p>To use python-oletools from the command line as analysis tools, you may simply <a href="https://github.com/decalage2/oletools/releases">download the latest release archive</a> and extract the files into the directory of your choice.</p>
17   -<p>You may also download the <a href="https://github.com/decalage2/oletools/archive/master.zip">latest development version</a> with the most recent features.</p>
18   -<p>Another possibility is to use a git client to clone the repository (https://github.com/decalage2/oletools.git) into a folder. You can then update it easily in the future.</p>
19   -<h3 id="windows">Windows</h3>
20   -<p>You may add the oletools directory to your PATH environment variable to access the tools from anywhere.</p>
  13 +<p>The recommended Python version to run oletools is <strong>Python 2.7</strong>. Python 2.6 is also supported, but as it is not tested as often as 2.7, some features might not work as expected.</p>
  14 +<p>Since oletools v0.50, thanks to contributions by <span class="citation">[@Sebdraven]</span>(https://twitter.com/Sebdraven), most tools can also run with <strong>Python 3.x</strong>. As this is quite new, please <a href="(https://github.com/decalage2/oletools/issues)">report any issue</a> you may encounter.</p>
  15 +<h2 id="recommended-way-to-downloadinstallupdate-oletools-pip">Recommended way to Download+Install/Update oletools: pip</h2>
  16 +<p>Pip is included with Python since version 2.7.9 and 3.4. If it is not installed on your system, either upgrade Python or see https://pip.pypa.io/en/stable/installing/</p>
21 17 <h3 id="linux-mac-osx-unix">Linux, Mac OSX, Unix</h3>
22   -<p>It is very convenient to create symbolic links to each tool in one of the bin directories in order to run them as shell commands from anywhere. For example, here is how to create an executable link &quot;olevba&quot; in <code>/usr/local/bin</code> pointing to olevba.py, assuming oletools was unzipped into /opt/oletools:</p>
23   -<pre class="text"><code>chmod +x /opt/oletools/oletools/olevba.py
24   -ln -s /opt/oletools/oletools/olevba.py /usr/local/bin/olevba</code></pre>
25   -<p>Then the olevba command can be used from any directory:</p>
26   -<pre class="text"><code>user@remnux:~/MalwareZoo/VBA$ olevba dridex427.xls |less</code></pre>
27   -<h2 id="for-python-applications">For python applications</h2>
28   -<p>If you plan to use python-oletools with other Python applications or your own scripts, the simplest solution is to use <strong>&quot;pip install oletools&quot;</strong> or <strong>&quot;easy_install oletools&quot;</strong> to download and install the package in one go. Pip is included with Python since version 2.7.9.</p>
29   -<p><strong>Important: to update oletools</strong> if it is already installed, you must run <strong>&quot;pip install -U oletools&quot;</strong>, otherwise pip will not update it.</p>
30   -<p>Alternatively if you prefer the old school way, you may download the <a href="https://github.com/decalage2/oletools/releases">latest archive</a>, extract it into a temporary directory and run <strong>&quot;python setup.py install&quot;</strong>.</p>
  18 +<p>To download and install/update the latest release version of oletools, run the following command in a shell:</p>
  19 +<pre class="text"><code>sudo -H pip install -U oletools</code></pre>
  20 +<p><strong>Important</strong>: Since version 0.50, pip will automatically create convenient command-line scripts in /usr/local/bin to run all the oletools from any directory.</p>
  21 +<h3 id="windows">Windows</h3>
  22 +<p>To download and install/update the latest release version of oletools, run the following command in a cmd window:</p>
  23 +<pre class="text"><code>pip install -U oletools</code></pre>
  24 +<p><strong>Important</strong>: Since version 0.50, pip will automatically create convenient command-line scripts to run all the oletools from any directory: olevba, mraptor, oleid, rtfobj, etc.</p>
  25 +<h2 id="how-to-install-the-latest-development-version">How to install the latest development version</h2>
  26 +<p>If you want to benefit from the latest improvements in the development version, you may also use pip:</p>
  27 +<h3 id="linux-mac-osx-unix-1">Linux, Mac OSX, Unix</h3>
  28 +<pre class="text"><code>sudo -H pip install -U https://github.com/decalage2/oletools/archive/master.zip</code></pre>
  29 +<h3 id="windows-1">Windows</h3>
  30 +<pre class="text"><code>pip install -U https://github.com/decalage2/oletools/archive/master.zip</code></pre>
  31 +<h2 id="how-to-install-offline---computer-without-internet-access">How to install offline - Computer without Internet access</h2>
  32 +<p>First, download the oletools archive on a computer with Internet access: * Latest stable version: from https://github.com/decalage2/oletools/releases * Development version: https://github.com/decalage2/oletools/archive/master.zip</p>
  33 +<p>Copy the archive file to the target computer.</p>
  34 +<p>On Linux, Mac OSX, Unix, run the following command using the filename of the archive that you downloaded:</p>
  35 +<pre class="text"><code>sudo -H pip install -U oletools.zip</code></pre>
  36 +<p>On Windows:</p>
  37 +<pre class="text"><code>pip install -U oletools.zip</code></pre>
  38 +<h2 id="old-school-install-using-setup.py">Old school install using setup.py</h2>
  39 +<p>If you cannot use pip, it is still possible to run the setup.py script directly. However, this method will not create the command-line scripts automatically.</p>
  40 +<p>First, download the oletools archive: * Latest stable version: from https://github.com/decalage2/oletools/releases * Development version: https://github.com/decalage2/oletools/archive/master.zip</p>
  41 +<p>Then extract the archive, open a shell and go to the oletools directory.</p>
  42 +<h3 id="linux-mac-osx-unix-2">Linux, Mac OSX, Unix</h3>
  43 +<pre class="text"><code>sudo -H python setup.py install</code></pre>
  44 +<h3 id="windows-2">Windows:</h3>
  45 +<pre class="text"><code>python setup.py install</code></pre>
31 46 <hr />
32 47 <h2 id="python-oletools-documentation">python-oletools documentation</h2>
33 48 <ul>
... ...
oletools/doc/Install.md
... ... @@ -4,56 +4,113 @@ How to Download and Install python-oletools
4 4 Pre-requisites
5 5 --------------
6 6  
7   -For now, python-oletools require **Python 2.x**, if possible 2.7 or 2.6 to enable all features.
  7 +The recommended Python version to run oletools is **Python 2.7**.
  8 +Python 2.6 is also supported, but as it is not tested as often as 2.7, some features
  9 +might not work as expected.
8 10  
9   -They are not compatible with Python 3.x yet. (Please contact me if that is a strong requirement)
  11 +Since oletools v0.50, thanks to contributions by [@Sebdraven](https://twitter.com/Sebdraven),
  12 +most tools can also run with **Python 3.x**. As this is quite new, please
  13 +[report any issue]((https://github.com/decalage2/oletools/issues)) you may encounter.
10 14  
11 15  
12   -To use oletools as command-line tools
13   --------------------------------------
14 16  
15   -To use python-oletools from the command line as analysis tools, you may simply
16   -[download the latest release archive](https://github.com/decalage2/oletools/releases)
17   -and extract the files into the directory of your choice.
  17 +Recommended way to Download+Install/Update oletools: pip
  18 +--------------------------------------------------------
18 19  
19   -You may also download the [latest development version](https://github.com/decalage2/oletools/archive/master.zip) with the most recent features.
  20 +Pip is included with Python since version 2.7.9 and 3.4. If it is not installed on your
  21 +system, either upgrade Python or see https://pip.pypa.io/en/stable/installing/
20 22  
21   -Another possibility is to use a git client to clone the repository (https://github.com/decalage2/oletools.git) into a folder.
22   -You can then update it easily in the future.
  23 +### Linux, Mac OSX, Unix
  24 +
  25 +To download and install/update the latest release version of oletools,
  26 +run the following command in a shell:
  27 +
  28 +```text
  29 +sudo -H pip install -U oletools
  30 +```
  31 +
  32 +**Important**: Since version 0.50, pip will automatically create convenient command-line scripts
  33 +in /usr/local/bin to run all the oletools from any directory.
23 34  
24 35 ### Windows
25 36  
26   -You may add the oletools directory to your PATH environment variable to access the tools from anywhere.
  37 +To download and install/update the latest release version of oletools,
  38 +run the following command in a cmd window:
  39 +
  40 +```text
  41 +pip install -U oletools
  42 +```
  43 +
  44 +**Important**: Since version 0.50, pip will automatically create convenient command-line scripts
  45 +to run all the oletools from any directory: olevba, mraptor, oleid, rtfobj, etc.
  46 +
  47 +
  48 +How to install the latest development version
  49 +---------------------------------------------
  50 +
  51 +If you want to benefit from the latest improvements in the development version,
  52 +you may also use pip:
27 53  
28 54 ### Linux, Mac OSX, Unix
29 55  
30   -It is very convenient to create symbolic links to each tool in one of the bin directories in order to run them as shell
31   -commands from anywhere. For example, here is how to create an executable link "olevba" in `/usr/local/bin` pointing to
32   -olevba.py, assuming oletools was unzipped into /opt/oletools:
  56 +```text
  57 +sudo -H pip install -U https://github.com/decalage2/oletools/archive/master.zip
  58 +```
  59 +
  60 +### Windows
  61 +
  62 +```text
  63 +pip install -U https://github.com/decalage2/oletools/archive/master.zip
  64 +```
  65 +
  66 +How to install offline - Computer without Internet access
  67 +---------------------------------------------------------
  68 +
  69 +First, download the oletools archive on a computer with Internet access:
  70 +* Latest stable version: from https://github.com/decalage2/oletools/releases
  71 +* Development version: https://github.com/decalage2/oletools/archive/master.zip
  72 +
  73 +Copy the archive file to the target computer.
  74 +
  75 +On Linux, Mac OSX, Unix, run the following command using the filename of the
  76 +archive that you downloaded:
33 77  
34 78 ```text
35   -chmod +x /opt/oletools/oletools/olevba.py
36   -ln -s /opt/oletools/oletools/olevba.py /usr/local/bin/olevba
  79 +sudo -H pip install -U oletools.zip
37 80 ```
38   -Then the olevba command can be used from any directory:
  81 +
  82 +On Windows:
39 83  
40 84 ```text
41   -user@remnux:~/MalwareZoo/VBA$ olevba dridex427.xls |less
  85 +pip install -U oletools.zip
42 86 ```
43 87  
44   -For python applications
45   ------------------------
46 88  
47   -If you plan to use python-oletools with other Python applications or your own scripts, the simplest solution is to use
48   -**"pip install oletools"** or **"easy_install oletools"** to download and install the package in one go. Pip is included
49   -with Python since version 2.7.9.
  89 +Old school install using setup.py
  90 +---------------------------------
  91 +
  92 +If you cannot use pip, it is still possible to run the setup.py script
  93 +directly. However, this method will not create the command-line scripts
  94 +automatically.
  95 +
  96 +First, download the oletools archive:
  97 +* Latest stable version: from https://github.com/decalage2/oletools/releases
  98 +* Development version: https://github.com/decalage2/oletools/archive/master.zip
50 99  
51   -**Important: to update oletools** if it is already installed, you must run **"pip install -U oletools"**, otherwise pip
52   -will not update it.
  100 +Then extract the archive, open a shell and go to the oletools directory.
  101 +
  102 +### Linux, Mac OSX, Unix
  103 +
  104 +```text
  105 +sudo -H python setup.py install
  106 +```
  107 +
  108 +### Windows:
  109 +
  110 +```text
  111 +python setup.py install
  112 +```
53 113  
54   -Alternatively if you prefer the old school way, you may download the
55   -[latest archive](https://github.com/decalage2/oletools/releases), extract it into
56   -a temporary directory and run **"python setup.py install"**.
57 114  
58 115 --------------------------------------------------------------------------
59 116  
... ...
oletools/doc/mraptor.html
... ... @@ -9,8 +9,11 @@
9 9 </head>
10 10 <body>
11 11 <h1 id="mraptor-macroraptor">mraptor (MacroRaptor)</h1>
12   -<p>mraptor is a script to detect malicious VBA Macros.</p>
13   -<p>It can be used either as a command-line tool, or as a python module from your own applications.</p>
  12 +<p>mraptor is a tool designed to detect most malicious VBA Macros using generic heuristics. Unlike antivirus engines, it does not rely on signatures.</p>
  13 +<p>In a nutshell, mraptor detects keywords corresponding to the three following types of behaviour that are present in clear text in almost any macro malware: - A: Auto-execution trigger - W: Write to the file system or memory - X: Execute a file or any payload outside the VBA context</p>
  14 +<p>mraptor considers that a macro is suspicious when A and (W or X) is true.</p>
  15 +<p>For more information about mraptor's detection algorithm, see the article <a href="http://www.decalage.info/mraptor">How to detect most malicious macros without an antivirus</a>.</p>
  16 +<p>mraptor can be used either as a command-line tool, or as a python module from your own applications.</p>
14 17 <p>It is part of the <a href="http://www.decalage.info/python/oletools">python-oletools</a> package.</p>
15 18 <h2 id="usage">Usage</h2>
16 19 <pre class="text"><code>Usage: mraptor.py [options] &lt;filename&gt; [filename2 ...]
... ... @@ -47,6 +50,8 @@ An exit code is returned based on the analysis result:
47 50 <div class="figure">
48 51 <img src="mraptor1.png" />
49 52 </div>
  53 +<h2 id="python-3-support---mraptor3">Python 3 support - mraptor3</h2>
  54 +<p>As of v0.50, mraptor has been ported to Python 3 thanks to <span class="citation">@sebdraven</span>. However, the differences between Python 2 and 3 are significant and for now there is a separate version of mraptor named mraptor3 to be used with Python 3.</p>
50 55 <hr />
51 56 <h2 id="how-to-use-mraptor-in-python-applications">How to use mraptor in Python applications</h2>
52 57 <p>TODO</p>
... ...
oletools/doc/mraptor.md
1 1 mraptor (MacroRaptor)
2 2 =====================
3 3  
4   -mraptor is a script to detect malicious VBA Macros.
  4 +mraptor is a tool designed to detect most malicious VBA Macros using
  5 +generic heuristics. Unlike antivirus engines, it does not rely on signatures.
5 6  
6   -It can be used either as a command-line tool, or as a python module from your own applications.
  7 +In a nutshell, mraptor detects keywords corresponding to the three
  8 +following types of behaviour that are present in clear text in almost
  9 +any macro malware:
  10 +- A: Auto-execution trigger
  11 +- W: Write to the file system or memory
  12 +- X: Execute a file or any payload outside the VBA context
  13 +
  14 +mraptor considers that a macro is suspicious when A and (W or X) is true.
  15 +
  16 +For more information about mraptor's detection algorithm, see the article
  17 +[How to detect most malicious macros without an antivirus](http://www.decalage.info/mraptor).
  18 +
  19 +mraptor can be used either as a command-line tool, or as a python module
  20 +from your own applications.
7 21  
8 22 It is part of the [python-oletools](http://www.decalage.info/python/oletools) package.
9 23  
... ... @@ -61,12 +75,21 @@ list of files matching the wildcards before starting the script.
61 75  
62 76 ![](mraptor1.png)
63 77  
  78 +## Python 3 support - mraptor3
  79 +
  80 +As of v0.50, mraptor has been ported to Python 3 thanks to @sebdraven.
  81 +However, the differences between Python 2 and 3 are significant and for now
  82 +there is a separate version of mraptor named mraptor3 to be used with
  83 +Python 3.
  84 +
  85 +
64 86 --------------------------------------------------------------------------
65 87  
66 88 ## How to use mraptor in Python applications
67 89  
68 90 TODO
69 91  
  92 +
70 93 --------------------------------------------------------------------------
71 94  
72 95 python-oletools documentation
... ...
oletools/doc/olebrowse.html
... ... @@ -11,6 +11,12 @@
11 11 <h1 id="olebrowse">olebrowse</h1>
12 12 <p>olebrowse is a simple GUI to browse OLE files (e.g. MS Word, Excel, Powerpoint documents), to view and extract individual data streams.</p>
13 13 <p>It is part of the <a href="http://www.decalage.info/python/oletools">python-oletools</a> package.</p>
  14 +<h2 id="dependencies">Dependencies</h2>
  15 +<p>olebrowse requires <a href="https://en.wikipedia.org/wiki/Tkinter">Tkinter</a>. On Windows and MacOSX, it should be installed with Python, and olebrowse should work out of the box.</p>
  16 +<p>However, on Linux it might be necessary to install the tkinter package for Python separately. For example, on Ubuntu this is done with the following command:</p>
  17 +<pre><code>sudo apt-get install python-tk</code></pre>
  18 +<p>And for Python 3:</p>
  19 +<pre><code>sudo apt-get install python3-tk</code></pre>
14 20 <h2 id="usage">Usage</h2>
15 21 <pre><code>olebrowse.py [file]</code></pre>
16 22 <p>If you provide a file it will be opened, else a dialog will allow you to browse folders to open a file. Then if it is a valid OLE file, the list of data streams will be displayed. You can select a stream, and then either view its content in a builtin hexadecimal viewer, or save it to a file for further analysis.</p>
... ...
oletools/doc/olebrowse.md
... ... @@ -6,12 +6,37 @@ view and extract individual data streams.
6 6  
7 7 It is part of the [python-oletools](http://www.decalage.info/python/oletools) package.
8 8  
  9 +Dependencies
  10 +------------
  11 +
  12 +olebrowse requires [Tkinter](https://en.wikipedia.org/wiki/Tkinter).
  13 +On Windows and MacOSX, it should be installed with Python, and
  14 +olebrowse should work out of the box.
  15 +
  16 +However, on Linux it might be necessary to install the tkinter
  17 +package for Python separately. For example, on Ubuntu this is done with the
  18 +following command:
  19 +
  20 +```
  21 +sudo apt-get install python-tk
  22 +```
  23 +
  24 +And for Python 3:
  25 +
  26 +```
  27 +sudo apt-get install python3-tk
  28 +```
  29 +
  30 +
9 31 Usage
10 32 -----
11 33  
12 34 olebrowse.py [file]
13 35  
14   -If you provide a file it will be opened, else a dialog will allow you to browse folders to open a file. Then if it is a valid OLE file, the list of data streams will be displayed. You can select a stream, and then either view its content in a builtin hexadecimal viewer, or save it to a file for further analysis.
  36 +If you provide a file it will be opened, else a dialog will allow you to browse
  37 +folders to open a file. Then if it is a valid OLE file, the list of data streams
  38 +will be displayed. You can select a stream, and then either view its content
  39 +in a builtin hexadecimal viewer, or save it to a file for further analysis.
15 40  
16 41 Screenshots
17 42 -----------
... ...
oletools/doc/olevba.html
... ... @@ -211,6 +211,8 @@ OLE:M------ \MalwareZoo\VBA\samples\Normal_Document_Macro.doc
211 211 OpX:MASI--- \MalwareZoo\VBA\samples\RottenKitten.xlsb.malware
212 212 OLE:MASI-B- \MalwareZoo\VBA\samples\ROVNIX.doc.malware
213 213 OLE:MA----- \MalwareZoo\VBA\samples\Word within Word macro auto.doc</code></pre>
  214 +<h2 id="python-3-support---olevba3">Python 3 support - olevba3</h2>
  215 +<p>As of v0.50, olevba has been ported to Python 3 thanks to <span class="citation">@sebdraven</span>. However, the differences between Python 2 and 3 are significant and for now there is a separate version of olevba named olevba3 to be used with Python 3.</p>
214 216 <hr />
215 217 <h2 id="how-to-use-olevba-in-python-applications">How to use olevba in Python applications</h2>
216 218 <p>olevba may be used to open a MS Office file, detect if it contains VBA macros, extract and analyze the VBA source code from your own python applications.</p>
... ...
oletools/doc/olevba.md
... ... @@ -253,7 +253,14 @@ OpX:MASI--- \MalwareZoo\VBA\samples\RottenKitten.xlsb.malware
253 253 OLE:MASI-B- \MalwareZoo\VBA\samples\ROVNIX.doc.malware
254 254 OLE:MA----- \MalwareZoo\VBA\samples\Word within Word macro auto.doc
255 255 ```
256   -
  256 +
  257 +## Python 3 support - olevba3
  258 +
  259 +As of v0.50, olevba has been ported to Python 3 thanks to @sebdraven.
  260 +However, the differences between Python 2 and 3 are significant and for now
  261 +there is a separate version of olevba named olevba3 to be used with
  262 +Python 3.
  263 +
257 264 --------------------------------------------------------------------------
258 265  
259 266 ## How to use olevba in Python applications
... ...
oletools/doc/rtfobj.html
... ... @@ -28,18 +28,48 @@ code &gt; span.er { color: #ff0000; font-weight: bold; }
28 28 </head>
29 29 <body>
30 30 <h1 id="rtfobj">rtfobj</h1>
31   -<p>rtfobj is a Python module to extract embedded objects from RTF files, such as OLE ojects. It can be used as a Python library or a command-line tool.</p>
  31 +<p>rtfobj is a Python module to detect and extract embedded objects stored in RTF files, such as OLE objects. It can also detect OLE Package objects, and extract the embedded files.</p>
  32 +<p>Since v0.50, rtfobj contains a custom RTF parser that has been designed to match MS Word's behaviour, in order to handle obfuscated RTF files. See my article <a href="http://decalage.info/rtf_tricks">&quot;Anti-Analysis Tricks in Weaponized RTF&quot;</a> for some concrete examples.</p>
  33 +<p>rtfobj can be used as a Python library or a command-line tool.</p>
32 34 <p>It is part of the <a href="http://www.decalage.info/python/oletools">python-oletools</a> package.</p>
33 35 <h2 id="usage">Usage</h2>
34   -<pre class="text"><code>rtfobj.py &lt;file.rtf&gt;</code></pre>
35   -<p>It extracts and decodes all the data blocks encoded as hexadecimal in the RTF document, and saves them as files named &quot;object_xxxx.bin&quot;, xxxx being the location of the object in the RTF file.</p>
  36 +<pre class="text"><code>rtfobj [options] &lt;filename&gt; [filename2 ...]
  37 +
  38 +Options:
  39 + -h, --help show this help message and exit
  40 + -r find files recursively in subdirectories.
  41 + -z ZIP_PASSWORD, --zip=ZIP_PASSWORD
  42 + if the file is a zip archive, open first file from it,
  43 + using the provided password (requires Python 2.6+)
  44 + -f ZIP_FNAME, --zipfname=ZIP_FNAME
  45 + if the file is a zip archive, file(s) to be opened
  46 + within the zip. Wildcards * and ? are supported.
  47 + (default:*)
  48 + -l LOGLEVEL, --loglevel=LOGLEVEL
  49 + logging level debug/info/warning/error/critical
  50 + (default=warning)
  51 + -s SAVE_OBJECT, --save=SAVE_OBJECT
  52 + Save the object corresponding to the provided number
  53 + to a file, for example &quot;-s 2&quot;. Use &quot;-s all&quot; to save
  54 + all objects at once.
  55 + -d OUTPUT_DIR use specified directory to save output files.</code></pre>
  56 +<p>rtfobj displays a list of the OLE and Package objects that have been detected, with their attributes such as class and filename.</p>
  57 +<p>When an OLE Package object contains an executable file or script, it is highlighted as such. For example:</p>
  58 +<div class="figure">
  59 +<img src="rtfobj1.png" />
  60 +</div>
  61 +<p>To extract an object or file, use the option -s followed by the object number as shown in the table.</p>
  62 +<p>Example:</p>
  63 +<pre class="text"><code>rtfobj -s 0</code></pre>
  64 +<p>It extracts and decodes the corresponding object, and saves it as a file named &quot;object_xxxx.bin&quot;, xxxx being the location of the object in the RTF file.</p>
36 65 <h2 id="how-to-use-rtfobj-in-python-applications">How to use rtfobj in Python applications</h2>
37   -<p>Usage as a python module:</p>
38   -<p>rtf_iter_objects(filename) is an iterator which yields a tuple (index, object) providing the index of each hexadecimal stream in the RTF file, and the corresponding decoded object.</p>
  66 +<p>As of v0.50, the API has changed significantly and it is not final yet. For now, see the class RtfObjectParser in the code.</p>
  67 +<h3 id="deprecated-api-still-functional">Deprecated API (still functional):</h3>
  68 +<p>rtf_iter_objects(filename) is an iterator which yields a tuple (index, orig_len, object) providing the index of each hexadecimal stream in the RTF file, and the corresponding decoded object.</p>
39 69 <p>Example:</p>
40   -<pre class="sourceCode python"><code class="sourceCode python"><span class="ch">import</span> rtfobj
41   -<span class="kw">for</span> index, data in rtfobj.rtf_iter_objects(<span class="st">&quot;myfile.rtf&quot;</span>):
42   - <span class="dt">print</span> <span class="st">&#39;found object size </span><span class="ot">%d</span><span class="st"> at index </span><span class="ot">%08X</span><span class="st">&#39;</span> % (<span class="dt">len</span>(data), index)</code></pre>
  70 +<pre class="sourceCode python"><code class="sourceCode python"><span class="ch">from</span> oletools <span class="ch">import</span> rtfobj
  71 +<span class="kw">for</span> index, orig_len, data in rtfobj.rtf_iter_objects(<span class="st">&quot;myfile.rtf&quot;</span>):
  72 + <span class="dt">print</span>(<span class="st">&#39;found object size </span><span class="ot">%d</span><span class="st"> at index </span><span class="ot">%08X</span><span class="st">&#39;</span> % (<span class="dt">len</span>(data), index))</code></pre>
43 73 <hr />
44 74 <h2 id="python-oletools-documentation">python-oletools documentation</h2>
45 75 <ul>
... ...
oletools/doc/rtfobj.md
1 1 rtfobj
2 2 ======
3 3  
4   -rtfobj is a Python module to extract embedded objects from RTF files, such as
5   -OLE ojects. It can be used as a Python library or a command-line tool.
  4 +rtfobj is a Python module to detect and extract embedded objects stored
  5 +in RTF files, such as OLE objects. It can also detect OLE Package objects,
  6 +and extract the embedded files.
  7 +
  8 +Since v0.50, rtfobj contains a custom RTF parser that has been designed to
  9 +match MS Word's behaviour, in order to handle obfuscated RTF files. See my
  10 +article ["Anti-Analysis Tricks in Weaponized RTF"](http://decalage.info/rtf_tricks)
  11 +for some concrete examples.
  12 +
  13 +rtfobj can be used as a Python library or a command-line tool.
6 14  
7 15 It is part of the [python-oletools](http://www.decalage.info/python/oletools) package.
8 16  
9 17 ## Usage
10 18  
11 19 ```text
12   -rtfobj.py <file.rtf>
  20 +rtfobj [options] <filename> [filename2 ...]
  21 +
  22 +Options:
  23 + -h, --help show this help message and exit
  24 + -r find files recursively in subdirectories.
  25 + -z ZIP_PASSWORD, --zip=ZIP_PASSWORD
  26 + if the file is a zip archive, open first file from it,
  27 + using the provided password (requires Python 2.6+)
  28 + -f ZIP_FNAME, --zipfname=ZIP_FNAME
  29 + if the file is a zip archive, file(s) to be opened
  30 + within the zip. Wildcards * and ? are supported.
  31 + (default:*)
  32 + -l LOGLEVEL, --loglevel=LOGLEVEL
  33 + logging level debug/info/warning/error/critical
  34 + (default=warning)
  35 + -s SAVE_OBJECT, --save=SAVE_OBJECT
  36 + Save the object corresponding to the provided number
  37 + to a file, for example "-s 2". Use "-s all" to save
  38 + all objects at once.
  39 + -d OUTPUT_DIR use specified directory to save output files.
  40 +```
  41 +
  42 +rtfobj displays a list of the OLE and Package objects that have been detected,
  43 +with their attributes such as class and filename.
  44 +
  45 +When an OLE Package object contains an executable file or script, it is
  46 +highlighted as such. For example:
  47 +
  48 +![](rtfobj1.png)
  49 +
  50 +To extract an object or file, use the option -s followed by the object number
  51 +as shown in the table.
  52 +
  53 +Example:
  54 +
  55 +```text
  56 +rtfobj -s 0
13 57 ```
14 58  
15   -It extracts and decodes all the data blocks encoded as hexadecimal in the RTF document,
16   -and saves them as files named "object_xxxx.bin", xxxx being the location of the object
17   -in the RTF file.
  59 +It extracts and decodes the corresponding object, and saves it as a file
  60 +named "object_xxxx.bin", xxxx being the location of the object in the RTF file.
18 61  
19 62  
  63 +## How to use rtfobj in Python applications
20 64  
21   -## How to use rtfobj in Python applications
  65 +As of v0.50, the API has changed significantly and it is not final yet.
  66 +For now, see the class RtfObjectParser in the code.
22 67  
23   -Usage as a python module:
  68 +### Deprecated API (still functional):
24 69  
25   -rtf_iter_objects(filename) is an iterator which yields a tuple (index, object) providing the index of each hexadecimal stream in the RTF file, and the corresponding decoded object.
  70 +rtf_iter_objects(filename) is an iterator which yields a tuple
  71 +(index, orig_len, object) providing the index of each hexadecimal stream
  72 +in the RTF file, and the corresponding decoded object.
26 73  
27 74 Example:
28 75  
29 76 ```python
30   -import rtfobj
31   -for index, data in rtfobj.rtf_iter_objects("myfile.rtf"):
32   - print 'found object size %d at index %08X' % (len(data), index)
  77 +from oletools import rtfobj
  78 +for index, orig_len, data in rtfobj.rtf_iter_objects("myfile.rtf"):
  79 + print('found object size %d at index %08X' % (len(data), index))
33 80 ```
34 81  
35 82 --------------------------------------------------------------------------
... ...
setup.py
... ... @@ -40,7 +40,7 @@ import sys, os, fnmatch
40 40 #--- METADATA -----------------------------------------------------------------
41 41  
42 42 name = "oletools"
43   -version = '0.50a'
  43 +version = '0.50'
44 44 desc = "Python tools to analyze security characteristics of MS Office and OLE files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), for Malware Analysis and Incident Response #DFIR"
45 45 long_desc = open('oletools/README.rst').read()
46 46 author = "Philippe Lagadec"
... ...