Script-Time: Domain-Routing
Welche Subdomains gibt es in einer Domäne? Sind sie ein Alias für eine andere Domäne? Unter welcher IP-Adresse wird sie gehostet?
domain_routing(){
DOMAIN=$1
outfile=/tmp/domain_routing.png
GV="digraph G { graph [overlap=scale]; rankdir=LR; node [shape=box]"
DOMAINS="$( ( wget --timeout=4 -qO - "https://crt.sh/?q=${DOMAIN}&exclude=expired&output=json" | jq -r .[].name_value ; ) | sort -u ; )"
GV="${GV}""$( echo "$DOMAINS" | while read domain; do host $domain | grep -E "alias|address" | sed -e 's/ is an alias for /" -> "/;s/ has.*address /" -> "/;s/$/"/;s/\."$/"/;s/^/"/' ; done | sort -u )""}"
echo "$GV" | dot -Tpng -Goverlap=scale -o $outfile
xdg-open $outfile
}
Aufgerufen wird es zum Beispiel folgendermaßen:
domain_routing rtl.de
Die Ausgabe sieht so aus:
