Skip to main content

A tool for large-scale malware similarity analysis and clustering

Project description

PyBitShred

PyBitShred is a Python reimplementation of BitShred, a tool for large-scale malware similarity analysis and clustering.

This is my semester project of fall 2023 at EURECOM, France. The project is supervised by Antonino Vitale and Prof. Simone Aonzo. We implemented the tool in Python to make it more accessible and easier to use. We also added two new modes to the tool: the "all section" mode and the "raw file" mode.

Check the presentation slides here.

Getting Started

Installation

pip install pybitshred

Usage

Use the following command to see the available options:

pybitshred -h

There are three stages in the BitShred pipeline: update, compare, and cluster. The update stage is used to update the database with new samples. The compare stage is used to compare the samples in the database. The cluster stage is used to cluster the samples in the database.

Check the original paper for more details.

Running Original BitShred

@im-overlord04 wrote a Dockerfile to run the original BitShred tool in a container. This is useful as a reference to compare the results of the original tool with the results of the reimplemented tool.

FROM ubuntu:14.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install --no-install-recommends -y \
    wget git automake libtool make cmake gcc g++ pkg-config libmagic-dev \
    tar unzip libglib2.0-0 libssl-dev libdb-dev
RUN ld -v
ARG GIT_SSL_NO_VERIFY=1
RUN apt-get install -y automake1.11 binutils-dev

COPY bitshred/bitshred_single_steps bitshred_single_steps
RUN cd bitshred_single_steps/ && ./configure && make

COPY bitshred/bitshred_single bitshred_single
RUN cd bitshred_single/ && ./configure && make

COPY bitshred/bitshred_openmp bitshred_openmp
RUN cd bitshred_openmp/ && make

WORKDIR /

Build

docker build . -t nino:bitshred

Usage

docker run --rm --volume <input_folder>:/input:ro --volume <output_folder>:/db --entrypoint <entrypoint>/src/bitshred nino:bitshred <options>
  • input_folder: folder containing the samples
  • output_folder: folder where the results of the tool will be placed in
  • entrypoint: version of the tool to run: only supported either bitshred_single or bitshred_single_steps or bitshred_openmp
  • options: command line options required by the tool, specified between double quotes. NB: if you have to specify the input folder, you must use /input (any other path is not valid) and it corresponds to the value specified in input_folder. Same reasoning for the output folder, whose path to use is /db

Example:

docker run --rm --volume "/home/nino/samples/":/input:ro --volume "/home/nino/output":/db --entrypoint /bitshred_single/src/bitshred nino:bitshred "-b" "/input/" "-t" "0.60"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybitshred-0.1.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybitshred-0.1.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file pybitshred-0.1.1.tar.gz.

File metadata

  • Download URL: pybitshred-0.1.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for pybitshred-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bcbf75c67a6ac781a413c1c4a0865bbd96bc9a81f70f2d08ec38ac783d545e75
MD5 55f7f9374727d5e1b4e1936969df7f0d
BLAKE2b-256 1f21b0a9d0ab4255eaefd579b6f116f84e421df5d535c2d176d6523fb8008a33

See more details on using hashes here.

File details

Details for the file pybitshred-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pybitshred-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for pybitshred-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7eafca73acce8dba5450b8b669feb75c4b19053c0b52dd0eec72ffa47b81de6
MD5 a74d6e7fa5137721a7da2397509aa844
BLAKE2b-256 fcfe2c2c3acf37288cbe8256c2caad441b90804bc00d7edd56b1e324b9cfb0f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page