Last active
April 5, 2023 05:43
-
-
Save Edu4rdSHL/88a05ff3c3406fd1431e6d4382b95fb9 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.
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
#!/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