Skip to content

Instantly share code, notes, and snippets.

@yosignals
Last active October 12, 2023 20:53
Show Gist options
  • Save yosignals/37367edb947a0f6d528d3103753c0081 to your computer and use it in GitHub Desktop.
Save yosignals/37367edb947a0f6d528d3103753c0081 to your computer and use it in GitHub Desktop.
Dentist.sh - This script extracts what you want from your Nucleish json save, use this after you've ran Recruiter against your target domain.txt - https://thecontractor.io/data-bouncing/
#!/bin/bash
# Dependency check
if ! command -v jq &> /dev/null; then
echo "jq is not installed. Would you like to install it? (y/n)"
read -r answer
if [[ $answer == "y" || $answer == "Y" ]]; then
sudo apt-get install jq
else
echo "jq is required for this script to run."
exit 1
fi
fi
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <path_to_json_file> <string_to_remove>"
exit 1
fi
# Assign arguments to variables
json_file=$1
string_to_remove=$2
# Process the JSON file and write the output to DataBouncers.txt
jq -r '.["full-id"] | split(".")[0:3] | join(".")' "$json_file" | \
tr '[:upper:]' '[:lower:]' | \
sed "s/${string_to_remove}//g" | \
grep -E '^(host\.|xff\.|ref\.|wafp\.|cfcon\.|from\.|rip\.|trip\.|xclip\.|ff\.|origip\.|clip\.|contact\.)' | \
sort | uniq > DataBouncers.txt
# Inform the user that the data has been written to DataBouncers.txt
echo "Data has been written to DataBouncers.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment