mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
优化
This commit is contained in:
@@ -465,7 +465,7 @@ class Brute(Module):
|
||||
|
||||
Example:
|
||||
brute.py --target domain.com --word True run
|
||||
brute.py --target ./domains.txt --word True run
|
||||
brute.py --targets ./domains.txt --word True run
|
||||
brute.py --target domain.com --word True --process 1 run
|
||||
brute.py --target domain.com --word True --wordlist subnames.txt run
|
||||
brute.py --target domain.com --word True --recursive True --depth 2 run
|
||||
@@ -475,10 +475,11 @@ class Brute(Module):
|
||||
Note:
|
||||
--alive True/False Only export alive subdomains or not (default False)
|
||||
--format rst/csv/tsv/json/yaml/html/jira/xls/xlsx/dbf/latex/ods (result format)
|
||||
--path Result directory (default directory is ./results)
|
||||
--path Result path (default None, automatically generated)
|
||||
|
||||
|
||||
:param str target: One domain or File path of one domain per line (required)
|
||||
:param str target: One domain (target or targets must be provided)
|
||||
:param str targets: File path of one domain per line
|
||||
:param int process: Number of processes (default 1)
|
||||
:param int concurrent: Number of concurrent (default 10000)
|
||||
:param bool word: Use word mode generate dictionary (default False)
|
||||
@@ -494,17 +495,17 @@ class Brute(Module):
|
||||
:param bool export: Export the results (default True)
|
||||
:param str format: Result format (default csv)
|
||||
:param str path: Result directory (default None)
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, target, process=None, concurrent=None, word=False,
|
||||
wordlist=None, recursive=False, depth=None, nextlist=None,
|
||||
def __init__(self, target=None, targets=None, process=None, concurrent=None,
|
||||
word=False, wordlist=None, recursive=False, depth=None, nextlist=None,
|
||||
fuzz=False, place=None, rule=None, fuzzlist=None, export=True,
|
||||
alive=True, format='csv', path=None):
|
||||
Module.__init__(self)
|
||||
self.module = 'Brute'
|
||||
self.source = 'Brute'
|
||||
self.target = target
|
||||
self.targets = targets
|
||||
self.process_num = process or utils.get_process_num()
|
||||
self.concurrent_num = concurrent or settings.brute_concurrent_num
|
||||
self.word = word
|
||||
@@ -649,7 +650,7 @@ class Brute(Module):
|
||||
logger.log('INFOR', f'Start running {self.source} module')
|
||||
if self.check_env:
|
||||
utils.check_env()
|
||||
self.domains = utils.get_domains(self.target)
|
||||
self.domains = utils.get_domains(self.target, self.targets)
|
||||
all_subdomains = list()
|
||||
for self.domain in self.domains:
|
||||
self.check_brute_params()
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ def get_from_targets(targets):
|
||||
return domains
|
||||
|
||||
|
||||
def get_domains(target, targets):
|
||||
def get_domains(target, targets=None):
|
||||
logger.log('DEBUG', f'Getting domains')
|
||||
target_domains = get_from_target(target)
|
||||
targets_domains = get_from_targets(targets)
|
||||
|
||||
+10
-13
@@ -68,17 +68,17 @@ class OneForAll(object):
|
||||
--alive True/False Only export alive subdomains or not (default False)
|
||||
--port small/medium/large See details in ./config/setting.py(default small)
|
||||
--format rst/csv/tsv/json/yaml/html/jira/xls/xlsx/dbf/latex/ods (result format)
|
||||
--path Result path (default directory is ./results)
|
||||
--path Result path (default None, automatically generated)
|
||||
|
||||
:param str target: One domain (target or targets must be required)
|
||||
:param str targets: File path of one domain per line
|
||||
:param str target: One domain (target or targets must be provided)
|
||||
:param str targets: File path of one domain per line
|
||||
:param bool brute: Use brute module (default False)
|
||||
:param bool dns: Use DNS resolution (default True)
|
||||
:param bool req: HTTP request subdomains (default True)
|
||||
:param str port: The port range to request (default small port is 80,443)
|
||||
:param str port: The port range to request (default small port is 80,443)
|
||||
:param bool alive: Only export alive subdomains (default False)
|
||||
:param str format: Result format (default csv)
|
||||
:param str path: Result path (default None, automatically generated)
|
||||
:param str format: Result format (default csv)
|
||||
:param str path: Result path (default None, automatically generated)
|
||||
:param bool takeover: Scan subdomain takeover (default False)
|
||||
"""
|
||||
|
||||
@@ -269,13 +269,10 @@ class OneForAll(object):
|
||||
self.config_param()
|
||||
self.check_param()
|
||||
self.domains = utils.get_domains(self.target, self.targets)
|
||||
if self.domains:
|
||||
for domain in self.domains:
|
||||
self.domain = utils.get_main_domain(domain)
|
||||
self.main()
|
||||
utils.export_all(self.alive, self.format, self.path, self.datas)
|
||||
else:
|
||||
logger.log('FATAL', 'Failed to obtain domain')
|
||||
for domain in self.domains:
|
||||
self.domain = utils.get_main_domain(domain)
|
||||
self.main()
|
||||
utils.export_all(self.alive, self.format, self.path, self.datas)
|
||||
logger.log('INFOR', 'Finished OneForAll')
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user