Skip to content

Instantly share code, notes, and snippets.

@ander94lakx
Created August 24, 2021 15:23
Show Gist options
  • Save ander94lakx/583f7411753d66ba2f0a22130c4a2c48 to your computer and use it in GitHub Desktop.
Save ander94lakx/583f7411753d66ba2f0a22130c4a2c48 to your computer and use it in GitHub Desktop.
Given a file, looks for similar files in NSRL (NIST) using ssdeep datasets
#!/bin/bash
absdir=$(realpath "$1")
echo $absdir
mkdir NSRL_Corp
cd NSRL_Corp
rm *.zip
rm *.ssd
curl https://s3.amazonaws.com/docs.nsrl.nist.gov/morealgs/ssdeep_2.10/NSRL_corp.0[0-1][0-9].0.zip -o "NSRL_corp.0#1#2.0.zip"
curl https://s3.amazonaws.com/docs.nsrl.nist.gov/morealgs/ssdeep_2.10/NSRL_corp.0[0-1][0-9].5.zip -o "NSRL_corp.0#1#2.5.zip"
curl https://s3.amazonaws.com/docs.nsrl.nist.gov/morealgs/ssdeep_2.10/NSRL_corp.020.0.zip -o "NSRL_corp.020.0.zip"
curl https://s3.amazonaws.com/docs.nsrl.nist.gov/morealgs/ssdeep_2.10/NSRL_corp.020.5.zip -o "NSRL_corp.020.5.zip"
unzip \*.zip
rm *.zip
rm RESULTS.txt
find . -name "*.ssd" -exec ssdeep -a -m {} "$absdir" \; >> RESULTS.txt
rm -f *.ssd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment