Skip to content

Instantly share code, notes, and snippets.

@queencitycyber
Created July 13, 2023 18:34
Show Gist options
  • Save queencitycyber/180077268c4bc0ab37851d1d53ef9b7b to your computer and use it in GitHub Desktop.
Save queencitycyber/180077268c4bc0ab37851d1d53ef9b7b to your computer and use it in GitHub Desktop.
Parse FFUF json output
#!/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