https://github.com/joanbono/gottern
Golang port for Metasploit's pattern_create and pattern_offset
https://github.com/joanbono/gottern
buffer-overflow exploit-development go golang metasploit oscp oscp-tools pattern-create pattern-offset
Last synced: 5 months ago
JSON representation
Golang port for Metasploit's pattern_create and pattern_offset
- Host: GitHub
- URL: https://github.com/joanbono/gottern
- Owner: joanbono
- License: apache-2.0
- Created: 2019-02-23T19:23:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-07T12:24:18.000Z (almost 5 years ago)
- Last Synced: 2024-05-02T04:39:38.569Z (almost 2 years ago)
- Topics: buffer-overflow, exploit-development, go, golang, metasploit, oscp, oscp-tools, pattern-create, pattern-offset
- Language: Go
- Size: 1.75 MB
- Stars: 12
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README

[](https://github.com/joanbono/gottern/issues)
[](https://github.com/joanbono/gottern/tags)
[](https://golang.org/dl/)
[](https://www.apache.org/licenses/LICENSE-2.0)
[](https://goreportcard.com/report/github.com/joanbono/gottern)
Golang port for Metasploit's `pattern_create` and `pattern_offset`.
Based on [`haxpattern`](https://github.com/DharmaOfCode/haxpattern)
## Usage
```bash
$ gottern help
Pattern Offset Seeker and Pattern Creator
Usage:
Gottern [command]
Available Commands:
create Create the pattern
help Help about any command
offset Search for an offset
version Prints current Gottern version
Flags:
-h, --help help for Gottern
Use "Gottern [command] --help" for more information about a command.
```
### Create a pattern
Create a pattern using the `create` flag with the size (`-l`) of the pattern to be created.
```bash
$ gottern create -h
Create the pattern
Usage:
Gottern create [flags]
Flags:
-h, --help help for create
-l, --length int Lenght of the string to be created
$ gottern create -l 200
Aa0Aa1Aa2Aa3Aa4A[...]g1Ag2Ag3Ag4Ag5Ag
```
### Look for an offset
Search an offset using the `offset` flag with the query to perform (`-q`) of the pattern to be created. Use `-b` for big endian search.
```bash
$ gottern offset -h
Search for an offset
Usage:
Gottern offset [flags]
Flags:
-b, --bigendian Search for Big Endian Offset
-h, --help help for offset
-q, --query string Query the following pattern. Minimum 4 bytes.
```
Examples:
```bash
# ASCII
$ gottern offset -q 6Aj7
[*] 290
# Plain HEX
$ gottern offset -q 0x36416a37
[*] 290
# Little Endian HEX
$ gottern offset -q 376a4136
[*] 290
# Big Endian HEX
$ gottern offset -q 36416a37 -b
[*] 290
```
***
## Benchmarks
Some benchmarks using [`hyperfine`](https://github.com/sharkdp/hyperfine).
### Create a Pattern

### Find an offset
