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

Uploaded Source

Built Distribution

pegreet-0.2.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pegreet-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 644fd61ac3b5ac8edf3507037083ca6f0cc4691ccad64260dc8c584ba6360474
MD5 6f55ae0f3bdee0285b79e0d0f403babf
BLAKE2b-256 c0742da48472d3b67947e26227bdc0950511e591e299752d244103276b2abffa

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pegreet-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be58bd001dd00b5d9a7741fb0c78eabd484ab8d85534c37a3311d7e77aec3f92
MD5 02314a8c68b9c864cf14ae8a6a93ea10
BLAKE2b-256 18864facbad552bbfde81097161de9ccc949b94f004283e9ab3a57a628f8727f

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