Stateful fuzzing: Authenticate and Authorize first, than fuzzing #696
-
|
Hi, I'm trying to fuzz a protocol. In the first steps, there is some authentication and authorisation. To fuzz this part I use the following code:
This works great for me. Now, I want to fuzz the messages after the authentication steps. To keep the number of messages small, I don't want to authenticate every time, just once. Of course, if my target goes down, the authentication has to be done again; that's no issue. What is the best way to do with BooFuzz? With Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
I used to fuzz http requests with both pre-authenticated and post-authenticated. The method I choose is to put the login procedure in the edge callback. And I can decide if login is required based on a global flag and the repsonse. If the response indicates unauthorized or unauthenticated, then I'll login again, update the cookie/session to the next node and set the global flag. I'm not sure if it suits your case. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @SR4ven, Thanks for your answer. I've got it working so far. Just wondering: |
Beta Was this translation helpful? Give feedback.
The
NetworkMonitoryou're inheriting from is meant to interact with an RPC client. It's not suitable to what you're doing if I got your usecase correctly.Try inheriting from
BaseMonitordirectly and checkout the docstrings on when to perfrom the ping test (probably inpost_send()).You also have to implement a
restart_target()method, even if it always returns True.Then inside
post_start_target()you can send data. To send it on the same socket as the fuzz data later on, setreuse_target_connection=Truein the Session constructor. This will keep the TCP connection open in between test cases.Hope that helps.