From 342ecfe632129e7033513107a8dd9a298a808935 Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Tue, 31 Aug 2021 19:31:08 -0400 Subject: [PATCH] Tagging system updates. Now plugin slugs are included in the tags available, meaning you can run specific plugins using their tag. --- autorecon.py | 10 ++++++++++ plugins/dns.py | 4 ++-- plugins/smb.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/autorecon.py b/autorecon.py index 8d17069..029fc91 100644 --- a/autorecon.py +++ b/autorecon.py @@ -454,6 +454,7 @@ class AutoRecon(object): self.argparse_group = None self.args = None self.missing_services = [] + self.taglist = [] self.tags = [] self.excluded_tags = [] self.patterns = [] @@ -602,6 +603,9 @@ class AutoRecon(object): plugin.tags = [tag.lower() for tag in plugin.tags] + # Add plugin tags to tag list. + [autorecon.taglist.append(t) for t in plugin.tags if t not in autorecon.tags] + plugin.autorecon = self if configure_function_found: plugin.configure() @@ -1413,6 +1417,12 @@ async def main(): print(ex) sys.exit(1) + for plugin in autorecon.plugins.values(): + if plugin.slug in autorecon.taglist: + fail('Plugin ' + plugin.name + ' has a slug (' + plugin.slug + ') with the same name as a tag. Please either change the plugin name or override the slug.') + # Add plugin slug to tags. + plugin.tags += [plugin.slug] + if len(autorecon.plugin_types['port']) == 0: fail('Error: There are no valid PortScan plugins in the plugins directory "' + autorecon.config['plugins_dir'] + '".') diff --git a/plugins/dns.py b/plugins/dns.py index e0f59b2..1f8cfe0 100644 --- a/plugins/dns.py +++ b/plugins/dns.py @@ -1,10 +1,10 @@ from autorecon import ServiceScan -class DNS(ServiceScan): +class NmapDNS(ServiceScan): def __init__(self): super().__init__() - self.name = 'DNS' + self.name = 'Nmap DNS' self.tags = ['default', 'safe', 'dns'] def configure(self): diff --git a/plugins/smb.py b/plugins/smb.py index f5c4f65..af86618 100644 --- a/plugins/smb.py +++ b/plugins/smb.py @@ -41,7 +41,7 @@ class Enum4Linux(ServiceScan): def __init__(self): super().__init__() self.name = "Enum4Linux" - self.tags = ['default', 'safe', 'enum4linux', 'active-directory'] + self.tags = ['default', 'safe', 'active-directory'] def configure(self): self.match_service_name(['^ldap', '^smb', '^microsoft\-ds', '^netbios'])