diff --git a/.travis.yml b/.travis.yml index de2b1f7..a0a8f50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,5 +17,8 @@ matrix: - python: pypy - python: pypy3 +install: + - pip install msoffcrypto-tool + script: - python setup.py test diff --git a/INSTALL.txt b/INSTALL.txt index 62e4a4e..f1b4a46 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,16 +1,12 @@ -How to Download and Install python-oletools -=========================================== +How to Download and Install oletools +==================================== Pre-requisites -------------- -The recommended Python version to run oletools is Python 2.7. -Python 2.6 is also supported, but as it is not tested as often as 2.7, some features -might not work as expected. - -Since v0.50, oletools can also run with Python 3.x. As this is quite new, please -report any issue you may encounter. - +The recommended Python version to run oletools is the latest **Python 3.x** (3.7 for now). +Python 2.7 is still supported, but as it will become end of life in 2020 (see https://pythonclock.org/), it is highly +recommended to switch to Python 3 now. Recommended way to Download+Install/Update oletools: pip -------------------------------------------------------- @@ -23,7 +19,11 @@ system, either upgrade Python or see https://pip.pypa.io/en/stable/installing/ To download and install/update the latest release version of oletools, run the following command in a shell: +```text sudo -H pip install -U oletools +``` + +Replace `pip` by `pip3` or `pip2` to install on a specific Python version. **Important**: Since version 0.50, pip will automatically create convenient command-line scripts in /usr/local/bin to run all the oletools from any directory. @@ -33,7 +33,19 @@ in /usr/local/bin to run all the oletools from any directory. To download and install/update the latest release version of oletools, run the following command in a cmd window: +```text pip install -U oletools +``` + +Replace `pip` by `pip3` or `pip2` to install on a specific Python version. + +**Note**: with Python 3, you may need to open a cmd window with Administrator privileges in order to run pip +and install for all users. If that is not possible, you may also install only for the current user +by adding the `--user` option: + +```text +pip3 install -U --user oletools +``` **Important**: 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. @@ -47,18 +59,33 @@ you may also use pip: ### Linux, Mac OSX, Unix +```text sudo -H pip install -U https://github.com/decalage2/oletools/archive/master.zip +``` + +Replace `pip` by `pip3` or `pip2` to install on a specific Python version. ### Windows +```text pip install -U https://github.com/decalage2/oletools/archive/master.zip +``` + +Replace `pip` by `pip3` or `pip2` to install on a specific Python version. + +**Note**: with Python 3, you may need to open a cmd window with Administrator privileges in order to run pip +and install for all users. If that is not possible, you may also install only for the current user +by adding the `--user` option: +```text +pip3 install -U --user https://github.com/decalage2/oletools/archive/master.zip +``` How to install offline - Computer without Internet access --------------------------------------------------------- First, download the oletools archive on a computer with Internet access: -* Latest stable version: from https://github.com/decalage2/oletools/releases +* Latest stable version: from https://pypi.org/project/oletools/ or https://github.com/decalage2/oletools/releases * Development version: https://github.com/decalage2/oletools/archive/master.zip Copy the archive file to the target computer. @@ -66,11 +93,15 @@ Copy the archive file to the target computer. On Linux, Mac OSX, Unix, run the following command using the filename of the archive that you downloaded: +```text sudo -H pip install -U oletools.zip +``` On Windows: +```text pip install -U oletools.zip +``` Old school install using setup.py @@ -88,9 +119,12 @@ Then extract the archive, open a shell and go to the oletools directory. ### Linux, Mac OSX, Unix +```text sudo -H python setup.py install +``` ### Windows: +```text python setup.py install - +``` diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..896a57a --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,52 @@ +This license applies to the python-oletools package, apart from the thirdparty folder which contains third-party files +published with their own license. + +The python-oletools package is copyright (c) 2012-2019 Philippe Lagadec (http://www.decalage.info) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---------- + +olevba contains modified source code from the officeparser project, published +under the following MIT License (MIT): + +officeparser is copyright (c) 2014 John William Davison + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..b08e1e6 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,14 @@ +include install.bat +include INSTALL.txt +include README.md +include requirements.txt +include oletools/README.rst +include oletools/README.html +include oletools/LICENSE.txt +include oletools/DocVarDump.vba +recursive-include oletools/thirdparty *.* +recursive-include cheatsheet *.* +global-exclude *.pyc + +recursive-include tests *.py +graft tests/test-data diff --git a/README.md b/README.md index 69b7b81..163bc95 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,25 @@ Note: python-oletools is not related to OLETools published by BeCubed Software. News ---- -- **2018-05-30 v0.53**: +- **2019-05-22 v0.54.2**: + - bugfix release: fixed several issues related to encrypted documents + and XLM/XLF Excel 4 macros + - msoffcrypto-tool is now installed by default to handle encrypted documents + - olevba and msodde now handle documents encrypted with common passwords such + as 123, 1234, 4321, 12345, 123456, VelvetSweatShop automatically. +- **2019-04-04 v0.54**: + - olevba, msodde: added support for encrypted MS Office files + - olevba: added detection and extraction of XLM/XLF Excel 4 macros (thanks to plugin_biff from Didier Stevens' oledump) + - olevba, mraptor: added detection of VBA running Excel 4 macros + - olevba: detect and display special characters such as backspace + - olevba: colorized output showing suspicious keywords in the VBA code + - olevba, mraptor: full Python 3 compatibility, no separate olevba3/mraptor3 anymore + - olevba: improved handling of code pages and unicode + - olevba: fixed a false-positive in VBA macro detection + - rtfobj: improved OLE Package handling, improved Equation object detection + - oleobj: added detection of external links to objects in OpenXML + - replaced third party packages by PyPI dependencies +- 2018-05-30 v0.53: - olevba and mraptor can now parse Word/PowerPoint 2007+ pure XML files (aka Flat OPC format) - improved support for VBA forms in olevba (oleform) - rtfobj now displays the CLSID of OLE objects, which is the best way to identify them. Known-bad CLSIDs such as MS Equation Editor are highlighted in red. @@ -75,26 +93,38 @@ Projects using oletools: ------------------------ oletools are used by a number of projects and online malware analysis services, -including [Viper](http://viper.li/), [REMnux](https://remnux.org/), +including +[ACE](https://github.com/IntegralDefense/ACE), +[Anlyz.io](https://sandbox.anlyz.io/), +[AssemblyLine](https://www.cse-cst.gc.ca/en/assemblyline), +[CAPE](https://github.com/ctxis/CAPE), +[Cuckoo Sandbox](https://github.com/cuckoosandbox/cuckoo), +[DARKSURGEON](https://github.com/cryps1s/DARKSURGEON), +[Deepviz](https://sandbox.deepviz.com/), +[dridex.malwareconfig.com](https://dridex.malwareconfig.com), [FAME](https://certsocietegenerale.github.io/fame/), +[FLARE-VM](https://github.com/fireeye/flare-vm), [Hybrid-analysis.com](https://www.hybrid-analysis.com/), [Joe Sandbox](https://www.document-analyzer.net/), -[Deepviz](https://sandbox.deepviz.com/), [Laika BOSS](https://github.com/lmco/laikaboss), -[Cuckoo Sandbox](https://github.com/cuckoosandbox/cuckoo), -[Anlyz.io](https://sandbox.anlyz.io/), -[ViperMonkey](https://github.com/decalage2/ViperMonkey), -[pcodedmp](https://github.com/bontchev/pcodedmp), -[dridex.malwareconfig.com](https://dridex.malwareconfig.com), -[Snake](https://github.com/countercept/snake), -[DARKSURGEON](https://github.com/cryps1s/DARKSURGEON), -[CAPE](https://github.com/ctxis/CAPE), -[AssemblyLine](https://www.cse-cst.gc.ca/en/assemblyline), +[MacroMilter](https://github.com/sbidy/MacroMilter), [malshare.io](https://malshare.io), -[Malware Repository Framework (MRF)](https://www.adlice.com/download/mrf/), [malware-repo](https://github.com/Tigzy/malware-repo), -[Vba2Graph](https://github.com/MalwareCantFly/Vba2Graph), +[Malware Repository Framework (MRF)](https://www.adlice.com/download/mrf/), +[olefy](https://github.com/HeinleinSupport/olefy), +[PeekabooAV](https://github.com/scVENUS/PeekabooAV), +[pcodedmp](https://github.com/bontchev/pcodedmp), +[PyCIRCLean](https://github.com/CIRCL/PyCIRCLean), +[REMnux](https://remnux.org/), +[Snake](https://github.com/countercept/snake), +[SNDBOX](https://app.sndbox.com), [Strelka](https://github.com/target/strelka), +[stoQ](https://stoq.punchcyber.com/), +[TheHive/Cortex](https://github.com/TheHive-Project/Cortex-Analyzers), +[Vba2Graph](https://github.com/MalwareCantFly/Vba2Graph), +[Viper](http://viper.li/), +[ViperMonkey](https://github.com/decalage2/ViperMonkey), +[YOMI](https://yomi.yoroi.company), and probably [VirusTotal](https://www.virustotal.com). And quite a few [other projects on GitHub](https://github.com/search?q=oletools&type=Repositories). (Please [contact me]((http://decalage.info/contact)) if you have or know @@ -149,7 +179,7 @@ License This license applies to the python-oletools package, apart from the thirdparty folder which contains third-party files published with their own license. -The python-oletools package is copyright (c) 2012-2018 Philippe Lagadec (http://www.decalage.info) +The python-oletools package is copyright (c) 2012-2019 Philippe Lagadec (http://www.decalage.info) All rights reserved. diff --git a/oletools/LICENSE.txt b/oletools/LICENSE.txt index 64da42b..4a964f8 100644 --- a/oletools/LICENSE.txt +++ b/oletools/LICENSE.txt @@ -1,54 +1,54 @@ -LICENSE for the python-oletools package: - -This license applies to the python-oletools package, apart from the thirdparty -folder which contains third-party files published with their own license. - -The python-oletools package is copyright (c) 2012-2018 Philippe Lagadec (http://www.decalage.info) - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ----------- - -olevba contains modified source code from the officeparser project, published -under the following MIT License (MIT): - -officeparser is copyright (c) 2014 John William Davison - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +LICENSE for the python-oletools package: + +This license applies to the python-oletools package, apart from the thirdparty +folder which contains third-party files published with their own license. + +The python-oletools package is copyright (c) 2012-2019 Philippe Lagadec (http://www.decalage.info) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---------- + +olevba contains modified source code from the officeparser project, published +under the following MIT License (MIT): + +officeparser is copyright (c) 2014 John William Davison + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/oletools/README.html b/oletools/README.html index 4da6e8a..1e4d8bf 100644 --- a/oletools/README.html +++ b/oletools/README.html @@ -17,13 +17,33 @@

python-oletools

-

PyPI Build Status

+

PyPI Build Status Say Thanks!

oletools is a package of python tools to analyze Microsoft OLE2 files (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 olefile parser. See http://www.decalage.info/python/oletools for more info.

Quick links: Home page - Download/Install - Documentation - Report Issues/Suggestions/Questions - Contact the Author - Repository - Updates on Twitter Cheatsheet

Note: python-oletools is not related to OLETools published by BeCubed Software.

News