comparison make_fuzzinput.py @ 0:ec5e2b121e57

Dropbear fuzz corpus
author Matt Johnston <matt@ucc.asn.au>
date Mon, 22 May 2017 22:44:32 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:ec5e2b121e57
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)