byt3bl33d3r / CrackMapExec

A swiss army knife for pentesting networks
BSD 2-Clause "Simplified" License
8.38k stars 1.64k forks source link

an other error #43

Closed its0x08 closed 8 years ago

its0x08 commented 8 years ago
[+] 192.168.192.224:445 Login successful LENOVO\admin:admin
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "crackmapexec.py", line 3034, in connect
    share_list = enum_shares(smb)
  File "crackmapexec.py", line 2811, in enum_shares
    if smb.listPath(share_name, '*', args.passwd):
  File "/usr/local/lib/python2.7/dist-packages/impacket/smbconnection.py", line 344, in listPath
    return self._SMBConnection.list_path(shareName, path, password)
  File "/usr/local/lib/python2.7/dist-packages/impacket/smb3.py", line 1392, in listPath
    self.close(treeId, fileId)
  File "/usr/local/lib/python2.7/dist-packages/impacket/smb3.py", line 974, in close
    ans = self.recvSMB(packetID)
  File "/usr/local/lib/python2.7/dist-packages/impacket/smb3.py", line 376, in recvSMB
    packet = SMB2Packet(data.get_trailer())
  File "/usr/local/lib/python2.7/dist-packages/impacket/smb3structs.py", line 434, in __init__
    Structure.__init__(self,data)
  File "/usr/local/lib/python2.7/dist-packages/impacket/structure.py", line 82, in __init__
    self.fromString(data)
  File "/usr/local/lib/python2.7/dist-packages/impacket/structure.py", line 147, in fromString
    self[field[0]] = self.unpack(field[1], data[:size], dataClassOrCode = dataClassOrCode, field = field[0])
  File "/usr/local/lib/python2.7/dist-packages/impacket/structure.py", line 291, in unpack
    raise Exception, "Unpacked data doesn't match constant value '%r' should be '%r'" % (data, answer)
Exception: ("Unpacked data doesn't match constant value '''' should be ''\\xfeSMB''", 'When unpacking field \'ProtocolID | "\xfeSMB | \'\'[:4]\'')
<Greenlet at 0xb52b920cL: connect('192.168.192.224')> failed with Exception
maaaaz commented 8 years ago

Attaching a pcap file might help.

its0x08 commented 8 years ago

thats all I can attach :+1: root@backbox:/home/its0x08/Desktop/exploits/CrackMapExec# python crackmapexec.py -t 100 list.txt [] 192.168.195.1:445 is running Windows 6.3 Build 9600 (name:ACER) (domain:ACER) [] 192.168.195.0:445 is running Windows 6.1 Build 7600 (name:КАМИЛЛА-ПК) (domain:КАМИЛЛА-ПК) [] 192.168.202.0:445 is running Windows 6.3 Build 9600 (name:HP) (domain:HP) [_] 192.168.196.0:445 is running Windows 10.0 Build 10240 (name:CLAUDE-PC) (domain:CLAUDE-PC) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run result = self._run(_self.args, *_self.kwargs) File "crackmapexec.py", line 2929, in connect smb.logoff() File "/usr/local/lib/python2.7/dist-packages/impacket/smbconnection.py", line 296, in logoff return self._SMBConnection.logoff() File "/usr/local/lib/python2.7/dist-packages/impacket/smb3.py", line 1234, in logoff ans = self.recvSMB(packetID) File "/usr/local/lib/python2.7/dist-packages/impacket/smb3.py", line 356, in recvSMB data = self._NetBIOSSession.recv_packet(self._timeout) File "/usr/local/lib/python2.7/dist-packages/impacket/nmb.py", line 855, in recv_packet data = self.read(timeout) File "/usr/local/lib/python2.7/dist-packages/impacket/nmb.py", line 933, in read data = self.read_function(4, timeout) File "/usr/local/lib/python2.7/dist-packages/impacket/nmb.py", line 918, in non_polling_read raise NetBIOSTimeout NetBIOSTimeout: The NETBIOS connection with the remote host timed out. <Greenlet at 0xb650dc0cL: connect('192.168.202.0')> failed with NetBIOSTimeout

^CKeyboardInterrupt [*] Got CTRL-C! Exiting..

byt3bl33d3r commented 8 years ago

@its0x08 check the new version out

its0x08 commented 8 years ago

now this unicode error happen' again .. :3 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run result = self._run(_self.args, *_self.kwargs) File "/home/its_0x08/Desktop/exploits/CrackMapExec/core/maingreenlet.py", line 64, in connect smb = smart_login(host, smb, domain) File "/home/its_0x08/Desktop/exploits/CrackMapExec/core/smartlogin.py", line 135, in smart_login print_succ("{}:{} Login successful {}{}:{}".format(host, settings.args.port, domain, user, passwd)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128) <Greenlet at 0xb52e9f7cL: connect('192.168.192.161')> failed with UnicodeEncodeError

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run result = self._run(_self.args, *_self.kwargs) File "/home/its_0x08/Desktop/exploits/CrackMapExec/core/maingreenlet.py", line 64, in connect smb = smart_login(host, smb, domain) File "/home/its_0x08/Desktop/exploits/CrackMapExec/core/smartlogin.py", line 140, in smart_login print_error("{}:{} {}{}:{} {}".format(host, settings.args.port, domain, user, passwd, e)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-11: ordinal not in range(128) <Greenlet at 0xb528211cL: connect('192.168.192.165')> failed with UnicodeEncodeError

byt3bl33d3r commented 8 years ago

@its0x08 my bad, should be fixed now

its0x08 commented 8 years ago

now is good :+1:

maaaaz commented 8 years ago

@byt3bl33d3r If the fix you provided is OK, you should also apply it to every print_*() call.