tlsfuzzer.fuzzers module
Classes used for generating random (fuzzing) data
- class tlsfuzzer.fuzzers.StructuredRandom(vals, rng=None)[source]
Bases:
object
Random data with structure.
This class allows easy creation of random data that is structured, either by having a random bytes of specific length, or intermediate bytes that are constant.
vals is a list of tuples, the first element in the tuple specifies the length of the run and the second specifies the values of the bytes in the run. If the value is None, it means the bytes should be random.
thus a
vals = [(16, 0)]
will create a bytestring of length 16, with all bytes equal to zero andvals = [(4, None), (5, 6)]
will create a bytestring that has 4 random bytes followed by 5 bytes of value 0x06.- property data
Generate the random string based on description in vals.
- tlsfuzzer.fuzzers._normalise_groups(groups, sum_len, step)[source]
Make sure the sum of all lengths in groups is a multiple of step.