loading
loading
Utilities
Ungrep content in files by input string.
overview
ungrep-by-string is an inverse filter for a folder of files. Give it a string and a directory, and it keeps the files that do not contain that string, dropping the ones that do. It is the negative of a grep: instead of selecting matches, it removes them, which is exactly what you want when one noisy pattern is polluting a result set.
The job is small and the value is in the chaining. In a recon pipeline you often accumulate folders of tool output where some files carry a known false positive, a placeholder, or an out-of-scope marker. Pointing ungrep-by-string at that folder strips those files in one node, so the next stage sees a cleaner set without anyone editing files by hand.
In a Trickest Utilities workflow, ungrep-by-string takes a string and a folder of files and writes a file and a folder of the survivors. Use it to prune tool output between stages, removing files that match a string you have decided is noise.
source github.com/trickest
use cases
Remove every file in a results folder that contains a string you have already triaged as noise, so downstream stages never see it again.
Filter a folder of tool results to discard files mentioning a host or path that is outside scope, keeping the workflow focused.
Insert ungrep-by-string after a collector to prune unwanted files in place, with no manual editing, before the next tool consumes the folder.
When you need the files that do not match rather than the ones that do, ungrep-by-string gives you the complement of a normal content filter.
reference
| Name | Type | Flag | Description |
|---|---|---|---|
| ungrep-string | STRING | · | String that files must not contain to pass through. |
| folder-with-files | FOLDER | · | Folder of files to filter by the ungrep string. |
Showing key inputs. ungrep-by-string exposes 2 inputs in total.
example
# ungrep-by-string: drop files that mention out-of-scope noise# inputs: folder-with-files=results/ ungrep-string=out-of-scope.example.org# kept files still list in-scope hosts onlyapi.example.comapp.example.comstaging.example.comdev.example.commail.example.comcdn.example.comvpn.example.comwww.example.comguidance
Use ungrep-by-string when a folder of tool output carries a string you want gone, a false positive, a placeholder, or an out-of-scope marker, and you need the non-matching files to pass on. It is the inverse of a content grep. For deduplicating URLs use urldedupe; for extracting URL parts use unfurl.
Keeps files that contain the string. ungrep-by-string keeps the ones that do not.
Makes JSON greppable line by line. ungrep-by-string filters whole files in a folder.
Appends only new, unseen lines. ungrep-by-string removes files by content instead.
faq
related
Import, export, and link workflow data with Airtable.
Decode Android APK files into smali sources and resources.
Check a file's values against conditions and exit with a matching code.
Extract all hosted zones from AWS Route53.
Output file lines by batch size, given START_LINE and END_LINE.
Extract a batch range from a file's lines or a folder's files, with parallel processing.
A folder of files feeds ungrep-by-string, which drops every file containing the noise string and writes the surviving files as a queryable output.
Facts on this page come from the live Trickest tool library.