how to render and mutate a request in boofuzz 0.3.0.0

280 views Asked by At

Sometimes, I use the python boofuzz library to generate the fuzzed data but I send them using another library (for example websocket, or, for lower level stuff, Scapy). For this I used s_render and s_mutate. it seems however they have been removed in version 0.3.0.0. Is there still a way to do that ?

My code looked like something like this:

s_initialize(name="Request")
blocks

while s_mutate():
    send(s_render())

Thank you

2

There are 2 answers

1
sinkmanu On

I think that s_render is an inheritance from Sulley fuzzer. And this function does not appear in the documentation of Boofuzz

From the Sulley fuzzer documentation:

 s_render: Render out and return the entire contents of the current request.

From the Boofuzz docuentation:

s_get: Return the request with the specified name or the current request if name is not specified. Use this to switch from global function style request manipulation to direct object manipulation. 
Example:
    req = s_get("HTTP BASIC")
    print(req.num_mutations())
0
jtpereyda On

reposting from the mailing list

s_render and s_mutate were removed in pull request 422. They could technically be re-added, it would just take a little work.

In the meantime, you can approximate s_mutate and s_render with something like:

for mutations in r.mutate():
    mutation_context = MutationContext(mutations=mutations, message_path=[])
    data = r.render(mutation_context)

You may also find the FileConnection class helpful (file_connection.py). I just now realized it doesn't seem to be in the docs yet.

Let me know if that works!