当前位置: 首页>>代码示例>>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;未经允许,请勿转载。