當前位置: 首頁>>代碼示例>>Python>>正文


Python srvs.hNetrServerGetInfo方法代碼示例

本文整理匯總了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() 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:21,代碼來源:test_srvs.py

示例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']) 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:18,代碼來源:smbclient.py

示例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() 
開發者ID:praetorian-code,項目名稱:pentestly,代碼行數:23,代碼來源:smbmap.py

示例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'] 
開發者ID:tholum,項目名稱:PiBunny,代碼行數:18,代碼來源:smbclient.py


注:本文中的impacket.dcerpc.v5.srvs.hNetrServerGetInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。