Forcing the SMB dialect to SMBv1 since it gives us prettier OS banners

main
byt3bl33d3r 2017-04-10 02:58:33 -06:00
parent 6d9de77f4b
commit e98f798eb3
1 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import os
import ntpath import ntpath
from StringIO import StringIO from StringIO import StringIO
from impacket.smbconnection import SMBConnection, SessionError from impacket.smbconnection import SMBConnection, SessionError
from impacket.smb import SMB_DIALECT
from impacket.examples.secretsdump import RemoteOperations, SAMHashes, LSASecrets, NTDSHashes from impacket.examples.secretsdump import RemoteOperations, SAMHashes, LSASecrets, NTDSHashes
from impacket.nmb import NetBIOSError from impacket.nmb import NetBIOSError
from impacket.dcerpc.v5 import transport, lsat, lsad from impacket.dcerpc.v5 import transport, lsat, lsad
@ -312,8 +313,9 @@ class smb(connection):
return False return False
def create_conn_obj(self): def create_conn_obj(self):
#Seems like SMBv3 doesn't give us the 'pretty' OS banners, sticking to SMBv1 for now
try: try:
self.conn = SMBConnection(self.host, self.host, None, self.args.smb_port) self.conn = SMBConnection(self.host, self.host, None, self.args.smb_port, preferredDialect=SMB_DIALECT)
except socket.error: except socket.error:
return False return False
except Exception as e: except Exception as e: