Golang port for Metasploit's pattern_create
and pattern_offset
.
Based on haxpattern
$ 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 using the create
flag with the size (-l
) of the pattern to be created.
$ 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
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.
$ 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:
# 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
Some benchmarks using hyperfine
.