molly

package module
v0.0.0-...-79395b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

Molly
=====

Molly (after Molly Hooper in Sherlock Holmes, not the drug) is an automated file analysis and extraction tool. It can search files for user-defined patterns and perform various actions when a match is found.  

Molly comes with a number of operators for analyzing and files in addition to a simple API for adding custom ones.

Molly was initially developed in the SECONDS (Secure Connected Devices) project for binary extraction from foreign firmware images.

Installation
------------

Binaries are found on the `download page <https://bitbucket.org/vahidi/molly/downloads/>`_, but might be slightly out of date.

To build from source::

    sudo apt install golang build-essential git
    git clone https://bitbucket.org/vahidi/molly
    cd molly
    make && make test && make run

Rules
-----

Molly uses a rule database to store known patterns. The rules have a simple and familiar syntax, for example the following will recognize ZIP files)::

    rule ZIP (bigendian = false, tag = "archive") {
        var header = String(0, 4); /* extract 4-byte string at position 0 */
        var csize = Long(18);      /* extract 32-bit at position 18 */
        var usize = Long(22);
        if header == { 'P', 'K', 0x05, 0x06} || header == {'P', 'K', 0x03, 0x04};
        extract("zip", "");       /* apply the ZIP extractor on this file */
    }

For more detailed information refer to the `manual <manual.pdf>`_.

Documentation

Overview

Package molly is the root for the library API in molly

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractReport

func ExtractReport(m *types.Molly) *types.Report

ExtractReport generates a report

func LoadRules

func LoadRules(m *types.Molly, files ...string) error

LoadRules reads rules from files

func LoadRulesFromText

func LoadRulesFromText(m *types.Molly, text string) error

LoadRulesFromText reads rules from a string

func New

func New() *types.Molly

New creates a new molly context

func ScanData

func ScanData(m *types.Molly, data []byte) error

ScanData scans a byte vector for matches.

func ScanFiles

func ScanFiles(m *types.Molly, files ...string) error

ScanFiles scans a set of files for matches.

func Version

func Version() (int, int, int)

Version returns the library version (major, minor, maintenance)

Types

This section is empty.

Directories

Path Synopsis
cmd
exp
Package exp contains expression types and the logic to evaluate them
Package exp contains expression types and the logic to evaluate them
prim
Package prim contains primitive types used in the epxressions
Package prim contains primitive types used in the epxressions
package operators contains actions functions that can be called from rules.
package operators contains actions functions that can be called from rules.
analyzers
Package analyzers contains different file analyzers.
Package analyzers contains different file analyzers.
extractors
Package extractors contains file extractors for various formats
Package extractors contains file extractors for various formats
Package report provides helper functions to extract data from the generated reports
Package report provides helper functions to extract data from the generated reports
Package scan contains scanner/parser code for rules and scanner code for the binary files
Package scan contains scanner/parser code for rules and scanner code for the binary files
Package types contain main types used in the API + some minimal logic.
Package types contain main types used in the API + some minimal logic.
Package util contains various utility functions used by other packages
Package util contains various utility functions used by other packages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL