You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cve_bin_tool/checkers/README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -278,13 +278,16 @@ that include this product. For our example all listings except
278
278
example SQL query).
279
279
280
280
## Helper-Script
281
-
Helper-Script is a tool that takes *packages*(i.e. busybox_1.30.1-4ubuntu9_amd64.deb) as input and returns:
281
+
Helper-Script is a tool that takes a *package*(i.e. busybox_1.30.1-4ubuntu9_amd64.deb) as input and returns:
282
282
283
283
> 1.`CONTAINS_PATTERNS` - list of commonly found strings in the binary of the product
284
284
> 2.`FILENAME_PATTERNS` - list of different filename for the product
285
285
> 3.`VERSION_PATTERNS` - list of version patterns found in binary of the product.
286
286
> 4.`VENDOR_PRODUCT` - list of vendor product pairs for the product as they appear in NVD.
287
287
288
+
Helper-Script can also take multiple packages and `PRODUCT_NAME`(required) as input and return
289
+
common strings for `CONTAINS_PATTERNS`.
290
+
288
291
Usage: `python -m cve_bin_tool.helper_script`
289
292
290
293
```
@@ -357,6 +360,22 @@ class BusyboxChecker(Checker):
357
360
358
361
Try this against a few more `busybox` packages across different `distros` and see which strings are common among the following. Then follow the above steps to create the checker.
359
362
363
+
To get common strings for `CONTAINS_PATTERNS` in multiple `busybox` packages, we can use the script like this:
364
+
365
+
```
366
+
windows > python3 -m cve_bin_tool.helper_script busybox_1.30.1-4ubuntu6_amd64.deb busybox-1.33.0-3.fc34.x86_64.rpm --product busybox
367
+
linux $ python3 -m cve_bin_tool.helper_script busybox_1.30.1-4ubuntu6_amd64.deb busybox-1.33.0-3.fc34.x86_64.rpm --product busybox
368
+
─────────────────────────────────────────────────────── Common CONTAINS_PATTERNS strings for BusyboxChecker──────────────────────────
369
+
370
+
class BusyboxChecker(Checker):
371
+
CONTAINS_PATTERNS = [
372
+
r"BusyBox is a multi-call binary that combines many common Unix",
373
+
r"BusyBox is copyrighted by many authors between 1998-2015.",
374
+
r"link to busybox for each function they wish to use and BusyBox",
> _***NOTE:*** If you look at our existing checkers, you'll see that some strings are commented out in `CONTAINS_PATTERNS`. These strings are kept there as potential strings in case if the currently used strings stop working in the future versions. If you also find more than 2-3 strings, it's recommended to comment them out for future reference._
361
380
362
381
Currently, if you receive multiple vendor-product pairs, select the appropriate vendor-product pair from the following pairs obtained manually. In this case, it is `[('busybox', 'busybox')]`.
"""Helps contributors who want to write a new cve-bin-tool checker find common filenames, version strings, and other necessary data for building a binary checker"""
0 commit comments