Skip to content

Commit 06c2134

Browse files
committed
Fixing minor bugs using subbrute in sublist3r
1 parent c417ee7 commit 06c2134

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

lib/tools/subbrute/subbrute.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import thirdparty.dns.rdatatype
2020
import thirdparty.dns.resolver
2121

22+
from lib.utils.colors import tab, warn
2223
# Python 2.x and 3.x compatiablity
2324
# We need the Queue library for exception handling
2425
try:
@@ -422,7 +423,7 @@ def print_target(target,
422423
found_subdomains=[],
423424
verbose=False):
424425
subdomains_list = []
425-
run(target, record_type, subdomains, resolve_list, process_count)
426+
# run(target, record_type, subdomains, resolve_list, process_count)
426427
for result in run(target, record_type, subdomains, resolve_list, process_count):
427428
(hostname, record_type, response) = result
428429
if not record_type:
@@ -437,12 +438,16 @@ def print_target(target,
437438
return set(subdomains_list)
438439

439440

440-
def run(target, record_type=None, subdomains="names.txt", resolve_list="resolvers.txt", process_count=16):
441+
def run(target,
442+
record_type=None,
443+
subdomains="data/txt/names.txt",
444+
resolve_list="data/txt/resolvers.txt",
445+
process_count=16):
441446
subdomains = check_open(subdomains)
442447
resolve_list = check_open(resolve_list)
443448
if (len(resolve_list) / 16) < process_count:
444449
sys.stderr.write(
445-
'Warning: Fewer than 16 resovlers per thread, consider adding more nameservers to resolvers.txt.\n')
450+
f'{tab*2}{warn}Fewer than 16 resovlers per thread, consider adding more nameservers to resolvers.txt.\n')
446451
if os.name == 'nt':
447452
wildcards = {}
448453
spider_blacklist = {}

lib/tools/sublist3r.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,11 +996,10 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e
996996

997997
if enable_bruteforce:
998998
if not silent:
999-
print(tab + warn + "Starting bruteforce module now using subbrute.." + W)
999+
print(tab + warn + "Starting bruteforce module now using subbrute" + W)
10001000
record_type = False
1001-
path_to_file = os.path.dirname(os.path.realpath(__file__))
1002-
subs = os.path.join(path_to_file, 'subbrute', 'names.txt')
1003-
resolvers = os.path.join(path_to_file, 'subbrute', 'resolvers.txt')
1001+
subs = 'data/txt/names.txt'
1002+
resolvers = 'data/txt/resolvers.txt'
10041003
process_count = threads
10051004
output = False
10061005
json_output = False

lib/utils/cmdline.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ def formatter(prog): return argparse.HelpFormatter(prog, max_help_position=100)
129129
request.add_argument("--ignore-redirects", dest="ignoreRedirects", action="store_false",
130130
help="Ignore Redirection attempts")
131131

132-
request.add_argument("--threads", dest="threads", nargs="*", default=defaults.threads, type=int,
132+
request.add_argument("--threads", dest="threads", default=defaults.threads, type=int,
133133
help="Max number of concurrent HTTP(s) requests (default %d)" % defaults.threads)
134134

135135
# Search options
136136
search = parser.add_argument_group("Search", "These options can be used to perform advanced searches")
137137

138-
search.add_argument("-sC", "--search-censys", dest="censys", nargs="?", default="data/APIs/api.conf", type=str,
138+
search.add_argument("-sC", "--search-censys", dest="censys", default="data/APIs/api.conf", type=str,
139139
help="Perform search using Censys API")
140140

141-
search.add_argument("-sSh", "--search-shodan", dest="shodan", nargs="?", default="data/APIs/api.conf", type=str,
141+
search.add_argument("-sSh", "--search-shodan", dest="shodan", default="data/APIs/api.conf", type=str,
142142
help="Perform search using Shodan API")
143143

144-
search.add_argument("-sSt", "--search-st", dest="securitytrails", nargs="?", default="data/APIs/api.conf",
144+
search.add_argument("-sSt", "--search-st", dest="securitytrails", default="data/APIs/api.conf",
145145
type=str, help="Perform search using Securitytrails API")
146146

147147
# Output options

0 commit comments

Comments
 (0)