Skip to main content

Library and CLI tool for parsing, validating, modifying, and updating `pyproject.toml` files.

Project description

pegreet

PyPI - Version PyPI - Python Version

Greet your malware samples before you tear them apart.

pegreet is a tool that performs static analysis and feature extraction on Portable Executable files. As a cli app, it should help with first steps in malware analysis / reverse engineering. As a library, it can be used to extract useful information from samples in bulk for use in exploratory data analysis or building malware classification models.


Table of Contents

Features

Implemented

  • dump general file information
  • compute hashes (MD5, SHA1, SHA256, Imphash, SSDEEP)
  • calculate entropy
  • detect packers via PEiD signatures
  • dump info from headers
  • dump info from sections
  • dump imports and exports
  • annotate suspicious Windows API functions
  • display file parsing warnings
  • disassemble code from entry point
  • find strings
  • categorize strings

To Do

  • recognize known malicious section names
  • annotate suspicious entropy and size mismatches
  • extract resources
  • lookup on VirusTotal
  • lookup for public sandbox reports
  • check file against YARA rules
  • check digital signature
  • sort strings with StringSifter
  • extract obfuscated strings with FLOSS
  • custom output (csv, json, markdown)

Screenshots

i

Installation

as a module

<virtual environment shenanigans>
pip install pegreet

as a cli app

pipx install pegreet

Usage

$ pegreet --help

 Usage: pegreet [OPTIONS] COMMAND [ARGS]...

╭─ Options ───────────────────────────────────────────╮
│ --help                        Show this message and │
│                               exit.                 │
╰─────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────╮
│ disassemble  disassemble a specified number         │
│              instructions from entry point          │
│ info         print useful info                      │
│ strings      print strings                          │
╰─────────────────────────────────────────────────────╯

Notes

I started this project in 2020 in an attempt to learn about PE files and feature extraction for use in malware data science.

There are many other (better) tools available that implement similar functionality (see below). What I tried to do with pegreet is to focus on only the features that are useful to malware analysis to make it easier to digest the information. pegreet also provides annotations for suspicious indicators that can be used as jumping points for an investigation.

The pefile library was used extensively to implement the parsing of PE files. I would like to explore using the LIEF project instead as it supports multiple executable formats and it was used in the EMBER dataset. Maybe I'll follow this project up with an 'ELFgreet'.

Resources

Similar Tools

PE file info

License

pegreet is distributed under the terms of any of the following licenses:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pegreet-0.4.1.tar.gz (11.1 MB view details)

Uploaded Source

Built Distribution

pegreet-0.4.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file pegreet-0.4.1.tar.gz.

File metadata

  • Download URL: pegreet-0.4.1.tar.gz
  • Upload date:
  • Size: 11.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.1

File hashes

Hashes for pegreet-0.4.1.tar.gz
Algorithm Hash digest
SHA256 5a56c1512d7727faba9dd3299cf2b5beeab28aeb35059337e0c670486a7ced37
MD5 e80b5ad8ff2333009161bfb027ada984
BLAKE2b-256 7ecb5a0745c9858f32bf7f1a051aff6316335883db27f2fcd8fb65706992b711

See more details on using hashes here.

File details

Details for the file pegreet-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: pegreet-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.1

File hashes

Hashes for pegreet-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80a1770056c31d6dcf2d298f9c7c391db4d9a30a0f6a3ebc58f43739a7e8cbd7
MD5 99f1986a5ef623be3b80ff3f64cf0dab
BLAKE2b-256 a255aadc77765cc558b23fe78e58e7c1f50c01459bcee7b32610e4acfa094bd8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page