本文整理匯總了Python中impacket.dcerpc.v5.srvs.hNetrServerGetInfo方法的典型用法代碼示例。如果您正苦於以下問題:Python srvs.hNetrServerGetInfo方法的具體用法?Python srvs.hNetrServerGetInfo怎麽用?Python srvs.hNetrServerGetInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類impacket.dcerpc.v5.srvs
的用法示例。
在下文中一共展示了srvs.hNetrServerGetInfo方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_hNetrServerGetInfo
# 需要導入模塊: from impacket.dcerpc.v5 import srvs [as 別名]
# 或者: from impacket.dcerpc.v5.srvs import hNetrServerGetInfo [as 別名]
def test_hNetrServerGetInfo(self):
dce, rpctransport = self.connect()
resp = srvs.hNetrServerGetInfo(dce, 100)
resp.dump()
resp = srvs.hNetrServerGetInfo(dce, 101)
resp.dump()
resp = srvs.hNetrServerGetInfo(dce, 102)
resp.dump()
resp = srvs.hNetrServerGetInfo(dce, 103)
resp.dump()
resp = srvs.hNetrServerGetInfo(dce, 502)
resp.dump()
resp = srvs.hNetrServerGetInfo(dce, 503)
resp.dump()
示例2: do_info
# 需要導入模塊: from impacket.dcerpc.v5 import srvs [as 別名]
# 或者: from impacket.dcerpc.v5.srvs import hNetrServerGetInfo [as 別名]
def do_info(self, line):
if self.loggedIn is False:
LOG.error("Not logged in")
return
rpctransport = transport.SMBTransport(self.smb.getRemoteHost(), filename = r'\srvsvc', smb_connection = self.smb)
dce = rpctransport.get_dce_rpc()
dce.connect()
dce.bind(srvs.MSRPC_UUID_SRVS)
resp = srvs.hNetrServerGetInfo(dce, 102)
print("Version Major: %d" % resp['InfoStruct']['ServerInfo102']['sv102_version_major'])
print("Version Minor: %d" % resp['InfoStruct']['ServerInfo102']['sv102_version_minor'])
print("Server Name: %s" % resp['InfoStruct']['ServerInfo102']['sv102_name'])
print("Server Comment: %s" % resp['InfoStruct']['ServerInfo102']['sv102_comment'])
print("Server UserPath: %s" % resp['InfoStruct']['ServerInfo102']['sv102_userpath'])
print("Simultaneous Users: %d" % resp['InfoStruct']['ServerInfo102']['sv102_users'])
示例3: get_version
# 需要導入模塊: from impacket.dcerpc.v5 import srvs [as 別名]
# 或者: from impacket.dcerpc.v5.srvs import hNetrServerGetInfo [as 別名]
def get_version(self, host):
try:
rpctransport = transport.SMBTransport(self.smbconn[host].getServerName(), self.smbconn[host].getRemoteHost(), filename = r'\srvsvc', smb_connection = self.smbconn[host])
dce = rpctransport.get_dce_rpc()
dce.connect()
dce.bind(srvs.MSRPC_UUID_SRVS)
resp = srvs.hNetrServerGetInfo(dce, 102)
info("Version Major: %d" % resp['InfoStruct']['ServerInfo102']['sv102_version_major'])
info("Version Minor: %d" % resp['InfoStruct']['ServerInfo102']['sv102_version_minor'])
info("Server Name: %s" % resp['InfoStruct']['ServerInfo102']['sv102_name'])
info("Server Comment: %s" % resp['InfoStruct']['ServerInfo102']['sv102_comment'])
info("Server UserPath: %s" % resp['InfoStruct']['ServerInfo102']['sv102_userpath'])
info("Simultaneous Users: %d" % resp['InfoStruct']['ServerInfo102']['sv102_users'])
except Exception as e:
color('[!] RPC Access denied...oh well')
color('[!]', e)
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
info(exc_type, fname, exc_tb.tb_lineno)
sys.exit()
示例4: do_info
# 需要導入模塊: from impacket.dcerpc.v5 import srvs [as 別名]
# 或者: from impacket.dcerpc.v5.srvs import hNetrServerGetInfo [as 別名]
def do_info(self, line):
if self.loggedIn is False:
logging.error("Not logged in")
return
rpctransport = transport.SMBTransport(self.smb.getRemoteHost(), filename = r'\srvsvc', smb_connection = self.smb)
dce = rpctransport.get_dce_rpc()
dce.connect()
dce.bind(srvs.MSRPC_UUID_SRVS)
resp = srvs.hNetrServerGetInfo(dce, 102)
print "Version Major: %d" % resp['InfoStruct']['ServerInfo102']['sv102_version_major']
print "Version Minor: %d" % resp['InfoStruct']['ServerInfo102']['sv102_version_minor']
print "Server Name: %s" % resp['InfoStruct']['ServerInfo102']['sv102_name']
print "Server Comment: %s" % resp['InfoStruct']['ServerInfo102']['sv102_comment']
print "Server UserPath: %s" % resp['InfoStruct']['ServerInfo102']['sv102_userpath']
print "Simultaneous Users: %d" % resp['InfoStruct']['ServerInfo102']['sv102_users']