Mercurial > dropbear-fuzzcorpus
annotate make_fuzzinput.py @ 6:5214690dc1a7
Move dictionaries to corpus repo
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 09 Mar 2018 20:42:46 +0800 |
parents | ec5e2b121e57 |
children |
rev | line source |
---|---|
0 | 1 #!/usr/bin/env python3 |
2 | |
3 # A fuzz input consists of a SSH-string header followed by the SSH stream. | |
4 # This program prepends a basic prefix. | |
5 | |
6 import struct | |
7 import sys | |
8 | |
9 stream = sys.stdin.buffer.read() | |
10 | |
11 header = b'' | |
12 # uint32 wrapfd random seed | |
13 header += struct.pack(">I", 0xafaf1234) | |
14 | |
15 # prepend length | |
16 header = struct.pack(">I", len(header)) + header | |
17 sys.stdout.buffer.write(header) | |
18 sys.stdout.buffer.write(stream) |