Skip to main content

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

Project description

PEgreet

Greet your samples before you tear them apart.

PEgreet is a tool that performs static analysis and feature extraction on Portable Executable files. It should help with your first steps in analyzing a malware sample.

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

In Progress

  • recognize known malicious section names

To Do

  • 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)
  • modular design

Screenshots

i

Installation

PEgreet uses Python 3

Get PEgreet

git clone https://github.com/patrickarmengol/PEgreet.git
cd PEgreet

Install Required Dependencies

pip install -r requirements.txt

Install Optional Dependencies

(install ssdeep using package manager)
pip install -r optional-requirements.txt

Usage

usage: pegreet.py [-h] [-i] [-s [{c,a}]] [-d N] file

a tool to perform static analysis and feature extraction on Portable Executable files

positional arguments:
  file        the file's path

optional arguments:
  -h, --help  show this help message and exit
  -i          print useful info
  -s [{c,a}]  print strings - [c]ategorized (default) or [a]ll
  -d N        disassemble a specified number instructions from entry point

Notes

I started this project 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

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.3.0.tar.gz (11.1 MB view details)

Uploaded Source

Built Distribution

pegreet-0.3.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pegreet-0.3.0.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.3.0.tar.gz
Algorithm Hash digest
SHA256 c36b2817a599b289b9c8813bfd0d7a4eab336eb9a239e5f1b061ac36e2139d99
MD5 a9ab65fd78058905b1fab33cb66724a8
BLAKE2b-256 ff754b8a8464428f529de6c61a92ee8e42cd0e0974c922b89f54bb0fc050de12

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pegreet-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5a5f4255279866085cc42dc0929e60d9db02c47d1a845db5d847cdbb543c612
MD5 c8b2d52363db9f8570423d33ecf96e11
BLAKE2b-256 7fb44eab1cafb777e3e7dba8045782484589ab2b70101e782d59f4cb812b9d6b

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