本文整理汇总了Python中impacket.dcerpc.v5.wkst.hNetrWkstaGetInfo方法的典型用法代码示例。如果您正苦于以下问题:Python wkst.hNetrWkstaGetInfo方法的具体用法?Python wkst.hNetrWkstaGetInfo怎么用?Python wkst.hNetrWkstaGetInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类impacket.dcerpc.v5.wkst
的用法示例。
在下文中一共展示了wkst.hNetrWkstaGetInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getMachineNameAndDomain
# 需要导入模块: from impacket.dcerpc.v5 import wkst [as 别名]
# 或者: from impacket.dcerpc.v5.wkst import hNetrWkstaGetInfo [as 别名]
def getMachineNameAndDomain(self):
if self.__smbConnection.getServerName() == '':
# No serverName.. this is either because we're doing Kerberos
# or not receiving that data during the login process.
# Let's try getting it through RPC
rpc = transport.DCERPCTransportFactory(r'ncacn_np:445[\pipe\wkssvc]')
rpc.set_smb_connection(self.__smbConnection)
dce = rpc.get_dce_rpc()
dce.connect()
dce.bind(wkst.MSRPC_UUID_WKST)
resp = wkst.hNetrWkstaGetInfo(dce, 100)
dce.disconnect()
return resp['WkstaInfo']['WkstaInfo100']['wki100_computername'][:-1], resp['WkstaInfo']['WkstaInfo100'][
'wki100_langroup'][:-1]
else:
return self.__smbConnection.getServerName(), self.__smbConnection.getServerDomain()
示例2: test_hNetrWkstaSetInfo
# 需要导入模块: from impacket.dcerpc.v5 import wkst [as 别名]
# 或者: from impacket.dcerpc.v5.wkst import hNetrWkstaGetInfo [as 别名]
def test_hNetrWkstaSetInfo(self):
dce, rpctransport = self.connect()
resp = wkst.hNetrWkstaGetInfo(dce, 502)
resp.dump()
oldVal = resp['WkstaInfo']['WkstaInfo502']['wki502_dormant_file_limit']
resp['WkstaInfo']['WkstaInfo502']['wki502_dormant_file_limit'] = 500
resp2 = wkst.hNetrWkstaSetInfo(dce, 502,resp['WkstaInfo']['WkstaInfo502'])
resp2.dump()
resp = wkst.hNetrWkstaGetInfo(dce, 502)
resp.dump()
self.assertTrue(500 == resp['WkstaInfo']['WkstaInfo502']['wki502_dormant_file_limit'] )
resp['WkstaInfo']['WkstaInfo502']['wki502_dormant_file_limit'] = oldVal
resp2 = wkst.hNetrWkstaSetInfo(dce, 502,resp['WkstaInfo']['WkstaInfo502'])
resp2.dump()
示例3: test_hNetrWkstaGetInfo
# 需要导入模块: from impacket.dcerpc.v5 import wkst [as 别名]
# 或者: from impacket.dcerpc.v5.wkst import hNetrWkstaGetInfo [as 别名]
def test_hNetrWkstaGetInfo(self):
dce, rpctransport = self.connect()
resp = wkst.hNetrWkstaGetInfo(dce, 100)
resp.dump()
resp = wkst.hNetrWkstaGetInfo(dce, 101)
resp.dump()
resp = wkst.hNetrWkstaGetInfo(dce, 102)
resp.dump()
resp = wkst.hNetrWkstaGetInfo(dce, 502)
resp.dump()
示例4: getMachineNameAndDomain
# 需要导入模块: from impacket.dcerpc.v5 import wkst [as 别名]
# 或者: from impacket.dcerpc.v5.wkst import hNetrWkstaGetInfo [as 别名]
def getMachineNameAndDomain(self):
if self.__smbConnection.getServerName() == '':
# No serverName.. this is either because we're doing Kerberos
# or not receiving that data during the login process.
# Let's try getting it through RPC
rpc = transport.DCERPCTransportFactory(r'ncacn_np:445[\pipe\wkssvc]')
rpc.set_smb_connection(self.__smbConnection)
dce = rpc.get_dce_rpc()
dce.connect()
dce.bind(wkst.MSRPC_UUID_WKST)
resp = wkst.hNetrWkstaGetInfo(dce, 100)
dce.disconnect()
return resp['WkstaInfo']['WkstaInfo100']['wki100_computername'][:-1], resp['WkstaInfo']['WkstaInfo100']['wki100_langroup'][:-1]
else:
return self.__smbConnection.getServerName(), self.__smbConnection.getServerDomain()