當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。