Giter Site home page Giter Site logo

pattern's Introduction

Pattern - a reimplementation of pattern_create/pattern_offset in Python

Metasploit comes with multiple very convenient scripts and utilities. Among the most valuable for me are pattern_create and pattern_offset. I found it increasingly annoying that both have a relatively long startup time.

So after I overheard one of my colleagues complaining about this as well, I quickly hacked together a Python version that basically does the same.

Usage

$ ./pattern
Usage: pattern (create | offset) <value> <buflen>

So, to create a 2048 byte pattern you run

$ ./pattern create 2048
Aa0Aa1Aa2[...snip...]p7Cp8Cp9Cq0Cq1Cq

and it outputs a unique pattern of said length. To find an offset in the buffer, let's say f9Cg, you run

$ ./pattern offset f9Cg
1738

and the program returns the offset until the requested series. You can also look for memory values. The values need to be little-endian and prefixed with 0x:

$ ./pattern offset 0x67433966
1738

To make sure the program works as close to the Metasploit version as possible, the offset mode searches through a 8192 byte pattern, just like pattern_offset. If your pattern is longer than that, append the pattern length:

$ ./pattern offset 9Mc0
Not found
$ ./pattern offset 9Mc0 10000
9419

Todo

  • bad characters support for pattern creation
  • partial matches

pattern's People

Contributors

ickerwx avatar phra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.