Skip to content

Instantly share code, notes, and snippets.

@gwen001
Created November 28, 2019 19:52
Show Gist options
  • Save gwen001/52468644ddd8c4a5bfb85217f31c71e4 to your computer and use it in GitHub Desktop.
Save gwen001/52468644ddd8c4a5bfb85217f31c71e4 to your computer and use it in GitHub Desktop.
oneliner to get subdomains and related from the target itself
while read h; do curl -siL https://$h|egrep -io "[0-9a-z_\-\.]+\.([0-9a-z_\-]+)?`echo $h|awk -F '.' '{print $(NF-1)}'`([0-9a-z_\-\.]+)?\.[a-z]{1,5}"|sort -fu ; done < hosts.txt
function osub {
curl -siL https://$h1egrep -io "[0-9a-z_\-\.]+\.([0-9a-z_\-]+)?`echo $h|awk -F '.' '{print $(NF-1)}'`([0-9a-z_\-\.]+)?\.[a-z]{1,5}"|sort -fu
}
function osubs {
while read h; do curl -siL https://$h|egrep -io "[0-9a-z_\-\.]+\.([0-9a-z_\-]+)?`echo $h|awk -F '.' '{print $(NF-1)}'`([0-9a-z_\-\.]+)?\.[a-z]{1,5}"|sort -fu ; done < $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment