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

Method extract_service

autorecon/plugins.py:255–270  ·  view source on GitHub ↗
(self, line, regex)

Source from the content-addressed store, hash-verified

253 self.argparse_group.add_argument(name, **kwargs)
254
255 def extract_service(self, line, regex):
256 if regex is None:
257 regex = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/]+)(\s*)(.*)$'
258 match = re.search(regex, line)
259 if match:
260 protocol = match.group('protocol').lower()
261 port = int(match.group('port'))
262 service = match.group('service')
263 secure = True if 'ssl' in service or 'tls' in service else False
264
265 if service.startswith('ssl/') or service.startswith('tls/'):
266 service = service[4:]
267
268 return Service(protocol, port, service, secure)
269 else:
270 return None
271
272 async def extract_services(self, stream, regex):
273 if not isinstance(stream, CommandStreamReader):

Callers 1

extract_servicesMethod · 0.95

Calls 1

ServiceClass · 0.90

Tested by

no test coverage detected