% Tests for Scapy's p0f module. ~ p0f + Basic p0f module tests = Module loading load_module('p0f') = Fetch database ~ netaccess try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen for i in range(10): try: open("p0f.fp", 'wb').write(urlopen('https://raw.githubusercontent.com/p0f/p0f/e8b924ae7fa099a3a5fe7def0ce3e397fd9a7137/p0f.fp').read()) break except: raise conf.p0f_base = "p0f.fp" p0fdb.reload(conf.p0f_base) + Default tests = Test TCP p0f, SYN - Windows ~ netaccess pkt = IP(b'E\x00\x004Se@\x00\x80\x06\x93?\n\x00\x00\x14\n\x00\x00\x0c\xc3\x08\x01\xbb\xcf\xb4\xbb\\\x00\x00\x00\x00\x80\x02 \x00\xeb\x1b\x00\x00\x02\x04\x05\xb4\x01\x03\x03\x08\x01\x01\x04\x02') assert p0f(pkt) == (('s', 'win', 'Windows', '7 or 8'), 0, False) = Test TCP p0f, SYN - Linux ~ netaccess pkt = IP(b"E\x10\x00