- Updated README to reference new -q option

- Added check to a few more output statements to respect silent option
This commit is contained in:
Carl Pearson 2019-12-11 11:47:14 -08:00
parent e4fc38c84e
commit 6c749df4b7
2 changed files with 17 additions and 10 deletions

View File

@ -29,6 +29,7 @@ Short Form | Long Form | Description
(none) | --inputfile | Read domains from specified file, and use them for analysis (none) | --inputfile | Read domains from specified file, and use them for analysis
(none) | --debug | Print debug information during the analysis module (-a). Prints mostly raw DNS data, familarity with the DIG Linux DNS utility and it's output is helpful to interpret the debug output (none) | --debug | Print debug information during the analysis module (-a). Prints mostly raw DNS data, familarity with the DIG Linux DNS utility and it's output is helpful to interpret the debug output
-r | --resolvers | File with DNS servers to populate as resolvers. File must have only one server IP address per line and only IP addresses are accepted -r | --resolvers | File with DNS servers to populate as resolvers. File must have only one server IP address per line and only IP addresses are accepted
-q | --quiet | Only print found domains and/or CNAME mappings. Note errors may be printed as well
### Examples ### Examples

View File

@ -24,7 +24,8 @@ from collections import Counter
try: try:
from subbrute import subbrute from subbrute import subbrute
except: except:
print("Failed to import subbrute, you will not be able to bruteforce") pass
#print("Failed to import subbrute, you will not be able to bruteforce")
import requests import requests
# import dnslib, which provides better features compared to dns.resolver for finding subdomains # import dnslib, which provides better features compared to dns.resolver for finding subdomains
@ -1209,7 +1210,8 @@ if __name__ == "__main__":
RESOLVER_COUNT = len(resolvers) RESOLVER_COUNT = len(resolvers)
if (inputfile != None): if (inputfile != None):
print(B + "[-] Reading subdomains from " + inputfile + W) if not silent:
print(B + "[-] Reading subdomains from " + inputfile + W)
f = open(inputfile, 'r') f = open(inputfile, 'r')
res = f.readlines() res = f.readlines()
f.close() f.close()
@ -1219,14 +1221,16 @@ if __name__ == "__main__":
# Code added here # Code added here
if (analyze): if (analyze):
# res is the list of subdomains e.g. www.example.com, mail.example.com, etc # res is the list of subdomains e.g. www.example.com, mail.example.com, etc
print(B + "[-] Using DNS resolvers:" + W) if not silent:
for r in resolvers: print(B + "[-] Using DNS resolvers:" + W)
print(B + r + W) for r in resolvers:
print(B + r + W)
server = 0 server = 0
count = 0 count = 0
total = str(len(res)) total = str(len(res))
print("") if not silent:
print(B + "[-] Beginning analysis of " + total + " subdomains..." + W) print("")
print(B + "[-] Beginning analysis of " + total + " subdomains..." + W)
for subdomain in res: for subdomain in res:
try: try:
name = subdomain.replace('\n', '').replace('\r', '') name = subdomain.replace('\n', '').replace('\r', '')
@ -1243,8 +1247,9 @@ if __name__ == "__main__":
# update user on our progress - every 30 hosts # update user on our progress - every 30 hosts
count = count + 1 count = count + 1
if (count % 30) == 0: if not silent:
print(str(count) + '/' + total) if (count % 30) == 0:
print(str(count) + '/' + total)
time.sleep(0.2) # This helps the script catch the Ctrl-C cancel without looping up to the next subdomain time.sleep(0.2) # This helps the script catch the Ctrl-C cancel without looping up to the next subdomain
except KeyboardInterrupt: except KeyboardInterrupt:
print(R + '\n[-] User exit' + W) print(R + '\n[-] User exit' + W)
@ -1267,4 +1272,5 @@ if __name__ == "__main__":
if (analysisfile!=None): if (analysisfile!=None):
# save the analysis to a file. Merge the arrays into one list for easier reading # save the analysis to a file. Merge the arrays into one list for easier reading
write_file(analysisfile, ahosts + ["\n"] + cnames) write_file(analysisfile, ahosts + ["\n"] + cnames)
print(B + "Saved reverse DNS analysis to " + analysisfile + W) if not silent:
print(B + "Saved reverse DNS analysis to " + analysisfile + W)