MCPcopy Create free account
hub / github.com/AutoRecon/AutoRecon / run

Method run

autorecon/default-plugins/curl-robots.py:15–26  ·  view source on GitHub ↗
(self, service)

Source from the content-addressed store, hash-verified

13 self.match_service_name('^nacn_http$', negative_match=True)
14
15 async def run(self, service):
16 if service.protocol == 'tcp':
17 process, stdout, _ = await service.execute('curl -sSikf {http_scheme}://{addressv6}:{port}/robots.txt', future_outfile='{protocol}_{port}_{http_scheme}_curl-robots.txt')
18
19 lines = await stdout.readlines()
20
21 if process.returncode == 0 and lines:
22 filename = fformat('{scandir}/{protocol}_{port}_{http_scheme}_curl-robots.txt')
23 with open(filename, mode='wt', encoding='utf8') as robots:
24 robots.write('\n'.join(lines))
25 else:
26 service.info('{bblue}[' + fformat('{tag}') + ']{rst} There did not appear to be a robots.txt file in the webroot (/).')

Callers

nothing calls this directly

Calls 4

fformatFunction · 0.90
readlinesMethod · 0.80
executeMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected