Practical Applications of Bloom Filters to the NIST RDS and Hard Drive

Practical Applications of Bloom Filters to the NIST RDS and Hard Drive

Practical Applications of Bloom filters to the NIST RDS and hard drive triage. Paul Farrell Simson L. Garfinkel Douglas White Naval Postgraduate School Naval Postgraduate School NIST Monterey, CA Monterey, CA Gaithersburg, MD Abstract tree, producing access speeds that scale with the log of the dataset size. In our testing with very capable reference hard- Much effort has been expended in recent years to cre- ware, we could only perform between 17 thousand and 85 ate large sets of hash codes from known files. Distribut- thousand RDS hash lookups per second using SleuthKit’s ing these sets has become more difficult as these sets grow hfind command1, and only 4 thousand lookups per second larger. Meanwhile the value of these sets for eliminating when the hashes were stored in a MySQL InnoDB database. the need to analyze “known goods” has decreased as hard Bloom filters are an attractive way for handling very drives have dramatically increased in storage capacity. large hash sets. In this paper we present a new BF imple- This paper evaluates the use of Bloom filters (BFs) to dis- mentation that can perform between 98 thousand and 2.2 tribute the National Software Reference Library’s (NSRL) million lookups per second on that same hardware.2 Reference Data Set (RDS) version 2.19, with 13 million The RDS includes a significant amount of metadata for SHA-1 hashes. We present an open source reference BF each file, including the file’s name, size, the software pack- implementation and validate it against a large collection of age and operating systems for which it was distributed, and disk images. We discuss the tuning of the filters, discuss how the publisher. This information is not used by SleuthKit’s they can be used to enable new forensic functionality, and hfind command, Guidance Software’s EnCase[11], or present a novel attack against bloom filters. other tools we have evaluated. This metadata is largely un- exploited which, when accessed efficiently, can assist in the 1. Introduction rapid analysis and triage of newly acquired hard drives. Previous work has identified Bloom filters as attractive 1.1. This paper’s contribution tools for representing sets of hash values with minimal er- This paper applies and extends previous work on BFs to ror rates[17]. The National Institute of Standards and Tech- the National Software Reference Library’s (NSRL) Refer- nology (NIST) distributes a sample Bloom filter implemen- ence Data Set (RDS), specifically: tation in perl and two BFs containing a small subset of the • We present nsrl bloom, a new, efficient, highly config- NIST RDS 2.13[20]. Nevertheless, to date there has been urable, open source Bloom filter implementation in C. no published research on large-scale BF implementations • We modified fiwalk, an automated forensics tool optimized for speed; on-disk representations for BFs have based on SleuthKit, to use on our BF implementation not been standardized; and BFs have not been publicly in- to automatically exclude “known goods.” corporated into open source forensic tools. • We evaluate the performance of BFs created with dif- Meanwhile the NSRL’s RDS [19] continues to grow, ferent parameters and compare actual results with the with the July 2008 RDS 2.21 release mapping 47,553,722 NSRL RDS to the results predicted by theory. known files to 14,563,184 unique hashes. NIST has • We evaluate performance of BFs compared to lookups also announced its intentions to distribute dramatically ex- in sorted flat-files (what SleuthKit uses) and lookups panded hash sets “of each 512-byte block of every file we of hashes stored in a large MySQL database. process”[20]. 1 While storing these 14 million SHA1 hashes requires The range results from the fact that hfind’s binary search algorithm terminates early when it finds a hash that is in the database. As a result, 291 megabytes—a small amount of storage in today’s looking up a hash that is in the data set is roughly 5 times faster than world—the ancillary material that accompanies these hash looking up a hash that is not. Surprisingly, MySQL exhibits similar per- codes expands the size of the RDS to almost 6GB, mak- formance for both kinds of hashes. 2 ing the files somewhat difficult to distribute and work with. Once again, the range is the result of the difference in time between looking up a hash that is not in the database and one that is. Unlike binary The time to search this database is also increasing, since searches on sorted data, BFs terminate faster when searching for data that most tools use either a binary search or some kind of index is not present. • We evaluate the coverage of RDS over fresh installs of and scaled to produce bit i0. If bit i0 in the filter is not set, Windows 2000, XP and Vista. then value V 0 could not have been stored in the filter. • We present a novel attack against the use of BFs to If bit i0 is set, the bit may be set because V 0 was previ- eliminating “known goods.” ously stored in the filter. Alternatively, another value V 00 • We evaluate the use of BFs for cross-drive analysis and may have been stored that has a scaled hash i00 that is equal the distribution of extracted features. to i0. The values V 0 and V 00 are aliases: users of the filter 1.2. Related Work cannot determine which of these two values was previously Bloom introduced “hash coding with allowable errors” stored. Because of this property, BFs are said to offer prob- in 1970[2]. Dillinger and Manolios showed how BFs could abilistic data retrieval: if a BF says that a value was not be produced that are fast, accurate, memory-efficient, scal- stored in the filter, then it was definitely not stored. But if able and flexible[8]. Fan et al. introduced Counting Bloom the BF says that a value was stored, the value might have Filters, in which small integers are stored in the vector in- been stored; alternatively, an alias may have been stored. stead of individual bits[9]. Bloomier Filters[5] use layered As more information is stored in a BF, the probability of BFs for mapping entries to one of multiple sets. Broder aliases and false positives increase. presents equations for computing the optimal number of In practice, multiple hash functions f1 . fk are used to hashing functions to provide the minimal false positive store a single value V into filter F . This constellation of bits rate[3]. Manolios provides a simple online calculator for is referred to as an element. Storing data thus requires set- computing these values[14]. ting k different bits (i1 . ik) in filter vector F while query- BFs have since been applied to various forensic ing requires checking to see if those bits are set. applications[3]. Roussev et al. proposed using BFs for stor- BFs can thus described by four parameters: ing file hashes[17]. The researchers also stated object ver- m: the number of bits in the filter. (In this paper we sioning could be detected by piecewise hashing file parts, additionally use M to denote log2(m).) noting “it is possible to use filters with relatively high false k: the number of hash functions applied to produce positive rates (> 15%) and low number of bits per element each element (3-5) and still identify object versioning.” Unfortunately b: the number of bits set per element in the filter the source code for their program, md5bloom, was never f: the hash function released. In 2007, Roussev et al. expanded this research Once data is stored in the filter, additional parameters with Multi-Resolution Similarity Hashing to detect files that can be used to describe the filter’s state: were similar but different[18]. n the number of elements stored in the filter White created a sample BF implementation in Perl and p the probability that a value V , reported to be in the distributed it from the NIST website[19]. This code was filter, was actually stored in the filter. flawed, in that each bit of the MD5 or SHA1 code was used As discussed elsewhere[16, 15, 17], the probability that multiple times to compute multiple Bloom hash functions. a bit in a filter will not be set is: Furthermore, because it was written in perl, excessive mem- kn ory consumption prevented this program from being able to P0 = (1 − 1/m) (1) digest the entire RDS. 1.3. Outline of paper This can be approximated as: Section 2 discusses BFs and our BF implementation. −kn/m Section 3 discusses our experience at applying our imple- P0 = e (2) mentation to the NSRL RDS. Section 5 discusses the impli- The theoretical false positive rate is approximated as: cations of this work to mainstream forensics research and practice. Section 6 concludes. −kn/m k 2. High-performance BFs Pfp = (1 − e ) (3) 2.1. Introduction to Bloom filters 2.2. Performance Characteristics Fundamentally the Bloom filter is a data structure that al- Bloom filters are similar to hash tables (HTs), in that a lows multiple values V0 ...Vn to be stored in a single finite large number of sparse values can be stored compactly in bit vector F . As such, BFs support two primitive opera- a single data structure. Once stored, the structure allows a tions: storing a new value V into a filter F , and querying as values’ presence or absence to be queried in constant time to whether or not a value V 0 is present in F .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us