Skip to main content

A malicious file detection engine written with Python and Yara.

Project description

badfiles

Release Status CI Status

A malicious file detection engine written with Python and Yara.

Introduction

At some point most applications need to accept files from a third party. Since we do not have absolute control over these files they can present a serious threat vector.

The aim of this project is to provide a flexible and expandable solution to triage these files so they can be handled accordingly.

Features

Currently, this project focuses on detecting the following:

Generally Suspicious Files:

:heavy_check_mark: Mime type confusion.

:black_square_button: Files with a root UID or GID (*NIX only).

:black_square_button: Sticky, setuid, or setgit bit (*NIX only).

CSV Files

:heavy_check_mark: CSV Injection.

:black_square_button: Files with a root UID or GID (*NIX only).

:black_square_button: Sticky, setuid, or setgit bit (*NIX only).

Office Documents

:heavy_check_mark: DDE injection.

:heavy_check_mark: Files with a root UID or GID (*NIX only).

:heavy_check_mark: Sticky, setuid, or setgit bit (*NIX only).

Zip Files

:heavy_check_mark: Symlink attacks.

:heavy_check_mark: Zip slips.

:heavy_check_mark: Nested zip bombs.

:heavy_check_mark: Flat zip bombs.

:heavy_check_mark: Sticky, setuid, or setgit bit (*NIX only).

:heavy_check_mark: Files with a root UID or GID (*NIX only).

Tar Files

:heavy_check_mark: Files with a root UID or GID (*NIX only).

:heavy_check_mark: Sticky, setuid, or setgit bit (*NIX only).

:black_square_button: Files with absolute paths (*Nix only).

Additional Features

Please file an issue or a pull request especially if you have found or created malicious files that bypass these detection mechanisms. Please see the contributing guidelines for more details.

Getting Started

Usage

Credits

This package was created with This Cookiecutter template.

This project uses zip-bomb to create the nested and flat zip bombs for unit testing and detection rules.

This project uses a custom Yara rule from Reversing Labs to detect obfuscated CSV injection payloads.

Contributors

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

badfiles-0.3.0.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

badfiles-0.3.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file badfiles-0.3.0.tar.gz.

File metadata

  • Download URL: badfiles-0.3.0.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for badfiles-0.3.0.tar.gz
Algorithm Hash digest
SHA256 424faedfcd10a98489b332844b968b7ddc186cce9bd39d0d996b37d5e069a7b7
MD5 5ce816a32f72936785235cb06888a3a1
BLAKE2b-256 613fb7a459677b2343503c0634c8994c7a230ab4f499e5a6fe35b272eae9905b

See more details on using hashes here.

File details

Details for the file badfiles-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: badfiles-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for badfiles-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f922d2f010433638b8351c4f3607f80f74a933e5e1b6af630d27a45426b7481
MD5 71802d29a3cbc9ae1a07fd8c75765462
BLAKE2b-256 b295fe5472c4d061d77de84c1940b4fb9bad51d49f6e0001a5e139eaa1a42ee2

See more details on using hashes here.

Supported by

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