byt3bl33d3r / CrackMapExec

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

Unhandled Exception - NetBIOSTimeout #157

Closed aress31 closed 7 years ago

aress31 commented 7 years ago

Command string used

crackmapexec 10.11.1.0/24 --shares -t 20

CME verbose output (using the --verbose flag)

Traceback (most recent call last):
  File "/root/.virtualenvs/CME/local/lib/python2.7/site-packages/gevent/greenlet.py", line 536, in run
    result = self._run(*self.args, **self.kwargs)
  File "/root/.virtualenvs/CME/local/lib/python2.7/site-packages/cme/connection.py", line 62, in __init__
    smb = SMBConnection(self.host, self.host, None, self.args.smb_port)
  File "/root/.virtualenvs/CME/local/lib/python2.7/site-packages/impacket/smbconnection.py", line 63, in __init__
    self.negotiateSession(preferredDialect)
  File "/root/.virtualenvs/CME/local/lib/python2.7/site-packages/impacket/smbconnection.py", line 83, in negotiateSession
    self._timeout, True, flags1=flags1, flags2=flags2, data=negoData)
  File "/root/.virtualenvs/CME/local/lib/python2.7/site-packages/impacket/smbconnection.py", line 147, in _negotiateSession
    resp = self._nmbSession.recv_packet(timeout)
  File "/root/.virtualenvs/CME/local/lib/python2.7/site-packages/impacket/nmb.py", line 855, in recv_packet
    data = self.__read(timeout)
  File "/root/.virtualenvs/CME/local/lib/python2.7/site-packages/impacket/nmb.py", line 933, in __read
    data = self.read_function(4, timeout)
  File "/root/.virtualenvs/CME/local/lib/python2.7/site-packages/impacket/nmb.py", line 918, in non_polling_read
    raise NetBIOSTimeout
NetBIOSTimeout: The NETBIOS connection with the remote host timed out.
Wed Feb 22 11:20:31 2017 <Greenlet at 0x7fbd601a12d0: Connection(Namespace(content=False, cred_id=[], depth=10, dis, <cme.database.CMEDatabase instance at 0x7fbd6171ff, '10.11.1.145', None, None)> failed with NetBIOSTimeout

OS

Linux phlegethon 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux

Detailed issue explanation

It seems like when connection with a target takes too long (time-out) an unhandled NetBIOSTimeout exception is raised.

byt3bl33d3r commented 7 years ago

I've noticed this while spidering as well, thanks for the report.

byt3bl33d3r commented 7 years ago

@AresS31 Think I've fixed this in the latest version. Can you confirm? Thanks!

byt3bl33d3r commented 7 years ago

Closing due to inactivity