Code Monkey home page Code Monkey logo

tlsh_pg's Introduction

TLSH_PG

This project adds an extension to the Postgres database server to allow querying data by TLSH similarity. TLSH is the Trend Micro Locality Sensitive Hash.

Compiling:

  1. Install pre-requisites: CMake, Postgres server dev packages. On Ubuntu/Debian, this can be done by running sudo apt-get install cmake postgresql-server-dev-12 where 12 indicates the version of Postgres you're using.
  2. git clone --recursive https://github.com/malwaredb/tlsh_pg.git
  3. cd tlsh_pg
  4. Build TLSH, since it generates a needed header file.
    1. cd tlsh
    2. ./make.sh
  5. mkdir build
  6. cd build
  7. cmake .. -DCMAKE_BUILD_TYPE=Release
  8. make
  9. Installation & testing:
    1. Copy the resulting library to the Postgres lib directory, which is shown by running pg_config --pkglibdir.
    2. As the Postgres user, run psql DBNAME, where you'll load the libary for the database schema you wish to use it with. This is done per-schema, as a privileged user.
    3. At the psql prompt, run CREATE OR REPLACE FUNCTION tlsh_compare(TEXT, TEXT) RETURNS INTEGER AS 'tlsh_psql.so', 'pg_tlsh_compare' LANGUAGE 'c';.
    4. Test by running select tlsh_compare('T14814B643D364FEBFD624EAF8998AB8D5D4A5B0022BF00E5B65420EB704CE9D067543ED','T18784FA0392966E7FC9D6EFF8168BA4E5D562FC504BF0093B75404E3518CA9D0AB393E8');. The result should be 233.

tlsh_pg's People

Contributors

rjzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tlsh_pg's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.