Tagging system updates.

Now plugin slugs are included in the tags available, meaning you can run specific plugins using their tag.
This commit is contained in:
Tib3rius 2021-08-31 19:31:08 -04:00
parent 0b5ef7cf6e
commit 342ecfe632
3 changed files with 13 additions and 3 deletions

View File

@ -454,6 +454,7 @@ class AutoRecon(object):
self.argparse_group = None self.argparse_group = None
self.args = None self.args = None
self.missing_services = [] self.missing_services = []
self.taglist = []
self.tags = [] self.tags = []
self.excluded_tags = [] self.excluded_tags = []
self.patterns = [] self.patterns = []
@ -602,6 +603,9 @@ class AutoRecon(object):
plugin.tags = [tag.lower() for tag in plugin.tags] 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 plugin.autorecon = self
if configure_function_found: if configure_function_found:
plugin.configure() plugin.configure()
@ -1413,6 +1417,12 @@ async def main():
print(ex) print(ex)
sys.exit(1) 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: if len(autorecon.plugin_types['port']) == 0:
fail('Error: There are no valid PortScan plugins in the plugins directory "' + autorecon.config['plugins_dir'] + '".') fail('Error: There are no valid PortScan plugins in the plugins directory "' + autorecon.config['plugins_dir'] + '".')

View File

@ -1,10 +1,10 @@
from autorecon import ServiceScan from autorecon import ServiceScan
class DNS(ServiceScan): class NmapDNS(ServiceScan):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.name = 'DNS' self.name = 'Nmap DNS'
self.tags = ['default', 'safe', 'dns'] self.tags = ['default', 'safe', 'dns']
def configure(self): def configure(self):

View File

@ -41,7 +41,7 @@ class Enum4Linux(ServiceScan):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.name = "Enum4Linux" self.name = "Enum4Linux"
self.tags = ['default', 'safe', 'enum4linux', 'active-directory'] self.tags = ['default', 'safe', 'active-directory']
def configure(self): def configure(self):
self.match_service_name(['^ldap', '^smb', '^microsoft\-ds', '^netbios']) self.match_service_name(['^ldap', '^smb', '^microsoft\-ds', '^netbios'])