Skip to content

Instantly share code, notes, and snippets.

@RASSec
Forked from Edu4rdSHL/findomain_integration.sh
Created August 17, 2020 23:18
Show Gist options
  • Select an option

  • Save RASSec/8fa6f69984df5f1a2e08b956d235df32 to your computer and use it in GitHub Desktop.

Select an option

Save RASSec/8fa6f69984df5f1a2e08b956d235df32 to your computer and use it in GitHub Desktop.

Revisions

  1. @Edu4rdSHL Edu4rdSHL revised this gist Aug 14, 2020. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions findomain_integration.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    #!/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

    # ./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"
  2. @Edu4rdSHL Edu4rdSHL revised this gist Jun 18, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion findomain_integration.sh
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ while IFS= read -r domain; do
    if [ -n "$domain" ]; then
    fixed_domain=${domain//$'\r'/}
    external_sources "$fixed_domain"
    findomain -t "$fixed_domain" -o -c "$config_file" -m -i -q
    findomain -t "$fixed_domain" --import-subdomains "$total_file" -o -c "$config_file" -m -i -q
    rm -f "$total_file"
    fi
    done < "$domains_file"
  3. @Edu4rdSHL Edu4rdSHL revised this gist Jun 18, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions findomain_integration.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    #!/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

    domains_file="$1"
    config_file="$2"
  4. @Edu4rdSHL Edu4rdSHL created this gist Jun 18, 2020.
    31 changes: 31 additions & 0 deletions findomain_integration.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/usr/bin/env bash

    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" -o -c "$config_file" -m -i -q
    rm -f "$total_file"
    fi
    done < "$domains_file"