- 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,6 +1210,7 @@ if __name__ == "__main__":
RESOLVER_COUNT = len(resolvers) RESOLVER_COUNT = len(resolvers)
if (inputfile != None): if (inputfile != None):
if not silent:
print(B + "[-] Reading subdomains from " + inputfile + W) print(B + "[-] Reading subdomains from " + inputfile + W)
f = open(inputfile, 'r') f = open(inputfile, 'r')
res = f.readlines() res = f.readlines()
@ -1219,12 +1221,14 @@ 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
if not silent:
print(B + "[-] Using DNS resolvers:" + W) print(B + "[-] Using DNS resolvers:" + W)
for r in resolvers: for r in resolvers:
print(B + r + W) print(B + r + W)
server = 0 server = 0
count = 0 count = 0
total = str(len(res)) total = str(len(res))
if not silent:
print("") print("")
print(B + "[-] Beginning analysis of " + total + " subdomains..." + W) print(B + "[-] Beginning analysis of " + total + " subdomains..." + W)
for subdomain in res: for subdomain in res:
@ -1243,6 +1247,7 @@ 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 not silent:
if (count % 30) == 0: if (count % 30) == 0:
print(str(count) + '/' + total) 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
@ -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)
if not silent:
print(B + "Saved reverse DNS analysis to " + analysisfile + W) print(B + "Saved reverse DNS analysis to " + analysisfile + W)