explicitly identify an auth failure through smb.py

Bug #1389034 reported by Sam Stavinoha on 2014-11-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sam Stavinoha

Bug Description

It is common to see the following error/log output when trying to communicate with remote windows servers:

    Impacket v0.9.12 - Copyright 2002-2014 Core Security Technologies

    Trying protocol 51666/SMB...

    SMB SessionError: STATUS_LOGON_FAILURE(The attempted logon is invalid. This is either due to a bad username or authentication information.)

It would be useful to read this output explicitly (if it is the consistent output across most windows servers) and raise a specific authentication failure exception to inform the caller that the supplied credentials were invalid.

What currently happens is SubprocessError: subprocess with pid: 12345 has terminated unexpectedly (not informative!)

Sam Stavinoha (smlstvnh) wrote :
description: updated
description: updated

Fix proposed to branch: master
Review: https://review.openstack.org/132721

Changed in satori:
status: New → In Progress

Reviewed: https://review.openstack.org/132721
Committed: https://git.openstack.org/cgit/stackforge/satori/commit/?id=dea382bae1cd043189589c0f7d4c20b4b6725ab5
Submitter: Jenkins
Branch: master

commit dea382bae1cd043189589c0f7d4c20b4b6725ab5
Author: Samuel Stavinoha <email address hidden>
Date: Tue Nov 4 20:18:53 2014 +0000

    interpret stderr and raise custom exceptions

    1. Detects failed authentication message from Windows systems
        and raises SatoriSMBAuthenticationException
    2. Detects error message stating that the user has been locked
        out of a Windows system and raises SatoriSMBLockoutException
    3. Detects error message stating shared access flags are
        incompatible on a Windows system and raises

    Consolidates (DRY) the logic which listens to command output in
    smb.py so that the custom Exceptions mentioned above can be raised
    if any of the known error output is encountered.

    Unchanged: A non-zero exit status with an unknown error message
                raises a SubprocessError including that error message.

    Previously, all error messages corresponding to non-zero exit codes
    were "unknown".

    Closes-Bug: #1389034
    Change-Id: I157adfe9034177f7975473ff96f29fc17c6ad12b

Changed in satori:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers