Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SMB] Unknown NT STATUS Errors from [MS-ERREF] - 0xc9000000 / 3372220416 #1603

Closed
brunorafaeli opened this issue Aug 30, 2023 · 2 comments
Closed
Labels
waiting for response Further information is needed from people who opened the issue or pull request

Comments

@brunorafaeli
Copy link

Configuration

impacket version: 0_9_23
Python version: 3.10

Debug Output With Command String

powershell.exe -executionpolicy bypass -File "C:\/Windows\/MyFolder\/MyFile.ps1"

File /usr/local/lib/python3.10/site-packages/impacket/smb.py, line 521, in __str__/n<class 'KeyError'>:3372220416'

The error happens because the code is trying to access an error_code that does not exist in the mapping of NTSTATUS that comes from [MS-ERREF]: NTSTATUS Values

The code 3372220416 is 0xc9000000 in Hex, and is probably being converted by Python.

def __str__( self ):
        error_class = SessionError.error_classes.get( self.error_class, None )
        if not error_class:
            error_code_str = self.error_code
            error_class_str = self.error_class
        else:
            error_class_str = error_class[0]
            error_code = error_class[1].get( self.error_code, None )
            if not error_code:
                error_code_str = self.error_code
            else:
                error_code_str = '%s(%s)' % error_code

        if self.nt_status:
            return 'SMB SessionError: %s(%s)' % nt_errors.ERROR_MESSAGES[self.error_code] ### THIS LINE IS RAISING AN EXCEPTION
        else:
            # Fall back to the old format
            return 'SMB SessionError: class: %s, code: %s' % (error_class_str, error_code_str)
@anadrianmanrique
Copy link
Contributor

Can you provide steps necessary to reproduce the issue? thanks

@anadrianmanrique anadrianmanrique added the waiting for response Further information is needed from people who opened the issue or pull request label Sep 14, 2023
@rtpt-erikgeiser
Copy link
Contributor

Sounds like it would be fixed by #1311.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for response Further information is needed from people who opened the issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants