exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

RemoteOperatingSystemFingerprintingLib.html

RemoteOperatingSystemFingerprintingLib.html
Posted Nov 16, 2002

Defcon 10 Presentation: RemoteOperatingSystemFingerprintingLib

SHA-256 | c755c2d8028772a1f84ddd8c049399c9492300f2790b957e09a37cb7b3d3b86a

RemoteOperatingSystemFingerprintingLib.html

Change Mirror Download
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>Remote Operating System Fingerprinting Library</TITLE>
<META NAME="Template" CONTENT="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
</HEAD>
<BODY LINK="#0000ff" VLINK="#800080">

<FONT SIZE=2><P ALIGN="CENTER">&nbsp;</P>
</FONT><B><FONT SIZE=4><P ALIGN="CENTER">Remote Operating System Fingerprinting Library</P>
<P ALIGN="CENTER">The libOS Release</P>
</FONT><P ALIGN="CENTER">By Fred Trotter</P>
<P ALIGN="CENTER">July 14, 2000</P>
</B><FONT SIZE=2><P ALIGN="CENTER">&nbsp;</P>
<OL TYPE="I">

<B><LI>Introduction</LI>
<LI>History</LI>
<LI>Library</LI></OL>

<OL TYPE="A">
<OL TYPE="A">

<LI>Architecture</LI>
<LI>C code</LI>
<LI>Java code</LI>
<LI>C++ code</LI>
<LI>Perl code</LI></OL>
</OL>

<OL TYPE="I">

<LI>License</LI>
<LI>Future</LI>
<LI>References</LI></OL>

<OL TYPE="I">

<LI>Introduction</LI>
</B><P>Operating system fingerprinting is and will forever be in the domain of gray hat hacking. What operating system is running where on a given network is a subject of curiosity for hackers and administrators alike. Every security patch adds to the complexity of vulnerability history. White Hat Administrators want to find and patch vulnerable systems. Black Hat Hackers want to find and exploit vulnerable systems. Code that helps to determine OS and Service version help both groups.</P>
<P>Outside of the security community, however, the ability to detect operating systems is an untapped resource. Intranet Sites could be tuned to give different content to different types of desktops. The possible uses for this type of system because are relatively unexplored, for until now the science of operating system detection has been accessible only to the most dedicated and patient researchers in the security industry.</P>
<P>This is a presentation of a new OS fingerprinting library libOS (name subject to coolness upgrades). Using this library both professional developers and weekend scripters will have access to the state of the art techniques. Further, they will be able to extend the system with tests of their own design.</P>
<B><LI>History</LI>
</B><P>The history of operating system fingerprinting begins with Queso, by Savage from Apostols.org. This was the first program to walk upright on its hind legs. Shortly after that came the largest single leap in OS fingerprinting evolution; nmap’s operating system fingerprinting system, by Fyodor. This system, incorporated into the port scanning functions of nmap, are the most complex and feature rich released to date. To discover the evolution before Queso, take a look at the history found in Fyodor’s excellent article http://www.insecure.org/nmap/nmap-fingerprinting-article.html</P>
<P>Last year, Ofir Arkin and Fyodor Yarochkin released the only other fingerprinting system which could be compared with nmap. This scanner, called X, used ICMP techniques to quickly delineate between operating systems. Although the new techniques were impressive, the scanner lacked the ability to distinguish more than a few OS types. There was no external database of operating system fingerprints that could be modified or upgraded easily. It was however the first use of logic to reduce the total number of packets sent. X only sent packets that would improve the OS guess. </P>
<P>Four months ago in April 2002 the folks at </FONT><A HREF="http://www.intranode.com/"><FONT SIZE=2>www.intranode.com</FONT></A><FONT SIZE=2> released a new fingerprinting system called ring. This system has the advantage of not violating RFC. This means that detecting this test will be nearly impossible for IDS systems. This system starts a TCP/IP handshake and then ignores the reply. TCP treats this event as a dropped packet. So a packets intended to restore the connection are sent at regular (but varied by OS) intervals. Timing these packets allows for fingerprinting. </P>
<P>The next generation of TCP/IP test will probably do more of this bending within the bounds of TCP. This type of test represents the best of active fingerprinting and passive fingerprinting. The excellent paper on the subject from intranode mentions that it is possible to foil the plot using a TCP/IP proxy. Ironically I believe that proxies are the future of fingerprinting. A fingerprinting proxy would take standard traffic sent to a host and bend the underlying TCP functions without damaging the data at the higher layers. Think of it as a kinder, gentler fragrouter. I would love it if my library could help somebody develop this!</P>
<P>A matter of minutes before libOS is released Xprobe2, the successor to X will be released. Based on the claimed features from the initial release at CanSecWest, many of the failings of X are addressed in Xprobe2. Potentially making it the most advanced fingerprinting system of its kind.</P>
<P>But which is better? Nmap, or some version of X? In truth this is an arbitrary question similar to what car is best, or whether one prefers blonde, brunette or bald. Just as a Hummer does not compare well with a Ferrari, X and nmap do not compare well.</P>
<P>The reason is simple, the meta-level logic in each system have very different goals. There are two portions to any remote OS fingerprinting system. The first is the Test Suite. The second is the Testing Logic. </P>
<P>A Test Suite is full of methods for detecting the differences between hosts. Often this means proactive tests, where you are analyzing the response to a carefully crafted communication. Some tests, on the other hand require no proactive communication, but rather the ability to analyze current traffic. </P>
<P>Test Logic is a method intelligently interpreting the results of tests and guiding further testing of the results. </P>
<P>In reality, Test Logic is what separates nmap and the original X. The goal of nmap is to get as much accurate and usable information to the user as possible. This means that it executes all of its tests no matter what, and when a test fails it will often repeat it. The database is further evidence of this. It contains far more individuated OS categories then X. For an exercise in excess, take a glance at the contents of nmap-os-fingerprints included in the source code for your copy of nmap.</P>
<P>The goal of X, on the other hand was to be as accurate as possible, with as few packets as possible. As a result, it includes a hard coded logic tree which makes its fingerprinting very effective. X does not knowingly run tests that give it information that it already has.</P>
<P>So which is better, X or nmap? Depends on what you want and what you need!</P>
<P>What if you want your operating system Test Logic to do something that neither nmap or X do? What if you want to see if a new Test is a useful addition to a Test suite? What if you want to include OS sensitivity to your code but forking a call to a current program is not elegant enough?</P>
<P>Then LibOS is for you!!</P>
<P>&nbsp;</P>
<B><LI>Library</LI></OL>
<DIR>
<DIR>

</B><P>LibOS is a library that allows any program to execute Operating System tests and interpret the results. The library includes methods for accessing individual tests, giving the programmer fine grain control over what tests are run and how. The Library also provides access to Test Logics, if all that is needed is a best guess.</P>
<P>The library includes the algorithms found in queso, nmap and X. Support for Xprobe2 will probably depend on licensing issues.</P></DIR>
</DIR>

<OL TYPE="A">

<B><LI>Architecture</LI>
</B><P>The goal of LibOS is to be threaded and OOP. This allows for parallel running of tests as well as greatly increased flexibility in Test Logic (where the fun really is). Further the Library will be replicated in several popular languages. Currently Java and C are supported, with C++ and Perl on the way. At the bottom level, most of the tests from nmap, queso and X are recoded using libnet instead of libpcap. The libnet version is the current beta 7b (more icmp support). </P>
<P>At this point you are thinking that LibOS is a beta library itself. This is very much true. It is based on beta libnet and the code needs a thorough going over by the community. This and the C++ and perl modules need to be finished. So there is still much to do. So much that I would appreciate help. There are a lot of design questions that are still open. Version 1.0 really does need to be solid code, so that serious applications can be designed on top of it. This means that I would like to get Architectural bugs worked out at the outset. I also want to lean towards features that the community needs, with a decided bias to feature that co-developers want. You know those "wouldn’t it be neat if" thoughts one has on occasion? If you have one about LibOS then email it to me… no really, I want to know.</P>
<P>Here is a diagram of the current architecture.</P>
</FONT><P><IMG SRC="Image1.jpg" WIDTH=573 HEIGHT=212><FONT SIZE=2><<Insert Pic>></P>
<P>As you can see the core of the library is in C, but the Logic is re-implemented in each language. Also note that there is space for new tests written in any language. This means that if you really want a new test you can have your pick of languages to implement them in.</P>
<P>&nbsp;</P>
<B><LI>C code</LI>
</B><P>The C code forms the core of the Library. Queso, nmap and Xv1 tests are implemented at this level. The code to send each test is located in a separate .c file. Sometimes this is true for the Listener that grabs and parses the returning test. But where possible I have made a generalized listen that works for several tests.</P>
<B><LI>Java code</LI>
</B><P>All of the .java files are named beginning with a capital J, so that the Java portion of the library can be listed with ls J*. </P>
<P>The Java has a base class called JOStest from which the other Tests are derived. This class includes methods for executing a test as well as for storing the results of a test. This includes fields for storing the Family. Major Version, Minor Version and Architecture of the Operating System.</P>
<P>This is the main benefit of OOP. Fyodor(nmap) wrote me and told me that he did not want his database mixed with the other apps, he suggested that the other authors would feel the same way. I tend to agree with him, merely combining databases would dilute the power that each has individually. The abstraction of OS identity at an OOP level gets around this consider</P>
<P>Abstract Class JOStest</P>
<P>{</P>
<P> public String OSFamily;</P>
<P> public String OSMajorVersion;</P>
<P> public String OSMinorVersion;</P>
<P> public String OSOther</P>
<P> public String OSArch;</P>
<P>… constructor and functions</P>
<P>}</P>
<P>Every nmap, queso or x fingerprint can be it into these categories. Here is the coding procedure… OS Family is the major family of OS like Windows, Solaris, Macintosh or Linux. OS Major Version is for example Linux "2.4" or Windows "98". OS Minor Version is anything else about a version that could be considered well formed. What is well formed is very much an open design question, but I will tend to favor the method that the vendor uses. Like "sp2" for Windows 98 or "13-24" for linux 2.X. OSOther is anything about and OS that effects its fingerprint that is not well formed like "With X program installed" or something like that. OS Minor Verision is the method for catching fine distinctions between Operating Systems. Last there is OS arch, this will become more and more important as the Operating Systems continue to be ported to new architectures.</P>
<P>So an entry from nmap-os-fingerprints would be encoded thus…</P>
<P># Linux Kernel 2.4.3-2.10.1smp (RedHat 7.0.98 Wolverine)</P>
<P>###OSFamily=Linux</P>
<P>###OSMajorVersion=2.4</P>
<P>###OSMinorVersion=3</P>
<P>###OSOther=(RedHat 7.0.98 Wolverine)</P>
<P>###OSFamily=Linux</P>
<P>###OSMajorVersion=2.10</P>
<P>###OSMinorVersion=smp</P>
<P>###OSOther=(RedHat 7.0.98 Wolverine)</P>
<P>###OSArch=smp</P>
<P>This, like many fingerprints in the database it uses one fingerprint for more than one operating system. Here I assume that print refers 2.4.3 is a separate system that 2.10.1smp. Unfortunately the prints in many of the databases are natural language and as a result it will take some time to correctly convert them into more formal descriptions.</P>
<P>Currently I am adding these ### comments to nmap-os-fingerprints and queso.conf. I am still undecided about how to handle X, I will probably wait to see what format X2 uses for its database and use that.</P>
<P>The file JOSimp.c contains the JNI to C tie in functions which make the calls to the C library</P>
<B><LI>C++ code</LI>
</B><P>This code is not yet developed. This is because getting everything that I wanted from Java (read Threads) was easier. Also since the base functions were in C I knew that if you wanted to use them you could very easily. This is scheduled to be completed last.</P>
<B><LI>Perl code</LI></OL>
<DIR>
<DIR>

</B><P>This is probably the most important code. I think that I may have to implement the threads in C to make this really work however.</P>
<P>&nbsp;</P></DIR>
</DIR>

<OL TYPE="I">

<B><LI>License</LI>
</B><P>Licensing is currently very complex but I hope to simplify it soon. Why you ask cant you just use GPL?? Well, not exactly. The first reason is that X is not released GPL. It contains the GNU header. But it also contains the following line</P>
<B><P>All material for nonprofit, educational use only.</P>
</B><P>This line conflicts with the GPL which states</P>
<P>You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. </P>
<P>Nmap and Queso however are both GPLed. Further I used actual nmap code as the base for the Options parsing code in the TX series of Tests. This means that for the time being I am bound by the GPL. </P>
<P>Ultimately I want the library code and any tests that I write to be distributed under the Lesser GPL. For obvious reasons, the functionality that I am presenting here is not new and the largest benefit is just that it is a library. So there is no benefit of releasing the code GPL. In order to facilitate this I have used only the algorithms from each of the programs. Algorithms are not copyrightable so I can release the library under LGPL, (with the exception of the options sequence which I should rewrite for clarity anyway)</P>
<P>The only hitch is that the nmap-os-fingerprints database and queso.conf are both released GPL and the functioning of my library depends on the contents of these files. When X2 comes out the same will be true of its database file</P>
<P>If the authors of these respective pieces of software so choose they can re-release these pieces of code to me under the LGPL. If they decide to do so then the entire contents of the Library will be released LGPL. Otherwise the Library portion (mine) of the software will be LPGL as well as new tests donated to the library. If one chooses to link through my software to the GPLed databases then your software will be bound by the GPL. </P>
<P>Initially I will release a GPL copy of the library until the original authors and I can meet and come to an agreement about how the library should be licensed. </P>
<B><LI>Future</LI>
</B><P>There are several sub-projects and extensions which I would like to propose in the wake of this fingerprinting library. </P>
<P>1. Service Fingerprinting </P>
<P>The first is a service fingerprinting system. This will allow for an open-source OS version to service version database to be developed. This database will quickly become useful for guessing OS. In conjunction to this port database, a port patterns should be studied. What OS has what ports running on install. This is useful for detecting new installations (which are a dangerous source of attacks). </P>
<P>Hopefully this phase will build on the work of Winfingerprints SMB based OS detection scheme. </P>
<P>2. OS-Service to CVE Database map. </P>
<P>There already several different versions of databases like this. The difference is that this database will be focused on what the "detectable" version of the operating systems are. Consider the following hypothetical operating system history</P>
<P>&nbsp;</P>
<P>1998 May OS IRUNWELL v1 patch release</P>
<P>1998 Dec OS IRUNWELL v1 patch b</P>
<P>1999 Jan OS IRUNWELL v1 patch c</P>
<P>1999 Feb OS IRUNWELL v2 patch release</P>
<P>1999 March OS IRUNWELL v1 patch d</P>
<P>1999 May OS IRUNWELL v2 patch b</P>
<P>1999 August OS IRUNWELL v2 patch c</P>
<P>1999 Dec Vulnerability OS IRUNWELL remote root </P>
<P>2000 Jan OS IRUNWELL v2 patch d -< includes fix</P>
<P>2000 Jan OS IRUNWELL v1 patch e -< includes fix</P>
<P>2000 May OS IRUNWELL v3 release</P>
<P>If we had perfect OS detection we would not need vulnerability scanners at all. We would just scan the network for "unpatched" versions. Unfortunately patches often do not change the networking software of the computer.</P>
<P>Programs like Nessus develop sophisticated tests in order to detect when a service is actually available. </P>
<P>3. Super Simple Operating System Scanner</P>
<P>This scanner would do nothing except create a up to the day catalog of an organizations Operating Systems and Services. With this when a vulnerability became public knowledge. A list of operating systems on your network that "could" be vulnerable could be printed. Then the Web Proxy could force any web traffic from that host to an Intranet server with a patch download. </P>
<P>This would create a very effective patch distribution system. In the weeks before the Nessus came out with a Test for the vulnerability. Nessus and other scanners will always be excellent for discovering where you are from a vulnerability standpoint. But if you know exactly what Operating Systems you have already on your network. Then you just need a fact mechanism for getting the right patches to the right people.</P>
<P>Combine this with one of the alert services from someone like securityfocus </FONT><A HREF="http://www.securityfocus.com/corporate/products/alerts"><FONT SIZE=2>http://www.securityfocus.com/corporate/products/alerts</FONT></A></P>
<FONT SIZE=2><P>And you have a fast vulnerability scanner on the cheap.</P>
<P>4. LibOS-Apache Module</P>
<P>Just think when someone finds a vulnerability in "Windows – All Versions" and then Microsoft issues 10 patches, your patch download page would display only the patch that the user actually needed.</P>
<B><LI>References</LI></OL>
<DIR>
<DIR>

</B><P>All about CVE </FONT><A HREF="http://www.cve.mitre.org/"><FONT SIZE=2>http://www.cve.mitre.org</FONT></A></P>
<FONT SIZE=2><P>All about X and icmp </FONT><A HREF="http://www.sys-security.com/html/projects/X.html"><FONT SIZE=2>http://www.sys-security.com/html/projects/X.html</FONT></A></P>
<FONT SIZE=2><P>All about nmap OS fingerprinting </FONT><A HREF="http://www.insecure.org/nmap/nmap-fingerprinting-article.html"><FONT SIZE=2>http://www.insecure.org/nmap/nmap-fingerprinting-article.html</FONT></A></P>
<FONT SIZE=2><P>All about nmap OS fingerprinting http://www.sans.org/newlook/resources/IDFAQ/TCP_fingerprinting.htm</P>
<P>All about nmap </FONT><A HREF="http://www.insecure.org/nmap/"><FONT SIZE=2>http://www.insecure.org/nmap/</FONT></A></P>
<FONT SIZE=2><P>All about fooling nmap fingerprinting </FONT><A HREF="http://ippersonality.sourceforge.net/"><FONT SIZE=2>http://ippersonality.sourceforge.net/</FONT></A></P>
<FONT SIZE=2><P>All about printing Windows services http://winfingerprint.sourceforge.net/winfingerprint-help/opt-winfingerprint.htm</P>
<P>All about me </FONT><A HREF="http://www.fredtrotter.com/"><FONT SIZE=2>http://www.fredtrotter.com</FONT></A><FONT SIZE=2> </FONT><A HREF="http://www.synseer.net/"><FONT SIZE=2>http://www.synseer.net</FONT></A></P>
<FONT SIZE=2><P>&nbsp;</P></DIR>
</DIR>
</FONT></BODY>
</HTML>
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close