Skip to main content

Generate/find patterns for use in stack smashing alla pattern_{create,offset}.rb from Metasploit

Project description

msfpatterns

📦️ PyPI 👷 Continuous Integration 🧪 Coverage

msfpatterns (Buffer Overflow Finder) is a tool for generating and analyzing cyclic patterns, similar to pattern_create and pattern_offset from Metasploit. It helps exploit developers identify exact buffer overflow offsets across multiple architectures, including 16-bit, 32-bit, and 64-bit platforms.

Features

  • Generate unique cyclic patterns for buffer overflow analysis
  • Find offsets of overwritten return addresses in memory dumps
  • Supports 2-byte, 4-byte, and 8-byte searches (suitable for MSP430, x86, x86-64, etc.)
  • Returns all matching offsets (useful for 16-bit systems where repeats may occur)
  • Simple CLI interface

Installation

Using uv (recommended)

uv tool install msfpatterns

Using pip

pip install msfpatterns

CLI Usage

Generating a Pattern

pattern 128 # Generates a pattern of length 128

Finding an Offset

pattern -q 0x41306241 128 # Find offset of 0x41306241 in a 128-byte pattern

Library Usage

You can also use msfpatterns as a Python library:

from msfpatterns import generate_pattern, find_offset

pattern = generate_pattern(128)
print(pattern)
offset = find_offset("0x41306241", 128)
print(f"Offset: {offset}")

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

msfpatterns-2.0.15.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msfpatterns-2.0.15-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file msfpatterns-2.0.15.tar.gz.

File metadata

  • Download URL: msfpatterns-2.0.15.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for msfpatterns-2.0.15.tar.gz
Algorithm Hash digest
SHA256 0ddd9ae45c067e210e5cc4b40e896b13acd187c930e40c168f82eb9b2305f8d1
MD5 2dbeefa0fb54ffe00bc031cb9fae1482
BLAKE2b-256 1bd342b4f03c08b86c1472f4dce5eb06cd1abd5d0d72b46e295d9eda96a241c1

See more details on using hashes here.

File details

Details for the file msfpatterns-2.0.15-py3-none-any.whl.

File metadata

File hashes

Hashes for msfpatterns-2.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 85b7f24aefc2d8e4d63fcb5501eb13f6470984e9d1c4aa58a15cc3dcf88204cc
MD5 92ca8c21dc87afa6e61139b6e92a9b00
BLAKE2b-256 f841ea41292d2ab22a85193cfd65d443b365392a8e3c874764d60d77282662bc

See more details on using hashes here.

Supported by

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