So, I’m new to this whole blogging thing, and I haven’t quite gotten the hang of it down yet. Apparently I’m supposed to finish what I’m posting about rather than post and then finish.
A friend and I have discussed various sorts of datamining that we could do on the network traffic that firewalls routinely filter out and drop because they’re not actually intended for our particular IP. Somewhere in this discussion, we had talked about doing OS fingerprinting to see what else was on the local network (which is a small campus-sort of network, uses a /21 so only 2048 maximum hosts). But the conversation meandered somewhere else from there and never really got anywhere.
Which brings me to a few days ago. I was sitting in class and thinking about OS fingerprinting some more. I’ve played around with nmap’s OS fingerprinting before, but it is a rather brute force approach, being active. And active scans with nmap are something that people don’t like you doing on their network. So I started thinking about passive OS fingerprinting.
So, I did some searching on the internet and came across a tool called p0f, that does passive fingerprinting on all of the packets that it captures with pcap. Its developers even provide a handy webpage that will try to guess your OS (it’s pretty accurate, unless you’re like me and are running PF with scrub enabled), which you can try out here.
Which led me to deciding that it would be interesting to try out. So I setup p0f and set it to listen on an interface outside of my firewall and watched as packets started rolling in, as well as all of the OS guesses.
Which brings me to the results. I ran the scan on a /21 (that’s 2048 IPs) network, and I only saw packets from 513 unique hosts over the run of about a day and a half. Additionally, I had a lot of unknown hosts, or ones that I would categorize as unknown based on widely differing results from p0f. Additionally, in a few cases, I was able to find out the host OS at a specific IP that was listed as an unknwon by p0f and guessed that other fingerprints that looked the same were the same OS.
So, without further ado, here are the results (broken down by OS family):
143 hosts running XP.
113 hosts running Vista.
24 hosts running Windows XP or newer (so XP/Vista).
282 total running some version of Windows (I’ll explain the missing two in a moment).
54 hosts running OSX.
12 hosts running Linux of some flavour.
163 unknown OSs (of which I think one is running Linux and 6 are Windows).
2 Others.
So, hosts of interest. Someone is still running Windows 98SE, and there is also a Windows 2000 SP4 based computer on the network.
Additionally, two people still have PPC based Macs (as evidenced by their earlier, non-Intel version of OSX). One person is running FreeBSD (okay, that’s what I seem to scan as when I’m not scanning as unknown) and one person seems to be running some strange sort of NAS operating system (Synology or something?).
And yes, there are some people with XP SP1 still out there, as well as most people seem to be using SP2 and not SP3.
I had actually expected to get more hosts than I saw as this network apparently has 1800 people using it, granted, not all of those will have computers, and not all of them would have been on over the two days or so that I collected data.
I think part of the reason may be the fact that the switches don’t uniformly leak packets, but only sometimes, which may have kept me from getting proper data. Additionally, I didn’t see much stuff from the higher /22 (1024 IPs) as the lower /22, which may have to do with the way the network is setup. I suspect that there is a router in between the upper and lower halves, which is likely keeping me from seeing a lot of traffic from them (insert graph of IP usage distribution here).
Now for some analysis of the data. I was expecting to see more Windows machines (I suspect that quite a few of the unknown ones were Windows machines, but I couldn’t get a positive match on lots of the suspicious ones). The mix of XP versus Vista is about what I expected, because I know that lots of new (first year students mostly) get new laptops when they go away to school, and Vista Home Basic is generally the OS of choice.
There were also more Macs than I expected, but that makes sense considering people seem to like Macbooks (I’m not sure why though).
There were a lot fewer Linux hosts than I expected as well, and I’m not sure why that is. Maybe they’re harder to fingerprint and they’re in my unknowns.
Additionally, I should add that I have suspicions that some of the unknowns were actually routers. And while I understand that p0f shouldn’t have any issues fingerprinting the OS behind a router, it seemed to be having issues some times. Additionally, I also put hosts with multiple OS returns under the unknown categoty, which likely indicates multiple computers behind a router. Interestingly enough, I saw lots of XP/OSX pairings here, so I think people may have brought their XP desktops with them to school and had also gotten a nice new Macbook to take to class.
All in all, p0f seems to work quite well under good conditions (the connections from others on the network to my router were very accurate) but didn’t quite turn out too well under less than stellar conditions. Still, it is a very useful tool, and it was able to identify more than it wasn’t.
Another note, when I was compiling my aggregate statistics, I wanted to be 95% certain (or better) of what an OS actually was, so this probably contributed to the high number of detections that I classified as unknown (I have decided not to post my raw data due to possible privacy concerns, so you’ll just have to trust me on this one).
And what does this mean to the normal person? Well, if someone knows your OS, then they have narrowed down their list of exploits to run against you. Though, even if you are running something with packet normalization (like PF’s scrub), there are still other ways to fingerprint an OS, though they are much more intrusive, something which I’ll hopefully expand on in a later post.