Skip to content

Instantly share code, notes, and snippets.

@sasqwatch
Forked from gwen001/osub.sh
Created August 18, 2020 04:25
Show Gist options
  • Save sasqwatch/9eef50d349f6261b3dd357af57d7f9a6 to your computer and use it in GitHub Desktop.
Save sasqwatch/9eef50d349f6261b3dd357af57d7f9a6 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