blint 3.0.2__tar.gz → 3.0.4__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 (44) hide show
  1. blint-3.0.4/PKG-INFO +227 -0
  2. blint-3.0.4/README.md +183 -0
  3. {blint-3.0.2 → blint-3.0.4}/blint/config.py +88 -11
  4. {blint-3.0.2 → blint-3.0.4}/blint/lib/analysis.py +1 -1
  5. {blint-3.0.2 → blint-3.0.4}/blint/lib/binary.py +253 -12
  6. blint-3.0.4/blint/lib/disassembler.py +1330 -0
  7. {blint-3.0.2 → blint-3.0.4}/blint/lib/runners.py +3 -3
  8. {blint-3.0.2 → blint-3.0.4}/blint/lib/sbom.py +1 -1
  9. {blint-3.0.2 → blint-3.0.4}/blint/lib/utils.py +18 -1
  10. {blint-3.0.2 → blint-3.0.4}/pyproject.toml +1 -1
  11. blint-3.0.2/PKG-INFO +0 -241
  12. blint-3.0.2/README.md +0 -197
  13. blint-3.0.2/blint/lib/disassembler.py +0 -835
  14. {blint-3.0.2 → blint-3.0.4}/LICENSE +0 -0
  15. {blint-3.0.2 → blint-3.0.4}/blint/__init__.py +0 -0
  16. {blint-3.0.2 → blint-3.0.4}/blint/cli.py +0 -0
  17. {blint-3.0.2 → blint-3.0.4}/blint/cyclonedx/README.md +0 -0
  18. {blint-3.0.2 → blint-3.0.4}/blint/cyclonedx/__init__.py +0 -0
  19. {blint-3.0.2 → blint-3.0.4}/blint/cyclonedx/spdx.py +0 -0
  20. {blint-3.0.2 → blint-3.0.4}/blint/cyclonedx/spec.py +0 -0
  21. {blint-3.0.2 → blint-3.0.4}/blint/data/__init__.py +0 -0
  22. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/__init__.py +0 -0
  23. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_entries_generic.yml +0 -0
  24. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_entries_pe.yml +0 -0
  25. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_exe_go.yml +0 -0
  26. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_functions_generic.yml +0 -0
  27. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_imports_pe.yml +0 -0
  28. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_methods_generic.yml +0 -0
  29. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_methods_mips.yml +0 -0
  30. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_monero_generic.yml +0 -0
  31. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_monero_go.yml +0 -0
  32. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_monero_rust.yml +0 -0
  33. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_rootkits_win.yml +0 -0
  34. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_symbols_antiforensic.yml +0 -0
  35. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_symbols_generic.yml +0 -0
  36. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_symbols_hooka.yml +0 -0
  37. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_symbols_macho.yml +0 -0
  38. {blint-3.0.2 → blint-3.0.4}/blint/data/annotations/review_symbols_rust.yml +0 -0
  39. {blint-3.0.2 → blint-3.0.4}/blint/data/rules.yml +0 -0
  40. {blint-3.0.2 → blint-3.0.4}/blint/db.py +0 -0
  41. {blint-3.0.2 → blint-3.0.4}/blint/lib/__init__.py +0 -0
  42. {blint-3.0.2 → blint-3.0.4}/blint/lib/android.py +0 -0
  43. {blint-3.0.2 → blint-3.0.4}/blint/lib/checks.py +0 -0
  44. {blint-3.0.2 → blint-3.0.4}/blint/logger.py +0 -0
blint-3.0.4/PKG-INFO ADDED
@@ -0,0 +1,227 @@
1
+ Metadata-Version: 2.4
2
+ Name: blint
3
+ Version: 3.0.4
4
+ Summary: Linter and SBOM generator for binary files.
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Keywords: linter,binary,security,sast
8
+ Author: Team AppThreat
9
+ Author-email: cloud@appthreat.com
10
+ Requires-Python: >=3.10,<3.14
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: System Administrators
14
+ Classifier: Topic :: Utilities
15
+ Classifier: Topic :: Security
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Operating System :: OS Independent
21
+ Provides-Extra: dev
22
+ Requires-Dist: PyYAML (>=6.0.2)
23
+ Requires-Dist: appdirs (>=1.4.4)
24
+ Requires-Dist: apsw (>=3.49.1.0)
25
+ Requires-Dist: ar (>=1.0.0)
26
+ Requires-Dist: black (>=25.1.0) ; extra == "dev"
27
+ Requires-Dist: custom-json-diff (>=2.1.6)
28
+ Requires-Dist: defusedxml (>=0.7.1)
29
+ Requires-Dist: flake8 (>=7.2.0) ; extra == "dev"
30
+ Requires-Dist: lief (>=0.16.6)
31
+ Requires-Dist: oras (>=0.2.28)
32
+ Requires-Dist: orjson (>=3.10.16)
33
+ Requires-Dist: packageurl-python (>=0.16.0)
34
+ Requires-Dist: pydantic[email] (>=2.11.3)
35
+ Requires-Dist: pyinstaller (>=6.12.0) ; extra == "dev"
36
+ Requires-Dist: pylint (>=3.3.6) ; extra == "dev"
37
+ Requires-Dist: pytest (>=8.3.5) ; extra == "dev"
38
+ Requires-Dist: pytest-cov (>=6.1.1) ; extra == "dev"
39
+ Requires-Dist: rich (>=14.0.0)
40
+ Requires-Dist: symbolic (==10.2.1)
41
+ Project-URL: CI, https://github.com/owasp-dep-scan/blint/actions
42
+ Description-Content-Type: text/markdown
43
+
44
+ # blint
45
+
46
+ <img src="./blint.png" width="200" height="auto" />
47
+
48
+ `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.
49
+
50
+ ## What is blint?
51
+
52
+ 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.
53
+
54
+ **Supported Binary Formats:**
55
+
56
+ - ELF (for GNU and musl libc)
57
+ - PE (Windows executables and DLLs)
58
+ - Mach-O (macOS and iOS, x64 and arm64)
59
+ - Android (APK, AAB, including DEX files in deep mode)
60
+
61
+ ## Key Features & Use Cases
62
+
63
+ - **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.
64
+ - **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.
65
+ - **Deep Binary Inspection:** Extracts and analyzes a wealth of information including symbols, functions, dependencies, and build toolchains. This raw data is saved as a detailed JSON file.
66
+ - **For a complete guide to all attributes in this file, see the [Technical Metadata Documentation](./docs/METADATA.md).**
67
+ - **Capability Analysis:** Identifies potentially sensitive capabilities by reviewing imported functions and symbols, such as network access, filesystem operations, or cryptographic API usage.
68
+ - **CI/CD Integration:** Can be added to build pipelines to enforce security policies, such as requiring code signing on all release artifacts.
69
+ - **Fuzzing Target Identification:** Suggests interesting functions to target for fuzzing based on common patterns in function names (e.g., `parse`, `decode`, `copy`).
70
+ - **Extensible with Custom Rules:** Define your own capabilities and checks using simple [YAML rule files](./docs/RULES.md).
71
+
72
+ ## Installation
73
+
74
+ `blint` requires Python >= 3.10.
75
+
76
+ ```bash
77
+ pip install blint
78
+ ```
79
+
80
+ 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.
81
+
82
+ ```bash
83
+ pip install blint[extended]
84
+ ```
85
+
86
+ ### Standalone Executables
87
+
88
+ Single-file executables that do not require Python are available from the [blint releases page](https://github.com/OWASP-dep-scan/blint/releases). The macOS `.pkg` file is signed with a valid Apple Developer ID.
89
+
90
+ ## Quick Start
91
+
92
+ Analyze a binary and save the reports to the `/tmp/blint` directory:
93
+
94
+ ```bash
95
+ blint -i /bin/netstat -o /tmp/blint
96
+ ```
97
+
98
+ Analyze a Go or Rust binary and get suggestions for fuzzing targets:
99
+
100
+ ```bash
101
+ blint -i /path/to/my-binary --suggest-fuzzable
102
+ ```
103
+
104
+ Generate a CycloneDX SBOM for an Android application:
105
+
106
+ ```shell
107
+ blint sbom -i /path/to/app.apk -o bom.cdx.json
108
+ ```
109
+
110
+ ## Understanding the Output
111
+
112
+ blint produces several JSON artifacts in the specified reports directory.
113
+
114
+ | Filename | Purpose | Details |
115
+ | ----------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
+ | `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. |
117
+ | `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. |
118
+ | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
119
+ | `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. |
120
+ | `bom-*.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. |
121
+
122
+ ## Advanced Usage: SBOM Generation with blintdb
123
+
124
+ 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.
125
+
126
+ The workflow is a two-step process:
127
+
128
+ 1. **Download the blintdb database:**
129
+
130
+ ```shell
131
+ blint db --download
132
+ ```
133
+
134
+ This downloads the database to the directory specified by the `BLINTDB_HOME` environment variable.
135
+
136
+ 2. **Generate the SBOM with blintdb enabled:**
137
+ ```shell
138
+ blint sbom -i /path/to/binary -o bom.cdx.json --use-blintdb
139
+ ```
140
+
141
+ This will cross-reference symbols found in your binary against the database to identify components like OpenSSL, zlib, and others.
142
+
143
+ ## Command-Line Reference
144
+
145
+ <details>
146
+ <summary><strong>Main Command Help</strong></summary>
147
+
148
+ ```shell
149
+ usage: blint [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o REPORTS_DIR] [--no-error] [--no-banner] [--no-reviews] [--suggest-fuzzable] [--use-blintdb] {sbom} ...
150
+
151
+ Binary linter and SBOM generator.
152
+
153
+ options:
154
+ -h, --help show this help message and exit
155
+ -i, --src SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]
156
+ Source directories, container images or binary files. Defaults to current directory.
157
+ -o, --reports REPORTS_DIR
158
+ Reports directory. Defaults to reports.
159
+ --no-error Continue on error to prevent build from breaking.
160
+ --no-banner Do not display banner.
161
+ --no-reviews Do not perform method reviews.
162
+ --suggest-fuzzable Suggest functions and symbols for fuzzing based on a dictionary.
163
+ --use-blintdb Use blintdb for symbol resolution. Use environment variables: BLINTDB_IMAGE_URL, BLINTDB_HOME, and BLINTDB_REFRESH for customization.
164
+ --disassemble Disassemble functions and store the instructions in the metadata. Requires blint extended group to be installed.
165
+ --custom-rules-dir CUSTOM_RULES_DIR
166
+ Path to a directory containing custom YAML rule files (.yml or .yaml). These will be loaded in addition to default rules.
167
+ -q, --quiet Disable logging and progress bars.
168
+
169
+ sub-commands:
170
+ Additional sub-commands
171
+
172
+ {sbom}
173
+ sbom Command to generate SBOM for supported binaries.
174
+ db Command to manage the pre-compiled database.
175
+ ```
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary><strong>SBOM Sub-command Help</strong></summary>
181
+
182
+ ```shell
183
+ usage: blint sbom [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o SBOM_OUTPUT] [--deep] [--stdout] [--exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]]
184
+ [--bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]]
185
+
186
+ options:
187
+ -h, --help show this help message and exit
188
+ -i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...], --src SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]
189
+ Source directories, container images or binary files. Defaults to current directory.
190
+ -o SBOM_OUTPUT, --output-file SBOM_OUTPUT
191
+ SBOM output file. Defaults to bom-post-build.cdx.json in current directory.
192
+ --deep Enable deep mode to collect more used symbols and modules aggressively. Slow operation.
193
+ --stdout Print the SBOM to stdout instead of a file.
194
+ --exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]
195
+ prefixes for the exports to be included in the SBOM.
196
+ --bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]
197
+ Directories containing pre-build and build BOMs. Use to improve the precision.
198
+ ```
199
+
200
+ </details>
201
+
202
+ <details>
203
+ <summary><strong>DB Sub-command Help</strong></summary>
204
+
205
+ ```shell
206
+ usage: blint db [-h] [--download] [--image-url IMAGE_URL]
207
+
208
+ options:
209
+ -h, --help show this help message and exit
210
+ --download Download the pre-compiled database to the /Volumes/Work/blintdb/ directory. Use the environment variable `BLINTDB_HOME` to override.
211
+ --image-url IMAGE_URL
212
+ 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.
213
+ ```
214
+
215
+ </details>
216
+
217
+ ## References
218
+
219
+ - [lief examples](https://github.com/lief-project/LIEF/tree/master/examples)
220
+ - [checksec.py](https://github.com/slimm609/checksec.py)
221
+
222
+ ## Sponsorship
223
+
224
+ 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.
225
+
226
+ - [LIEF Project](https://github.com/sponsors/lief-project/)
227
+
blint-3.0.4/README.md ADDED
@@ -0,0 +1,183 @@
1
+ # blint
2
+
3
+ <img src="./blint.png" width="200" height="auto" />
4
+
5
+ `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.
6
+
7
+ ## What is blint?
8
+
9
+ 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.
10
+
11
+ **Supported Binary Formats:**
12
+
13
+ - ELF (for GNU and musl libc)
14
+ - PE (Windows executables and DLLs)
15
+ - Mach-O (macOS and iOS, x64 and arm64)
16
+ - Android (APK, AAB, including DEX files in deep mode)
17
+
18
+ ## Key Features & Use Cases
19
+
20
+ - **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.
21
+ - **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.
22
+ - **Deep Binary Inspection:** Extracts and analyzes a wealth of information including symbols, functions, dependencies, and build toolchains. This raw data is saved as a detailed JSON file.
23
+ - **For a complete guide to all attributes in this file, see the [Technical Metadata Documentation](./docs/METADATA.md).**
24
+ - **Capability Analysis:** Identifies potentially sensitive capabilities by reviewing imported functions and symbols, such as network access, filesystem operations, or cryptographic API usage.
25
+ - **CI/CD Integration:** Can be added to build pipelines to enforce security policies, such as requiring code signing on all release artifacts.
26
+ - **Fuzzing Target Identification:** Suggests interesting functions to target for fuzzing based on common patterns in function names (e.g., `parse`, `decode`, `copy`).
27
+ - **Extensible with Custom Rules:** Define your own capabilities and checks using simple [YAML rule files](./docs/RULES.md).
28
+
29
+ ## Installation
30
+
31
+ `blint` requires Python >= 3.10.
32
+
33
+ ```bash
34
+ pip install blint
35
+ ```
36
+
37
+ 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.
38
+
39
+ ```bash
40
+ pip install blint[extended]
41
+ ```
42
+
43
+ ### Standalone Executables
44
+
45
+ Single-file executables that do not require Python are available from the [blint releases page](https://github.com/OWASP-dep-scan/blint/releases). The macOS `.pkg` file is signed with a valid Apple Developer ID.
46
+
47
+ ## Quick Start
48
+
49
+ Analyze a binary and save the reports to the `/tmp/blint` directory:
50
+
51
+ ```bash
52
+ blint -i /bin/netstat -o /tmp/blint
53
+ ```
54
+
55
+ Analyze a Go or Rust binary and get suggestions for fuzzing targets:
56
+
57
+ ```bash
58
+ blint -i /path/to/my-binary --suggest-fuzzable
59
+ ```
60
+
61
+ Generate a CycloneDX SBOM for an Android application:
62
+
63
+ ```shell
64
+ blint sbom -i /path/to/app.apk -o bom.cdx.json
65
+ ```
66
+
67
+ ## Understanding the Output
68
+
69
+ blint produces several JSON artifacts in the specified reports directory.
70
+
71
+ | Filename | Purpose | Details |
72
+ | ----------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
73
+ | `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. |
74
+ | `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. |
75
+ | `reviews.json` | A summary of the **capability review**. | Lists detected capabilities (e.g., "networking", "file-read", "crypto") based on the symbols and functions found. |
76
+ | `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. |
77
+ | `bom-*.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. |
78
+
79
+ ## Advanced Usage: SBOM Generation with blintdb
80
+
81
+ 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.
82
+
83
+ The workflow is a two-step process:
84
+
85
+ 1. **Download the blintdb database:**
86
+
87
+ ```shell
88
+ blint db --download
89
+ ```
90
+
91
+ This downloads the database to the directory specified by the `BLINTDB_HOME` environment variable.
92
+
93
+ 2. **Generate the SBOM with blintdb enabled:**
94
+ ```shell
95
+ blint sbom -i /path/to/binary -o bom.cdx.json --use-blintdb
96
+ ```
97
+
98
+ This will cross-reference symbols found in your binary against the database to identify components like OpenSSL, zlib, and others.
99
+
100
+ ## Command-Line Reference
101
+
102
+ <details>
103
+ <summary><strong>Main Command Help</strong></summary>
104
+
105
+ ```shell
106
+ usage: blint [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o REPORTS_DIR] [--no-error] [--no-banner] [--no-reviews] [--suggest-fuzzable] [--use-blintdb] {sbom} ...
107
+
108
+ Binary linter and SBOM generator.
109
+
110
+ options:
111
+ -h, --help show this help message and exit
112
+ -i, --src SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]
113
+ Source directories, container images or binary files. Defaults to current directory.
114
+ -o, --reports REPORTS_DIR
115
+ Reports directory. Defaults to reports.
116
+ --no-error Continue on error to prevent build from breaking.
117
+ --no-banner Do not display banner.
118
+ --no-reviews Do not perform method reviews.
119
+ --suggest-fuzzable Suggest functions and symbols for fuzzing based on a dictionary.
120
+ --use-blintdb Use blintdb for symbol resolution. Use environment variables: BLINTDB_IMAGE_URL, BLINTDB_HOME, and BLINTDB_REFRESH for customization.
121
+ --disassemble Disassemble functions and store the instructions in the metadata. Requires blint extended group to be installed.
122
+ --custom-rules-dir CUSTOM_RULES_DIR
123
+ Path to a directory containing custom YAML rule files (.yml or .yaml). These will be loaded in addition to default rules.
124
+ -q, --quiet Disable logging and progress bars.
125
+
126
+ sub-commands:
127
+ Additional sub-commands
128
+
129
+ {sbom}
130
+ sbom Command to generate SBOM for supported binaries.
131
+ db Command to manage the pre-compiled database.
132
+ ```
133
+
134
+ </details>
135
+
136
+ <details>
137
+ <summary><strong>SBOM Sub-command Help</strong></summary>
138
+
139
+ ```shell
140
+ usage: blint sbom [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o SBOM_OUTPUT] [--deep] [--stdout] [--exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]]
141
+ [--bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]]
142
+
143
+ options:
144
+ -h, --help show this help message and exit
145
+ -i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...], --src SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]
146
+ Source directories, container images or binary files. Defaults to current directory.
147
+ -o SBOM_OUTPUT, --output-file SBOM_OUTPUT
148
+ SBOM output file. Defaults to bom-post-build.cdx.json in current directory.
149
+ --deep Enable deep mode to collect more used symbols and modules aggressively. Slow operation.
150
+ --stdout Print the SBOM to stdout instead of a file.
151
+ --exports-prefix EXPORTS_PREFIX [EXPORTS_PREFIX ...]
152
+ prefixes for the exports to be included in the SBOM.
153
+ --bom-src SRC_DIR_BOMS [SRC_DIR_BOMS ...]
154
+ Directories containing pre-build and build BOMs. Use to improve the precision.
155
+ ```
156
+
157
+ </details>
158
+
159
+ <details>
160
+ <summary><strong>DB Sub-command Help</strong></summary>
161
+
162
+ ```shell
163
+ usage: blint db [-h] [--download] [--image-url IMAGE_URL]
164
+
165
+ options:
166
+ -h, --help show this help message and exit
167
+ --download Download the pre-compiled database to the /Volumes/Work/blintdb/ directory. Use the environment variable `BLINTDB_HOME` to override.
168
+ --image-url IMAGE_URL
169
+ 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.
170
+ ```
171
+
172
+ </details>
173
+
174
+ ## References
175
+
176
+ - [lief examples](https://github.com/lief-project/LIEF/tree/master/examples)
177
+ - [checksec.py](https://github.com/slimm609/checksec.py)
178
+
179
+ ## Sponsorship
180
+
181
+ 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.
182
+
183
+ - [LIEF Project](https://github.com/sponsors/lief-project/)
@@ -1399,20 +1399,62 @@ CRYPTO_INDICATORS = [
1399
1399
  'npxor', 'vpxor', 'vpxord', 'vpxorq',
1400
1400
  'pshufb', 'vpshufb',
1401
1401
  'pclmulqdq', 'vpclmulqdq',
1402
- 'movdqa', 'movdqu', 'vmovdqa', 'vmovdqu',
1403
- 'padd', 'psub', 'pmul',
1404
- 'psll', 'psrl', 'psra',
1405
1402
  'vpaddd', 'vpsubd', 'vpmulld', 'pmaddwd'
1406
1403
  ]
1404
+
1405
+ # https://docs.nvidia.com/cuda/cuda-binary-utilities/index.html#turing-turing-instruction-set-table
1407
1406
  GPU_INDICATORS = [
1408
- 'glbind', 'glvertex', 'glcolor', 'glbegin', 'glend', 'glenable', 'gldisable', 'glget', 'glset', 'glload', 'glsave', 'gluniform', 'gluseprogram', 'glattachshader', 'gldraw', 'glclear', 'glviewport', 'glmatrix', 'glpushmatrix', 'glpopmatrix',
1409
- 'cuda', 'cuinit', 'cucontext', 'cudriver', 'cugpu', 'cudevice', 'cumem', 'cuptr', 'cukernel', 'culaunch', 'cugrid', 'cublock', 'cuthread', 'cufree', 'cucopy',
1410
- 'clgetplatform', 'clgetdevice', 'clcreatecontext', 'clcreatecommandqueue', 'clcreateshared', 'clcreatekernel', 'clsetkernelarg', 'clenqueuendrange', 'clfinish', 'clrelease', 'clbuildprogram',
1411
- 'd3d', 'd3d11', 'd3d12', 'create', 'device', 'swapchain', 'rendertarget', 'shaders', 'ps_', 'vs_', 'gs_', 'cs_', 'hs_', 'ds_',
1412
- 'vkcreate', 'vkdestroy', 'vkallocate', 'vkfree', 'vkqueue', 'vksubmit', 'vkwait', 'vkacquire', 'vkpresent', 'vkcmd', 'vkbegin', 'vkend', 'vkbind', 'vkdraw', 'vkdispatch', 'vkcopy', 'vkblit', 'vkclear', 'vkfill', 'vkupdate',
1413
- 'mtl', 'metal', 'mtldevice', 'mtlcommand', 'mtlrender', 'mtlcompute', 'mtlbuffer', 'mtltexture', 'mtlfunction', 'mtllibrary', 'mtlencoder', 'mtlpass',
1414
- 'gpu', 'compute', 'shader', 'vertex', 'fragment', 'pixel', 'kernel', 'workgroup', 'local', 'global', 'buffer', 'texture', 'surface',
1415
- ]
1407
+ 'acqbulk', 'acqshminit', 'atom', 'atomg', 'atoms', 'b2r', 'bgmma',
1408
+ 'bmov', 'bmma', 'bmsk', 'bpt', 'brx', 'brxu',
1409
+ 'bssy', 'bsync', 'bvote', 'cctl', 'cctll', 'cctlt',
1410
+ 'cgaerrbar', 'clclear', 'clcolor', 'clcreatecommandqueue',
1411
+ 'clcreatecontext', 'clcreatekernel', 'clcreateshared', 'cldevice',
1412
+ 'clenqueuendrange', 'clfinish', 'clgetdevice', 'clgetplatform', 'clcopy',
1413
+ 'clrelease', 'clsetkernelarg', 'compute', 'credux', 'cs2r',
1414
+ 'cs2ur', 'cuda', 'cublock', 'cucontext', 'cucopy', 'cudevice',
1415
+ 'cudriver', 'cufree', 'cugpu', 'cugrid', 'cuinit', 'cukernel', 'culaunch',
1416
+ 'cumem', 'cuptr', 'cuthread', 'd3d', 'd3d11', 'd3d12', 'depbar',
1417
+ 'dfma', 'dmma', 'elect', 'endcollective',
1418
+ 'errbar', 'fadd32i',
1419
+ 'fchk', 'ffma2', 'ffma32i', 'fhfma', 'fmnmx',
1420
+ 'fmnmx3', 'fmul2', 'fmul32i', 'fragment',
1421
+ 'fswzadd', 'getlmembase', 'glattachshader', 'glbegin', 'glbind',
1422
+ 'glclear', 'glcolor', 'gldisable', 'gldraw', 'glend', 'glenable', 'glget',
1423
+ 'glload', 'glmatrix', 'glpopmatrix', 'glpushmatrix', 'glsave', 'glset',
1424
+ 'gluniform', 'gluseprogram', 'glvertex', 'glviewport', 'gpu',
1425
+ 'gs_', 'hadd2', 'hadd2_32i', 'hfma2', 'hfma2_32i', 'hgmma', 'hmma',
1426
+ 'hmnmx2', 'hmul2', 'hmul2_32i',
1427
+ 'iadd3', 'iadd32i', 'idp4a', 'igmma',
1428
+ 'imma', 'imnmx', 'imul32i', 'iscadd', 'iscadd32i',
1429
+ 'jmxu', 'ldcu',
1430
+ 'ldgdepbar', 'ldgmc', 'ldgsts' 'ldsm', 'ldtm',
1431
+ 'lepc', 'lop3', 'lop32i', 'metal',
1432
+ 'mov32i', 'movm', 'mtl', 'mtlbuffer', 'mtlcommand', 'mtlcompute',
1433
+ 'mtldevice', 'mtlencoder', 'mtlfunction', 'mtllibrary', 'mtlpass',
1434
+ 'mtlrender', 'mtltexture', 'mufu', 'omma', 'p2r',
1435
+ 'plop3', 'pmtrig', 'preexit',
1436
+ 'qgmma', 'qspc', 'r2b', 'r2p', 'r2ur', 'redas', 'redg', 'redux',
1437
+ 'rendertarget', 'rpcmov', 'rtt', 's2r', 's2ur', 'setctaid',
1438
+ 'setlmembase', 'shader', 'shaders', 'shf', 'shfl', 'sgxt',
1439
+ 'stas', 'stg', 'stsm', 'sttm', 'suatom', 'suld',
1440
+ 'sured', 'sust', 'swapchain', 'syncs', 'tex', 'texture', 'tld',
1441
+ 'tld4', 'tmml', 'txd', 'txq', 'ublkcp', 'ublkpf', 'ublkred', 'ubmsk',
1442
+ 'ubrev', 'ucgabar_arv', 'ucgabar_wait', 'uclea', 'uf2f', 'uf2fp', 'uf2i',
1443
+ 'uf2ip', 'ufadd', 'uffma', 'uflo', 'ufmnmx', 'ufmul', 'ufrnd', 'ufsel',
1444
+ 'ugetnextworkid', 'ui2f', 'ui2fp', 'ui2i', 'ui2ip',
1445
+ 'uiabs', 'uiadd3', 'uiadd3.64', 'uimad', 'uimnmx', 'uldc', 'ulea',
1446
+ 'ulepc', 'ulop', 'ulop3', 'ulop32i', 'umemsets', 'up2ur', 'uplop3',
1447
+ 'upopc', 'ur2up', 'uredgr', 'usel', 'usetmaxreg',
1448
+ 'usgxt', 'ushf', 'ushl', 'ushr', 'ustgr', 'utcatomsws', 'utcbar', 'utccp',
1449
+ 'utchmma', 'utcimma', 'utcomma', 'utcqmma', 'utcshift', 'utmacctl',
1450
+ 'utmacmdflush', 'utmaldg', 'utmapf', 'utmaredg', 'utmastg', 'uviadd',
1451
+ 'uvimnmx', 'uvirtcount', 'vabsdiff4', 'vertex', 'vhmnmx',
1452
+ 'viadd', 'viaddmnmx', 'vimnmx', 'vimnmx3', 'vkacquire', 'vkallocate',
1453
+ 'vkbegin', 'vkbind', 'vkblit', 'vkclear', 'vkcmd', 'vkcopy', 'vkcreate',
1454
+ 'vkdestroy', 'vkdispatch', 'vkdraw', 'vkend', 'vkfill', 'vkfree',
1455
+ 'vkpresent', 'vkqueue', 'vksubmit', 'vkupdate', 'vkwait',
1456
+ 'warpgroup', 'warpgroupset', 'warpsync', 'vote'
1457
+ ]
1416
1458
 
1417
1459
  IMPLICIT_REGS_X86 = {
1418
1460
  'mul': {'read': {'ax', 'eax', 'rax'}, 'write': {'dx', 'ax', 'edx', 'eax', 'rdx', 'rax'}},
@@ -1545,3 +1587,38 @@ APPLE_PROPRIETARY_SREGS = {
1545
1587
  "S3_5_C15_C1_3",
1546
1588
  },
1547
1589
  }
1590
+
1591
+ MIPS_GPR = {f"${i}" for i in range(32)}
1592
+ MIPS_ABI_REGS = {
1593
+ "$zero", "$at", "$v0", "$v1", "$a0", "$a1", "$a2", "$a3",
1594
+ "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7",
1595
+ "$s0", "$s1", "$s2", "$s3", "$s4", "$s5", "$s6", "$s7",
1596
+ "$t8", "$t9", "$k0", "$k1", "$gp", "$sp", "$fp", "$ra"
1597
+ }
1598
+ MIPS_SPECIAL_REGS = {"lo", "hi", "pc"}
1599
+
1600
+ ALL_REGS_MIPS = MIPS_GPR | MIPS_ABI_REGS | MIPS_SPECIAL_REGS
1601
+ SORTED_ALL_REGS_MIPS = sorted(ALL_REGS_MIPS, key=len, reverse=True)
1602
+ IMPLICIT_REGS_MIPS = {
1603
+ 'jal': {'write': {'$ra'}},
1604
+ 'jalr': {'write': {'$ra'}},
1605
+ 'jr': {'read': {'$ra'}},
1606
+ 'syscall':{'read': {'$v0', '$a0', '$a1', '$a2', '$a3'}, 'write': {'$v0', '$v1'}},
1607
+ 'mult': {'write': {'hi', 'lo'}},
1608
+ 'multu': {'write': {'hi', 'lo'}},
1609
+ 'div': {'write': {'hi', 'lo'}},
1610
+ 'divu': {'write': {'hi', 'lo'}},
1611
+ 'mfhi': {'read': {'hi'}},
1612
+ 'mflo': {'read': {'lo'}},
1613
+ 'mthi': {'write': {'hi'}},
1614
+ 'mtlo': {'write': {'lo'}},
1615
+ }
1616
+ MIPS_ARITH_LOGIC_3_OP = {"add", "addu", "sub", "subu", "and", "or", "xor", "nor", "slt", "sltu"}
1617
+ MIPS_ARITH_LOGIC_2_OP_IMM = {"addi", "addiu", "andi", "ori", "xori", "slti", "sltiu"}
1618
+ MIPS_SHIFT_3_OP = {"sllv", "srlv", "srav"}
1619
+ MIPS_SHIFT_2_OP_IMM = {"sll", "srl", "sra"}
1620
+ MIPS_LOAD_STORE = {"lb", "lbu", "lh", "lhu", "lw", "lwl", "lwr", "sb", "sh", "sw", "swl", "swr"}
1621
+ MIPS_MOVE = {"move"}
1622
+ MIPS_BRANCH_2_OP = {"beq", "bne", "bgez", "bgtz", "blez", "bltz"}
1623
+ MIPS_MULT_DIV = {"mult", "multu", "div", "divu"}
1624
+ MIPS_CALL_INST = {"jal", "bal"}
@@ -410,7 +410,7 @@ def print_reviews_table(reviews, files):
410
410
  if len(files) > 1:
411
411
  table.add_row(
412
412
  r.get("id"),
413
- r.get("exe_name"),
413
+ os.path.basename(r.get("exe_name")),
414
414
  r.get("summary"),
415
415
  "\n".join(evidences),
416
416
  )