Giter VIP home page Giter VIP logo

imphash's Introduction

ImpHash for Go

  • The imports are sorted by the library and function name, so re-ordering the imports doesn't change the import hash. However, that means the imports aren't the same as the pefile Python module, or other sources, such as VirusTotal.
  • Fuzzy import hashes are achieved by using SSDeep to generate a fuzzy hash of the import information, after sorting. This was inspired by the impfuzzy project.
  • Additional features over other implementations:
    • ELF support: since ELFs also have imports, so why not? Don't expect the same hashes between file types.
    • Mach-O support: since Macho-O files have imports as well. However, the library and imported functions aren't paired, so they're not hashed together, but instead all in one sorted list. Includes Fat Mach-O files as well.
  • Trying to run ImpHash on a static file will result in an error, which is expected since there's no import data to crunch in that case.
  • Since Go's native executable format parser is used, some weird files, like malware, may not be parseable and will result in an error.
  • The main goal of this project is to provide an additional file similarity metric to MalwareDB, but can be used with other projects as well.

Data Structure

The function ImpHashFromBytes() returns the below structure, and possibly an error object.

type ImpHashResult struct {
    ImpHash string   // MD5 hash of the sorted imports
    ImpFuzzy string  // SSDeep hash of the sorted imports
    ImpString string // The sorted string which was hashed.
}

imphash's People

Contributors

rjzak avatar

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.