diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e89b85975a54c994f91ddfe3adc1b868d9efc0c..36d3d977f282117e76fa1e60fd6a05ce71f1f3ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.5.0 - TBD * Added `smbprotocol.exceptions.SMBConnectionClosed` that is raised when trying to send or receive data on a connection that has been closed +* Added `smbprotocol.exceptions.WrongPassword` that is raised when some servers indicate the password is not correct or the account is locked out * Do not attempt to reuse any cached connections that have been closed in `smbclient` * Added a lock when writing to the socket, only 1 thread can write a message at a single point in time * Revamped the SMB receiver code to simplify the logic and make it more durable diff --git a/smbprotocol/exceptions.py b/smbprotocol/exceptions.py index 1bac3aaad9310b7db1c7cfe1206b0fcb42632c61..752d06d36667274390c415eef6d3558ec001a565 100644 --- a/smbprotocol/exceptions.py +++ b/smbprotocol/exceptions.py @@ -438,6 +438,11 @@ class PrivilegeNotHeld(SMBResponseException): _STATUS_CODE = NtStatus.STATUS_PRIVILEGE_NOT_HELD +class WrongPassword(SMBResponseException): + _BASE_MESSAGE = "The specified password is not correct or the user is locked out." + _STATUS_CODE = NtStatus.STATUS_WRONG_PASSWORD + + class LogonFailure(SMBResponseException): _BASE_MESSAGE = "The attempted logon is invalid. This is either due to a bad username or authentication " \ "information." diff --git a/smbprotocol/header.py b/smbprotocol/header.py index bbae26d9b5de4544f289a7c6a0cb716134b0ea1d..5950a440d97111908f6e95005b2103515707d47f 100644 --- a/smbprotocol/header.py +++ b/smbprotocol/header.py @@ -87,6 +87,7 @@ class NtStatus(object): STATUS_NO_EAS_ON_FILE = 0xC0000052 STATUS_EA_CORRUPT_ERROR = 0xC0000053 STATUS_PRIVILEGE_NOT_HELD = 0xC0000061 + STATUS_WRONG_PASSWORD = 0xC000006A STATUS_LOGON_FAILURE = 0xC000006D STATUS_PASSWORD_EXPIRED = 0xC0000071 STATUS_INSUFFICIENT_RESOURCES = 0xC000009A