Updated Config / Global Files
Moved global patterns to the global file. Placed create-port-dirs = true in config file to see if people notice and like it. ;)
This commit is contained in:
parent
deb36f51d0
commit
ccfedf7db4
27
autorecon.py
27
autorecon.py
|
|
@ -1449,6 +1449,19 @@ async def main():
|
||||||
global_plugin_args = parser.add_argument_group("global plugin arguments", description="These are optional arguments that can be used by all plugins.")
|
global_plugin_args = parser.add_argument_group("global plugin arguments", description="These are optional arguments that can be used by all plugins.")
|
||||||
|
|
||||||
global_plugin_args.add_argument('--global.' + slugify(gkey), **options)
|
global_plugin_args.add_argument('--global.' + slugify(gkey), **options)
|
||||||
|
elif key == 'pattern' and isinstance(val, list): # Process global patterns.
|
||||||
|
for pattern in val:
|
||||||
|
if 'pattern' in pattern:
|
||||||
|
try:
|
||||||
|
compiled = re.compile(pattern['pattern'])
|
||||||
|
if 'description' in pattern:
|
||||||
|
autorecon.patterns.append(Pattern(compiled, description=pattern['description']))
|
||||||
|
else:
|
||||||
|
autorecon.patterns.append(Pattern(compiled))
|
||||||
|
except re.error:
|
||||||
|
fail('Error: The pattern "' + pattern['pattern'] + '" in the config file is invalid regex.')
|
||||||
|
else:
|
||||||
|
fail('Error: A [[pattern]] in the global file doesn\'t have a required pattern variable.')
|
||||||
|
|
||||||
except toml.decoder.TomlDecodeError:
|
except toml.decoder.TomlDecodeError:
|
||||||
fail('Error: Couldn\'t parse ' + g.name + ' file. Check syntax.')
|
fail('Error: Couldn\'t parse ' + g.name + ' file. Check syntax.')
|
||||||
|
|
@ -1466,20 +1479,6 @@ async def main():
|
||||||
else:
|
else:
|
||||||
if autorecon.argparse.get_default('global.' + slugify(gkey).replace('-', '_')):
|
if autorecon.argparse.get_default('global.' + slugify(gkey).replace('-', '_')):
|
||||||
autorecon.argparse.set_defaults(**{'global.' + slugify(gkey).replace('-', '_'): gval})
|
autorecon.argparse.set_defaults(**{'global.' + slugify(gkey).replace('-', '_'): gval})
|
||||||
|
|
||||||
elif key == 'pattern' and isinstance(val, list): # Process global patterns.
|
|
||||||
for pattern in val:
|
|
||||||
if 'pattern' in pattern:
|
|
||||||
try:
|
|
||||||
compiled = re.compile(pattern['pattern'])
|
|
||||||
if 'description' in pattern:
|
|
||||||
autorecon.patterns.append(Pattern(compiled, description=pattern['description']))
|
|
||||||
else:
|
|
||||||
autorecon.patterns.append(Pattern(compiled))
|
|
||||||
except re.error:
|
|
||||||
fail('Error: The pattern "' + pattern['pattern'] + '" in the config file is invalid regex.')
|
|
||||||
else:
|
|
||||||
fail('Error: A [[pattern]] in the config file doesn\'t have a required pattern variable.')
|
|
||||||
elif isinstance(val, dict): # Process potential plugin arguments.
|
elif isinstance(val, dict): # Process potential plugin arguments.
|
||||||
for pkey, pval in config_toml[key].items():
|
for pkey, pval in config_toml[key].items():
|
||||||
if autorecon.argparse.get_default(slugify(key).replace('-', '_') + '.' + slugify(pkey).replace('-', '_')):
|
if autorecon.argparse.get_default(slugify(key).replace('-', '_') + '.' + slugify(pkey).replace('-', '_')):
|
||||||
|
|
|
||||||
13
config.toml
13
config.toml
|
|
@ -1,20 +1,9 @@
|
||||||
# Configure regular AutoRecon options at the top of this file.
|
# Configure regular AutoRecon options at the top of this file.
|
||||||
|
|
||||||
|
create-port-dirs = true
|
||||||
# verbose = 1
|
# verbose = 1
|
||||||
# max-scans = 30
|
# max-scans = 30
|
||||||
|
|
||||||
# Configure global pattern matching here.
|
|
||||||
[[pattern]]
|
|
||||||
description = 'Nmap script found a potential vulnerability. ({match})'
|
|
||||||
pattern = 'State: (?:(?:LIKELY\_?)?VULNERABLE)'
|
|
||||||
|
|
||||||
[[pattern]]
|
|
||||||
pattern = '(?i)unauthorized'
|
|
||||||
|
|
||||||
[[pattern]]
|
|
||||||
description = 'CVE Identified: {match}'
|
|
||||||
pattern = '(CVE-\d{4}-\d{4,7})'
|
|
||||||
|
|
||||||
# Configure global options here.
|
# Configure global options here.
|
||||||
# [global]
|
# [global]
|
||||||
# username-wordlist = '/usr/share/seclists/Usernames/cirt-default-usernames.txt'
|
# username-wordlist = '/usr/share/seclists/Usernames/cirt-default-usernames.txt'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue