nsrlsvr is a tool to facilitate looking up data in NIST’s National Software Reference Library Reference Data Set.
It’s a database of about 50 million MD5 hashes, representing every file known to NIST.
Why do I care?
If you deal with a lot of unknown files it can be useful to separate them into “stuff NIST already knows about, ergo it’s commonplace” and “stuff NIST doesn’t know about, so maybe it’s interesting”.
You can use a tool like hashdeep to generate MD5 hashes of large filesystems and feed the output into a tool like nsrllookup, which will in turn go off and query an nsrlsvr instance to see what’s what.
Why would I want to run my own?
Great question, especially since nsrllookup comes out-of-the-box ready to work with the freely-accessible nsrllookup.com server.
There are two use cases for standing up your own nsrlsvr instance:
- You’re doing such high volumes that you’re concerned I’ll block your IP on nsrllookup.com, or
- You have your own list of MD5 hashes which you want to filter for.
If either of those two describes you, read on!
What you’ll need
- A UNIX operating system
- A C++ compiler that supports the C++14 standard
- The Boost C++ libraries and development headers
- Python 3.5 or later
- A list of unique MD5 hashes, each line consisting of thirty-two ASCII characters terminated by a newline
How to install
- Download the latest official release of nsrlsvr
tar xzf [downloaded-file]to uncompress it
cdinto the directory you uncompressed it to
cmake -DPYTHON_EXECUTABLE=`which python3` .will initialize the build system (don’t forget that trailing period)
maketo build nsrlsvr
sudo make installto install it to
- Build your dataset (see below)
- Start nsrlsvr with
nsrlsvrand you’re off to the races. Any nsrllookup client can now use you as a hash server.
How do I make my own dataset from NIST’s minimal RDS?
nsrlsvr comes with a tool called
nsrlupdate. You’ll want to use it.
- Download the latest NSRL RDS minimal set. Note: only the minimal set is supported.
- Uncompress it and find a file called “NSRLFile.txt”.
- This may take a long time but you’ll have a complete NSRL RDS hash set when you finish.
Alternately, you can drop your own file of hashes in
/usr/local/share/nsrlsvr/hashes.txt. They must be uppercase UTF-8 containing only the letters A-F or 0-9, with thirty-two characters per line terminated by a newline.