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
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
- ssdeep + python-ssdeep for generating ssdeep hashes
- capstone for code disassembly
(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
- pefile - python library for reading PE info
- peframe - PE analysis tool
- PEpper - PE analysis tool
- PEcli - PE analysis tool
- PPEE - PE analysis tool
- PE Studio - PE analysis tool
- pev - PE analysis tool
- pecheck - PE analysis tool
- PE-bear - PE analysis tool
- PE-sieve - scans live PEs for suspicious indicators and dumps
- PE_unmapper - convert dump to raw
- IAT Patcher - IAT editor
PE file info
- corkami PE101 and PE102 - fantastic visualizations
- corkami PE wiki - lots of info
- corkami PE POCs - cool/weird stuff
- PE format layout graph - nice visualization
- PE format walkthrough - overlay of PE format on raw hex
- PE Format - PE documentation by MS
- An In-Depth Look into the Win32 Portable Executable File Format Part 1 and Part 2 - writeups by MS
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
Built Distribution
File details
Details for the file pegreet-0.4.0.tar.gz
.
File metadata
- Download URL: pegreet-0.4.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b320daae2f6d161432d89dbdfd5247bb433604950c091e72cb5af2bc07f053d1 |
|
MD5 | ce92a3a2300f29e69453f48c15582b66 |
|
BLAKE2b-256 | 004815a0d7e1d279d0fbb66426b2612f0a907326e46680475662164a370d38e5 |
File details
Details for the file pegreet-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: pegreet-0.4.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cd07370c1880565df7c0a7f71ebf5545902bd019bac9ce887a71ce2f65e1933 |
|
MD5 | e38c2f0d15bf9a4c441b255433041fbf |
|
BLAKE2b-256 | 698354d822a811bd24b8d445e5b635c193cabe16c10b8394d35cbca966876c88 |