MCPcopy
hub / github.com/fortra/impacket / getMachineNameAndDomain

Method getMachineNameAndDomain

impacket/examples/secretsdump.py:779–794  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

777 return salt
778
779 def getMachineNameAndDomain(self):
780 if self.__smbConnection.getServerName() == '':
781 # No serverName.. this is either because we're doing Kerberos
782 # or not receiving that data during the login process.
783 # Let's try getting it through RPC
784 rpc = transport.DCERPCTransportFactory(r'ncacn_np:445[\pipe\wkssvc]')
785 rpc.set_smb_connection(self.__smbConnection)
786 dce = rpc.get_dce_rpc()
787 dce.connect()
788 dce.bind(wkst.MSRPC_UUID_WKST)
789 resp = wkst.hNetrWkstaGetInfo(dce, 100)
790 dce.disconnect()
791 return resp['WkstaInfo']['WkstaInfo100']['wki100_computername'][:-1], resp['WkstaInfo']['WkstaInfo100'][
792 'wki100_langroup'][:-1]
793 else:
794 return self.__smbConnection.getServerName(), self.__smbConnection.getServerDomain()
795
796 def getDNSDomain(self):
797 if self.__smbConnection.getServerDNSDomainName() == '':

Callers 7

getDomainUsersMethod · 0.95
getDomainSidMethod · 0.95
__printSecretMethod · 0.45
dumpMethod · 0.45
__init__Method · 0.45
dumpMethod · 0.45

Calls 7

set_smb_connectionMethod · 0.80
getServerNameMethod · 0.45
get_dce_rpcMethod · 0.45
connectMethod · 0.45
bindMethod · 0.45
disconnectMethod · 0.45
getServerDomainMethod · 0.45

Tested by

no test coverage detected