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


Python structure.Structure方法代碼示例

本文整理匯總了Python中impacket.structure.Structure方法的典型用法代碼示例。如果您正苦於以下問題:Python structure.Structure方法的具體用法?Python structure.Structure怎麽用?Python structure.Structure使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在impacket.structure的用法示例。


在下文中一共展示了structure.Structure方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: OpenSCManager

# 需要導入模塊: from impacket import structure [as 別名]
# 或者: from impacket.structure import Structure [as 別名]
def OpenSCManager(host, access = 1):
   class foo(Structure):
       opnum = 0x0f
       structure = (
           ('str1', ':'),
           ('null', '<L=0'),
           ('access', '<L'),
       )

   query = foo()
   query['str1'] = rpcstr("\\\\%s\x00" % (host))
   query['access'] = access

   return query

# MS RPC OpenServiceW 
開發者ID:knightmare2600,項目名稱:d4rkc0de,代碼行數:18,代碼來源:070310.py

示例2: OpenService

# 需要導入模塊: from impacket import structure [as 別名]
# 或者: from impacket.structure import Structure [as 別名]
def OpenService(handle, service, access = 1):
   class foo(Structure):
       opnum = 0x10
       structure = (
           ('handle', ':'),
           ('str1', ':'),
           ('access', '<L'),
       )

   query = foo()

   query['handle'] = handle
   query['str1'] = rpcstr("%s\x00" % (service), 0)
   query['access'] = access

   return query 
開發者ID:knightmare2600,項目名稱:d4rkc0de,代碼行數:18,代碼來源:070310.py

示例3: __init__

# 需要導入模塊: from impacket import structure [as 別名]
# 或者: from impacket.structure import Structure [as 別名]
def __init__(self, *args, **kargs):
        structure.Structure.__init__(self, *args, **kargs)
        self['data'] = '' 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:5,代碼來源:pcapfile.py

示例4: __init__

# 需要導入模塊: from impacket import structure [as 別名]
# 或者: from impacket.structure import Structure [as 別名]
def __init__(self, data = None, alignment = 0):
        structure.Structure.__init__(self, data, alignment) 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:4,代碼來源:dhcp.py

示例5: rpcstr

# 需要導入模塊: from impacket import structure [as 別名]
# 或者: from impacket.structure import Structure [as 別名]
def rpcstr(str, id = 1, unicode_string = 1):
   class foo(Structure):
       alignment = 4
       structure = ()

       if(id == 1):
           structure += (('id', '<L')),

       structure += (
           ('max', '<L'),
           ('offset', '<L=0'),
           ('actual', '<L'),
           ('str', '%s'),
       )

   query = foo()

   if(id == 1):
       query['id'] = dword_rand()

   query['max'] = len(str)
   query['actual'] = len(str)

   if(unicode_string == 1):
       query['str'] = utf16(str)
   else:
       query['str'] = str

   return query

# MS RPC OpenSCManager 
開發者ID:knightmare2600,項目名稱:d4rkc0de,代碼行數:33,代碼來源:070310.py

示例6: __init__

# 需要導入模塊: from impacket import structure [as 別名]
# 或者: from impacket.structure import Structure [as 別名]
def __init__(self, *args, **kargs):
        structure.Structure.__init__(self, *args, **kargs)
        self['data'] = b'' 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:5,代碼來源:pcapfile.py


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