blint 3.1.2__tar.gz → 3.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. {blint-3.1.2 → blint-3.2.1}/PKG-INFO +75 -22
  2. blint-3.2.1/README.md +248 -0
  3. blint-3.2.1/blint/cli.py +592 -0
  4. {blint-3.1.2 → blint-3.2.1}/blint/config.py +189 -191
  5. {blint-3.1.2 → blint-3.2.1}/blint/cyclonedx/spec.py +332 -119
  6. blint-3.2.1/blint/data/android-services.json +1008 -0
  7. blint-3.2.1/blint/data/annotations/review_apple_local_privesc_mie.yml +97 -0
  8. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_functions_generic.yml +109 -0
  9. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_imports_pe.yml +52 -0
  10. blint-3.2.1/blint/data/annotations/review_methods_android.yml +249 -0
  11. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_methods_generic.yml +61 -0
  12. blint-3.2.1/blint/data/annotations/review_methods_pe.yml +88 -0
  13. blint-3.2.1/blint/data/annotations/review_rpc_win.yml +79 -0
  14. blint-3.2.1/blint/data/trackers.json +6328 -0
  15. blint-3.2.1/blint/db.py +755 -0
  16. {blint-3.1.2 → blint-3.2.1}/blint/lib/analysis.py +427 -39
  17. blint-3.2.1/blint/lib/android.py +801 -0
  18. blint-3.2.1/blint/lib/android_services.py +145 -0
  19. {blint-3.1.2 → blint-3.2.1}/blint/lib/binary.py +865 -138
  20. blint-3.2.1/blint/lib/callgraph/__init__.py +40 -0
  21. blint-3.2.1/blint/lib/callgraph/algorithms.py +114 -0
  22. blint-3.2.1/blint/lib/callgraph/api.py +129 -0
  23. blint-3.2.1/blint/lib/callgraph/canon.py +269 -0
  24. blint-3.2.1/blint/lib/callgraph/command.py +220 -0
  25. blint-3.2.1/blint/lib/callgraph/fingerprint.py +108 -0
  26. blint-3.2.1/blint/lib/callgraph/match.py +510 -0
  27. blint-3.2.1/blint/lib/callgraph/model.py +296 -0
  28. blint-3.2.1/blint/lib/callgraph/rusi.py +113 -0
  29. blint-3.2.1/blint/lib/callgraph_kpi.py +176 -0
  30. {blint-3.1.2 → blint-3.2.1}/blint/lib/checks.py +1 -0
  31. blint-3.2.1/blint/lib/dalvik.py +650 -0
  32. blint-3.2.1/blint/lib/dalvik_callgraph.py +175 -0
  33. blint-3.2.1/blint/lib/dalvik_review.py +163 -0
  34. blint-3.2.1/blint/lib/disassembler.py +2148 -0
  35. blint-3.2.1/blint/lib/function_reviews.py +560 -0
  36. blint-3.2.1/blint/lib/indicators.py +447 -0
  37. blint-3.2.1/blint/lib/review_runner.py +195 -0
  38. blint-3.2.1/blint/lib/review_utils.py +115 -0
  39. blint-3.2.1/blint/lib/runners.py +180 -0
  40. {blint-3.1.2 → blint-3.2.1}/blint/lib/sbom.py +150 -87
  41. {blint-3.1.2 → blint-3.2.1}/blint/lib/utils.py +83 -27
  42. {blint-3.1.2 → blint-3.2.1}/blint/logger.py +1 -3
  43. {blint-3.1.2 → blint-3.2.1}/pyproject.toml +14 -7
  44. blint-3.1.2/README.md +0 -197
  45. blint-3.1.2/blint/cli.py +0 -290
  46. blint-3.1.2/blint/db.py +0 -150
  47. blint-3.1.2/blint/lib/android.py +0 -427
  48. blint-3.1.2/blint/lib/disassembler.py +0 -1425
  49. blint-3.1.2/blint/lib/runners.py +0 -521
  50. {blint-3.1.2 → blint-3.2.1}/LICENSE +0 -0
  51. {blint-3.1.2 → blint-3.2.1}/blint/__init__.py +0 -0
  52. {blint-3.1.2 → blint-3.2.1}/blint/cyclonedx/README.md +0 -0
  53. {blint-3.1.2 → blint-3.2.1}/blint/cyclonedx/__init__.py +0 -0
  54. {blint-3.1.2 → blint-3.2.1}/blint/cyclonedx/spdx.py +0 -0
  55. {blint-3.1.2 → blint-3.2.1}/blint/data/__init__.py +0 -0
  56. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/__init__.py +0 -0
  57. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_entries_generic.yml +0 -0
  58. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_entries_pe.yml +0 -0
  59. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_exe_go.yml +0 -0
  60. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_methods_mips.yml +0 -0
  61. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_monero_generic.yml +0 -0
  62. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_monero_go.yml +0 -0
  63. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_monero_rust.yml +0 -0
  64. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_rootkits_win.yml +0 -0
  65. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_symbols_antiforensic.yml +0 -0
  66. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_symbols_generic.yml +0 -0
  67. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_symbols_hooka.yml +0 -0
  68. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_symbols_macho.yml +0 -0
  69. {blint-3.1.2 → blint-3.2.1}/blint/data/annotations/review_symbols_rust.yml +0 -0
  70. {blint-3.1.2 → blint-3.2.1}/blint/data/rules.yml +0 -0
  71. {blint-3.1.2 → blint-3.2.1}/blint/lib/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blint
3
- Version: 3.1.2
3
+ Version: 3.2.1
4
4
  Summary: Linter and SBOM generator for binary files.
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -21,10 +21,10 @@ Classifier: Programming Language :: Python :: 3.14
21
21
  Classifier: Operating System :: OS Independent
22
22
  Provides-Extra: dev
23
23
  Requires-Dist: PyYAML (>=6.0.3)
24
+ Requires-Dist: apkInspector (>=1.3.6)
24
25
  Requires-Dist: appdirs (>=1.4.4)
25
26
  Requires-Dist: apsw (>=3.53.0.0)
26
27
  Requires-Dist: ar (>=1.0.1)
27
- Requires-Dist: black (>=26.3.0) ; extra == "dev"
28
28
  Requires-Dist: custom-json-diff (>=2.1.6)
29
29
  Requires-Dist: defusedxml (>=0.7.1)
30
30
  Requires-Dist: flake8 (>=7.3.0) ; extra == "dev"
@@ -33,12 +33,14 @@ Requires-Dist: multi-demangle (>=1.0.3)
33
33
  Requires-Dist: oras (>=0.2.41)
34
34
  Requires-Dist: orjson (>=3.11.7)
35
35
  Requires-Dist: packageurl-python (>=0.17.6)
36
- Requires-Dist: pydantic[email] (>=2.13.0)
37
- Requires-Dist: pyinstaller (>=6.19.0) ; extra == "dev"
36
+ Requires-Dist: pydantic[email] (>=2.13.3)
37
+ Requires-Dist: pyinstaller (>=6.20.0) ; extra == "dev"
38
38
  Requires-Dist: pylint (>=4.0.5) ; extra == "dev"
39
- Requires-Dist: pytest (>=9.0.2) ; extra == "dev"
40
- Requires-Dist: pytest-cov (>=7.0.0) ; extra == "dev"
39
+ Requires-Dist: pytest (>=9.0.3) ; extra == "dev"
40
+ Requires-Dist: pytest-cov (>=7.1.0) ; extra == "dev"
41
41
  Requires-Dist: rich (>=15.0.0)
42
+ Requires-Dist: ruff (>=0.14.0) ; extra == "dev"
43
+ Requires-Dist: wasm-tools (>=1.0.3)
42
44
  Project-URL: CI, https://github.com/owasp-dep-scan/blint/actions
43
45
  Description-Content-Type: text/markdown
44
46
 
@@ -46,6 +48,8 @@ Description-Content-Type: text/markdown
46
48
 
47
49
  <img src="./blint.png" width="200" height="auto" />
48
50
 
51
+ [![AI-DECLARATION: pair](https://img.shields.io/badge/䷼%20AI--DECLARATION-pair-ffedd5?labelColor=ffedd5)](./AI-DECLARATION.md)
52
+
49
53
  `blint` is a Binary Linter that checks the security properties and capabilities of your executables. It is powered by [lief](https://github.com/lief-project/LIEF) and can generate a Software Bill-of-Materials (SBOM) for supported binaries.
50
54
 
51
55
  ## What is blint?
@@ -57,8 +61,9 @@ blint is a tool for reverse engineers, security analysts, and developers to quic
57
61
  - ELF (for GNU and musl libc)
58
62
  - PE (Windows executables and DLLs)
59
63
  - Mach-O (macOS and iOS, x64 and arm64)
60
- - Android (APK, AAB, including DEX files in deep mode)
61
- - Disassembler: AArch64, x86/x86-64, ARM, Mips, MicroMips.
64
+ - WASM (WebAssembly modules)
65
+ - Android (APK, APKM, AAB, including DEX files in deep mode)
66
+ - Disassembler: AArch64, x86/x86-64, ARM, Mips, MicroMips (native), and Dalvik (DEX).
62
67
 
63
68
  ## Key Features & Use Cases
64
69
 
@@ -66,8 +71,12 @@ blint is a tool for reverse engineers, security analysts, and developers to quic
66
71
  - **Software Bill-of-Materials (SBOM) Generation:** Creates CycloneDX SBOMs for binaries built with Go, Rust, .NET, and Android toolchains, providing a clear inventory of third-party components for vulnerability management.
67
72
  - **Deep Binary Inspection:** Disassembles, extracts, and analyzes a wealth of information including symbols, functions, dependencies, and build toolchains. This raw data is saved as a detailed JSON file.
68
73
  - For a complete guide to all attributes in this file, see the [Technical Metadata Documentation](./docs/METADATA.md).
74
+ - For the custom CycloneDX properties blint adds to the BOM, see the [Custom Properties Documentation](./docs/CUSTOM_PROPERTIES.md).
69
75
  - Navigate to the [disassembly guide](./docs/DISASSEMBLE.md).
76
+ - For callgraph internals and analyst-facing interpretation, see the [callgraph guide](./docs/CALLGRAPH.md).
77
+ - **Android Deep Analysis:** In deep mode blint parses the dex classes, detects bundled service and tracker SDKs, and runs a Dalvik behavioural review that decodes the bytecode and flags risky behaviours such as dynamic code loading, reflection, native command execution, weak cryptography, and cleartext networking. The findings are attached to the BOM as custom properties. When disassembly is enabled, blint also writes a Dalvik callgraph sidecar next to the BOM.
70
78
  - **Capability Analysis:** Identifies potentially sensitive capabilities by reviewing imported functions and symbols, such as network access, filesystem operations, or cryptographic API usage.
79
+ - Includes cluster-style behavioral reviews for low-level networking patterns (for example eBPF sock_ops usage, TUN interception stacks, raw packet injection primitives, and local DoH redirection indicators).
71
80
  - **CI/CD Integration:** Can be added to build pipelines to enforce security policies, such as requiring code signing on all release artifacts.
72
81
  - **Fuzzing Target Identification:** Suggests interesting functions to target for fuzzing based on common patterns in function names (e.g., `parse`, `decode`, `copy`).
73
82
  - **Extensible with Custom Rules:** Define your own capabilities and checks using simple [YAML rule files](./docs/RULES.md).
@@ -122,21 +131,35 @@ blint sbom -i /path/to/app.apk -o sbom.cdx.json
122
131
  docker run --rm -it -v /path/to:/app -w /app ghcr.io/owasp-dep-scan/blint:latest sbom -i /app/app.apk -o sbom.cdx.json
123
132
  ```
124
133
 
134
+ For Android deep analysis, enable deep mode so the dex classes are parsed. This is what makes service and tracker detection and the Dalvik behavioural review possible. Add `--disassembly` to also write the Dalvik callgraph sidecar next to the BOM. Both `.apk` single files and `.apkm` split bundles are supported.
135
+
136
+ ```shell
137
+ blint sbom -i /path/to/app.apkm -o sbom.cdx.json --deep --disassembly
138
+ ```
139
+
125
140
  ## Understanding the Output
126
141
 
127
142
  blint produces several JSON artifacts in the specified reports directory.
128
143
 
129
- | Filename | Purpose | Details |
130
- | ----------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
131
- | `exename-metadata.json` | **Raw, detailed metadata** extracted from the binary. This is the source for all other reports. | Contains everything: headers, symbols, functions, dependencies, signature info, and more. See the **[Technical Metadata Documentation](./docs/METADATA.md)** for a full breakdown. |
132
- | `findings.json` | A summary of the **security properties audit**. Designed for CI/CD integration. | Lists security mitigations like PIE, NX, and Stack Canaries and whether they are present. |
133
- | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
134
- | `fuzzables.json` | A list of **suggested functions to fuzz**, generated when using the `--suggest-fuzzable` flag. | Identifies functions with names that suggest data parsing or manipulation, which are often good candidates for fuzzing. |
135
- | `sbom-*.cdx.json` | The **Software Bill-of-Materials (SBOM)**, generated by the `sbom` sub-command. | A CycloneDX-formatted JSON file detailing the binary's components and dependencies. |
144
+ | Filename | Purpose | Details |
145
+ | --------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
146
+ | `exename-metadata.json` | **Raw, detailed metadata** extracted from the binary. This is the source for all other reports. | Contains everything: headers, symbols, functions, dependencies, signature info, and more. See the **[Technical Metadata Documentation](./docs/METADATA.md)** for a full breakdown. |
147
+ | `exename-wasm-report.json` | **Raw WASM parser report** for WebAssembly inputs. | Generated for `.wasm` files and contains the full `wasm_tools` parser output, including section/function/instruction detail. |
148
+ | `findings.json` | A summary of the **security properties audit**. Designed for CI/CD integration. | Lists security mitigations like PIE, NX, and Stack Canaries and whether they are present. |
149
+ | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
150
+ | `fuzzables.json` | A list of **suggested functions to fuzz**, generated when using the `--suggest-fuzzable` flag. | Identifies functions with names that suggest data parsing or manipulation, which are often good candidates for fuzzing. |
151
+ | `exename-callgraph.mmd` | Mermaid callgraph export generated with `--export-callgraph-mermaid`. | Includes internal and unresolved edges; also embedded into `blint-output.html`. |
152
+ | `exename-callgraph.graphml` | GraphML callgraph export generated with `--export-callgraph-graphml`. | Useful for Gephi, Cytoscape, and NetworkX workflows. |
153
+ | `exename-callgraph.gexf` | GEXF callgraph export generated with `--export-callgraph-gexf`. | Useful for Gephi-centric large graph exploration. |
154
+ | `sbom-*.cdx.json` | The **Software Bill-of-Materials (SBOM)**, generated by the `sbom` sub-command. | A CycloneDX-formatted JSON file detailing the binary's components and dependencies. |
136
155
 
137
156
  ## Advanced Usage: SBOM Generation with blintdb
138
157
 
139
- For C/C++ binaries, identifying components from symbols alone can be imprecise. `blint` can use **blintdb**, a pre-compiled database of symbols from popular open-source libraries (like those from vcpkg), to dramatically improve component identification.
158
+ For C and C++ binaries, identifying components from symbols alone can be imprecise. `blint` can use **blintdb v2**, a pre-compiled database built from real project outputs, to improve component identification with:
159
+
160
+ - project-level symbol matching
161
+ - binary-name hints
162
+ - optional disassembly hash matching when deep mode is enabled
140
163
 
141
164
  The workflow is a two-step process:
142
165
 
@@ -149,11 +172,31 @@ The workflow is a two-step process:
149
172
  This downloads the database to the directory specified by the `BLINTDB_HOME` environment variable.
150
173
 
151
174
  2. **Generate the SBOM with blintdb enabled:**
175
+
152
176
  ```shell
153
177
  blint sbom -i /path/to/binary -o sbom.cdx.json --use-blintdb
154
178
  ```
155
179
 
156
- This will cross-reference symbols found in your binary against the database to identify components like OpenSSL, zlib, and others.
180
+ 3. **For higher-confidence native matching, enable deep mode:**
181
+
182
+ ```shell
183
+ blint sbom -i /path/to/binary -o sbom.cdx.json --use-blintdb --deep
184
+ ```
185
+
186
+ When `--use-blintdb` and `--deep` are set together, `blint` enables disassembly automatically and searches the database with function hashes before falling back to symbol evidence.
187
+
188
+ The generated SBOM keeps the inferred package purl and also records `internal:blintdb_*` evidence properties on matched components so you can review why a component was selected.
189
+
190
+ For repeatable end-to-end validation of local `blint-db` changes, use the integration script in `tests/scripts/validate_blintdb_small_corpus.py`. It builds and validates a versioned 15-case corpus split across Meson, vcpkg, and Homebrew, using the manifest stored in `tests/data/blintdb-small-corpus.json`.
191
+
192
+ The generated `summary.json` includes per-ecosystem provenance copied from the linked `blint-db` run metadata under `ecosystems.<name>.provenance`. That block mirrors `projects.selected_count`, `attempted_count`, `success_count`, `failure_count`, `status_counts`, and `build_failures`. Each `projects.build_failures[]` entry is a flattened per-project failure record with stable keys such as `selector`, `project_name`, `ecosystem`, `build_system`, `status`, `stage`, and `message`, plus optional details like `returncode` or `exception_type` when they are available.
193
+
194
+ ## Environment Variables
195
+
196
+ - `BLINTDB_HOME`, `BLINTDB_IMAGE_URL`, `BLINTDB_REFRESH`: Control blintdb download location, source image, and refresh behavior.
197
+ - `BLINT_MAX_HEX_BYTES`: Maximum number of raw bytes converted to hex when metadata contains undecodable byte sequences. Default is `4096`.
198
+ - `0` disables truncation.
199
+ - When truncation happens, blint appends `...<truncated:N_bytes>` to preserve context without producing huge JSON fields.
157
200
 
158
201
  ## Command-Line Reference
159
202
 
@@ -175,8 +218,16 @@ options:
175
218
  --no-banner Do not display banner.
176
219
  --no-reviews Do not perform method reviews.
177
220
  --suggest-fuzzable Suggest functions and symbols for fuzzing based on a dictionary.
178
- --use-blintdb Use blintdb for symbol resolution. Use environment variables: BLINTDB_IMAGE_URL, BLINTDB_HOME, and BLINTDB_REFRESH for customization.
221
+ --use-blintdb Use blintdb v2 for symbol resolution. Use environment variables: BLINTDB_IMAGE_URL, BLINTDB_HOME, and BLINTDB_REFRESH for customization.
179
222
  --disassemble Disassemble functions and store the instructions in the metadata. Requires blint extended group to be installed.
223
+ --export-callgraph-mermaid
224
+ Export callgraph as Mermaid (.mmd) files and embed diagrams into blint-output.html. Effective when --disassemble is enabled.
225
+ --export-callgraph-graphml
226
+ Export callgraph as GraphML for external graph analysis tools. Effective when --disassemble is enabled.
227
+ --export-callgraph-gexf
228
+ Export callgraph as GEXF for Gephi and other graph tooling. Effective when --disassemble is enabled.
229
+ --callgraph-min-confidence {low,medium,high}
230
+ Filter exported callgraph edges/external links by confidence. Defaults to low (no filtering).
180
231
  --custom-rules-dir CUSTOM_RULES_DIR
181
232
  Path to a directory containing custom YAML rule files (.yml or .yaml). These will be loaded in addition to default rules.
182
233
  -q, --quiet Disable logging and progress bars.
@@ -195,8 +246,8 @@ sub-commands:
195
246
  <summary><strong>SBOM Sub-command Help</strong></summary>
196
247
 
197
248
  ```shell
198
- usage: blint sbom [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o SBOM_OUTPUT] [--deep] [--stdout] [--exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]]
199
- [--bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]]
249
+ usage: blint sbom [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o SBOM_OUTPUT] [--deep] [--stdout] [-q]
250
+ [--exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]] [--bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]] [--use-blintdb]
200
251
 
201
252
  options:
202
253
  -h, --help show this help message and exit
@@ -204,12 +255,14 @@ options:
204
255
  Source directories, container images or binary files. Defaults to current directory.
205
256
  -o SBOM_OUTPUT, --output-file SBOM_OUTPUT
206
257
  SBOM output file. Defaults to sbom-binary-postbuild.cdx.json in current directory.
207
- --deep Enable deep mode to collect more used symbols and modules aggressively. Slow operation.
258
+ --deep Enable deep mode to collect more used symbols and modules aggressively. Slow operation. When combined with --use-blintdb, disassembly is enabled automatically to use function-hash lookup.
208
259
  --stdout Print the SBOM to stdout instead of a file.
260
+ -q, --quiet Disable logging and progress bars.
209
261
  --exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]
210
262
  prefixes for the exports to be included in the SBOM.
211
263
  --bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]
212
264
  Directories containing pre-build and build BOMs. Use to improve the precision.
265
+ --use-blintdb Use blintdb v2 for symbol and disassembly-hash resolution. Defaults to true if the local database file exists.
213
266
  ```
214
267
 
215
268
  </details>
@@ -224,7 +277,7 @@ options:
224
277
  -h, --help show this help message and exit
225
278
  --download Download the pre-compiled database to the /Volumes/Work/blintdb/ directory. Use the environment variable `BLINTDB_HOME` to override.
226
279
  --image-url IMAGE_URL
227
- blintdb image url. Defaults to ghcr.io/appthreat/blintdb-vcpkg-arm64:v1. The environment variable `BLINTDB_IMAGE_URL` is an alternative way to set this value.
280
+ blintdb image url. Defaults to ghcr.io/appthreat/blintdb-vcpkg-arm64:v2. The environment variable `BLINTDB_IMAGE_URL` is an alternative way to set this value.
228
281
  ```
229
282
 
230
283
  </details>
blint-3.2.1/README.md ADDED
@@ -0,0 +1,248 @@
1
+ # blint
2
+
3
+ <img src="./blint.png" width="200" height="auto" />
4
+
5
+ [![AI-DECLARATION: pair](https://img.shields.io/badge/䷼%20AI--DECLARATION-pair-ffedd5?labelColor=ffedd5)](./AI-DECLARATION.md)
6
+
7
+ `blint` is a Binary Linter that checks the security properties and capabilities of your executables. It is powered by [lief](https://github.com/lief-project/LIEF) and can generate a Software Bill-of-Materials (SBOM) for supported binaries.
8
+
9
+ ## What is blint?
10
+
11
+ blint is a tool for reverse engineers, security analysts, and developers to quickly assess the security posture and composition of a binary file. In an age of statically-linked Golang, Rust, and .NET applications, understanding what's inside a binary is more important than ever. blint automates this initial triage process.
12
+
13
+ **Supported Binary Formats:**
14
+
15
+ - ELF (for GNU and musl libc)
16
+ - PE (Windows executables and DLLs)
17
+ - Mach-O (macOS and iOS, x64 and arm64)
18
+ - WASM (WebAssembly modules)
19
+ - Android (APK, APKM, AAB, including DEX files in deep mode)
20
+ - Disassembler: AArch64, x86/x86-64, ARM, Mips, MicroMips (native), and Dalvik (DEX).
21
+
22
+ ## Key Features & Use Cases
23
+
24
+ - **Comprehensive Security Audits:** Automatically checks for common security mitigations like PIE, ASLR, NX, Stack Canaries, and RELRO. Ideal for ensuring your CI/CD pipeline produces hardened binaries.
25
+ - **Software Bill-of-Materials (SBOM) Generation:** Creates CycloneDX SBOMs for binaries built with Go, Rust, .NET, and Android toolchains, providing a clear inventory of third-party components for vulnerability management.
26
+ - **Deep Binary Inspection:** Disassembles, extracts, and analyzes a wealth of information including symbols, functions, dependencies, and build toolchains. This raw data is saved as a detailed JSON file.
27
+ - For a complete guide to all attributes in this file, see the [Technical Metadata Documentation](./docs/METADATA.md).
28
+ - For the custom CycloneDX properties blint adds to the BOM, see the [Custom Properties Documentation](./docs/CUSTOM_PROPERTIES.md).
29
+ - Navigate to the [disassembly guide](./docs/DISASSEMBLE.md).
30
+ - For callgraph internals and analyst-facing interpretation, see the [callgraph guide](./docs/CALLGRAPH.md).
31
+ - **Android Deep Analysis:** In deep mode blint parses the dex classes, detects bundled service and tracker SDKs, and runs a Dalvik behavioural review that decodes the bytecode and flags risky behaviours such as dynamic code loading, reflection, native command execution, weak cryptography, and cleartext networking. The findings are attached to the BOM as custom properties. When disassembly is enabled, blint also writes a Dalvik callgraph sidecar next to the BOM.
32
+ - **Capability Analysis:** Identifies potentially sensitive capabilities by reviewing imported functions and symbols, such as network access, filesystem operations, or cryptographic API usage.
33
+ - Includes cluster-style behavioral reviews for low-level networking patterns (for example eBPF sock_ops usage, TUN interception stacks, raw packet injection primitives, and local DoH redirection indicators).
34
+ - **CI/CD Integration:** Can be added to build pipelines to enforce security policies, such as requiring code signing on all release artifacts.
35
+ - **Fuzzing Target Identification:** Suggests interesting functions to target for fuzzing based on common patterns in function names (e.g., `parse`, `decode`, `copy`).
36
+ - **Extensible with Custom Rules:** Define your own capabilities and checks using simple [YAML rule files](./docs/RULES.md).
37
+
38
+ ## Installation
39
+
40
+ `blint` requires Python >= 3.10.
41
+
42
+ ```shell
43
+ pip install blint
44
+ ```
45
+
46
+ For **disassembly support**, which enables instruction-level analysis of functions, install the `extended` version. This includes the [nyxstone](https://github.com/emproof-com/nyxstone) disassembler.
47
+
48
+ ```shell
49
+ pip install blint[extended]
50
+ ```
51
+
52
+ ### Via Container Image
53
+
54
+ You can also run blint using the official container image available on GitHub Container Registry. This is a convenient way to run blint without installing Python or any dependencies on your host machine.
55
+
56
+ ```
57
+ docker run --rm -it -v $(pwd):/app -w /app ghcr.io/owasp-dep-scan/blint:latest -i /path/to/your/binary
58
+ ```
59
+
60
+ ## Quick Start
61
+
62
+ Analyze a binary and save the reports to the `/tmp/blint` directory:
63
+
64
+ ```shell
65
+ blint -i /bin/netstat -o /tmp/blint
66
+ ```
67
+
68
+ ```shell
69
+ docker run --rm -it -v /tmp:/tmp -v /bin:/app/bin -w /app ghcr.io/owasp-dep-scan/blint:latest -i /app/bin/netstat -o /tmp/blint
70
+ ```
71
+
72
+ Analyze a Go or Rust binary and get suggestions for fuzzing targets:
73
+
74
+ ```shell
75
+ blint -i /path/to/my-binary --suggest-fuzzable
76
+ ```
77
+
78
+ Generate a CycloneDX SBOM for an Android application:
79
+
80
+ ```shell
81
+ blint sbom -i /path/to/app.apk -o sbom.cdx.json
82
+ ```
83
+
84
+ ```shell
85
+ docker run --rm -it -v /path/to:/app -w /app ghcr.io/owasp-dep-scan/blint:latest sbom -i /app/app.apk -o sbom.cdx.json
86
+ ```
87
+
88
+ For Android deep analysis, enable deep mode so the dex classes are parsed. This is what makes service and tracker detection and the Dalvik behavioural review possible. Add `--disassembly` to also write the Dalvik callgraph sidecar next to the BOM. Both `.apk` single files and `.apkm` split bundles are supported.
89
+
90
+ ```shell
91
+ blint sbom -i /path/to/app.apkm -o sbom.cdx.json --deep --disassembly
92
+ ```
93
+
94
+ ## Understanding the Output
95
+
96
+ blint produces several JSON artifacts in the specified reports directory.
97
+
98
+ | Filename | Purpose | Details |
99
+ | --------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100
+ | `exename-metadata.json` | **Raw, detailed metadata** extracted from the binary. This is the source for all other reports. | Contains everything: headers, symbols, functions, dependencies, signature info, and more. See the **[Technical Metadata Documentation](./docs/METADATA.md)** for a full breakdown. |
101
+ | `exename-wasm-report.json` | **Raw WASM parser report** for WebAssembly inputs. | Generated for `.wasm` files and contains the full `wasm_tools` parser output, including section/function/instruction detail. |
102
+ | `findings.json` | A summary of the **security properties audit**. Designed for CI/CD integration. | Lists security mitigations like PIE, NX, and Stack Canaries and whether they are present. |
103
+ | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
104
+ | `fuzzables.json` | A list of **suggested functions to fuzz**, generated when using the `--suggest-fuzzable` flag. | Identifies functions with names that suggest data parsing or manipulation, which are often good candidates for fuzzing. |
105
+ | `exename-callgraph.mmd` | Mermaid callgraph export generated with `--export-callgraph-mermaid`. | Includes internal and unresolved edges; also embedded into `blint-output.html`. |
106
+ | `exename-callgraph.graphml` | GraphML callgraph export generated with `--export-callgraph-graphml`. | Useful for Gephi, Cytoscape, and NetworkX workflows. |
107
+ | `exename-callgraph.gexf` | GEXF callgraph export generated with `--export-callgraph-gexf`. | Useful for Gephi-centric large graph exploration. |
108
+ | `sbom-*.cdx.json` | The **Software Bill-of-Materials (SBOM)**, generated by the `sbom` sub-command. | A CycloneDX-formatted JSON file detailing the binary's components and dependencies. |
109
+
110
+ ## Advanced Usage: SBOM Generation with blintdb
111
+
112
+ For C and C++ binaries, identifying components from symbols alone can be imprecise. `blint` can use **blintdb v2**, a pre-compiled database built from real project outputs, to improve component identification with:
113
+
114
+ - project-level symbol matching
115
+ - binary-name hints
116
+ - optional disassembly hash matching when deep mode is enabled
117
+
118
+ The workflow is a two-step process:
119
+
120
+ 1. **Download the blintdb database:**
121
+
122
+ ```shell
123
+ blint db --download
124
+ ```
125
+
126
+ This downloads the database to the directory specified by the `BLINTDB_HOME` environment variable.
127
+
128
+ 2. **Generate the SBOM with blintdb enabled:**
129
+
130
+ ```shell
131
+ blint sbom -i /path/to/binary -o sbom.cdx.json --use-blintdb
132
+ ```
133
+
134
+ 3. **For higher-confidence native matching, enable deep mode:**
135
+
136
+ ```shell
137
+ blint sbom -i /path/to/binary -o sbom.cdx.json --use-blintdb --deep
138
+ ```
139
+
140
+ When `--use-blintdb` and `--deep` are set together, `blint` enables disassembly automatically and searches the database with function hashes before falling back to symbol evidence.
141
+
142
+ The generated SBOM keeps the inferred package purl and also records `internal:blintdb_*` evidence properties on matched components so you can review why a component was selected.
143
+
144
+ For repeatable end-to-end validation of local `blint-db` changes, use the integration script in `tests/scripts/validate_blintdb_small_corpus.py`. It builds and validates a versioned 15-case corpus split across Meson, vcpkg, and Homebrew, using the manifest stored in `tests/data/blintdb-small-corpus.json`.
145
+
146
+ The generated `summary.json` includes per-ecosystem provenance copied from the linked `blint-db` run metadata under `ecosystems.<name>.provenance`. That block mirrors `projects.selected_count`, `attempted_count`, `success_count`, `failure_count`, `status_counts`, and `build_failures`. Each `projects.build_failures[]` entry is a flattened per-project failure record with stable keys such as `selector`, `project_name`, `ecosystem`, `build_system`, `status`, `stage`, and `message`, plus optional details like `returncode` or `exception_type` when they are available.
147
+
148
+ ## Environment Variables
149
+
150
+ - `BLINTDB_HOME`, `BLINTDB_IMAGE_URL`, `BLINTDB_REFRESH`: Control blintdb download location, source image, and refresh behavior.
151
+ - `BLINT_MAX_HEX_BYTES`: Maximum number of raw bytes converted to hex when metadata contains undecodable byte sequences. Default is `4096`.
152
+ - `0` disables truncation.
153
+ - When truncation happens, blint appends `...<truncated:N_bytes>` to preserve context without producing huge JSON fields.
154
+
155
+ ## Command-Line Reference
156
+
157
+ <details>
158
+ <summary><strong>Main Command Help</strong></summary>
159
+
160
+ ```shell
161
+ usage: blint [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o REPORTS_DIR] [--no-error] [--no-banner] [--no-reviews] [--suggest-fuzzable] [--use-blintdb] {sbom} ...
162
+
163
+ Binary linter and SBOM generator.
164
+
165
+ options:
166
+ -h, --help show this help message and exit
167
+ -i, --src SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]
168
+ Source directories, container images or binary files. Defaults to current directory.
169
+ -o, --reports REPORTS_DIR
170
+ Reports directory. Defaults to reports.
171
+ --no-error Continue on error to prevent build from breaking.
172
+ --no-banner Do not display banner.
173
+ --no-reviews Do not perform method reviews.
174
+ --suggest-fuzzable Suggest functions and symbols for fuzzing based on a dictionary.
175
+ --use-blintdb Use blintdb v2 for symbol resolution. Use environment variables: BLINTDB_IMAGE_URL, BLINTDB_HOME, and BLINTDB_REFRESH for customization.
176
+ --disassemble Disassemble functions and store the instructions in the metadata. Requires blint extended group to be installed.
177
+ --export-callgraph-mermaid
178
+ Export callgraph as Mermaid (.mmd) files and embed diagrams into blint-output.html. Effective when --disassemble is enabled.
179
+ --export-callgraph-graphml
180
+ Export callgraph as GraphML for external graph analysis tools. Effective when --disassemble is enabled.
181
+ --export-callgraph-gexf
182
+ Export callgraph as GEXF for Gephi and other graph tooling. Effective when --disassemble is enabled.
183
+ --callgraph-min-confidence {low,medium,high}
184
+ Filter exported callgraph edges/external links by confidence. Defaults to low (no filtering).
185
+ --custom-rules-dir CUSTOM_RULES_DIR
186
+ Path to a directory containing custom YAML rule files (.yml or .yaml). These will be loaded in addition to default rules.
187
+ -q, --quiet Disable logging and progress bars.
188
+
189
+ sub-commands:
190
+ Additional sub-commands
191
+
192
+ {sbom}
193
+ sbom Command to generate SBOM for supported binaries.
194
+ db Command to manage the pre-compiled database.
195
+ ```
196
+
197
+ </details>
198
+
199
+ <details>
200
+ <summary><strong>SBOM Sub-command Help</strong></summary>
201
+
202
+ ```shell
203
+ usage: blint sbom [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o SBOM_OUTPUT] [--deep] [--stdout] [-q]
204
+ [--exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]] [--bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]] [--use-blintdb]
205
+
206
+ options:
207
+ -h, --help show this help message and exit
208
+ -i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...], --src SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]
209
+ Source directories, container images or binary files. Defaults to current directory.
210
+ -o SBOM_OUTPUT, --output-file SBOM_OUTPUT
211
+ SBOM output file. Defaults to sbom-binary-postbuild.cdx.json in current directory.
212
+ --deep Enable deep mode to collect more used symbols and modules aggressively. Slow operation. When combined with --use-blintdb, disassembly is enabled automatically to use function-hash lookup.
213
+ --stdout Print the SBOM to stdout instead of a file.
214
+ -q, --quiet Disable logging and progress bars.
215
+ --exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]
216
+ prefixes for the exports to be included in the SBOM.
217
+ --bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]
218
+ Directories containing pre-build and build BOMs. Use to improve the precision.
219
+ --use-blintdb Use blintdb v2 for symbol and disassembly-hash resolution. Defaults to true if the local database file exists.
220
+ ```
221
+
222
+ </details>
223
+
224
+ <details>
225
+ <summary><strong>DB Sub-command Help</strong></summary>
226
+
227
+ ```shell
228
+ usage: blint db [-h] [--download] [--image-url IMAGE_URL]
229
+
230
+ options:
231
+ -h, --help show this help message and exit
232
+ --download Download the pre-compiled database to the /Volumes/Work/blintdb/ directory. Use the environment variable `BLINTDB_HOME` to override.
233
+ --image-url IMAGE_URL
234
+ blintdb image url. Defaults to ghcr.io/appthreat/blintdb-vcpkg-arm64:v2. The environment variable `BLINTDB_IMAGE_URL` is an alternative way to set this value.
235
+ ```
236
+
237
+ </details>
238
+
239
+ ## References
240
+
241
+ - [lief examples](https://github.com/lief-project/LIEF/tree/master/examples)
242
+ - [checksec.py](https://github.com/slimm609/checksec.py)
243
+
244
+ ## Sponsorship
245
+
246
+ If you love `blint`, please consider [donating to our project](https://owasp.org/donate?reponame=www-project-dep-scan&title=OWASP+dep-scan). In addition, `blint` is made possible by the incredible work of the LIEF project. Please consider sponsoring them as well.
247
+
248
+ - [LIEF Project](https://github.com/sponsors/lief-project/)