Giter Club home page Giter Club logo

flashmingo's Introduction

FLASHMINGO

Install

NOTE: The following instructions are for Python3.

If you need to install FLASHMINGO on Python2.7 you can checkout the release 1.0 under the releases tab. The installation steps are essentially the same.

Install the Python3 packages listed in requirements.txt.

You can use the following command: pip3 install -r requirements.txt

If you want to use the decompilation functionality you need to install Jython. Ubuntu/Debian users can issue apt install jython

Clone the project or download the zip file.

What

FLASHMINGO is an analysis framework for SWF files. The tool automatically triages suspicious Flash files and guides the further analysis process, freeing precious resources in your team. You can easily incorporate FLASHMINGO’s analysis modules into your workflow.

Why

To this day forensic investigators and malware analysts must deal with suspicious SWF files. If history repeats itself the security threat may even become bigger beyond Flash’s end of life in 2020. Systems will continue to support a legacy file format that is not going to be updated with security patches anymore. Automation is the best way to deal with this issue and this is where FLASHMINGO can help you. FLASHMINGO is an analysis framework to automatically process SWF files that enables you to flag suspicious Flash samples and analyze them with minimal effort. It integrates into various analysis workflows as a stand-alone application or a powerful library. Users can easily extend the tool’s functionality via custom Python plugins.

How

Architecture

FLASHMINGO is designed with simplicity in mind. It reads a SWF file and creates an object (SWFObject) representing its contents and structure. Afterwards FLASHMINGO runs a series of plugins acting on this SWFObject and returning their values to the main program.

Below a mandatory ASCII art flow diagram:

                                                 +----------+
                                                 |          |
                       +------------+----------->+ PLUGIN 1 +------------+
                       |            |            |          |            |
                       |            |            +----------+            |
                       |            |                                    |
                       |            |            +----------+            |
                       |            |            |          |            |
+---------+            |            +----------->+ PLUGIN 2 +--------+   |
|SWF FILE +----------->+ FLASHMINGO |            |          |        |   |
+---------+            |            |            +----------+        |   |
                       |            |                                |   |
                       |            |                                |   |
                       |            |                                |   |
                       |            |                          +-----v---v-+
                       |            |                          |           |
                       |            |                          |           |
                       +-----+------+------------------------->+ SWFOBJECT |
                             ^                                 |           |
                             |                                 |           |
                             |                                 +-----+-----+
                             |                                       |
                             |                                       |
                             |                                       |
                             +---------------------------------------+

When using FLASHMINGO as a library in your own projects, you only need to take care of two kind of objects:

  • one or many SWFObject(s), representing the sample(s)
  • a Flashmingo object. This acts essentially as a harness connecting plugins and SWFObject(s).

Plugins!

FLASHMINGO plugins are stored in their own directories under... you guessed it: plugins When a Flashmingo object is instantiated, it goes through this directory and process all plugins' manifests. Should this indicate that the plugin is active, this is registered for later use. At the code level, this means that a small plugin_info dictionary is added to the plugins list.

Plugins are invoked via the run_plugin API with two arguments:

  • the plugin's name
  • the SWFObject instance

Optionally, most of the plugins allow you to pass your own user data. This is plugin dependent (read the documentation) and it can be more easily be explained with an example. The default plugin SuspiciousNames will search all constant pools for strings containing suspicious substrings (for example: 'overflow', 'spray', 'shell', etc.) There is a list of common substrings already hard-coded in the plugin so that it can be used as-is. However, you may pass a list of your own defined substrings, in this case via the names parameter.

Code example:

fm = Flashmingo()
print fm.run_plugin('DangerousAPIs', swf=swf)
print fm.run_plugin('SuspiciousNames', swf=swf, names=['spooky'])

Default plugins

FLASHMINGO ships with some useful plugins out of the box:

  • binary_data
  • dangerous_apis
  • decompiler
  • suspicious_constants
  • suspicious_loops
  • suspicious_names
  • template :)

Extending FLASHMINGO

A template plugin is provided for easy development. Extending FLASHMINGO is rather straightforward. Follow these simple steps:

  • Copy the template
  • Edit the manifest
  • Override the run method
  • Add your custom code

You are ready to go :)

FLASHMINGO as a library

API

  • See the docs directory for autogenerated documentation
  • See FireEye's blog post for an example

Front-ends

  • Console

Create Documentation

$ pip install sphinxcontrib-napoleon

After setting up Sphinx to build your docs, enable napoleon in the Sphinx conf.py file:

In conf.py, add napoleon to the extensions list

extensions = ['sphinxcontrib.napoleon']

Use sphinx-apidoc to build your API documentation:

$ sphinx-apidoc -f -o docs/source projectdir

This creates .rst files for Sphinx to process

$ make html

That's it! :)

flashmingo's People

Contributors

carlosgprado avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flashmingo's Issues

Dependecies

What version of the python used ?
thankful

AVAST Trojan warning

when trying to unpack the zip file, Avast quarantined a file with the following ID
SWF:Agent-FV[Expl] and the (alledged) infected file is BigRig.SWF

now I would assume that this is a false positive, as I doubt GitHub would have files with viruses, but you never know. Would someone (the originator) please confirm that it is NOT a VIRUS, so that I can do this security update for Adobe
Barry

'ABCFile' object has no attribute 'instance'

I've tried to load three different swf, but all return the same error

warning: unknown tag 36
warning: unknown tag 36
warning: unknown tag 36
warning: unknown tag 36
warning: unknown tag 36
warning: unknown tag 36
warning: unknown tag 36
warning: unknown tag 21
warning: unknown tag 36
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cmd2.py", line 2476, in onecmd_plus_hooks
    stop = self.onecmd(statement)
  File "/usr/local/lib/python2.7/site-packages/cmd2.py", line 2675, in onecmd
    stop = func(statement)
  File "flashmingo-cmd.py", line 58, in do_load
    self.swf = SWFObject(sample_file, ml=self.logger)
  File "<PATH>/flashmingo/flashmingo/SWFObject.py", line 73, in __init__
    self.instance_info = self.get_all_instances_info()
  File "<PATH>/flashmingo/flashmingo/SWFObject.py", line 132, in get_all_instances_info
    for ii in abc.instances:
AttributeError: 'ABCFile' object has no attribute 'instances'
EXCEPTION of type 'AttributeError' occurred with message: ''ABCFile' object has no attribute 'instances''

With the file under samples dir, i've no errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.