Skip to content

Commit

Permalink
Fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
elyousfi5 committed Mar 13, 2024
1 parent e49235c commit 74b5f8e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions agent/metasploit_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def process(self, message: m.Message) -> None:

logger.info("Preparing targets ...")
targets = utils.prepare_targets(message)
logger.info("Scanning targets `%s`.", targets)
for target in targets:
logger.info("Scanning targets `%s`.", targets)
vhost = target.host
rport = target.port
is_ssl = target.scheme == "https"
Expand Down Expand Up @@ -129,14 +129,23 @@ def process(self, message: m.Message) -> None:
isinstance(results, dict)
and results.get("code") in VULNERABLE_STATUSES
):
logger.info(
"Target `%s` is vulnerable to %s",
vhost,
module_instance.modulename,
)
technical_detail = f"Using `{module_instance.moduletype}` module `{module_instance.modulename}`\n"
technical_detail += f"Target: {vhost}:{rport}\n"
technical_detail += (
f'Message: \n```shell\n{results["message"]}\n```'
)
logger.info("Emitting results for %s", module_instance.modulename)
self._emit_results(module_instance, technical_detail)

else:
logger.info(
"Target `%s` is not vulnerable to %s",
vhost,
module_instance.modulename,
)
client.logout()

self._mark_target_as_processed(message)
Expand Down

0 comments on commit 74b5f8e

Please sign in to comment.