Created
July 13, 2023 18:34
-
-
Save queencitycyber/180077268c4bc0ab37851d1d53ef9b7b to your computer and use it in GitHub Desktop.
Parse FFUF json output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Directory path containing the JSON files | |
directory="." | |
# Print column titles | |
# not pretty and doesn't scale well but who cares | |
echo -e "URL\tStatus\tLength\tWords\tLines" | |
# Iterate over each JSON file in the directory | |
for file in "$directory"/*.json; do | |
# Filter and output 200 status results with length, words, and lines using jq. | |
# If you want other status codes, do it like "select(.status == 200 or .status == 302)" | |
cat "$file" | jq -r '.results[] | select(.status == 200) | "\(.url)\t\(.status)\t\(.length)\t\(.words)\t\(.lines)"' | |
done | column -t -s $'\t' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment