当前位置: 首页>>代码示例>>Python>>正文


Python SuperSocket.close方法代码示例

本文整理汇总了Python中scapy.supersocket.SuperSocket.close方法的典型用法代码示例。如果您正苦于以下问题:Python SuperSocket.close方法的具体用法?Python SuperSocket.close怎么用?Python SuperSocket.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scapy.supersocket.SuperSocket的用法示例。


在下文中一共展示了SuperSocket.close方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_if_list

# 需要导入模块: from scapy.supersocket import SuperSocket [as 别名]
# 或者: from scapy.supersocket.SuperSocket import close [as 别名]
def get_if_list():
    try:
        f = open("/proc/net/dev", "rb")
    except IOError:
        try:
            f.close()
        except Exception:
            pass
        warning("Can't open /proc/net/dev !")
        return []
    lst = []
    f.readline()
    f.readline()
    for line in f:
        line = plain_str(line)
        lst.append(line.split(":")[0].strip())
    f.close()
    return lst 
开发者ID:secdev,项目名称:scapy,代码行数:20,代码来源:linux.py

示例2: in6_getifaddr

# 需要导入模块: from scapy.supersocket import SuperSocket [as 别名]
# 或者: from scapy.supersocket.SuperSocket import close [as 别名]
def in6_getifaddr():
    """
    Returns a list of 3-tuples of the form (addr, scope, iface) where
    'addr' is the address of scope 'scope' associated to the interface
    'ifcace'.

    This is the list of all addresses of all interfaces available on
    the system.
    """
    ret = []
    try:
        f = open("/proc/net/if_inet6","rb")
    except IOError as err:
        return ret
    l = f.readlines()
    for i in l:
        # addr, index, plen, scope, flags, ifname
        tmp = i.split()
        addr = struct.unpack('4s4s4s4s4s4s4s4s', tmp[0])
        addr = scapy.utils6.in6_ptop(b':'.join(addr).decode('ascii'))
        ret.append((addr, int(tmp[3], 16), tmp[5].decode('ascii'))) # (addr, scope, iface)
    f.close()
    return ret 
开发者ID:entynetproject,项目名称:arissploit,代码行数:25,代码来源:linux.py

示例3: get_if

# 需要导入模块: from scapy.supersocket import SuperSocket [as 别名]
# 或者: from scapy.supersocket.SuperSocket import close [as 别名]
def get_if(iff,cmd):
    s=socket.socket()
    ifreq = ioctl(s, cmd, struct.pack("16s16x",iff))
    s.close()
    return ifreq 
开发者ID:medbenali,项目名称:CyberScan,代码行数:7,代码来源:linux.py

示例4: close

# 需要导入模块: from scapy.supersocket import SuperSocket [as 别名]
# 或者: from scapy.supersocket.SuperSocket import close [as 别名]
def close(self):
        if self.closed:
            return
        self.closed=1
        if self.promisc:
            for i in self.iff:
                set_promisc(self.ins, i, 0)
        SuperSocket.close(self) 
开发者ID:medbenali,项目名称:CyberScan,代码行数:10,代码来源:linux.py

示例5: close

# 需要导入模块: from scapy.supersocket import SuperSocket [as 别名]
# 或者: from scapy.supersocket.SuperSocket import close [as 别名]
def close(self):
            SuperSocket.close(self)
            self.usbpcap_proc.kill() 
开发者ID:secdev,项目名称:scapy,代码行数:5,代码来源:usb.py

示例6: in6_getifaddr

# 需要导入模块: from scapy.supersocket import SuperSocket [as 别名]
# 或者: from scapy.supersocket.SuperSocket import close [as 别名]
def in6_getifaddr():
    """
    Returns a list of 3-tuples of the form (addr, scope, iface) where
    'addr' is the address of scope 'scope' associated to the interface
    'iface'.

    This is the list of all addresses of all interfaces available on
    the system.
    """
    ret = []
    try:
        fdesc = open("/proc/net/if_inet6", "rb")
    except IOError:
        return ret
    for line in fdesc:
        # addr, index, plen, scope, flags, ifname
        tmp = plain_str(line).split()
        addr = scapy.utils6.in6_ptop(
            b':'.join(
                struct.unpack('4s4s4s4s4s4s4s4s', tmp[0].encode())
            ).decode()
        )
        # (addr, scope, iface)
        ret.append((addr, int(tmp[3], 16), tmp[5]))
    fdesc.close()
    return ret 
开发者ID:secdev,项目名称:scapy,代码行数:28,代码来源:linux.py

示例7: close

# 需要导入模块: from scapy.supersocket import SuperSocket [as 别名]
# 或者: from scapy.supersocket.SuperSocket import close [as 别名]
def close(self):
        if not self.closed:
            self.impl.close()
            self.outs = None
            self.ins = None
            SuperSocket.close(self) 
开发者ID:secdev,项目名称:scapy,代码行数:8,代码来源:isotp.py

示例8: __del__

# 需要导入模块: from scapy.supersocket import SuperSocket [as 别名]
# 或者: from scapy.supersocket.SuperSocket import close [as 别名]
def __del__(self):
        self.close() 
开发者ID:secdev,项目名称:scapy,代码行数:4,代码来源:isotp.py


注:本文中的scapy.supersocket.SuperSocket.close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。