impacket
                                
                                 impacket copied to clipboard
                                
                                    impacket copied to clipboard
                            
                            
                            
                        Handle unknown NTSTATUS in SessionError
When a SessionError is raised during SMB session negotiation, currently unexpected NTSTATUS error codes are not handled properly. If the SessionError exception is catched and logged, a KeyError is thrown when retrieving the string representation of the exception in:
https://github.com/SecureAuthCorp/impacket/blob/d509775976ba37f4eaea630cc511e2fc3b65aba3/impacket/smb.py#L581
The error occurred when receiving an unexpected error code during an SMB login scan using CrackMapExec.
This pull request adds a generic error message when the error code is not contained in the ERROR_MESSAGES dictionary.