Closed PaulMcMillan closed 7 years ago
What worries me is that catching something as generic as RuntimeException can mask actual problems. I know people think it's annoying when stack traces get printed to the console, but I'm not sure that it's doing any actual harm?
Yeah, they aren't actually doing any harm other than making it harder to scroll through the output.
The only thing that this patch will catch is an exception in self.finish(), which is already throwing the RuntimeError sometimes anyway. If it throws anything more specific, it won't get caught by this change. I guess the only case that this will mask a different problem is if self.finish() somehow throws a RuntimeError for some other reason that is unexpected, and we notice it in the midst of all these expected errors.
We can't easily change the error that twisted returns, so it seems like this is the best option, unless we do something similar to the first version of the patch that didn't work quite correctly.
I'm having this problem without someone aborting the connection. The connection goes through fine on the victim end but, they can still escape into https from http.
Traceback (most recent call last):
File "./sslstrip.py", line 105, in main
reactor.run()
File "/pentest/web/sslstrip/twisted/internet/base.py", line 1169, in run
self.mainLoop()
File "/pentest/web/sslstrip/twisted/internet/base.py", line 1181, in mainLoop
self.doIteration(t)
File "/pentest/web/sslstrip/twisted/internet/pollreactor.py", line 167, in doPoll
log.callWithLogger(selectable, _drdw, selectable, fd, event)
---
Fix runtime errors caused by aborted connections. Fixes #3.