Skip to content

Instantly share code, notes, and snippets.

@LevitatingBusinessMan
Last active October 6, 2023 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LevitatingBusinessMan/7d3e32fdf66e5bf8b02692e5a4854b4a to your computer and use it in GitHub Desktop.
Save LevitatingBusinessMan/7d3e32fdf66e5bf8b02692e5a4854b4a to your computer and use it in GitHub Desktop.
Bruteforce subdomains
#!/usr/bin/env fish
argparse n/nameserver= d/domain= w/wordlist= o/output= -- $argv
or exit
if test -z $_flag_n; or test -z $_flag_d; or test -z $_flag_w
echo "Required arguments: nameserver, domain, wordlist"
echo "You can find the nameserver with nslookup and querytype=soa"
exit
end
if not test -f $_flag_w
echo "File $_flag_w not found"
exit
end
for word in (cat $_flag_w)
if nslookup "$word.$_flag_d" $_flag_n >/dev/null
echo "$word.$_flag_d"
if test -n $_flag_o
echo "$word.$_flag_d" >> $_flag_o
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment