From ffb4942e6c3a96d046b97d31fc8f5bf44a0ea395 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 23 Nov 2021 16:37:56 +0000 Subject: [PATCH] fix issues and add function --- autorecon/default-plugins/http_server.py | 27 +++++++++++++++++++++++- autorecon/default-plugins/smb.py | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/autorecon/default-plugins/http_server.py b/autorecon/default-plugins/http_server.py index 479f966..a7b4eb4 100644 --- a/autorecon/default-plugins/http_server.py +++ b/autorecon/default-plugins/http_server.py @@ -79,6 +79,31 @@ class CurlRobots(ServiceScan): else: info('{bblue}[' + fformat('{tag}') + ']{rst} There did not appear to be a robots.txt file in the webroot (/).') +class CurlKnowSecurity(ServiceScan): + + def __init__(self): + super().__init__() + self.name = "Know Security" + self.tags = ['default', 'safe', 'http'] + + def configure(self): + self.match_service_name('^http') + self.match_service_name('^nacn_http$', negative_match=True) + + async def run(self, service): + if service.protocol == 'tcp': + process, stdout, _ = await service.execute('curl -sSikf {http_scheme}://{addressv6}:{port}/.well-known/security.txt', future_outfile='{protocol}_{port}_{http_scheme}_known-security.txt') + + lines = await stdout.readlines() + + if process.returncode == 0 and lines: + filename = fformat('{scandir}/{protocol}_{port}_{http_scheme}_known-security.txt') + with open(filename, mode='wt', encoding='utf8') as robots: + robots.write('\n'.join(lines)) + else: + info('{bblue}[' + fformat('{tag}') + ']{rst} There did not appear to be a .well-known/security.txt file in the webroot (/).') + + class DirBuster(ServiceScan): def __init__(self): @@ -122,7 +147,7 @@ class DirBuster(ServiceScan): else: await service.execute('dirsearch -u {http_scheme}://{address}:{port}/ -t ' + str(self.get_option('threads')) + ' -e "' + self.get_option('ext') + '" -f -q -w ' + wordlist + ' --format=plain -o "{scandir}/{protocol}_{port}_{http_scheme}_dirsearch_' + name + '.txt"') elif self.get_option('tool') == 'ffuf': - await service.execute('ffuf -u {http_scheme}://{addressv6}:{port}/FUZZ -t ' + str(self.get_option('threads')) + ' -w ' + wordlist + ' -e "' + dot_extensions + '" -v -noninteractive | tee {scandir}/{protocol}_{port}_{http_scheme}_ffuf_' + name + '.txt') + await service.execute('ffuf -u {http_scheme}://{addressv6}:{port}/FUZZ -t ' + str(self.get_option('threads')) + ' -w ' + wordlist + ' -e "' + dot_extensions + '" -v | tee {scandir}/{protocol}_{port}_{http_scheme}_ffuf_' + name + '.txt') elif self.get_option('tool') == 'dirb': await service.execute('dirb {http_scheme}://{addressv6}:{port}/ ' + wordlist + ' -l -r -S -X ",' + dot_extensions + '" -o "{scandir}/{protocol}_{port}_{http_scheme}_dirb_' + name + '.txt"') diff --git a/autorecon/default-plugins/smb.py b/autorecon/default-plugins/smb.py index e5319ab..031f6bf 100644 --- a/autorecon/default-plugins/smb.py +++ b/autorecon/default-plugins/smb.py @@ -82,7 +82,7 @@ class SMBClient(ServiceScan): self.run_once(True) async def run(self, service): - await service.execute('smbclient -L\\\\ -N -I {address} 2>&1', outfile='smbclient.txt') + await service.execute('smbclient -L\\\ -N {address} 2>&1', outfile='smbclient.txt') class SMBMap(ServiceScan):