I've recently been thinking of projects to start, and I've settled on an OS fingerprinting tool. I know that the OS can be determined by matching TTL and TCP window size, but I don't know the most efficient way to cross-reference that information to identify the OS.
My idea so far is to have a text file containing the different fingerprints, and once the TCP traffic is captured, cross-reference it with the contents of the text file. But this method seems too bulky and slow. I thought of having some basic fingerprints built in and then cross-referencing text files within some structured sub-directories, but this also seems like a shoddy workaround.
At its core, my question is this; What is the best and most efficient way to query a large amount of information for specific information using Python?
Side note: I know that Scapy can be used with Nmap and P0f, but I'd like to avoid using these.