Fix AttributeError on NetBIOSTimeout in kerberos_login#1096
Fix AttributeError on NetBIOSTimeout in kerberos_login#1096azoxlpf wants to merge 3 commits intoPennyw0rth:mainfrom
Conversation
NeffIsBack
left a comment
There was a problem hiding this comment.
Thanks for the bug fix PR! Any reason why you moved the OSError to the section that does not display the secret? If there is none I think we should keep the error structure similar to before.
I hesitated about whether to keep |
|
Okay, yeah I think we should keep the old logging structure because there are a lot of places in nxc where things can fail and I think it helps to immediately being able to identify that this happened on the authentication call. So that you know that it was the authentication attempt that resulted in that error (usually an explicit reaction to the auth event and not really random). |
34c05c1 to
e1dfde2
Compare
Done ! |
NeffIsBack
left a comment
There was a problem hiding this comment.
Following up on my previous comment, k think we should also display the auth when dealing with connection errors so it is immediately clear that the error originated from the authentication try. Something like "{auth_creds} {error}".
Maybe even combining it with impackets SessionError by doing something like if hasattr(e, getErrorString): desc=e.string; else: desc=""
|
Oh, my bad I had misunderstood your feedback. I think It should be good now |
Description
During Kerberos auth (including
S4U2self/S4U2proxy), aNetBIOSTimeoutwas caught byexcept (SessionError, Exception). The handler callede.getErrorString(), which only exists onSessionError, causing :Fix : Catch connection-related exceptions (
ConnectionResetError,NetBIOSTimeout,NetBIOSError,OSError) in a dedicated block that logs them withself.logger.fail(f"Connection Error: {e}").Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Screenshots (if appropriate):
Before :
After :
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run python -m ruff check . --preview, use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)