Skip to content

Instantly share code, notes, and snippets.

@hunter0x8
Forked from Edu4rdSHL/findomain_integration.sh
Created September 5, 2020 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hunter0x8/a4c0c04463be400aea6045829297a72a to your computer and use it in GitHub Desktop.
Save hunter0x8/a4c0c04463be400aea6045829297a72a to your computer and use it in GitHub Desktop.
Simple script to collect the info from the top enumeration tools, unify all the results in a same file, import the data to Findomain and include it in the monitoring process while saving to database.
#!/usr/bin/env bash
# Simple script to collect the info from the top enumeration tools, unify all the results in a same file, import the data to Findomain and include it in the monitoring process while saving to database.
# Usage:
# ./findomain_integration.sh domains_file findomain_config_file - see https://www.github.com/Edu4rdSHL/findomain/tree/master/config_examples
domains_file="$1"
config_file="$2"
total_file="all_external_subdomains.txt"
external_sources() {
local amass_file="amass_output.txt"
local sublist3r_file="sublist3r_output.txt"
local assetfinder_file="assetfinder_output.txt"
local subfinder_file="subfinder_output.txt"
local domain="$1"
touch "$amass_file" "$sublist3r_file" "$assetfinder_file" "$subfinder_file"
amass enum --passive -d "$domain" -o "$amass_file" >/dev/null &
sublist3r -d "$domain" -o "$sublist3r_file" >/dev/null &
assetfinder -subs-only "$domain" > "$assetfinder_file" &
subfinder -silent -d "$domain" -o "$subfinder_file" >/dev/null &
wait
cat "$amass_file" "$sublist3r_file" "$assetfinder_file" "$subfinder_file" > "$total_file"
rm -f "$amass_file" "$sublist3r_file" "$assetfinder_file" "$subfinder_file"
}
while IFS= read -r domain; do
if [ -n "$domain" ]; then
fixed_domain=${domain//$'\r'/}
external_sources "$fixed_domain"
findomain -t "$fixed_domain" --import-subdomains "$total_file" -o -c "$config_file" -m -i -q
rm -f "$total_file"
fi
done < "$domains_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment