diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make_fuzzinput.py	Mon May 22 22:44:32 2017 +0800
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+# A fuzz input consists of a SSH-string header followed by the SSH stream.
+# This program prepends a basic prefix.
+
+import struct
+import sys
+
+stream = sys.stdin.buffer.read()
+
+header = b''
+# uint32 wrapfd random seed
+header += struct.pack(">I", 0xafaf1234)
+
+# prepend length
+header = struct.pack(">I", len(header)) + header
+sys.stdout.buffer.write(header)
+sys.stdout.buffer.write(stream)