Objetivo:

Criar um Script para identificar possíveis Hosts em um domínio.

O usuário deve informar o domínio e caso o site possua subdomínios na pagina ele deve retornar o IP dos Hosts.

#!/bin/bash

if [ "$1" == "" ]
then
    echo "Passe o argumento"
else
    wget $1

    grep href index.html | cut -d "/" -f 3 | grep "\." | cut -d '"' -f 1 | grep -v "<l" > lista

    for url in $(cat lista); 
    do 
        host $url | grep "has address"; 
    done
fi

Comandos

wget (nome do site) - Retorna um index.txt

host (nome do site) - Retorna o

grep href index.html | cut -d "/" -f 3 | grep "\." | cut -d '"' -f 1 | grep -v "<l" > lista