Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

ValueError: too many values to unpack (expected 2) #822

Open
0xGreen opened this issue Dec 2, 2023 · 2 comments
Open

ValueError: too many values to unpack (expected 2) #822

0xGreen opened this issue Dec 2, 2023 · 2 comments

Comments

@0xGreen
Copy link

0xGreen commented Dec 2, 2023

After kali update, CME feels broken, works fine for valid credentials but errors our for invalid credentials:

Operating System: Kali
CME Version: 5.4.0

Valid Credentials

crackmapexec smb win7 -u <valid-user> -p <valid-password>                                                                                                                    
SMB         win7            445    VM-WIN7          [*] Windows 7 Professional 7601 Service Pack 1 x64 (name:VM-WIN7) (domain:vm-win7) (signing:False) (SMBv1:True)         
SMB         win7            445    VM-WIN7          [+] vm-win7\<valid-user:valid-password> (Pwn3d!)

Invalid Credentials

command:

crackmapexec smb win7 -u <valid-user> -p <invalid-password>

output:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/impacket/smbconnection.py", line 276, in login
    return self._SMBConnection.login(user, password, domain, lmhash, nthash, ntlmFallback)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/impacket/smb.py", line 3502, in login
    self.login_extended(user, password, domain, lmhash, nthash, use_ntlmv2 = True)
  File "/usr/local/lib/python3.11/dist-packages/impacket/smb.py", line 3437, in login_extended
    if smb.isValidAnswer(SMB.SMB_COM_SESSION_SETUP_ANDX):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/impacket/smb.py", line 786, in isValidAnswer
    raise SessionError("SMB Library Error", self['ErrorClass'] + (self['_reserved'] << 8), self['ErrorCode'], self['Flags2'] & SMB.FLAGS2_NT_STATUS, self)
impacket.smb.SessionError: SMB SessionError: code: 0xc000006d - STATUS_LOGON_FAILURE - The attempted logon is invalid. This is either due to a bad username or authentication information.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cme/protocols/smb.py", line 433, in plaintext_login
    self.conn.login(self.username, self.password, domain)
  File "/usr/local/lib/python3.11/dist-packages/impacket/smbconnection.py", line 280, in login
    raise SessionError(e.get_error_code(), e.get_error_packet())
impacket.smbconnection.SessionError: SMB SessionError: code: 0xc000006d - STATUS_LOGON_FAILURE - The attempted logon is invalid. This is either due to a bad username or authentication information.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/crackmapexec", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3/dist-packages/cme/crackmapexec.py", line 257, in main
    asyncio.run(
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cme/crackmapexec.py", line 105, in start_threadpool
    await asyncio.gather(*jobs)
  File "/usr/lib/python3/dist-packages/cme/crackmapexec.py", line 69, in run_protocol
    await asyncio.wait_for(
  File "/usr/lib/python3.11/asyncio/tasks.py", line 452, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cme/protocols/smb.py", line 143, in __init__
    connection.__init__(self, args, db, host)
  File "/usr/lib/python3/dist-packages/cme/connection.py", line 65, in __init__
    self.proto_flow()
  File "/usr/lib/python3/dist-packages/cme/connection.py", line 101, in proto_flow
    if self.login() or (self.username == '' and self.password == ''):
       ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cme/connection.py", line 300, in login
    elif self.plaintext_login(self.domain, user, password): return True
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cme/protocols/smb.py", line 459, in plaintext_login
    error, desc = e.getErrorString()
    ^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)
@Mister-Joe
Copy link

I also had this issue with version 5.4.0. Clone the repository and build to get the latest version (6.1.0), which fixes this issue.

@0xGreen
Copy link
Author

0xGreen commented Dec 5, 2023

I also had this issue with version 5.4.0. Clone the repository and build to get the latest version (6.1.0), which fixes this issue.

It worked! Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants