bids-analyser


Namebids-analyser JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/aph10/BIDS
SummaryAnalyser for ELF files
upload_time2024-11-19 11:56:22
maintainerAnthony Harrison
docs_urlNone
authorAnthony Harrison
requires_python>=3.9
licenseApache-2.0
keywords security tools elf dependency symbols binary analsyis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BIDS
BIDS (Binary Identification of Dependencies with Search). The BIDS project will deliver tooling to analyse ELF binaries and extract key features for indexing and searching. The tooling to index these binary features in a search engine uses an inverted index.

This project is sponsored by NLNET https://nlnet.nl/project/BIDS/.

## Installation

To install use the following command:

`pip install bids-analyser`

Alternatively, just clone the repo and install dependencies using the following command:

`pip install -U -r requirements.txt`

The tool requires Python 3 (3.9+). It is recommended to use a virtual python environment especially
if you are using different versions of python. `virtualenv` is a tool for setting up virtual python environments which
allows you to have all the dependencies for the tool set up in a single environment, or have different environments set
up for testing using different versions of Python.

## Usage

```
usage: bids-analyser [-h] [-f FILE] [--description DESCRIPTION] [--exclude-dependency] [--exclude-symbol] [--exclude-callgraph] [-d] [-o OUTPUT_FILE] [-V]

bids-analyser analyses a binary application in ELF format and extracts dependency, symbolic and call graph information into a JSON data stream

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit

Input:
  -f FILE, --file FILE  identity of binary file
  --description DESCRIPTION
                        description of file
  --exclude-dependency  suppress reporting of dependencies
  --exclude-symbol      suppress reporting of symbols
  --exclude-callgraph   suppress reporting of call graph

Output:
  -d, --debug           add debug information
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
                        output filename (default: output to stdout)
```
					
## Operation

The `--file` option is used to specify the binary file to be processed.

The `--description` option is used to provide a biref description of the binary being processed.

The `--exclude-dependency`, `--exclude-symbol`, and `--exclude-callgraph` option is used to disable
the capture of dependency, symbol or callgraph information respectively.

The `--output-file` option is used to control the destination of the output generated by the tool. The
default is to report to the console but can be stored in a file (specified using `--output-file` option).

## Output File Format

The output file is in JSON format. The content depends on the contents of the file and the specified command line options.

```bash
bids-analyser -f go/bin/go --output gobin.json --description "Go binary"
```

```json
{
  "metadata": {
    "docFormat": "BIDS",
    "specVersion": "1.0",
    "id": "da4ef1aa-f9bb-49df-ab61-51224ea4bfc5",
    "version": 1,
    "timestamp": "2024-11-04T20:44:25Z",
    "tool": "bids_generator:0.1.0",
    "binary": {
      "class": "ELF64",
      "architecture": "x86_64",
      "bits": 64,
      "os": "linux",
      "filename": "go/bin/go",
      "filesize": 12983131,
      "filedate": "Thu Aug 15 19:50:32 2019",
      "checksum": {
        "algorithm": "SHA256",
        "value": "6ef479d2538373f31056cace657508359e39f31adf07a183f8b2d55be72c328c"
      }
    },
    "description": "Go binary"
  },
  "components": {
    "dynamiclibrary": [
      {
        "name": "libpthread.so.0",
        "location": "/usr/lib32/libpthread.so.0"
      },
      {
        "name": "libc.so.6",
        "location": "/usr/lib32/libc.so.6",
        "version": "2.38"
      }
    ],
    "globalsymbol": [
      "__errno_location",
      "abort",
      "fprintf",
      "fputc",
      "free",
      "freeaddrinfo",
      "fwrite",
      "gai_strerror",
      "getaddrinfo",
      "getnameinfo",
      "malloc",
      "nanosleep",
      "pthread_attr_destroy",
      "pthread_attr_getstacksize",
      "pthread_attr_init",
      "pthread_cond_broadcast",
      "pthread_cond_wait",
      "pthread_create",
      "pthread_detach",
      "pthread_mutex_lock",
      "pthread_mutex_unlock",
      "pthread_sigmask",
      "setenv",
      "sigfillset",
      "stderr",
      "strerror",
      "unsetenv",
      "vfprintf"
    ],
    "localsymbols": [
      "_cgo_panic",
      "_cgo_topofstack",
      "crosscall2"
    ]
  },
  "relationships": {
    "libpthread.so.0": [
      "__errno_location",
      "pthread_mutex_lock",
      "pthread_cond_wait",
      "pthread_mutex_unlock",
      "pthread_cond_broadcast",
      "pthread_create",
      "nanosleep",
      "pthread_detach",
      "pthread_attr_init",
      "pthread_attr_getstacksize",
      "pthread_attr_destroy",
      "pthread_sigmask"
    ],
    "libc.so.6": [
      "getnameinfo",
      "getaddrinfo",
      "freeaddrinfo",
      "gai_strerror",
      "stderr",
      "fwrite",
      "vfprintf",
      "fputc",
      "abort",
      "strerror",
      "fprintf",
      "free",
      "sigfillset",
      "setenv",
      "unsetenv",
      "malloc"
    ]
  }
}
```

## Return Values

The following values are returned:

- 0 - Binary analysis completed
- 1 - Error detected in analysis process

## License

Licensed under the Apache 2.0 License.

## Limitations

The tool has the following limitations:

- Stripped binaries will result in a limited amount of data

- Callgraph processing is not implemented

## Feedback and Contributions

Bugs and feature requests can be made via GitHub Issues.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aph10/BIDS",
    "name": "bids-analyser",
    "maintainer": "Anthony Harrison",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "anthony@aph10.com",
    "keywords": "security, tools, ELF, Dependency, Symbols, Binary Analsyis",
    "author": "Anthony Harrison",
    "author_email": "anthony@aph10.com",
    "download_url": null,
    "platform": null,
    "description": "# BIDS\nBIDS (Binary Identification of Dependencies with Search). The BIDS project will deliver tooling to analyse ELF binaries and extract key features for indexing and searching. The tooling to index these binary features in a search engine uses an inverted index.\n\nThis project is sponsored by NLNET https://nlnet.nl/project/BIDS/.\n\n## Installation\n\nTo install use the following command:\n\n`pip install bids-analyser`\n\nAlternatively, just clone the repo and install dependencies using the following command:\n\n`pip install -U -r requirements.txt`\n\nThe tool requires Python 3 (3.9+). It is recommended to use a virtual python environment especially\nif you are using different versions of python. `virtualenv` is a tool for setting up virtual python environments which\nallows you to have all the dependencies for the tool set up in a single environment, or have different environments set\nup for testing using different versions of Python.\n\n## Usage\n\n```\nusage: bids-analyser [-h] [-f FILE] [--description DESCRIPTION] [--exclude-dependency] [--exclude-symbol] [--exclude-callgraph] [-d] [-o OUTPUT_FILE] [-V]\n\nbids-analyser analyses a binary application in ELF format and extracts dependency, symbolic and call graph information into a JSON data stream\n\noptions:\n  -h, --help            show this help message and exit\n  -V, --version         show program's version number and exit\n\nInput:\n  -f FILE, --file FILE  identity of binary file\n  --description DESCRIPTION\n                        description of file\n  --exclude-dependency  suppress reporting of dependencies\n  --exclude-symbol      suppress reporting of symbols\n  --exclude-callgraph   suppress reporting of call graph\n\nOutput:\n  -d, --debug           add debug information\n  -o OUTPUT_FILE, --output-file OUTPUT_FILE\n                        output filename (default: output to stdout)\n```\n\t\t\t\t\t\n## Operation\n\nThe `--file` option is used to specify the binary file to be processed.\n\nThe `--description` option is used to provide a biref description of the binary being processed.\n\nThe `--exclude-dependency`, `--exclude-symbol`, and `--exclude-callgraph` option is used to disable\nthe capture of dependency, symbol or callgraph information respectively.\n\nThe `--output-file` option is used to control the destination of the output generated by the tool. The\ndefault is to report to the console but can be stored in a file (specified using `--output-file` option).\n\n## Output File Format\n\nThe output file is in JSON format. The content depends on the contents of the file and the specified command line options.\n\n```bash\nbids-analyser -f go/bin/go --output gobin.json --description \"Go binary\"\n```\n\n```json\n{\n  \"metadata\": {\n    \"docFormat\": \"BIDS\",\n    \"specVersion\": \"1.0\",\n    \"id\": \"da4ef1aa-f9bb-49df-ab61-51224ea4bfc5\",\n    \"version\": 1,\n    \"timestamp\": \"2024-11-04T20:44:25Z\",\n    \"tool\": \"bids_generator:0.1.0\",\n    \"binary\": {\n      \"class\": \"ELF64\",\n      \"architecture\": \"x86_64\",\n      \"bits\": 64,\n      \"os\": \"linux\",\n      \"filename\": \"go/bin/go\",\n      \"filesize\": 12983131,\n      \"filedate\": \"Thu Aug 15 19:50:32 2019\",\n      \"checksum\": {\n        \"algorithm\": \"SHA256\",\n        \"value\": \"6ef479d2538373f31056cace657508359e39f31adf07a183f8b2d55be72c328c\"\n      }\n    },\n    \"description\": \"Go binary\"\n  },\n  \"components\": {\n    \"dynamiclibrary\": [\n      {\n        \"name\": \"libpthread.so.0\",\n        \"location\": \"/usr/lib32/libpthread.so.0\"\n      },\n      {\n        \"name\": \"libc.so.6\",\n        \"location\": \"/usr/lib32/libc.so.6\",\n        \"version\": \"2.38\"\n      }\n    ],\n    \"globalsymbol\": [\n      \"__errno_location\",\n      \"abort\",\n      \"fprintf\",\n      \"fputc\",\n      \"free\",\n      \"freeaddrinfo\",\n      \"fwrite\",\n      \"gai_strerror\",\n      \"getaddrinfo\",\n      \"getnameinfo\",\n      \"malloc\",\n      \"nanosleep\",\n      \"pthread_attr_destroy\",\n      \"pthread_attr_getstacksize\",\n      \"pthread_attr_init\",\n      \"pthread_cond_broadcast\",\n      \"pthread_cond_wait\",\n      \"pthread_create\",\n      \"pthread_detach\",\n      \"pthread_mutex_lock\",\n      \"pthread_mutex_unlock\",\n      \"pthread_sigmask\",\n      \"setenv\",\n      \"sigfillset\",\n      \"stderr\",\n      \"strerror\",\n      \"unsetenv\",\n      \"vfprintf\"\n    ],\n    \"localsymbols\": [\n      \"_cgo_panic\",\n      \"_cgo_topofstack\",\n      \"crosscall2\"\n    ]\n  },\n  \"relationships\": {\n    \"libpthread.so.0\": [\n      \"__errno_location\",\n      \"pthread_mutex_lock\",\n      \"pthread_cond_wait\",\n      \"pthread_mutex_unlock\",\n      \"pthread_cond_broadcast\",\n      \"pthread_create\",\n      \"nanosleep\",\n      \"pthread_detach\",\n      \"pthread_attr_init\",\n      \"pthread_attr_getstacksize\",\n      \"pthread_attr_destroy\",\n      \"pthread_sigmask\"\n    ],\n    \"libc.so.6\": [\n      \"getnameinfo\",\n      \"getaddrinfo\",\n      \"freeaddrinfo\",\n      \"gai_strerror\",\n      \"stderr\",\n      \"fwrite\",\n      \"vfprintf\",\n      \"fputc\",\n      \"abort\",\n      \"strerror\",\n      \"fprintf\",\n      \"free\",\n      \"sigfillset\",\n      \"setenv\",\n      \"unsetenv\",\n      \"malloc\"\n    ]\n  }\n}\n```\n\n## Return Values\n\nThe following values are returned:\n\n- 0 - Binary analysis completed\n- 1 - Error detected in analysis process\n\n## License\n\nLicensed under the Apache 2.0 License.\n\n## Limitations\n\nThe tool has the following limitations:\n\n- Stripped binaries will result in a limited amount of data\n\n- Callgraph processing is not implemented\n\n## Feedback and Contributions\n\nBugs and feature requests can be made via GitHub Issues.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Analyser for ELF files",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/aph10/BIDS"
    },
    "split_keywords": [
        "security",
        " tools",
        " elf",
        " dependency",
        " symbols",
        " binary analsyis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b7a6007fd9fba8ba7199bd3deda8ad16d250d17c95d2cc71c7ec21c22a7d1d49",
                "md5": "886bc846cbdbe3ce8358621bc82fb91c",
                "sha256": "3c5dc6f9ce9d1ff3a2e799bde04cd8313e6676a6c674026c93b1be5e1b0c266f"
            },
            "downloads": -1,
            "filename": "bids_analyser-0.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "886bc846cbdbe3ce8358621bc82fb91c",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.9",
            "size": 21381,
            "upload_time": "2024-11-19T11:56:22",
            "upload_time_iso_8601": "2024-11-19T11:56:22.382247Z",
            "url": "https://files.pythonhosted.org/packages/b7/a6/007fd9fba8ba7199bd3deda8ad16d250d17c95d2cc71c7ec21c22a7d1d49/bids_analyser-0.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-19 11:56:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aph10",
    "github_project": "BIDS",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "bids-analyser"
}
        
Elapsed time: 0.37584s