async def run(self, service): if service.protocol == 'tcp': process, stdout, _ = await service.execute('curl -sSikf {http_scheme}://{addressv6}:{port}/robots.txt', future_outfile='{protocol}_{port}_{http_scheme}_curl-robots.txt') lines = await stdout.readlines() if process.returncode == 0 and lines: filename = fformat('{scandir}/{protocol}_{port}_{http_scheme}_curl-robots.txt') with open(filename, mode='wt', encoding='utf8') as robots: robots.write('\n'.join(lines)) else: service.info('{bblue}[' + fformat('{tag}') + ']{rst} There did not appear to be a robots.txt file in the webroot (/).')
async def run(self, service): filename = fformat('{scandir}/{protocol}_{port}_winrm-detection.txt') with open(filename, mode='wt', encoding='utf8') as winrm: winrm.write( 'WinRM was possibly detected running on ' + service.protocol + ' port ' + str(service.port) + '.\nCheck _manual_commands.txt for manual commands you can run against this service.' )