Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sessions.py #614

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update sessions.py #614

wants to merge 2 commits into from

Conversation

siw3kosky
Copy link

  • Changed plain print about completion of fuzzing session into log info message.
  • Catching EOFError exception when all test cases are executed to not throw traceback.

siw3kosky and others added 2 commits March 31, 2022 11:44
- Changed plain print about completion of fuzzing session into log info message.
- Catching EOFError exception when all test cases are executed to not throw traceback.
@jtpereyda
Copy link
Owner

Thanks @siw3kosky ! In what situation does the EOFError happen? Sometimes the test cases can end and not throw an EOFError, right?

@siw3kosky
Copy link
Author

siw3kosky commented Apr 1, 2022

Unfortunately, in my case, I always got Fuzzing session completed.... message followed by traceback in sessions.py in _main_fuzz_loop function in input() call with message EOFError: EOF when reading a line after last test case.
So in my environment boofuzz is not finishing his job gracefully :(

@SR4ven
Copy link
Collaborator

SR4ven commented Apr 1, 2022

@siw3kosky how do you execute the boofuzz script? Is it possible that the terminal doesn't support stdin?
EOFError indicates that an EOF was received before any other input.
https://stackoverflow.com/questions/12547683/python-3-eof-when-reading-a-line-sublime-text-2-is-angry

Maybe we should put a try catch directly around input() for use cases where no stdin is available.

@siw3kosky
Copy link
Author

I executed it directly from the ubuntu shell and via vscode.
In both situations traceback appears at the end.
I thing that it is not possible that the terminal doesn't support stdin.

Maybe we should put a try catch directly around input() for use cases where no stdin is available.

I think thats also a good solution, should I create new pull request? :)

@jtpereyda
Copy link
Owner

@siw3kosky We should trace down that error and figure out why it's happening -- ideally we shouldn't cause the exception in the first place if we can help it. Could you share a very simple script that reproduces the problem?

@siw3kosky
Copy link
Author

Ok gentlemen, after a short investigation I know why it is happening.

Is it possible that the terminal doesn't support stdin?

I run my script with multiprocessing, so it is running in the background.
When a process runs in the background, I can't send input to the process via terminal and hence input() can't work.

@jtpereyda
Copy link
Owner

@siw3kosky That makes sense! Which python library are you using for multithreading?

In the case of multithreading, does it still make sense to leave the web server open for a time?

@siw3kosky
Copy link
Author

I am using multiprocessing.
I think that it still make sense to leave the web server open for a time.

@jtpereyda
Copy link
Owner

@siw3kosky are you able to share an example script showing how you run the fuzzer with multiprocessing? This sounds like an interesting use case that would be cool to support.

If nothing else, I would wrap a try/except directly around the input() line. But I'm sure there's a more appropriate way to handle the use case.

@SR4ven
Copy link
Collaborator

SR4ven commented Apr 8, 2022

We could also detect if the shell is interactive or not. https://stackoverflow.com/questions/2356399/tell-if-python-is-in-interactive-mode
But I guess simply trying and possibly catching the exception would be a more pythonic way.
How would we keep the webinterface open in a multithreaded context? Sleep indefinitely?

@jtpereyda
Copy link
Owner

I think it depends on the threading scheme being used. I was hoping @siw3kosky could share the approach being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants