tlsh_unittest(1)

πŸ“¦
version 5.0.0 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– tlsh_unittest β€” the Debian manual page, but make it a group chat πŸ’–

okay bestie, listen. you know tlsh_unittest(1)? that's the page we're doing today, and it's genuinely iconic. it computes TLSH digest values and it computes the distance between them. that's the whole vibe. let's get into it πŸ¦‹


✨ NAME ✨

tlsh_unittest β€” compute TLSH digest values and distance. that's it. that's the girl. πŸ’…


🌸 SYNOPSIS 🌸

five whole moods, and every single one of them is valid:

tlsh_unittest [-c <file|digest>]         -f <file>     [-T <threshold_value>] [-xlen] [-details]
tlsh_unittest  -c <file|digest>          -d <digest>   [-T <threshold_value>] [-xlen] [-details]
tlsh_unittest [-c <file|digest> | -xref] -r <dir>      [-T <threshold_value>] [-xlen] [-details]
tlsh_unittest [-c <file|digest> | -xref] -l <listfile> [-T <threshold_value>] [-xlen] [-details]
tlsh_unittest -version

like. pick your fighter. they're all serving. πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

so tlsh_unittest is the bestie who either computes TLSH digest values or measures the distance between digest values. and it does it in three distinct ways, no cap:

  1. just compute the digest, babe β€” you give it a single file (-f file) or a whole directory of files (-r dir), and it spits out the TLSH digest value. pro tip from the original page: this output can be used to create the listfile required by the -l option described further down. foreshadowing. we love her. ✨
  2. the comparison arc β€” you feed it a comparison file or TLSH digest (-c <file|digest>) and it measures the distance against whichever thing you picked: a specified file (-f file), a TLSH digest (-d digest), a directory of files (-r dir), or a list (-l listfile). it's giving matchmaker. 🫢
  3. the xref era β€” you turn on -xref and it computes the distance between every element in a set and every other element in that set. that's the files in a directory (-r dir) or the files/digests in a list (-l listfile). everyone gets compared to everyone. it's a whole social network. πŸ’€

πŸ’… OPTIONS πŸ’…

  • -c <file|digest> β€” names a filename or a digest whose TLSH value is gonna get compared to... something. which something? glad you asked. it could be a specified TLSH digest (-d), OR the TLSH value of a specified file (-f), OR the TLSH values of the files in a specified directory (-r), OR the TLSH values in a specified listfile (-l). main character energy, honestly. 🌟
  • -xref β€” this is the one that calculates the distance between each element in the set and every other element in the set. only usable when you've specified a set of files (-r dir) or TLSH values (-l listfile). it needs a crowd, bestie, it doesn't do solo performances. 🎭
  • -f file β€” names a file whose TLSH values are to be computed, or used for comparison when you passed -c <file|digest>. one file. one job. we respect it. πŸ“
  • -d digest β€” hands over a TLSH digest value that gets compared to the comparison file or digest you specified with -c <file|digset>. (yes, the original page writes digset right there β€” we're keeping it exactly as written, that's a canon typo and it's lowkey iconic πŸ™ˆ)
  • -r dir β€” recursive directory search, babes. finds files whose TLSH values are to be computed, or used for comparison (-c <file|digset> or -xref). it goes deep. 🧚
  • -l listfile β€” for comparison purposes only (-c <file|digset> or -xref). and here's the tea, every line in listfile can hold either of these two formats:
    • a TLSH digest value β€” and then the comparison output will display TLSH digests
    • a tab separated TLSH digest value and its corresponding filename β€” and then the comparison output will display filenames

and where do you get a tab separated listfile, you ask? you generate it by running tlsh_unittest with either the -f or -r flag. see? told you it was foreshadowing. 🌈

  • -xlen β€” this one determines whether the lengths of the compared files get included in determining the distance. yes, size matters, that's literally the flag. πŸ’€
  • -details β€” gives you extra detailed output. more lore. more content. we're obsessed. πŸ”₯
  • -T threshold_value β€” only used during comparisons (-c <file|digset> or -xref). it specifies the maximum distance a comparison must generate before it gets reported. and the default? 9999. so it's the "don't talk to me unless it's at least this dramatic" setting. πŸ’…
  • -version β€” yeah, it's in the synopsis. just show me the version, king. πŸ‘‘

⭐ EXAMPLE ⭐

calculate the distance between two files:

tlsh_unittest -c <file 1> -f <file 2>

calculate the distance between two TLSH digest values:

tlsh_unittest -c <TLSH digest 1> -d <TLSH digest 2>

calculate the TLSH digest values for every file in a directory. (this creates input for the -l option, no big deal):

tlsh_unittest -r <dir>

get the distance between a reference TLSH digest value, and a list of TLSH digest values in a file:

tlsh_unittest -c <TLSH digest> -l <file>

compare the TLSH value for every file in a directory, to every other file in that directory:

tlsh_unittest -xref -r <dir>

πŸ¦‹ NOTES πŸ¦‹

this man page has been adapted from tlsh_unittest usage output for the Debian project. so it's a glow-up of the original, basically. ✨

πŸ‘‘ AUTHOR πŸ‘‘

JΓ©rΓ©my Bobbio <lunar@debian.org> β€” thank you for your service, legend. πŸ«‘πŸ’–


Apache-2.0


and that's the whole page, bestie. this was the tlsh_unittest(1) manual from Debian, and yes, we kept the entire thing β€” every flag, every default, every typo, every <file|digset> β€” because the facts do not change even when the vibe is immaculate. slay, go compute some digests. πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ«ΆπŸ”₯πŸ‘‘πŸŒˆπŸ’€πŸ“πŸ§šπŸ’œ

πŸ“¦ where this page comes from